From fb03d1ae3042fe7ee8859941c2f2ca5495d50261 Mon Sep 17 00:00:00 2001 From: Tyrone CT Date: Fri, 27 Jun 2025 11:43:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BA=86=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E5=92=8C=E7=B2=BE=E5=BA=A6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CapMachine.Wpf/Services/AlarmService.cs | 4 ++-- CapMachine.Wpf/Services/MachineRtDataService.cs | 16 +++++++++------- CapMachine.Wpf/ViewModels/MonitorViewModel.cs | 6 ++++-- CapMachine.Wpf/Views/MonitorView.xaml | 6 +++--- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/CapMachine.Wpf/Services/AlarmService.cs b/CapMachine.Wpf/Services/AlarmService.cs index 49b505d..315316e 100644 --- a/CapMachine.Wpf/Services/AlarmService.cs +++ b/CapMachine.Wpf/Services/AlarmService.cs @@ -43,12 +43,12 @@ namespace CapMachine.Wpf.Services }}, new AlarmRunCell(FreeSql){Index=1,CurAlarmConfig=new AlarmConfig() { - Name="地压报警", + Name="低压报警", ActiveType=ActiveType.Bool, Address="V0.2", AlarmLevel=AlarmLevel.Level1, Category="一般报警", - Message="地压报警", + Message="低压报警", ThresholdDown=1, ThresholdUp=1, BoolActiveValue=true diff --git a/CapMachine.Wpf/Services/MachineRtDataService.cs b/CapMachine.Wpf/Services/MachineRtDataService.cs index 5fb422b..bb5ab60 100644 --- a/CapMachine.Wpf/Services/MachineRtDataService.cs +++ b/CapMachine.Wpf/Services/MachineRtDataService.cs @@ -616,8 +616,8 @@ namespace CapMachine.Wpf.Services MinValue = -50, MaxValue = 150, IsMeter = true, - DecimalPoint = 1, - Precision = 10, + DecimalPoint = 2, + Precision = 100, Unit = "℃", DataType = TagDataType.Short, PVModel = new MeterValueAttrCell() { Address = "VW126", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 26 }, @@ -647,7 +647,7 @@ namespace CapMachine.Wpf.Services MaxValue = 100, IsMeter = true, DecimalPoint = 1, - Precision = 10, + Precision = 100, Unit = "%", DataType = TagDataType.Short, PVModel = new MeterValueAttrCell() { Address = "VW128", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 28 }, @@ -2270,7 +2270,7 @@ namespace CapMachine.Wpf.Services new HandSwitchData(){Name="EV4",ActionAddress="M3.2",StateAddress="Q2.1" ,StateAddressType=HandSwitchStateType.Bool }, new HandSwitchData(){Name="试验箱",ActionAddress="M3.3",StateAddress="VW32" ,StateAddressType=HandSwitchStateType.Word },//VW32=1 new HandSwitchData(){Name="吸排气球阀",ActionAddress="M3.4",StateAddress="Q2.3" ,StateAddressType=HandSwitchStateType.Bool }, - new HandSwitchData(){Name="使能",ActionAddress="M3.5",StateAddress="V9.1" ,StateAddressType=HandSwitchStateType.Bool }, + //new HandSwitchData(){Name="使能",ActionAddress="M3.5",StateAddress="V9.1" ,StateAddressType=HandSwitchStateType.Bool }, }; ListPlcExdConfigCell = new List() @@ -2362,7 +2362,8 @@ namespace CapMachine.Wpf.Services //return true; //取消XXX - var Result = SiemensDrive.Write("M0.4", true); + var Result = SiemensDrive.Write("M0.4", true); + var Result1 = SiemensDrive.Write("V99.0", true); if (Result.IsSuccess) { return true; @@ -2384,6 +2385,7 @@ namespace CapMachine.Wpf.Services //取消XXX var Result = SiemensDrive.Write("M0.7", true); + var Result1 = SiemensDrive.Write("V99.0", false); if (Result.IsSuccess) { return true; @@ -2629,13 +2631,13 @@ namespace CapMachine.Wpf.Services //取得压缩机的CANLIN数据到数据集合中 pVModel!.EngValue = CanDriveService.GetDbcValueByName(itemCanLinGroup.Value.NameNoUnit); //写入到PLC中 - SiemensDrive.Write(pVModel!.Address!.Replace("W", ""), (short)(CanDriveService.GetDbcValueByName(itemCanLinGroup.Value.NameNoUnit))); + SiemensDrive.Write(pVModel!.Address!.Replace("W", ""), (short)(CanDriveService.GetDbcValueByName(itemCanLinGroup.Value.NameNoUnit) * itemCanLinGroup.Value.Precision)); break; case CanLinEnum.Lin: //取得压缩机的CANLIN数据 pVModel!.EngValue = LinDriveService.GetLdfValueByName(itemCanLinGroup.Value.NameNoUnit); //写入到PLC中 - SiemensDrive.Write(pVModel!.Address!.Replace("W", ""), (short)(LinDriveService.GetLdfValueByName(itemCanLinGroup.Value.NameNoUnit))); + SiemensDrive.Write(pVModel!.Address!.Replace("W", ""), (short)(LinDriveService.GetLdfValueByName(itemCanLinGroup.Value.NameNoUnit) * itemCanLinGroup.Value.Precision)); break; case CanLinEnum.No: break; diff --git a/CapMachine.Wpf/ViewModels/MonitorViewModel.cs b/CapMachine.Wpf/ViewModels/MonitorViewModel.cs index 744fd10..421e6da 100644 --- a/CapMachine.Wpf/ViewModels/MonitorViewModel.cs +++ b/CapMachine.Wpf/ViewModels/MonitorViewModel.cs @@ -62,7 +62,7 @@ namespace CapMachine.Wpf.ViewModels InhPressTag = TagManager.DicTags.GetValueOrDefault("吸气压力[BarA]"); InhTempTag = TagManager.DicTags.GetValueOrDefault("吸气温度[℃]"); - Cond1TempT4Tag = TagManager.DicTags.GetValueOrDefault("COND1入口温度T4[℃]"); + Cond1TempTag = TagManager.DicTags.GetValueOrDefault("COND1温度[℃]"); VRVTag = TagManager.DicTags.GetValueOrDefault("冷媒流量[kg/h]"); LubeFlowTag = TagManager.DicTags.GetValueOrDefault("润滑油流量[kg/h]"); Cond2TempTag = TagManager.DicTags.GetValueOrDefault("COND2温度[℃]"); @@ -231,7 +231,7 @@ namespace CapMachine.Wpf.ViewModels /// /// 冷凝器出口水温 /// - public ITag Cond1TempT4Tag { get; set; } + public ITag Cond1TempTag { get; set; } /// /// 冷媒流量 @@ -341,11 +341,13 @@ namespace CapMachine.Wpf.ViewModels case CanLinEnum.Can: //获取PLC的SV数据 更新SV的速度值到压缩机 CanDriveService.UpdateSpeedCmdData(0); + CanDriveService.UpdateCapEnableCmdData(false); //itemTag.Value.EngPvValue = 0; break; case CanLinEnum.Lin: //获取PLC的SV数据 更新SV的速度值到压缩机 LinDriveService.UpdateSpeedCmdData(0); + LinDriveService.UpdateCapEnableCmdData(false); //itemTag.Value.EngPvValue = 0; break; default: diff --git a/CapMachine.Wpf/Views/MonitorView.xaml b/CapMachine.Wpf/Views/MonitorView.xaml index e997c9a..0107111 100644 --- a/CapMachine.Wpf/Views/MonitorView.xaml +++ b/CapMachine.Wpf/Views/MonitorView.xaml @@ -1292,9 +1292,9 @@ Canvas.Top="147" HorizontalAlignment="Center" VerticalAlignment="Top" - CellTitle="COND1入口温度T4" - CellUnit="{Binding Cond1TempT4Tag.Unit}" - CellValue="{Binding Cond1TempT4Tag.PVModel.EngValueStr}" /> + CellTitle="COND1温度" + CellUnit="{Binding Cond1TempTag.Unit}" + CellValue="{Binding Cond1TempTag.PVModel.EngValueStr}" />