逻辑规则无法弹窗修复问题

This commit is contained in:
2025-09-19 22:08:28 +08:00
parent 59ea3aa8f0
commit b9d35c6c6f
2 changed files with 45 additions and 0 deletions

View File

@@ -101,6 +101,8 @@ namespace CapMachine.Wpf
containerRegistry.RegisterSingleton<ConfigService>();
containerRegistry.RegisterSingleton<AlarmService>();
containerRegistry.RegisterSingleton<LogicRuleService>();
////注册设备服务
//containerRegistry.RegisterSingleton<MachineDataService>();
containerRegistry.RegisterSingleton<CanDriveService>();

View File

@@ -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
/// <summary>
/// 过热度和过冷度配置弹窗
/// </summary>
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<bool>("IsRuleEdit");
if (ReturnValue)
{
MessageBox.Show("检测到你已经改变了规则CAN或者LIN配置中如果已经加载规则或者连接的话则会出现错误那么你需要重启软件");
//逻辑可能更改了
EventAggregator.GetEvent<LogicRuleChangeEvent>().Publish("");
}
}
else if (par.Result == ButtonResult.Cancel)
{
//取消
}
});
}
#endregion