From cb25acc46bf41863e068b6f968f1592b7a14d1c9 Mon Sep 17 00:00:00 2001 From: helongyang <647556386@qq.com> Date: 星期六, 13 九月 2025 08:12:14 +0800 Subject: [PATCH] 功能更新优化 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/ConveyorLineJob_GM.cs | 62 +++++++++++++++++++++++++----- 1 files changed, 51 insertions(+), 11 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" index 8e3b890..ec69ca0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" @@ -17,6 +17,7 @@ using WIDESEAWCS_ITaskInfoService; using WIDESEAWCS_Model.Models; using WIDESEAWCS_QuartzJob; +using WIDESEAWCS_QuartzJob.ConveyorLine.Enum; using WIDESEAWCS_QuartzJob.DTO; using WIDESEAWCS_QuartzJob.Models; using WIDESEAWCS_QuartzJob.Repository; @@ -93,26 +94,19 @@ ConveyorLineSignal conveyorLineSignalWrite = conveyorLineInfoWrite.Signal.ByteToBoolObject<ConveyorLineSignal>(); if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) { + //骞茶啘鍏ュ簱绔欏彴浜や簰 if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK) { string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); if (!string.IsNullOrEmpty(boxcode)) { - string sc = device.Communicator.Read<string>("DB900.508.0"); + string sc = device.Communicator.Read<string>("DB900.478.0"); WriteError(device.DeviceName, $"璇诲彇鍊硷細{boxcode},瀵规瘮{sc}"); string boxEndCode = ""; - if (boxcode.LastIndexOf(",SC:") >=0) + if (boxcode.LastIndexOf(",PO:") >=0) { - boxEndCode = "M"+ boxcode.Substring(0,boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", ""); - } - else if (boxcode.LastIndexOf(",SC") > 0) - { - boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); - } - else if (boxcode.LastIndexOf(",S") > 0) - { - boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); + boxEndCode = "M"+ boxcode.Substring(0,boxcode.LastIndexOf(",PO:")) + sc.Substring(sc.IndexOf(",PO:")).Replace("\0", ""); } //鍏ュ簱鐢宠浠诲姟 @@ -177,6 +171,7 @@ } else { + //骞茶啘鍑哄簱绔欏彴浜や簰 if (!conveyorLineSignalWrite.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Goods) { Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == item.StationDeviceCode); @@ -205,6 +200,7 @@ } else if (conveyorLineSignalWrite.STB && conveyorLineSignalRead.ACK && conveyorLineStatus.Goods) { + //瀹屾垚骞茶啘鍑哄簱浠诲姟 _taskService.TaskCompleted(conveyorLineInfoWrite.TaskNum); device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); } @@ -244,6 +240,50 @@ { WriteInfo(device.DeviceName, $"鏈壘鍒拌澶囧瓙缂栧彿{item.StationCode}鐨勫崗璁俊鎭�"); } + R_ConveyorLineInfo conveyorLineInfoRead1 = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(deviceProRead.DeviceProAddress); + W_ConveyorLineInfo conveyorLineInfoWrite1 = device.Communicator.ReadCustomer<W_ConveyorLineInfo>(deviceProWrite.DeviceProAddress); + R_ConveyorLineStatus conveyorLineStatus1 = conveyorLineInfoRead1.Status.ByteToBoolObject<R_ConveyorLineStatus>(); + ConveyorLineSignal conveyorLineSignalRead1 = conveyorLineInfoRead1.Signal.ByteToBoolObject<ConveyorLineSignal>(); + ConveyorLineSignal conveyorLineSignalWrite1 = conveyorLineInfoWrite1.Signal.ByteToBoolObject<ConveyorLineSignal>(); + if (item.StationCode == "7003") { + if (conveyorLineSignalRead1.STB && conveyorLineStatus1.Online && conveyorLineStatus1.Goods && !conveyorLineStatus1.Alarm && !conveyorLineSignalWrite1.ACK) + { + StackerCraneJob_GM.gMReadData.R_GM_Boxcode = device.Communicator.Read<string>("DB900.478.0"); + } + StackerCraneJob_GM.gMReadData.R_GM_HandShake3 = conveyorLineStatus1.HandShake; + StackerCraneJob_GM.gMReadData.R_GM_Online3 = conveyorLineStatus1.Online; + StackerCraneJob_GM.gMReadData.R_GM_Free3 = conveyorLineStatus1.Free; + StackerCraneJob_GM.gMReadData.R_GM_Goods3 = conveyorLineStatus1.Goods; + StackerCraneJob_GM.gMReadData.R_GM_Alarm3 = conveyorLineStatus1.Alarm; + StackerCraneJob_GM.gMReadData.R_GM_STB3 = conveyorLineSignalRead1.STB; + StackerCraneJob_GM.gMReadData.R_GM_ACK3 = conveyorLineSignalRead1.ACK; + StackerCraneJob_GM.gMReadData.W_GM_STB3 = conveyorLineSignalWrite1.STB; + StackerCraneJob_GM.gMReadData.W_GM_ACK3 = conveyorLineSignalWrite1.ACK; + } + else if(item.StationCode == "7004") + { + StackerCraneJob_GM.gMReadData.R_GM_HandShake4 = conveyorLineStatus1.HandShake; + StackerCraneJob_GM.gMReadData.R_GM_Online4 = conveyorLineStatus1.Online; + StackerCraneJob_GM.gMReadData.R_GM_Free4 = conveyorLineStatus1.Free; + StackerCraneJob_GM.gMReadData.R_GM_Goods4 = conveyorLineStatus1.Goods; + StackerCraneJob_GM.gMReadData.R_GM_Alarm4 = conveyorLineStatus1.Alarm; + StackerCraneJob_GM.gMReadData.R_GM_STB4 = conveyorLineSignalRead1.STB; + StackerCraneJob_GM.gMReadData.R_GM_ACK4 = conveyorLineSignalRead1.ACK; + StackerCraneJob_GM.gMReadData.W_GM_STB4 = conveyorLineSignalWrite1.STB; + StackerCraneJob_GM.gMReadData.W_GM_ACK4 = conveyorLineSignalWrite1.ACK; + } + else if (item.StationCode == "7005") + { + StackerCraneJob_GM.gMReadData.R_GM_HandShake5 = conveyorLineStatus1.HandShake; + StackerCraneJob_GM.gMReadData.R_GM_Online5 = conveyorLineStatus1.Online; + StackerCraneJob_GM.gMReadData.R_GM_Free5 = conveyorLineStatus1.Free; + StackerCraneJob_GM.gMReadData.R_GM_Goods5 = conveyorLineStatus1.Goods; + StackerCraneJob_GM.gMReadData.R_GM_Alarm5 = conveyorLineStatus1.Alarm; + StackerCraneJob_GM.gMReadData.R_GM_STB5 = conveyorLineSignalRead1.STB; + StackerCraneJob_GM.gMReadData.R_GM_ACK5 = conveyorLineSignalRead1.ACK; + StackerCraneJob_GM.gMReadData.W_GM_STB5 = conveyorLineSignalWrite1.STB; + StackerCraneJob_GM.gMReadData.W_GM_ACK5 = conveyorLineSignalWrite1.ACK; + } } } -- Gitblit v1.9.3