using Bro.Common.Helper;
|
using Newtonsoft.Json;
|
using System;
|
using System.ComponentModel;
|
|
namespace Bro.Common.Model
|
{
|
|
/// <summary>
|
/// 警报配置
|
/// </summary>
|
public class WarningSet : IComplexDisplay
|
{
|
[Category("索引设置")]
|
[Description("警报索引——字索引")]
|
[DisplayName("警报字索引")]
|
public int WarningIndex_Word { get; set; }
|
|
[Category("索引设置")]
|
[Description("警报索引——位索引")]
|
[DisplayName("警报位索引")]
|
public int WarningIndex_Bit { get; set; }
|
|
[Category("触发设置")]
|
[Description("true:高电平触发报警 false:低电平触发报警")]
|
[DisplayName("警报值")]
|
public bool TriggerValue { get; set; } = true;
|
|
[Category("警报内容")]
|
[Description("警报代码")]
|
[DisplayName("警报代码")]
|
public string WarningCode { get; set; }
|
|
[Category("警报内容")]
|
[Description("警报描述")]
|
[DisplayName("警报描述")]
|
public string WarningDescription { get; set; }
|
|
[Category("级别设置")]
|
[Description("警报级别")]
|
[DisplayName("警报级别")]
|
public int WarningLvl { get; set; } = 0;
|
|
/// <summary>
|
/// 表示报警状态,是报警地址值和警报触发值比较后的结果
|
/// true 正在报警 false 取消报警
|
/// </summary>
|
[Browsable(false)]
|
[JsonIgnore]
|
public bool CurrentStatus { get; set; } = false;
|
|
[Browsable(false)]
|
[JsonIgnore]
|
public string Source { get; set; } = "";
|
|
[Browsable(false)]
|
[JsonIgnore]
|
public DateTime TriggerTime { get; set; } = DateTime.Now;
|
|
public string GetDisplayText()
|
{
|
return $"{WarningIndex_Word}:{WarningIndex_Bit}-{WarningCode}-{WarningDescription}";
|
}
|
}
|
}
|