整理了错误的捕捉
关闭窗口验证
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using CapMachine.Wpf.Models;
|
||||
using CapMachine.Wpf.PrismEvent;
|
||||
using Prism.Events;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
@@ -10,11 +11,11 @@ using System.Threading.Tasks;
|
||||
namespace CapMachine.Wpf.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统
|
||||
/// 系统运行服务
|
||||
/// </summary>
|
||||
public class SysRunService : BindableBase
|
||||
{
|
||||
public SysRunService(IEventAggregator eventAggregator,ConfigService configService,CanDriveService canDriveService,LinDriveService linDriveService)
|
||||
public SysRunService(IEventAggregator eventAggregator, ConfigService configService, CanDriveService canDriveService, LinDriveService linDriveService)
|
||||
{
|
||||
// 创建一个定时器,设置间隔时间为2000毫秒(即2秒)
|
||||
CurTimer = new System.Timers.Timer(5000);
|
||||
@@ -28,10 +29,27 @@ namespace CapMachine.Wpf.Services
|
||||
ConfigService = configService;
|
||||
CanDriveService = canDriveService;
|
||||
LinDriveService = linDriveService;
|
||||
MachineRunState1 = new MachineRunState("M1", EventAggregator, ConfigService,canDriveService,linDriveService);
|
||||
MachineRunState1 = new MachineRunState("M1", EventAggregator, ConfigService, canDriveService, linDriveService);
|
||||
|
||||
EventAggregator.GetEvent<ErrStateEvent>().Subscribe(ErrStateAction);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 错误状态处理方法
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void ErrStateAction(ErrStateMsg errStateMsg)
|
||||
{
|
||||
SysErrStateInfo.ActiveErr(errStateMsg.ErrMsg!);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 系统错误状态
|
||||
/// </summary>
|
||||
public SysErrState SysErrStateInfo { get; set; } = new SysErrState();
|
||||
|
||||
/// <summary>
|
||||
/// 设备运行状态
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user