bklLiudl
2024-10-15 dd973f741617e3bbf5ecf11747ff71960991549c
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>();