bklLiudl
2024-09-03 5fab21700b6005e8eecf41f05638ecadf3048bbc
Admin.NET/WCS.Application/Hub/PlcHub.cs
@@ -34,4 +34,31 @@
    //{
    //    await _plcHubContext.Clients.All.PublicStationStatus(context);
    //}
    /// <summary>
    /// 下发服务状态
    /// </summary>
    public async Task UpdateService(PLCServiceModel context)
    {
        //运行状态
        if (context.BoRunningState.HasValue)
            PLCTaskAction.boRunningState = context.BoRunningState.Value;
        //脱机模式
        if (context.BoOffline.HasValue)
            PLCTaskAction.boOffline = context.BoOffline.Value;
        //自刷新
        if (context.BoRefresh.HasValue)
            PLCTaskAction.boRefresh = context.BoRefresh.Value;
        await _plcHubContext.Clients.All.UpdateService(context);
    }
}
public class PLCServiceModel
{
    public bool? BoRunningState { get; set; }
    public bool? BoOffline { get; set; }
    public bool? BoRefresh { get; set; }
}