73 lines
2.1 KiB
C#
73 lines
2.1 KiB
C#
using Prism.Mvvm;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using static CapMachine.Wpf.Models.ComEnum;
|
|
|
|
namespace CapMachine.Wpf.Models
|
|
{
|
|
/// <summary>
|
|
/// CAN 和 LIN运行的状态汇总模型
|
|
/// </summary>
|
|
public class CanLinRunStateModel:BindableBase
|
|
{
|
|
private CanLinEnum _CurSysSelectedCanLin;
|
|
/// <summary>
|
|
/// 当前系统选中使用的CanLin状态
|
|
/// </summary>
|
|
public CanLinEnum CurSysSelectedCanLin
|
|
{
|
|
get { return _CurSysSelectedCanLin; }
|
|
set
|
|
{
|
|
_CurSysSelectedCanLin = value;
|
|
switch (value)
|
|
{
|
|
case CanLinEnum.No:
|
|
SelectedCanLinMsg = "无";
|
|
CanLinRunState = false;
|
|
break;
|
|
case CanLinEnum.Can:
|
|
SelectedCanLinMsg = "CAN";
|
|
CanLinRunState=true;
|
|
break;
|
|
case CanLinEnum.CANFD:
|
|
SelectedCanLinMsg = "CANFD";
|
|
CanLinRunState = true;
|
|
break;
|
|
case CanLinEnum.Lin:
|
|
SelectedCanLinMsg = "LIN";
|
|
CanLinRunState = true;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
private bool _CanLinRunState;
|
|
/// <summary>
|
|
/// CAN 和 LIN的运行状态
|
|
/// </summary>
|
|
public bool CanLinRunState
|
|
{
|
|
get { return _CanLinRunState; }
|
|
set { _CanLinRunState = value;RaisePropertyChanged(); }
|
|
}
|
|
|
|
|
|
private string? _SelectedCanLinMsg;
|
|
/// <summary>
|
|
/// CANLIN 选择的字符串
|
|
/// </summary>
|
|
public string? SelectedCanLinMsg
|
|
{
|
|
get { return _SelectedCanLinMsg; }
|
|
set { _SelectedCanLinMsg = value; RaisePropertyChanged(); }
|
|
}
|
|
|
|
}
|
|
}
|