FautSnap.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using System;
  2. using System.ComponentModel;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. using System.Drawing;
  5. using System.Runtime.CompilerServices;
  6. using System.Runtime.Serialization;
  7. namespace GDNXFD.Data
  8. {
  9. [DataContract]
  10. [Table("FAULTSNAP")]
  11. public class FaultSnap : INotifyPropertyChanged
  12. {
  13. [DataMember]
  14. [Column("ID")]
  15. public long Id { get; set; }
  16. [DataMember]
  17. [Column("STATIONID")]
  18. public string StationId { get; set; }
  19. [DataMember]
  20. [Column("PROJECTID")]
  21. public string ProjectId { get; set; }
  22. [DataMember]
  23. [Column("LINEID")]
  24. public string LineId { get; set; }
  25. [DataMember]
  26. [Column("WINDTURBINEID")]
  27. public string WindturbineId { get; set; }
  28. [DataMember]
  29. [Column("ALERTVALUE")] //报警对应故障编码
  30. public long AlertValue { get; set; }
  31. [DataMember]
  32. [Column("RANK")] //报警级别
  33. public string Rank { get; set; }
  34. [DataMember]
  35. [Column("CATEGORY1")]
  36. public string Category1 { get; set; }
  37. [DataMember]
  38. [Column("CATEGORY2")]
  39. public string Category2 { get; set; }
  40. [DataMember]
  41. [Column("CATEGORY3")]
  42. public string Category3 { get; set; }
  43. [DataMember]
  44. [Column("ISOPENED")]
  45. public bool IsOpened { get; set; }
  46. [DataMember]
  47. [Column("LASTUPDATETIME")]
  48. public DateTime? LastUpdateTime { get; set; }
  49. [DataMember]
  50. [Column("LASTUPDATEPERSON")]
  51. public string LastUpdatePerson { get; set; }
  52. [DataMember]
  53. [Column("STATIONNAME")]
  54. public string StationName { get; set; }
  55. [DataMember]
  56. [Column("PROJECTNAME")]
  57. public string ProjectName { get; set; }
  58. [DataMember]
  59. [Column("LINENAME")]
  60. public string LineName { get; set; }
  61. [DataMember]
  62. [Column("WINDTURBINENAME")]
  63. public string WindturbineName { get; set; }
  64. [DataMember]
  65. [Column("ALERTTEXT")]
  66. public string AlertText { get; set; }
  67. [DataMember]
  68. [Column("MODELID")]
  69. public string ModelId { get; set; }
  70. [DataMember]
  71. [Column("TESTINGPOINTKEY")]
  72. public string TestingPointKey { get; set; }
  73. /// <summary>
  74. /// Property changed event
  75. /// </summary>
  76. public event PropertyChangedEventHandler PropertyChanged;
  77. private void RaisePropertyChanged([CallerMemberName] string caller = "")
  78. {
  79. if (PropertyChanged != null)
  80. {
  81. PropertyChanged(this, new PropertyChangedEventArgs(caller));
  82. }
  83. }
  84. public string ObjectName
  85. {
  86. get
  87. {
  88. if (Category1 == "FJ")
  89. return WindturbineName;
  90. else
  91. return StationName;
  92. }
  93. }
  94. public string ObjectId
  95. {
  96. get
  97. {
  98. if (Category1 == "FJ")
  99. return WindturbineId;
  100. else
  101. return StationId;
  102. }
  103. }
  104. public string CategoryName
  105. {
  106. get
  107. {
  108. switch (Category1)
  109. {
  110. case "FJ":
  111. return "风机";
  112. case "SYZ":
  113. return "升压站";
  114. default:
  115. return "未知";
  116. }
  117. }
  118. }
  119. }
  120. }