From 695571c6009ecbc12e7d4a4fb147df7967a1260e Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 07 七月 2025 20:21:19 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/StackerCraneJob_PP.cs | 66 +++++++++++++++++---------------
1 files changed, 35 insertions(+), 31 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs"
index 0bca298..f78753c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs"
@@ -22,6 +22,7 @@
using WIDESEAWCS_Tasks;
using WIDESEAWCS_Core;
using SqlSugar.Extensions;
+using WIDESEAWCS_Tasks.ConveyorLineJob;
namespace WIDESEAWCS_Tasks
{
@@ -54,29 +55,26 @@
{
commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢
}
-
- if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal)
+ commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆�
+ if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
{
- commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆�
-
- if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
+ Thread.Sleep(1000);
+ Dt_Task? task = GetTask(commonStackerCrane);
+ if (task != null)
{
- Dt_Task? task = GetTask(commonStackerCrane);
- if (task != null)
+ StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
+ if (stackerCraneTaskCommand != null)
{
- StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
- if (stackerCraneTaskCommand != null)
+ bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
+ if (sendFlag)
{
- bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
- if (sendFlag)
- {
- commonStackerCrane.LastTaskType = task.TaskType;
- task.Dispatchertime = DateTime.Now;
- task.ExceptionMessage = "";
- _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
-
- commonStackerCrane.Communicator.Write("DB105.54", (short)1);
- }
+ commonStackerCrane.LastTaskType = task.TaskType;
+ task.Dispatchertime = DateTime.Now;
+ task.ExceptionMessage = "";
+ _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
+ commonStackerCrane.Communicator.Write("DB105.54", (short)1);
+ //寤舵椂1s
+ Thread.Sleep(1000);
}
}
}
@@ -102,8 +100,10 @@
{
if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
{
- StackerCraneTaskCompleted(e.TaskNum, commonStackerCrane.DeviceCode);
- commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
+ if (StackerCraneTaskCompleted(e.TaskNum, commonStackerCrane.DeviceCode).Status)
+ {
+ commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
+ }
}
}
}
@@ -130,10 +130,12 @@
task.CurrentAddress = stationManger.StationCode;
_taskRepository.UpdateData(task);
_taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"绯荤粺鑷姩娴佺▼,浠诲姟鐘舵�佷粠銆恵oldStatus}銆戣浆鍒般�恵task.TaskState}銆�");
+ WriteInfo(deviceCode, $"鍫嗗灈鏈轰换鍔″畬鎴�,浠诲姟鍙�:{taskNum}");
//todo 瀹屾垚
}
else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup || task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
{
+ WriteInfo(deviceCode, $"鍫嗗灈鏈轰换鍔″畬鎴�,浠诲姟鍙�:{taskNum}");
_taskService.TaskCompleted(taskNum);
}
else
@@ -229,20 +231,22 @@
if (device != null)
{
OtherDevice client = (OtherDevice)device;
- if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//鍑哄簱绔欏彴鏈鍗犵敤
+ if (!client.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Goods, stationManger.StationCode))//鍑哄簱绔欏彴鏈鍗犵敤
{
- task.TargetAddress = stationManger.StackerCraneStationCode;
+ task.NextAddress = stationManger.StackerCraneStationCode;
_taskRepository.UpdateData(task);
return task;
}
}
else
{
+ WriteInfo(task.DeviceCode, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
_taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
}
}
else
{
+ WriteInfo(task.DeviceCode, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴");
_taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴");
}
return null;
@@ -323,11 +327,11 @@
else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
{
string[] targetCodes = task.NextAddress.Split("-");
- if (targetCodes.Length == 3)
+ if (targetCodes.Length == 5)
{
- stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
- stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
- stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
+ stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]);
+ stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]);
+ stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[3]);
}
else
{
@@ -336,11 +340,11 @@
return null;
}
string[] sourceCodes = task.CurrentAddress.Split("-");
- if (sourceCodes.Length == 3)
+ if (sourceCodes.Length == 5)
{
- stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
- stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
- stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
+ stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]);
+ stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]);
+ stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[3]);
}
else
{
--
Gitblit v1.9.3