From b2feeabc23454a2c9e161aa3b26d0edf938e55bd Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期二, 22 七月 2025 15:03:17 +0800 Subject: [PATCH] 增加超时设置,更新依赖注入和查询逻辑 --- CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 31 ++++++++++++++++++++++++++++++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs index e1f3e5a..adcf4e2 100644 --- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs +++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs @@ -113,7 +113,9 @@ //builder.AppendLine(); //ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue); commonStackerCrane.LastTaskType = task.TaskType; + _taskService.UpdateTaskStatusToNext(task.TaskNum); + } } else @@ -182,6 +184,22 @@ var task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum); if (task == null) commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); + + if (commonStackerCrane.DeviceCode.Contains("CW") && task.TaskType == (int)TaskOutboundTypeEnum.InToOut) + { + var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationPLC == "1006" && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode); + + IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC); + if (device != null) + { + CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device; + conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(3292), stationinfo.stationChildCode); + Thread.Sleep(100); + conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode); + } + WriteInfo(commonStackerCrane.DeviceName, $"銆愭墜鍔ㄥ嚭搴撹褰曘�戜换鍔″彿銆恵e.TaskNum}銆戞墭鐩樺彿銆恵task.PalletCode}銆�"); + } + if (commonStackerCrane.DeviceCode.Contains("GW") && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) { @@ -554,7 +572,18 @@ } else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) { - if (task.Roadway.Contains("GW") || task.TaskType == (int)TaskOutboundTypeEnum.OutFireAlarm) + if (task.TaskType == (int)TaskOutboundTypeEnum.InToOut) + { + string[] endCodes = task.TargetAddress.Split("-"); + stackerCraneTaskCommand.EndRow = Convert.ToInt16(endCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(endCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(endCodes[2]); + string[] sourceCodes = task.SourceAddress.Split("-"); + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]) % 2 != 0 ? (short)1 : (short)2; + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); + } + else if (task.Roadway.Contains("GW") || task.TaskType == (int)TaskOutboundTypeEnum.OutFireAlarm) { string[] endCodes = task.NextAddress.Split("-"); stackerCraneTaskCommand.EndRow = Convert.ToInt16(endCodes[0]); -- Gitblit v1.9.3