65 lines
1.7 KiB
C#
65 lines
1.7 KiB
C#
using HslCommunication;
|
|
using Prism.Mvvm;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO.Ports;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CapMachine.Wpf.Models
|
|
{
|
|
/// <summary>
|
|
/// 手自动切换的条件
|
|
/// </summary>
|
|
public class AutoHandSwtichCondition : BindableBase
|
|
{
|
|
private bool _IsCanSwitch;
|
|
/// <summary>
|
|
/// 是否可切换
|
|
/// </summary>
|
|
public bool IsCanSwitch
|
|
{
|
|
get { return _IsCanSwitch; }
|
|
set { _IsCanSwitch = value; RaisePropertyChanged(); }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 全部报警地址
|
|
/// </summary>
|
|
public string? AlarmAddress { get; set; } = "V3.0";
|
|
|
|
/// <summary>
|
|
/// 报警结果
|
|
/// </summary>
|
|
public OperateResult<bool>? AlarmStateResult { get; set; }
|
|
|
|
/// <summary>
|
|
/// 手动状态地址
|
|
/// </summary>
|
|
public string? HandStateAddress { get; set; } = "M0.0";
|
|
|
|
/// <summary>
|
|
/// 手动状态结果
|
|
/// </summary>
|
|
public OperateResult<bool>? HandStateResult { get; set; }
|
|
|
|
/// <summary>
|
|
/// 汇总结果
|
|
/// </summary>
|
|
/// <param name="AlarmState"></param>
|
|
/// <param name="HandState"></param>
|
|
/// <returns></returns>
|
|
public void SumResult()
|
|
{
|
|
if (AlarmStateResult!.IsSuccess && HandStateResult!.IsSuccess)
|
|
{
|
|
//IsCanSwitch = AlarmStateResult.Content==false && HandStateResult.Content==false;
|
|
IsCanSwitch = HandStateResult.Content==false;
|
|
//return IsCanSwitch;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|