From b9d35c6c6f5fbfa15f4fc50e102773c386d465d5 Mon Sep 17 00:00:00 2001 From: Tyrone CT Date: Fri, 19 Sep 2025 22:08:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=A7=84=E5=88=99=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=BC=B9=E7=AA=97=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CapMachine.Wpf/App.xaml.cs | 2 + CapMachine.Wpf/Services/ComActionService.cs | 43 +++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/CapMachine.Wpf/App.xaml.cs b/CapMachine.Wpf/App.xaml.cs index 22dc887..2e7a470 100644 --- a/CapMachine.Wpf/App.xaml.cs +++ b/CapMachine.Wpf/App.xaml.cs @@ -101,6 +101,8 @@ namespace CapMachine.Wpf containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); + containerRegistry.RegisterSingleton(); + ////注册设备服务 //containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); diff --git a/CapMachine.Wpf/Services/ComActionService.cs b/CapMachine.Wpf/Services/ComActionService.cs index 21fb180..0639ed2 100644 --- a/CapMachine.Wpf/Services/ComActionService.cs +++ b/CapMachine.Wpf/Services/ComActionService.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows; namespace CapMachine.Wpf.Services { @@ -61,6 +62,14 @@ namespace CapMachine.Wpf.Services case "过热度/过冷度配置": ShowSuperHeatCool(msg.Par); break; + case "规则转换": + if (SysRunServer.MachineRunState1.IsRunState) + { + MessageBox.Show("请不要在运行时编辑规则转换,此时更改可能导致运行出错,请停止后再编辑"); + return; + } + ShowLogicRule(msg.Par); + break; default: break; } @@ -94,6 +103,40 @@ namespace CapMachine.Wpf.Services + /// + /// 过热度和过冷度配置弹窗 + /// + private void ShowLogicRule(object par) + { + //弹窗 + DialogService.ShowDialog("DialogLogicRuleView", new DialogParameters() { { "Name", par } }, (par) => + { + if (par.Result == ButtonResult.OK) + { + //保存配置信息 + //PPCService.SaveSuperHeatCoolConfig(); + + //是否改变规格 + var ReturnValue = par.Parameters.GetValue("IsRuleEdit"); + if (ReturnValue) + { + MessageBox.Show("检测到你已经改变了规则,CAN或者LIN配置中如果已经加载规则或者连接的话,则会出现错误,那么你需要重启软件"); + //逻辑可能更改了 + EventAggregator.GetEvent().Publish(""); + } + + + } + else if (par.Result == ButtonResult.Cancel) + { + //取消 + + } + + }); + } + + #endregion