更新了Tag的字段属性和Can配置的修复

This commit is contained in:
2025-01-06 10:06:36 +08:00
parent 3a5674054d
commit e5ebd9113a
11 changed files with 166 additions and 54 deletions

View File

@@ -0,0 +1,64 @@
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;
}
}
}
}