增加公共操作的方法,过热度和过冷度的配置弹窗设置

This commit is contained in:
2025-01-06 17:55:01 +08:00
parent ff07461818
commit 82ee066300
18 changed files with 673 additions and 43 deletions

View File

@@ -0,0 +1,95 @@
using CapMachine.Wpf.PrismEvent;
using Prism.Events;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CapMachine.Wpf.Services
{
/// <summary>
/// 公共操作的服务
/// 存放公共事件的服务
/// </summary>
public class ComActionService
{
public ConfigService ConfigService { get; }
private IEventAggregator EventAggregator { get; set; }
public DataRecordService DataRecordService { get; }
public SysRunService SysRunServer { get; }
public PPCService PPCService { get; }
public MachineRtDataService MachineRtDataService { get; }
public IDialogService DialogService { get; }
public ComActionService(ConfigService configService, IEventAggregator eventAggregator,
DataRecordService dataRecordService, SysRunService sysRunService,PPCService pPCService,
MachineRtDataService machineRtDataService, IDialogService dialogService)
{
ConfigService = configService;
//事件服务
EventAggregator = eventAggregator;
DataRecordService = dataRecordService;
SysRunServer = sysRunService;
PPCService = pPCService;
MachineRtDataService = machineRtDataService;
DialogService = dialogService;
EventAggregator.GetEvent<ComDialogEvent>().Subscribe(ComDialogEventCall);
}
#region
/// <summary>
/// 公共弹窗事件执行方法
/// </summary>
/// <param name="msg"></param>
/// <exception cref="NotImplementedException"></exception>
private void ComDialogEventCall(ComDialogMsg msg)
{
switch (msg.Name)
{
case "过热度/过冷度配置":
ShowSuperHeatCool(msg.Par);
break;
default:
break;
}
}
/// <summary>
/// 过热度和过冷度配置弹窗
/// </summary>
private void ShowSuperHeatCool(object par)
{
//弹窗
DialogService.ShowDialog("DialogSuperHeatCoolConfigView", new DialogParameters() { { "Name", par } }, (par) =>
{
if (par.Result == ButtonResult.OK)
{
//保存配置信息
PPCService.SaveSuperHeatCoolConfig();
}
else if (par.Result == ButtonResult.Cancel)
{
//取消
}
});
}
#endregion
}
}