77 lines
2.0 KiB
C#
77 lines
2.0 KiB
C#
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>
|
|
/// PCS故障单元
|
|
/// </summary>
|
|
public class PcsAlarmCell
|
|
{
|
|
public PcsAlarmCell()
|
|
{
|
|
CurTimeInfo = new AlarmTimeInfo();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 发布报警信息
|
|
/// </summary>
|
|
public event EventHandler<PcsAlarmCellEventHandMsg> PubPcsAlarmEventHandler;
|
|
|
|
/// <summary>
|
|
/// 报警内容
|
|
/// </summary>
|
|
public string Content { get; set; }
|
|
|
|
/// <summary>
|
|
/// Bit位置
|
|
/// </summary>
|
|
public ushort BitIndex { get; set; }
|
|
|
|
private bool _State;
|
|
/// <summary>
|
|
/// 报警状态
|
|
/// </summary>
|
|
public bool State
|
|
{
|
|
get { return _State; }
|
|
set
|
|
{
|
|
if (_State != value && value == true)//报警发生
|
|
{
|
|
_State = value;
|
|
|
|
CurTimeInfo.StartTime = DateTime.Now;
|
|
|
|
//发布报警
|
|
PubPcsAlarmEventHandler(this, new PcsAlarmCellEventHandMsg() { State = true, Content = Content, Level = 3, CurTimeInfo = CurTimeInfo });
|
|
|
|
}
|
|
else if (_State != value && value == false)//报警消失
|
|
{
|
|
_State = value;
|
|
CurTimeInfo.EndTime = DateTime.Now;
|
|
//发布报警
|
|
PubPcsAlarmEventHandler(this, new PcsAlarmCellEventHandMsg() { State = false, Content = Content, Level = 3, CurTimeInfo = CurTimeInfo });
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 报警时间信息
|
|
/// </summary>
|
|
public AlarmTimeInfo CurTimeInfo { get; set; }
|
|
|
|
///// <summary>
|
|
///// 报警状态
|
|
///// </summary>
|
|
//public bool State { get; set; }
|
|
}
|
|
}
|