| | |
| | | //{ |
| | | // 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.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); |
| | | } |
| | | } |
| | | public class PLCServiceModel |
| | | { |
| | | public bool? BoRunningState { get; set; } |
| | | |
| | | |
| | | public bool? BoOffline { get; set; } |
| | | |
| | | |
| | | public bool? BoRefresh { get; set; } |
| | | } |