From fdab33a6b12d09c898606f15e40178b44e174721 Mon Sep 17 00:00:00 2001
From: IPC-610 <IPC-610@DESKTOP-6LEOOS3>
Date: 星期四, 26 九月 2024 17:00:16 +0800
Subject: [PATCH] 码垛交互流程

---
 Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs b/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs
index fdff08a..ad3ab15 100644
--- a/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs
+++ b/Admin.NET/WCS.Application/Hub/PlcDeviceHub.cs
@@ -16,7 +16,6 @@
 [MapHub("/hubs/PlcDevice")]
 public class PlcDeviceHub : Hub<IPlcDeviceHub>
 {
-    private static readonly IHubContext<PlcDeviceHub, IPlcDeviceHub> _plcDeviceHubContext = App.GetService<IHubContext<PlcDeviceHub, IPlcDeviceHub>>();
     private static readonly SysCacheService _sysCacheService = App.GetRequiredService<SysCacheService>();
     private static bool boRunningState = false;
     private static CancellationTokenSource cts;//鍙栨秷绾跨▼鏍囪瘑
@@ -188,6 +187,13 @@
                                     modDevice.PickStorey = Convert.ToInt32(pickStorey);
                                 }
 
+                                if (modPlc.Type == PLCTypeEnum.StackingMachine)
+                                {
+                                    //璺烘満鐨勮捣濮嬪伐浣嶇敤鍙栬揣鎺掑垪灞�
+                                    modDevice.StartLocatNo = $"{modDevice.PickRow.ToString()}{modDevice.PickCol.ToString()}{modDevice.PickStorey.ToString()}";
+                                    //璺烘満鐨勭洰鐨勫伐浣嶇敤鏀捐揣鎺掑垪灞�
+                                    modDevice.EndLocatNo = $"{modDevice.ReleaseRow.ToString()}{modDevice.ReleaseCol.ToString()}{modDevice.ReleaseStorey.ToString()}";
+                                }
                             }
                         }
                         //else
@@ -219,7 +225,7 @@
                                      modDevice.PickStorey != initialState.PickStorey)))
                             {
                                 // 閫氱煡鐢ㄦ埛鍙樻洿
-                                _plcDeviceHubContext.Clients.All.PublicPlcDevice(modDevice);
+                                HubUtil.PublicPlcDevice(modDevice);
                             }
                         }
                         initialStates[modDevice.Id] = modDevice.Adapt<WcsDeviceOutput>();

--
Gitblit v1.8.0