using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations.Schema; using System.Drawing; using System.Runtime.CompilerServices; using System.Runtime.Serialization; namespace GDNXFD.Data { [DataContract] [Table("FAULTSNAP")] public class FaultSnap : INotifyPropertyChanged { [DataMember] [Column("ID")] public long Id { 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; } [DataMember] [Column("TESTINGPOINTKEY")] public string TestingPointKey { get; set; } /// /// Property changed event /// 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 "未知"; } } } } }