From 75f990bfee010d7905758237bd4090244cb9cf10 Mon Sep 17 00:00:00 2001 From: xiaoguo Date: Wed, 1 May 2024 01:45:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=99=A8=E6=97=B6=E9=97=B4=E5=8F=82=E6=95=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=8F=8A=E8=AE=BE=E7=BD=AE=20=E5=8A=9F=E8=83=BD=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/PLCPointName.cs | 46 ++++++++ .../Repositories/Entities/GSDBContext.cs | 84 ++++++++------ .../Impl/PLCDeviceRecordRepository.cs | 16 +-- .../Services/Impl/PLCCommunicationService.cs | 15 ++- .../Services/Impl/PLCMonitorService.cs | 27 +++-- .../Services/Impl/PLCPointService.cs | 12 +- .../ControlUI/ControlParamSetting.cs | 108 +++++++++++++++++- .../Controller/PLCController.cs | 33 ++++-- .../GuideScreen/GuideScreen.UI/FormScreen.cs | 23 ++-- 9 files changed, 284 insertions(+), 80 deletions(-) diff --git a/guidescreen/GuideScreen/GuideScreen.Common/Constants/PLCPointName.cs b/guidescreen/GuideScreen/GuideScreen.Common/Constants/PLCPointName.cs index 986dec6..8753937 100644 --- a/guidescreen/GuideScreen/GuideScreen.Common/Constants/PLCPointName.cs +++ b/guidescreen/GuideScreen/GuideScreen.Common/Constants/PLCPointName.cs @@ -435,5 +435,51 @@ /// 女3控制器T5 /// public const string ToiletWomanController3T5 = nameof(ToiletWomanController3T5); + + /// + /// 下发参数T2 + /// + public const string ToiletIssueT2 = nameof(ToiletIssueT2); + + /// + /// 下发参数T3 + /// + public const string ToiletIssueT3 = nameof(ToiletIssueT3); + + /// + /// 下发参数T4 + /// + public const string ToiletIssueT4 = nameof(ToiletIssueT4); + + /// + /// 下发参数T5 + /// + public const string ToiletIssueT5 = nameof(ToiletIssueT5); + + /// + /// 下发参数T2确认(1)/复位(0) + /// + public const string ToiletIssueActionT2 = nameof(ToiletIssueActionT2); + + /// + /// 下发参数T3确认(1)/复位(0) + /// + public const string ToiletIssueActionT3 = nameof(ToiletIssueActionT3); + + /// + /// 下发参数T4确认(1)/复位(0) + /// + public const string ToiletIssueActionT4 = nameof(ToiletIssueActionT4); + + /// + /// 下发参数T5确认(1)/复位(0) + /// + public const string ToiletIssueActionT5 = nameof(ToiletIssueActionT5); + + /// + /// 下发参数_侧位选择 + /// 男1=2,男2=3,男3=4,男4=5,男5=6,女1=7,女2=8,女3=9 + /// + public const string ToiletIssueSelect = nameof(ToiletIssueSelect); } } \ No newline at end of file diff --git a/guidescreen/GuideScreen/GuideScreen.Common/Repositories/Entities/GSDBContext.cs b/guidescreen/GuideScreen/GuideScreen.Common/Repositories/Entities/GSDBContext.cs index 974df98..f77ef42 100644 --- a/guidescreen/GuideScreen/GuideScreen.Common/Repositories/Entities/GSDBContext.cs +++ b/guidescreen/GuideScreen/GuideScreen.Common/Repositories/Entities/GSDBContext.cs @@ -193,38 +193,47 @@ namespace GuideScreen.Common.Repositories var washCountToiletWomanCount2 = new PLCPointEntity { DeviceName = PLCDeviceNames.WashCount, PointName = PLCPointNameByWashCount.ToiletWomanCount2, PointNote = "女2冲洗次数", PointDataType = PLCPointDataType.Int16, PointAddress = "VW186", Unit = "次", IsWrite = true }; var washCountToiletWomanCount3 = new PLCPointEntity { DeviceName = PLCDeviceNames.WashCount, PointName = PLCPointNameByWashCount.ToiletWomanCount3, PointNote = "女3冲洗次数", PointDataType = PLCPointDataType.Int16, PointAddress = "VW188", Unit = "次", IsWrite = true }; //控制器时间参数显示及设置 - var toiletManController1T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController1T2, PointNote = "男1控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW190", Unit = "s", IsWrite = true }; - var toiletManController1T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController1T3, PointNote = "男1控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW192", Unit = "s", IsWrite = true }; - var toiletManController1T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController1T4, PointNote = "男1控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW194", Unit = "s", IsWrite = true }; - var toiletManController1T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController1T5, PointNote = "男1控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW196", Unit = "s", IsWrite = true }; - var toiletManController2T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController2T2, PointNote = "男2控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW198", Unit = "s", IsWrite = true }; - var toiletManController2T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController2T3, PointNote = "男2控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW200", Unit = "s", IsWrite = true }; - var toiletManController2T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController2T4, PointNote = "男2控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW202", Unit = "s", IsWrite = true }; - var toiletManController2T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController2T5, PointNote = "男2控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW204", Unit = "s", IsWrite = true }; - var toiletManController3T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController3T2, PointNote = "男3控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW206", Unit = "s", IsWrite = true }; - var toiletManController3T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController3T3, PointNote = "男3控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW208", Unit = "s", IsWrite = true }; - var toiletManController3T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController3T4, PointNote = "男3控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW210", Unit = "s", IsWrite = true }; - var toiletManController3T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController3T5, PointNote = "男3控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW212", Unit = "s", IsWrite = true }; - var toiletManController4T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController4T2, PointNote = "男4控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW214", Unit = "s", IsWrite = true }; - var toiletManController4T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController4T3, PointNote = "男4控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW216", Unit = "s", IsWrite = true }; - var toiletManController4T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController4T4, PointNote = "男4控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW218", Unit = "s", IsWrite = true }; - var toiletManController4T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController4T5, PointNote = "男4控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW220", Unit = "s", IsWrite = true }; - var toiletManController5T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController5T2, PointNote = "男5控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW222", Unit = "s", IsWrite = true }; - var toiletManController5T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController5T3, PointNote = "男5控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW224", Unit = "s", IsWrite = true }; - var toiletManController5T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController5T4, PointNote = "男5控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW226", Unit = "s", IsWrite = true }; - var toiletManController5T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController5T5, PointNote = "男5控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW228", Unit = "s", IsWrite = true }; - var toiletWomanController1T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController1T2, PointNote = "女1控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW230", Unit = "s", IsWrite = true }; - var toiletWomanController1T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController1T3, PointNote = "女1控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW232", Unit = "s", IsWrite = true }; - var toiletWomanController1T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController1T4, PointNote = "女1控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW234", Unit = "s", IsWrite = true }; - var toiletWomanController1T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController1T5, PointNote = "女1控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW236", Unit = "s", IsWrite = true }; - var toiletWomanController2T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController2T2, PointNote = "女2控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW238", Unit = "s", IsWrite = true }; - var toiletWomanController2T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController2T3, PointNote = "女2控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW240", Unit = "s", IsWrite = true }; - var toiletWomanController2T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController2T4, PointNote = "女2控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW242", Unit = "s", IsWrite = true }; - var toiletWomanController2T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController2T5, PointNote = "女2控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW244", Unit = "s", IsWrite = true }; - var toiletWomanController3T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController3T2, PointNote = "女3控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW246", Unit = "s", IsWrite = true }; - var toiletWomanController3T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController3T3, PointNote = "女3控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW248", Unit = "s", IsWrite = true }; - var toiletWomanController3T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController3T4, PointNote = "女3控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW250", Unit = "s", IsWrite = true }; - var toiletWomanController3T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController3T5, PointNote = "女3控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW252", Unit = "s", IsWrite = true }; + var toiletManController1T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController1T2, PointNote = "男1控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW190", Unit = "s", IsWrite = false }; + var toiletManController1T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController1T3, PointNote = "男1控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW192", Unit = "s", IsWrite = false }; + var toiletManController1T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController1T4, PointNote = "男1控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW194", Unit = "s", IsWrite = false }; + var toiletManController1T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController1T5, PointNote = "男1控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW196", Unit = "s", IsWrite = false }; + var toiletManController2T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController2T2, PointNote = "男2控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW198", Unit = "s", IsWrite = false }; + var toiletManController2T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController2T3, PointNote = "男2控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW200", Unit = "s", IsWrite = false }; + var toiletManController2T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController2T4, PointNote = "男2控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW202", Unit = "s", IsWrite = false }; + var toiletManController2T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController2T5, PointNote = "男2控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW204", Unit = "s", IsWrite = false }; + var toiletManController3T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController3T2, PointNote = "男3控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW206", Unit = "s", IsWrite = false }; + var toiletManController3T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController3T3, PointNote = "男3控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW208", Unit = "s", IsWrite = false }; + var toiletManController3T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController3T4, PointNote = "男3控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW210", Unit = "s", IsWrite = false }; + var toiletManController3T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController3T5, PointNote = "男3控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW212", Unit = "s", IsWrite = false }; + var toiletManController4T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController4T2, PointNote = "男4控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW214", Unit = "s", IsWrite = false }; + var toiletManController4T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController4T3, PointNote = "男4控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW216", Unit = "s", IsWrite = false }; + var toiletManController4T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController4T4, PointNote = "男4控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW218", Unit = "s", IsWrite = false }; + var toiletManController4T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController4T5, PointNote = "男4控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW220", Unit = "s", IsWrite = false }; + var toiletManController5T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController5T2, PointNote = "男5控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW222", Unit = "s", IsWrite = false }; + var toiletManController5T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController5T3, PointNote = "男5控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW224", Unit = "s", IsWrite = false }; + var toiletManController5T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController5T4, PointNote = "男5控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW226", Unit = "s", IsWrite = false }; + var toiletManController5T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletManController5T5, PointNote = "男5控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW228", Unit = "s", IsWrite = false }; + var toiletWomanController1T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController1T2, PointNote = "女1控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW230", Unit = "s", IsWrite = false }; + var toiletWomanController1T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController1T3, PointNote = "女1控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW232", Unit = "s", IsWrite = false }; + var toiletWomanController1T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController1T4, PointNote = "女1控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW234", Unit = "s", IsWrite = false }; + var toiletWomanController1T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController1T5, PointNote = "女1控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW236", Unit = "s", IsWrite = false }; + var toiletWomanController2T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController2T2, PointNote = "女2控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW238", Unit = "s", IsWrite = false }; + var toiletWomanController2T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController2T3, PointNote = "女2控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW240", Unit = "s", IsWrite = false }; + var toiletWomanController2T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController2T4, PointNote = "女2控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW242", Unit = "s", IsWrite = false }; + var toiletWomanController2T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController2T5, PointNote = "女2控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW244", Unit = "s", IsWrite = false }; + var toiletWomanController3T2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController3T2, PointNote = "女3控制器T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW246", Unit = "s", IsWrite = false }; + var toiletWomanController3T3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController3T3, PointNote = "女3控制器T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW248", Unit = "s", IsWrite = false }; + var toiletWomanController3T4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController3T4, PointNote = "女3控制器T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW250", Unit = "s", IsWrite = false }; + var toiletWomanController3T5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletWomanController3T5, PointNote = "女3控制器T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW252", Unit = "s", IsWrite = false }; + var toiletIssueT2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueT2, PointNote = "下发参数T2", PointDataType = PLCPointDataType.Int16, PointAddress = "VW280", Unit = "s", IsWrite = true }; + var toiletIssueT3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueT3, PointNote = "下发参数T3", PointDataType = PLCPointDataType.Int16, PointAddress = "VW282", Unit = "s", IsWrite = true }; + var toiletIssueT4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueT4, PointNote = "下发参数T4", PointDataType = PLCPointDataType.Int16, PointAddress = "VW284", Unit = "s", IsWrite = true }; + var toiletIssueT5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueT5, PointNote = "下发参数T5", PointDataType = PLCPointDataType.Int16, PointAddress = "VW286", Unit = "s", IsWrite = true }; + var toiletIssueActionT2 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueActionT2, PointNote = "下发参数T2确认(1)/复位(0) ", PointDataType = PLCPointDataType.Bool, PointAddress = "V270.0", Unit = "s", IsWrite = true }; + var toiletIssueActionT3 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueActionT3, PointNote = "下发参数T3确认(1)/复位(0) ", PointDataType = PLCPointDataType.Bool, PointAddress = "V270.1", Unit = "s", IsWrite = true }; + var toiletIssueActionT4 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueActionT4, PointNote = "下发参数T4确认(1)/复位(0) ", PointDataType = PLCPointDataType.Bool, PointAddress = "V270.2", Unit = "s", IsWrite = true }; + var toiletIssueActionT5 = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueActionT5, PointNote = "下发参数T5确认(1)/复位(0) ", PointDataType = PLCPointDataType.Bool, PointAddress = "V270.3", Unit = "s", IsWrite = true }; + var toiletIssueSelect = new PLCPointEntity { DeviceName = PLCDeviceNames.SetControllerTimeParameters, PointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueSelect, PointNote = "侧位选择", PointDataType = PLCPointDataType.Int16, PointAddress = "VW288", Unit = "s", IsWrite = true }; context.PLCPointEntites.AddRange(new PLCPointEntity[] { vacuumPumpingStationRealTimeVacuum, @@ -304,6 +313,17 @@ namespace GuideScreen.Common.Repositories toiletWomanController3T3, toiletWomanController3T4, toiletWomanController3T5, + + toiletIssueT2, + toiletIssueT3, + toiletIssueT4, + toiletIssueT5, + toiletIssueActionT2, + toiletIssueActionT3, + toiletIssueActionT4, + toiletIssueActionT5, + toiletIssueSelect + }); context.SaveChanges(); diff --git a/guidescreen/GuideScreen/GuideScreen.Common/Repositories/Impl/PLCDeviceRecordRepository.cs b/guidescreen/GuideScreen/GuideScreen.Common/Repositories/Impl/PLCDeviceRecordRepository.cs index 68de84c..2003703 100644 --- a/guidescreen/GuideScreen/GuideScreen.Common/Repositories/Impl/PLCDeviceRecordRepository.cs +++ b/guidescreen/GuideScreen/GuideScreen.Common/Repositories/Impl/PLCDeviceRecordRepository.cs @@ -85,7 +85,7 @@ namespace GuideScreen.Common.Repositories.Impl using (var context = GSDBContext.GetDbContext()) { var total = context.PLCDeviceRecordDayEntities.Where(f => f.DeviceName == deviceName).Select(f => (decimal?)f.RecordValue).Sum(); - return total??0; + return total ?? 0; } } @@ -172,9 +172,9 @@ namespace GuideScreen.Common.Repositories.Impl var year = DateTime.Now.Year; var begDate = DateTime.Parse($"{year}-1-1"); var endDate = begDate.AddYears(1).AddDays(-1); - + //获取月份 - var months=new List(); + var months = new List(); for (var date = begDate; date <= endDate; date = date.AddMonths(1)) { months.Add(date.Month); @@ -187,7 +187,7 @@ namespace GuideScreen.Common.Repositories.Impl { var list = context.PLCDeviceRecordDayEntities .Where(f => f.DeviceName == PLCDeviceNames.ToiletPosition && f.UpdateDateTime >= begDate && f.UpdateDateTime <= endDate) - .GroupBy(f => f.Day).Select(f => new { Day = f.Key, Sum = f.Sum(ff=>ff.RecordValue) }) + .GroupBy(f => f.Day).Select(f => new { Day = f.Key, Sum = f.Sum(ff => ff.RecordValue) }) .ToList(); foreach (var m in months) @@ -240,7 +240,7 @@ namespace GuideScreen.Common.Repositories.Impl var end = beg.AddDays(1).AddMinutes(-1); var last = list.Select(f => new { Day = DateTime.Parse(f.Day), f.RecordValue }).Where(f => f.Day >= beg && f.Day <= end).OrderBy(f => f.Day).Select(f => f.RecordValue).LastOrDefault(); - if (index == 0) + if (index == 0) { var first = list.Select(f => new { Day = DateTime.Parse(f.Day), f.RecordValue }).Where(f => f.Day >= beg && f.Day <= end).OrderBy(f => f.Day).Select(f => f.RecordValue).FirstOrDefault(); retValues.Add(month.ToString(), last > first ? last - first : 0); @@ -317,13 +317,13 @@ namespace GuideScreen.Common.Repositories.Impl /// 获取总用水量 /// /// - public decimal WaterTotal() + public decimal WaterTotal() { using (var context = GSDBContext.GetDbContext()) { - var val = context.PLCDeviceRecordDayEntities.Where(f => f.PointName == PLCPointNameByEnergyMonitoring.WaterConsumption).Sum(f=>f.RecordValue); + var val = context.PLCDeviceRecordDayEntities.Where(f => f.PointName == PLCPointNameByEnergyMonitoring.WaterConsumption).Sum(f => (decimal?)f.RecordValue); - return val; + return val ?? 0; } } } diff --git a/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCCommunicationService.cs b/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCCommunicationService.cs index 1bff16d..02b031a 100644 --- a/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCCommunicationService.cs +++ b/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCCommunicationService.cs @@ -197,9 +197,18 @@ namespace GuideScreen.Common.Services.Impl /// public PLCResult Write(string address, Int16 value) { - var operateResult = siemensS7Net.Write(address, value); - var result = ConvertResult(operateResult); - return result; + try + { + var operateResult = siemensS7Net.Write(address, value); + var result = ConvertResult(operateResult); + return result; + } + catch (Exception ex) + { + ex.WriteErrorLog("写入Int16值"); + throw; + } + } /// diff --git a/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCMonitorService.cs b/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCMonitorService.cs index db637fe..13f7483 100644 --- a/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCMonitorService.cs +++ b/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCMonitorService.cs @@ -37,10 +37,10 @@ namespace GuideScreen.Common.Services.Impl /// /// 是否在运行状态 /// - public bool IsRun + public bool IsRun { - get - { + get + { return isRun; } } @@ -206,7 +206,7 @@ namespace GuideScreen.Common.Services.Impl /// 点位地址 /// 写类型 /// - public object ReadValue(string address ,Type type) + public object ReadValue(string address, Type type) { object retVal = null; var plcService = plcCommunicationService; @@ -266,53 +266,56 @@ namespace GuideScreen.Common.Services.Impl /// public PLCResult WriteValue(string address, Type type, object value) { + PLCResult retVal = null; var plcService = plcCommunicationService; //Boolean if (type.Equals(typeof(Boolean))) { - var result = plcService.Write(address, (bool)value); + var result = plcService.Write(address, Convert.ToBoolean(value)); retVal = result; } //Byte if (type.Equals(typeof(Byte))) { - var result = plcService.Write(address, (byte)value); + var result = plcService.Write(address, Convert.ToByte(value)); retVal = result; } //Int16 if (type.Equals(typeof(Int16))) { - var result = plcService.Write(address, (Int16)value); + var result = plcService.Write(address, Convert.ToInt16(value)); retVal = result; } //Int32 if (type.Equals(typeof(Int32))) { - var result = plcService.Write(address, (Int32)value); + var result = plcService.Write(address, Convert.ToInt32(value)); retVal = result; } //Int64 if (type.Equals(typeof(Int64))) { - var result = plcService.Write(address, (Int64)value); + var result = plcService.Write(address, Convert.ToInt64(value)); retVal = result; } //float if (type.Equals(typeof(float))) { - var result = plcService.Write(address, (float)value); + var result = plcService.Write(address, Convert.ToSingle(value)); retVal = result; } //double if (type.Equals(typeof(Double))) { - var result = plcService.Write(address, (Double)value); + var result = plcService.Write(address, Convert.ToDouble(value)); retVal = result; } return retVal; + + } private void PointMonitor() @@ -408,7 +411,7 @@ namespace GuideScreen.Common.Services.Impl } else { - ErrorMessage?.Invoke(this, result.Message); + ErrorMessage?.Invoke(this, $"点位:{point.Name} 读取失败:{result.Message}"); point.Error?.Invoke(result.Message); } } diff --git a/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCPointService.cs b/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCPointService.cs index 07387ae..32705d9 100644 --- a/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCPointService.cs +++ b/guidescreen/GuideScreen/GuideScreen.Common/Services/Impl/PLCPointService.cs @@ -37,11 +37,11 @@ namespace GuideScreen.Common.Services.Impl public PageModel> GetPLCPointList(string deviceName, string note, int pageSize, int pageIndex) { var pageModel = plcPointRepository.GetPLCPointList(deviceName, note, pageSize, pageIndex); - if (pageModel.Content != null && pLCMonitorService.IsRun) + if (pageModel.Content != null && plcMonitorService.IsRun) { foreach (var model in pageModel.Content) { - model.PointValue = pLCMonitorService.ReadValue(model.PointAddress, Type.GetType(model.PointDataType))?.ToString(); + model.PointValue = plcMonitorService.ReadValue(model.PointAddress, Type.GetType(model.PointDataType))?.ToString(); } } return pageModel; @@ -55,12 +55,12 @@ namespace GuideScreen.Common.Services.Impl { var list = plcPointRepository.GetPLCPointList(PLCDeviceNames.SetControllerTimeParameters, "", 0, 0); var points = plcMonitorService.Points; - if (points != null && points.Count > 0) + if (points != null && points.Count > 0) { - foreach (var c in list.Content) + foreach (var c in list.Content) { - var point = points.Where(f => f.Address == c.PointAddress).FirstOrDefault(); - if (point != null) + var point = points.Where(f => f.Address == c.PointAddress).FirstOrDefault(); + if (point != null) { c.PointValue = point.ObjectValue?.ToString(); } diff --git a/guidescreen/GuideScreen/GuideScreen.UI/ControlUI/ControlParamSetting.cs b/guidescreen/GuideScreen/GuideScreen.UI/ControlUI/ControlParamSetting.cs index 78e8ac3..232df99 100644 --- a/guidescreen/GuideScreen/GuideScreen.UI/ControlUI/ControlParamSetting.cs +++ b/guidescreen/GuideScreen/GuideScreen.UI/ControlUI/ControlParamSetting.cs @@ -1,6 +1,8 @@ using GuideScreen.Common.Common; +using GuideScreen.Common.Constants; using GuideScreen.Common.Services; using GuideScreen.Common.Services.Models; +using Newtonsoft.Json.Linq; using Sunny.UI; using System; using System.Collections.Generic; @@ -28,6 +30,18 @@ namespace GuideScreen.UI.ControlUI plcPointService = DIManager.GetContainerObject(); plcMonitorService = DIManager.GetContainerObject(); + btnSetT2.Tag = "T2"; + btnSetT3.Tag = "T3"; + btnSetT4.Tag = "T4"; + btnSetT5.Tag = "T5"; + btnSetT2.KeyDown += BtnSet_KeyDown; + btnSetT2.KeyUp += BtnSet_KeyUp; + btnSetT3.KeyDown += BtnSet_KeyDown; + btnSetT3.KeyUp += BtnSet_KeyUp; + btnSetT4.KeyDown += BtnSet_KeyDown; + btnSetT4.KeyUp += BtnSet_KeyUp; + btnSetT5.KeyDown += BtnSet_KeyDown; + btnSetT5.KeyUp += BtnSet_KeyUp; } private void ControlParamSetting_Load(object sender, EventArgs e) @@ -35,7 +49,7 @@ namespace GuideScreen.UI.ControlUI var list = plcPointService.GetControllerTimeParametersList(); if (list.Count > 0) { - var toilets = list.Select(f => f.PointNote.Substring(0, 2)).Distinct().ToList(); + var toilets = list.Where(f => f.PointNote.StartsWith("男") || f.PointNote.StartsWith("女")).Select(f => f.PointNote.Substring(0, 2)).Distinct().ToList(); cmbToilet.DataSource = toilets; btnSelect_Click(); } @@ -89,6 +103,19 @@ namespace GuideScreen.UI.ControlUI Setting(3, Int16.Parse(txtT5.Text)); } + private void BtnSet_KeyDown(object sender, KeyEventArgs e) + { + + var btn = (UIButton)sender; + downUp(btn.Tag.ToString(), true); + } + + private void BtnSet_KeyUp(object sender, KeyEventArgs e) + { + var btn = (UIButton)sender; + downUp(btn.Tag.ToString(), false); + } + private void Setting(int index, Int16 value) { if (!plcMonitorService.IsRun) @@ -101,7 +128,43 @@ namespace GuideScreen.UI.ControlUI ShowErrorNotifier("查询参数不正确!"); return; } - var result = plcMonitorService.WriteValue(models[index].PointAddress, value); + string pointName = string.Empty; + switch (index) + { + case 0: + pointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueT2; + break; + case 1: + pointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueT3; + break; + case 2: + pointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueT4; + break; + case 3: + pointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueT5; + break; + default: + break; + } + var point = plcMonitorService.Points.Where(f => f.Name == pointName).FirstOrDefault(); + if (point == null) + { + ShowErrorNotifier($"没有找到点位设置参数 {pointName} 点位!"); + return; + } + var selectPoint = plcMonitorService.Points.Where(f => f.Name == PLCPointNameBySetControllerTimeParameters.ToiletIssueSelect).FirstOrDefault(); + if (selectPoint == null) + { + ShowErrorNotifier($"没有找到点位设置参数 {PLCPointNameBySetControllerTimeParameters.ToiletIssueSelect} 点位!"); + return; + } + var result = plcMonitorService.WriteValue(selectPoint.Address, selectPoint.DataType, cmbToilet.SelectedIndex + 2); + if (!result.IsSuccess) + { + ShowErrorNotifier($"下发失败,选择侧位{cmbToilet.Text},值:{cmbToilet.SelectedIndex + 2}," + result.Message); + return; + } + result = plcMonitorService.WriteValue(point.Address, point.DataType, value); if (!result.IsSuccess) { ShowErrorNotifier("下发失败," + result.Message); @@ -110,5 +173,46 @@ namespace GuideScreen.UI.ControlUI ShowSuccessNotifier("下发成功!"); } + + + private void downUp(string tag, bool isDown) + { + if (!plcMonitorService.IsRun) + { + ShowErrorNotifier("PLC连接失败!"); + return; + } + string pointName = string.Empty; + switch (tag) + { + case "T2": + pointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueActionT2; + break; + case "T3": + pointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueActionT3; + break; + case "T4": + pointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueActionT4; + break; + case "T5": + pointName = PLCPointNameBySetControllerTimeParameters.ToiletIssueActionT5; + break; + default: + break; + } + var point = plcMonitorService.Points.Where(f => f.Name == pointName).FirstOrDefault(); + if (point == null) + { + ShowErrorNotifier($"没有找到点位设置参数 {pointName} 点位!"); + return; + } + var result = plcMonitorService.WriteValue(point.Address, point.DataType, isDown); + if (!result.IsSuccess) + { + ShowErrorNotifier("下发失败," + result.Message); + return; + } + + } } } diff --git a/guidescreen/GuideScreen/GuideScreen.UI/Controller/PLCController.cs b/guidescreen/GuideScreen/GuideScreen.UI/Controller/PLCController.cs index 8111b40..8bc8b85 100644 --- a/guidescreen/GuideScreen/GuideScreen.UI/Controller/PLCController.cs +++ b/guidescreen/GuideScreen/GuideScreen.UI/Controller/PLCController.cs @@ -122,19 +122,19 @@ namespace GuideScreen.Common.Services.Impl /// 获取个厕位使用累计记录 /// /// - public IDictionary ToiletPositionRecordTotal() + public IDictionary ToiletPositionRecordTotal() { //厕所侧位使用统计 var toilets = new Dictionary { - ["男厕1"] = plcMonitorService.ReadValue(PLCPointNameByWashCount.ToiletManCount1), - ["男厕2"] = plcMonitorService.ReadValue(PLCPointNameByWashCount.ToiletManCount2), - ["男厕3"] = plcMonitorService.ReadValue(PLCPointNameByWashCount.ToiletManCount3), - ["男厕4"] = plcMonitorService.ReadValue(PLCPointNameByWashCount.ToiletManCount4), - ["男厕5"] = plcMonitorService.ReadValue(PLCPointNameByWashCount.ToiletManCount5), - ["女厕1"] = plcMonitorService.ReadValue(PLCPointNameByWashCount.ToiletWomanCount1), - ["女厕2"] = plcMonitorService.ReadValue(PLCPointNameByWashCount.ToiletWomanCount2), - ["女厕3"] = plcMonitorService.ReadValue(PLCPointNameByWashCount.ToiletWomanCount3), + ["男厕1"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount1), + ["男厕2"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount2), + ["男厕3"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount3), + ["男厕4"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount4), + ["男厕5"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount5), + ["女厕1"] = GetPointWashCount(PLCPointNameByWashCount.ToiletWomanCount1), + ["女厕2"] = GetPointWashCount(PLCPointNameByWashCount.ToiletWomanCount2), + ["女厕3"] = GetPointWashCount(PLCPointNameByWashCount.ToiletWomanCount3), }; return toilets; @@ -172,6 +172,12 @@ namespace GuideScreen.Common.Services.Impl return 0; } + private Int16 GetPointWashCount(string name) + { + var point = Points.Where(f => f.Name == name).FirstOrDefault(); + return Convert.ToInt16(point?.ObjectValue); + } + /// /// 添加点位记录 /// @@ -196,7 +202,10 @@ namespace GuideScreen.Common.Services.Impl //记录正空泵信息 case PLCDeviceNames.VacuumPumpingStation: break; - + //获取冲洗统计 + case PLCDeviceNames.WashCount: + ToiletPositionRecordTotal(); + break; default: break; } @@ -250,6 +259,10 @@ namespace GuideScreen.Common.Services.Impl public decimal GetWaterTotal() { var value = deviceRecordService.WaterTotal(); + if (value > 0) + { + value = Math.Round(value, 2); + } return value; } } diff --git a/guidescreen/GuideScreen/GuideScreen.UI/FormScreen.cs b/guidescreen/GuideScreen/GuideScreen.UI/FormScreen.cs index 6b0cdff..783260c 100644 --- a/guidescreen/GuideScreen/GuideScreen.UI/FormScreen.cs +++ b/guidescreen/GuideScreen/GuideScreen.UI/FormScreen.cs @@ -67,9 +67,9 @@ namespace GuideScreen.UI plcController = DIManager.GetContainerObject(); plcController.PointChnage += PlcController_PointChnage; plcController.ErrorMessage += Controller_ErrorMessage; - passengerFlowStatisticsController = DIManager.GetContainerObject(); - passengerFlowStatisticsController.Action += PassengerFlowStatisticsController_Action; - passengerFlowStatisticsController.ErrorMessage += Controller_ErrorMessage; + //passengerFlowStatisticsController = DIManager.GetContainerObject(); + //passengerFlowStatisticsController.Action += PassengerFlowStatisticsController_Action; + //passengerFlowStatisticsController.ErrorMessage += Controller_ErrorMessage; Load += FormScreen_Load; } @@ -457,7 +457,7 @@ namespace GuideScreen.UI //λͼ ToileUseChartByDay(); - ToileUseChartTotal(); + //ToileUseChartTotal(); } @@ -646,6 +646,15 @@ namespace GuideScreen.UI default: break; } + + switch (e.Device) + { + case PLCDeviceNames.WashCount: + ToileUseChartTotal(); + break; + default: + break; + } } #endregion PLCȡλ @@ -784,7 +793,7 @@ namespace GuideScreen.UI } //նȹ - if (vacuumIndex > 1000) + if (vacuumIndex > 1000) { vacuumIndex = 0; chartVacuum.Option.Clear(); @@ -804,11 +813,11 @@ namespace GuideScreen.UI { var count = toilets.Values.Sum(); //ÿô1.6ˮ - var value = Math.Round(count * 0.0016, 2); + var value = Math.Round(count * 0.0016, 4); var dayStr = value.ToString().Aggregate(string.Empty, (c, i) => c + i + " "); lblDayWarter.Text = $"ˮ {dayStr} "; - plcController.AdddeviceRecord(new PLCPoint + plcController.AdddeviceRecord(new PLCPoint { Device = PLCDeviceNames.EnergyMonitoring, Name = PLCPointNameByEnergyMonitoring.WaterConsumption,