增加公共操作的方法,过热度和过冷度的配置弹窗设置
This commit is contained in:
95
CapMachine.Wpf/Services/ComActionService.cs
Normal file
95
CapMachine.Wpf/Services/ComActionService.cs
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user