From 19724b0969eb2f91b38efb262a6ef4de04d6b0c5 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期二, 14 十月 2025 12:07:58 +0800
Subject: [PATCH] 新增“有货状态”显示及数据处理逻辑支持在Home.vue和 LineComponent.vue中新增了“有货状态”显示功能,为 RGV 和堆垛机对象添加了 InStock属性。 修改了 Home.vue 的 created生命周期和 LineComponent.vue的 update 方法,增加了对 inStock数据的处理逻辑。删除了三个旧的二进制文件,新增了六个新的二进制文件,可能与项目构建或依赖更新相关。优化了任务分配和状态判断逻辑,确保任务执行更加准确和高效。
---
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob_FirstFloor/CommonRGV_FirstFloorJob.cs | 141 +++++++++++++++++++++++++++++-----------------
1 files changed, 88 insertions(+), 53 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob_FirstFloor/CommonRGV_FirstFloorJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob_FirstFloor/CommonRGV_FirstFloorJob.cs"
index 728235d..94dbabe 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob_FirstFloor/CommonRGV_FirstFloorJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob_FirstFloor/CommonRGV_FirstFloorJob.cs"
@@ -136,7 +136,7 @@
IsExecutingTask.TargetStation = station.remark;
IsExecutingTask.TaskState = (int)TaskOutStatusEnum.RGV_TransFer;
}
-
+
_taskRepository.UpdateData(IsExecutingTask);
Thread.Sleep(1000);
}
@@ -154,62 +154,68 @@
}
else
{
+
Dt_Task taskNew = null;
taskNew = GetTransFerTask(FirstRgv);
if (taskNew == null)
{
- taskNew = DispatchTask(FirstRgv);
+ if (IsExistTransTask(FirstRgv))
+ {
+ taskNew = DispatchTask(FirstRgv);
+ }
}
if (taskNew != null)
- {
- RGVTaskCommand? rgvTaskCommand = ConvertToRGVTaskCommand(taskNew);
- if (rgvTaskCommand != null)
{
- Thread.Sleep(1000);
- bool sendFlag = SendCommand(FirstRgv, rgvTaskCommand);
- if (sendFlag)
+ RGVTaskCommand? rgvTaskCommand = ConvertToRGVTaskCommand(taskNew);
+ if (rgvTaskCommand != null)
{
- if (taskNew.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish)
+ Thread.Sleep(1000);
+ bool sendFlag = SendCommand(FirstRgv, rgvTaskCommand);
+ if (sendFlag)
{
- taskNew.TaskState = (int)TaskInStatusEnum.RGV_InExecuting;
- _taskRepository.UpdateData(taskNew);
- Thread.Sleep(1000);
- }
- else if (taskNew.TaskState == (int)TaskOutStatusEnum.RGV_TransFerFInish)
- {
- taskNew.TaskState = (int)TaskOutStatusEnum.RGV_OutExecuting;
- _taskRepository.UpdateData(taskNew);
- Thread.Sleep(1000);
- }
- else if (taskNew.Remark != null)
- {
- taskNew.RGVName = "RGV02";
- taskNew.CurrentAddress = taskNew.Remark;
- taskNew.Remark = "";
- taskNew.TaskState = (int)TaskOutStatusEnum.RGV_TransFer;
- Dt_StationManager station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskNew.NextAddress);
- taskNew.SourceStation = taskNew.CurrentAddress == "1025" ? 10 : 7;
- if (taskNew.TaskType == (int)TaskInboundTypeEnum.Inbound)
+ if (taskNew.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish)
{
- taskNew.TargetStation = station.stationRemark;
+ taskNew.TaskState = (int)TaskInStatusEnum.RGV_InExecuting;
+ _taskRepository.UpdateData(taskNew);
+ Thread.Sleep(1000);
+ }
+ else if (taskNew.TaskState == (int)TaskOutStatusEnum.RGV_TransFerFInish)
+ {
+ taskNew.TaskState = (int)TaskOutStatusEnum.RGV_OutExecuting;
+ _taskRepository.UpdateData(taskNew);
+ Thread.Sleep(1000);
+ }
+ else if (taskNew.Remark != null)
+ {
+ taskNew.RGVName = "RGV02";
+ taskNew.CurrentAddress = taskNew.Remark;
+ taskNew.Remark = "";
+ taskNew.TaskState = (int)TaskOutStatusEnum.RGV_TransFer;
+ Dt_StationManager station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskNew.NextAddress);
+ taskNew.SourceStation = taskNew.CurrentAddress == "1025" ? 10 : 7;
+ if (taskNew.TaskType == (int)TaskInboundTypeEnum.Inbound)
+ {
+ taskNew.TargetStation = station.stationRemark;
+ }
+ else
+ {
+ taskNew.TargetStation = station.remark;
+ }
+ _taskRepository.UpdateData(taskNew);
+ Thread.Sleep(1000);
}
else
{
- taskNew.TargetStation = station.remark;
+ taskNew.RGVName = FirstRgv.DeviceCode;
+ _taskRepository.UpdateData(taskNew);
+ _taskService.UpdateTaskStatusToNext(taskNew.TaskNum);
+ Thread.Sleep(1000);
}
- _taskRepository.UpdateData(taskNew);
- Thread.Sleep(1000);
- }
- else
- {
- taskNew.RGVName = FirstRgv.DeviceCode;
- _taskRepository.UpdateData(taskNew);
- _taskService.UpdateTaskStatusToNext(taskNew.TaskNum);
- Thread.Sleep(1000);
}
}
+
}
- }
+
}
}
#region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
@@ -290,7 +296,7 @@
IsExecutingTask.RGVName = "RGV01";
IsExecutingTask.CurrentAddress = IsExecutingTask.Remark;
IsExecutingTask.Remark = "";
-
+
Dt_StationManager station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == IsExecutingTask.NextAddress);
IsExecutingTask.SourceStation = IsExecutingTask.CurrentAddress == "1025" ? 10 : 7;
if (IsExecutingTask.TaskType == (int)TaskInboundTypeEnum.Inbound)
@@ -321,13 +327,16 @@
}
else
{
+
Dt_Task taskNew = null;
taskNew = GetTransFerTask(SecondRgv);
if (taskNew == null)
{
- taskNew = DispatchTask(SecondRgv);
+ if (IsExistTransTask(SecondRgv))
+ {
+ taskNew = DispatchTask(SecondRgv);
+ }
}
-
if (taskNew != null)
{
RGVTaskCommand? rgvTaskCommand = ConvertToRGVTaskCommand(taskNew);
@@ -368,6 +377,7 @@
}
}
}
+
}
}
#region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
@@ -400,6 +410,7 @@
LevelPoint = SecondRgv.GetValue<RGVDBName, int>(RGVDBName.LevelPoint),
CurrentTaskNum = SecondRgv.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum),
RGVAlarm = SecondRgv.GetValue<RGVDBName, uint>(RGVDBName.RGVAlarm),
+ InStock = SecondRgv.GetValue<RGVDBName, bool>(RGVDBName.InStock),
SecondRgv.DeviceCode,
SecondRgv.DeviceName,
};
@@ -520,7 +531,7 @@
};
SendCommand(commonRGVSecond, command);
Thread.Sleep(3000);
- if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running))
+ if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVSecond.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0)
{
return null;
}
@@ -633,7 +644,7 @@
};
SendCommand(commonRGVFirst, command);
Thread.Sleep(3000);
- if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running))
+ if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVFirst.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0)
{
return null;
}
@@ -716,7 +727,7 @@
};
SendCommand(commonRGVSecond, command);
Thread.Sleep(3000);
- if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running))
+ if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVSecond.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0)
{
return null;
}
@@ -795,7 +806,7 @@
};
SendCommand(commonRGVFirst, command);
Thread.Sleep(3000);
- if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running))
+ if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVFirst.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0)
{
return null;
}
@@ -902,7 +913,7 @@
};
SendCommand(commonRGVSecond, command);
Thread.Sleep(3000);
- if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running))
+ if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVSecond.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0)
{
return null;
}
@@ -989,7 +1000,7 @@
};
SendCommand(commonRGVFirst, command);
Thread.Sleep(3000);
- if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running))
+ if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVFirst.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0)
{
return null;
}
@@ -1033,6 +1044,21 @@
return null;
}
}
+
+ public bool IsExistTransTask(CommonRGV_FirstFloor commonRGV)
+ {
+ if (commonRGV.DeviceCode == "RGV01")
+ {
+ var task = _taskRepository.QueryFirst(x => x.Floor == "1F" && (x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish || x.TaskState == (int)TaskOutStatusEnum.RGV_TransFerFInish)&&x.RGVName=="RGV02");
+ return task == null ? true : false;
+ }
+ else
+ {
+ var task = _taskRepository.QueryFirst(x => x.Floor == "1F" && (x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish || x.TaskState == (int)TaskOutStatusEnum.RGV_TransFerFInish) && x.RGVName == "RGV01");
+ return task == null ? true : false;
+ }
+ }
+
/// <summary>
/// RGV浠诲姟瀹屾垚
@@ -1398,7 +1424,7 @@
}
else if (task.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish)
{
- if (task.Remark != null && (task.Roadway == "SC01" || task.Roadway == "SC06"))
+ if (task.Remark != null && (task.Remark == "1026" || task.Remark == "1025"))
{
Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.Remark);
rgvTaskCommand.TaskType = (byte)Convert.ToSByte(4);
@@ -1446,9 +1472,18 @@
}
else if (task.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish)
{
- Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.NextAddress);
- rgvTaskCommand.TaskType = (byte)Convert.ToSByte(4);
- rgvTaskCommand.PutcargoLocation = (byte)Convert.ToSByte(stationManager.stationRemark);
+ if (task.Remark != null && (task.Roadway == "SC01" || task.Roadway == "SC06"))
+ {
+ Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.Remark);
+ rgvTaskCommand.TaskType = (byte)Convert.ToSByte(4);
+ rgvTaskCommand.PutcargoLocation = (byte)Convert.ToSByte(stationManager.stationRemark);
+ }
+ else
+ {
+ Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.NextAddress);
+ rgvTaskCommand.TaskType = (byte)Convert.ToSByte(4);
+ rgvTaskCommand.PutcargoLocation = (byte)Convert.ToSByte(stationManager.stationRemark);
+ }
}
else
{
--
Gitblit v1.9.3