hwh
2024-09-05 d3e1346d52806f00d21eba23cabf9cfa4f61d7d4
Admin.NET/WCS.Application/Hub/PlcHub.cs
@@ -42,14 +42,20 @@
    {
        //运行状态
        if (context.BoRunningState.HasValue)
        {
            PLCTaskAction.boRunningState = context.BoRunningState.Value;
            if (context.BoRunningState.Value)
                PLCTaskAction.Init();
            else
                PLCTaskAction.Stop();
        }
        //脱机模式
        if (context.BoOffline.HasValue)
            PLCTaskAction.boOffline = context.BoOffline.Value;
        //自刷新
        if (context.BoRefresh.HasValue)
            PLCTaskAction.boRefresh = context.BoRefresh.Value;
        await _plcHubContext.Clients.All.UpdateService(context);
        await _plcHubContext.Clients.All.UpdateService(new PLCServiceModel() { BoRunningState = PLCTaskAction.boRunningState, BoRefresh = PLCTaskAction.boRefresh, BoOffline = PLCTaskAction.boOffline });
    }
}
public class PLCServiceModel