From 11cea3bba7ac11d67c1110f3a922c8a19cb5a57d Mon Sep 17 00:00:00 2001 From: hwh <332078369@qq.com> Date: 星期二, 03 九月 2024 11:42:53 +0800 Subject: [PATCH] 报警监控通讯和页面优化 --- Admin.NET/WCS.Application/Hub/PlcHub.cs | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/Admin.NET/WCS.Application/Hub/PlcHub.cs b/Admin.NET/WCS.Application/Hub/PlcHub.cs index b6dbb86..f85da61 100644 --- a/Admin.NET/WCS.Application/Hub/PlcHub.cs +++ b/Admin.NET/WCS.Application/Hub/PlcHub.cs @@ -34,4 +34,37 @@ //{ // 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; } +} \ No newline at end of file -- Gitblit v1.8.0