| | |
| | | { |
| | | //运行状态 |
| | | 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 |