using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.Application
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class MonitorAlarmPageRecordMobileDto1_1
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public MonitorAlarmPageRecordMobileDto1_1() { }
|
|
/// <summary>
|
///
|
/// </summary>
|
public MonitorAlarmPageRecordMobileDto1_1
|
(Model.MonitorPoint monitor, Model.Signal_SignalType signal,List<Model.AlarmLevel> alarmLevelList, Model.MonitorAlarmRecord rhs)
|
{
|
this.ID = rhs.ID;
|
this.MonitorPointName = monitor.Name;
|
this.SignalName = signal?.Name;
|
this.AlarmType = rhs.AlarmType;
|
this.AlarmLevelName = alarmLevelList?.Find(x => x.Grade == rhs.AlarmLevel)?.Name;
|
var enUnitName = signal?.GetEnUnitName();
|
switch(rhs.AlarmType)
|
{
|
case Alarm.Type_Upper:this.ThresholdValue = rhs.ThresholdValue+" "+enUnitName; break;
|
case Alarm.Type_Lower:this.ThresholdValue=rhs.ThresholdValue+" "+enUnitName; break;
|
case Alarm.Type_Mutation:this.ThresholdValue=rhs.ThresholdValue + " s"; break;
|
case Alarm.Type_Interrupted:this.ThresholdValue=rhs.ThresholdValue+" s"; break;
|
case Alarm.Type_Lacked:this.ThresholdValue= rhs.ThresholdValue+" s"; break;
|
case Alarm.Type_UnChanged:this.ThresholdValue=rhs.ThresholdValue+" s"; break;
|
case Alarm.Type_UnReasonable:
|
{
|
var reasonble = Model.MonitorAlarmConfigure.ReasonableSpace.ToModel(rhs.ThresholdValue);
|
this.ThresholdValue = $"[{reasonble.MinValue},{reasonble.MaxValue}] {enUnitName}";
|
}
|
break;
|
default:break;
|
}
|
this.AlarmTime = rhs.AlarmTime;
|
this.AlarmContent = rhs.AlarmContent;
|
this.DataTime = rhs.DataTime;
|
this.DataValue = rhs.DataValue;
|
switch (rhs.HandleStatus)
|
{
|
case Model.Alarm.eHandleStatus.UnHandle:this.HandleStatus = "未处理";break;
|
case Model.Alarm.eHandleStatus.Handle:this.HandleStatus = "已处理";break;
|
case Model.Alarm.eHandleStatus.Shelve:this.HandleStatus = "搁置";break;
|
case Model.Alarm.eHandleStatus.Shield:this.HandleStatus = "屏蔽";break;
|
default:break;
|
}
|
|
if (signal.TryConvert(rhs.DataValue, out double dataValue))
|
{
|
this.DataValue = dataValue.ToString() + " " + enUnitName;
|
}
|
else
|
{
|
this.DataValue = rhs.DataValue + " " + enUnitName;
|
}
|
}
|
|
/// <summary>
|
/// 标识
|
/// </summary>
|
public long ID { get; set; }
|
|
/// <summary>
|
/// 测点名称
|
/// </summary>
|
public string MonitorPointName { get; set; }
|
|
/// <summary>
|
/// 信号名称
|
/// </summary>
|
public string SignalName { get; set; }
|
|
/// <summary>
|
/// 报警类型
|
/// </summary>
|
public string AlarmType { get; set; }
|
|
/// <summary>
|
/// 报警等级名称
|
/// </summary>
|
public string AlarmLevelName { get; set; }
|
|
/// <summary>
|
/// 阀值
|
/// </summary>
|
public string ThresholdValue { get; set; }
|
|
/// <summary>
|
/// 报警时间
|
/// </summary>
|
public DateTime AlarmTime { get; set; }
|
|
/// <summary>
|
/// 报警内容
|
/// </summary>
|
public string AlarmContent { get; set; }
|
|
/// <summary>
|
/// 数据时间
|
/// </summary>
|
public DateTime? DataTime { get; set; }
|
|
/// <summary>
|
/// 数据值
|
/// </summary>
|
public string DataValue { get; set; }
|
|
/// <summary>
|
/// 处理状态
|
/// </summary>
|
public string HandleStatus { get; set; }
|
}
|
}
|