78 lines
2.1 KiB
C#
78 lines
2.1 KiB
C#
using OrpaonEMS.App.Event;
|
|
using OrpaonEMS.Core.EventHandMsg;
|
|
using OrpaonEMS.Core.Model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace OrpaonEMS.App.Models
|
|
{
|
|
/// <summary>
|
|
/// 状态字的位报警内容
|
|
/// </summary>
|
|
public class CoolBitAlarmInfo
|
|
{
|
|
public CoolBitAlarmInfo()
|
|
{
|
|
CurTimeInfo=new AlarmTimeInfo();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 发布报警信息
|
|
/// </summary>
|
|
public event EventHandler<CoolAlarmCellEventHandMsg> PubCoolAlarmEventHandler;
|
|
|
|
private bool _State;
|
|
/// <summary>
|
|
/// 报警状态
|
|
/// </summary>
|
|
public bool State
|
|
{
|
|
get { return _State; }
|
|
set
|
|
{
|
|
if (_State != value && value == true)//报警发生
|
|
{
|
|
_State = value;
|
|
|
|
CurTimeInfo.StartTime = DateTime.Now;
|
|
|
|
//发布报警
|
|
PubCoolAlarmEventHandler(this, new CoolAlarmCellEventHandMsg() { State = true, Content = Content, Category = Category, CurTimeInfo = CurTimeInfo });
|
|
|
|
}
|
|
else if (_State != value && value == false)//报警消失
|
|
{
|
|
_State = value;
|
|
CurTimeInfo.EndTime = DateTime.Now;
|
|
//发布报警
|
|
PubCoolAlarmEventHandler(this, new CoolAlarmCellEventHandMsg() { State = false, Content = Content, Category = Category, CurTimeInfo = CurTimeInfo });
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 报警时间信息
|
|
/// </summary>
|
|
public AlarmTimeInfo CurTimeInfo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 类别
|
|
/// </summary>
|
|
public ushort Category { get; set; }
|
|
|
|
/// <summary>
|
|
/// Bit位置
|
|
/// </summary>
|
|
public ushort BitIndex { get; set; }
|
|
|
|
/// <summary>
|
|
/// 报警内容
|
|
/// </summary>
|
|
public string Content { get; set; }
|
|
}
|
|
}
|