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