123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.ComponentModel.DataAnnotations.Schema;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Text;
- using System.Threading.Tasks;
- using System.Runtime.Serialization;
- using System.ServiceModel;
- using System.Drawing;
- namespace GDNXFD.Data
- {
- [DataContract]
- [Table("VIEW_FAULTHISTORY")]
- public class FaultInfo : INotifyPropertyChanged
- {
- [DataMember]
- [Column("ID")]
- public long Id { get; set; }
- [DataMember]
- [Column("FAULTTIME")] //报警时间
- public DateTime AlertTime { get; set; }
- [DataMember]
- [Column("MESSAGETYPE")] //对象类型
- public int MessageType { get; set; }
- [DataMember]
- [Column("SNAPID")] //报警内容
- public long SnapID { get; set; }
- [DataMember]
- [Column("CONFIRMTYPE")]
- public int ConfirmType { get; set; }
- [DataMember]
- [Column("CONFIRMTIME")]
- public DateTime? ConfirmTime { get; set; }
- [DataMember]
- [Column("CONFIRMPERSON")]
- public string ConfirmPerson { get; set; }
- [DataMember]
- [Column("STATIONID")]
- public string StationId { get; set; }
- [DataMember]
- [Column("PROJECTID")]
- public string ProjectId { get; set; }
- [DataMember]
- [Column("LINEID")]
- public string LineId { get; set; }
- [DataMember]
- [Column("WINDTURBINEID")]
- public string WindturbineId { get; set; }
- [DataMember]
- [Column("ALERTVALUE")] //报警对应故障编码
- public long AlertValue { get; set; }
- [DataMember]
- [Column("RANK")] //报警级别
- public string Rank { get; set; }
- [DataMember]
- [Column("CATEGORY1")]
- public string Category1 { get; set; }
- [DataMember]
- [Column("CATEGORY2")]
- public string Category2 { get; set; }
- [DataMember]
- [Column("CATEGORY3")]
- public string Category3 { get; set; }
- [DataMember]
- [Column("ISOPENED")]
- public bool IsOpened { get; set; }
- [DataMember]
- [Column("LASTUPDATETIME")]
- public DateTime? LastUpdateTime { get; set; }
- [DataMember]
- [Column("LASTUPDATEPERSON")]
- public string LastUpdatePerson { get; set; }
- [DataMember]
- [Column("STATIONNAME")]
- public string StationName { get; set; }
- [DataMember]
- [Column("PROJECTNAME")]
- public string ProjectName { get; set; }
- [DataMember]
- [Column("LINENAME")]
- public string LineName { get; set; }
- [DataMember]
- [Column("WINDTURBINENAME")]
- public string WindturbineName { get; set; }
- [DataMember]
- [Column("ALERTTEXT")]
- public string AlertText { get; set; }
- [DataMember]
- [Column("MODELID")]
- public string ModelId { get; set; }
- /// <summary>
- /// Property changed event
- /// </summary>
- public event PropertyChangedEventHandler PropertyChanged;
- private void RaisePropertyChanged([CallerMemberName] string caller = "")
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(caller));
- }
- }
- public string ObjectName
- {
- get
- {
- if (Category1 == "FJ")
- return WindturbineName;
- else
- return StationName;
- }
- }
- public string ObjectId
- {
- get
- {
- if (Category1 == "FJ")
- return WindturbineId;
- else
- return StationId;
- }
- }
- public string CategoryName
- {
- get
- {
- switch (Category1)
- {
- case "FJ":
- return "风机";
- case "SYZ":
- return "升压站";
- default:
- return "未知";
- }
- }
- }
- public string MessageTypeString
- {
- get
- {
- string resultString = "";
- if (MessageType == 1)
- {
- resultString = "触发";
- }
- else if (MessageType == 2)
- {
- resultString = "";
- }
- else if (MessageType == 3)
- {
- resultString = "解除";
- }
- return resultString;
- }
- }
- }
- }
|