整理了错误的捕捉

关闭窗口验证
This commit is contained in:
2025-07-10 18:00:31 +08:00
parent fdd321e635
commit 4e8c66aa38
17 changed files with 368 additions and 95 deletions

View File

@@ -33,6 +33,10 @@ namespace CapMachine.Wpf.Models
SelectedCanLinMsg = "CAN";
CanLinRunState=true;
break;
case CanLinEnum.CANFD:
SelectedCanLinMsg = "CANFD";
CanLinRunState = true;
break;
case CanLinEnum.Lin:
SelectedCanLinMsg = "LIN";
CanLinRunState = true;

View File

@@ -0,0 +1,69 @@
using Microsoft.VisualBasic;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CapMachine.Wpf.Models
{
/// <summary>
/// 系统错误状态
/// </summary>
public class SysErrState : BindableBase
{
private string? _ErrTime= "无错误";
/// <summary>
/// 错误时间
/// </summary>
public string? ErrTime
{
get { return _ErrTime; }
set { _ErrTime = value; RaisePropertyChanged(); }
}
private string? _ErrMsg;
/// <summary>
/// 错误消息
/// </summary>
public string? ErrMsg
{
get { return _ErrMsg; }
set { _ErrMsg = value; RaisePropertyChanged(); }
}
private bool _ErrState=false;
/// <summary>
/// 错误状态
/// </summary>
public bool ErrState
{
get { return _ErrState; }
set { _ErrState = value; RaisePropertyChanged(); }
}
/// <summary>
/// 激活错误状态
/// </summary>
public void ActiveErr(string Msg)
{
ErrState=true;
ErrTime =DateTime.Now.ToString("MM-dd HH:mm:ss");
ErrMsg = "见日志";
}
/// <summary>
/// 清空错误状态
/// </summary>
public void ClearErr()
{
ErrState = false;
ErrTime = "无错误";
ErrMsg = "";
}
}
}