FaultInfo.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. using System.Linq;
  6. using System.Runtime.CompilerServices;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Runtime.Serialization;
  10. using System.ServiceModel;
  11. using System.Drawing;
  12. namespace GDNXFD.Data
  13. {
  14. [DataContract]
  15. [Table("VIEW_FAULTHISTORY")]
  16. public class FaultInfo : INotifyPropertyChanged
  17. {
  18. [DataMember]
  19. [Column("ID")]
  20. public long Id { get; set; }
  21. [DataMember]
  22. [Column("FAULTTIME")] //报警时间
  23. public DateTime AlertTime { get; set; }
  24. [DataMember]
  25. [Column("MESSAGETYPE")] //对象类型
  26. public int MessageType { get; set; }
  27. [DataMember]
  28. [Column("SNAPID")] //报警内容
  29. public long SnapID { get; set; }
  30. [DataMember]
  31. [Column("CONFIRMTYPE")]
  32. public int ConfirmType { get; set; }
  33. [DataMember]
  34. [Column("CONFIRMTIME")]
  35. public DateTime? ConfirmTime { get; set; }
  36. [DataMember]
  37. [Column("CONFIRMPERSON")]
  38. public string ConfirmPerson { get; set; }
  39. [DataMember]
  40. [Column("STATIONID")]
  41. public string StationId { get; set; }
  42. [DataMember]
  43. [Column("PROJECTID")]
  44. public string ProjectId { get; set; }
  45. [DataMember]
  46. [Column("LINEID")]
  47. public string LineId { get; set; }
  48. [DataMember]
  49. [Column("WINDTURBINEID")]
  50. public string WindturbineId { get; set; }
  51. [DataMember]
  52. [Column("ALERTVALUE")] //报警对应故障编码
  53. public long AlertValue { get; set; }
  54. [DataMember]
  55. [Column("RANK")] //报警级别
  56. public string Rank { get; set; }
  57. [DataMember]
  58. [Column("CATEGORY1")]
  59. public string Category1 { get; set; }
  60. [DataMember]
  61. [Column("CATEGORY2")]
  62. public string Category2 { get; set; }
  63. [DataMember]
  64. [Column("CATEGORY3")]
  65. public string Category3 { get; set; }
  66. [DataMember]
  67. [Column("ISOPENED")]
  68. public bool IsOpened { get; set; }
  69. [DataMember]
  70. [Column("LASTUPDATETIME")]
  71. public DateTime? LastUpdateTime { get; set; }
  72. [DataMember]
  73. [Column("LASTUPDATEPERSON")]
  74. public string LastUpdatePerson { get; set; }
  75. [DataMember]
  76. [Column("STATIONNAME")]
  77. public string StationName { get; set; }
  78. [DataMember]
  79. [Column("PROJECTNAME")]
  80. public string ProjectName { get; set; }
  81. [DataMember]
  82. [Column("LINENAME")]
  83. public string LineName { get; set; }
  84. [DataMember]
  85. [Column("WINDTURBINENAME")]
  86. public string WindturbineName { get; set; }
  87. [DataMember]
  88. [Column("ALERTTEXT")]
  89. public string AlertText { get; set; }
  90. [DataMember]
  91. [Column("MODELID")]
  92. public string ModelId { get; set; }
  93. /// <summary>
  94. /// Property changed event
  95. /// </summary>
  96. public event PropertyChangedEventHandler PropertyChanged;
  97. private void RaisePropertyChanged([CallerMemberName] string caller = "")
  98. {
  99. if (PropertyChanged != null)
  100. {
  101. PropertyChanged(this, new PropertyChangedEventArgs(caller));
  102. }
  103. }
  104. public string ObjectName
  105. {
  106. get
  107. {
  108. if (Category1 == "FJ")
  109. return WindturbineName;
  110. else
  111. return StationName;
  112. }
  113. }
  114. public string ObjectId
  115. {
  116. get
  117. {
  118. if (Category1 == "FJ")
  119. return WindturbineId;
  120. else
  121. return StationId;
  122. }
  123. }
  124. public string CategoryName
  125. {
  126. get
  127. {
  128. switch (Category1)
  129. {
  130. case "FJ":
  131. return "风机";
  132. case "SYZ":
  133. return "升压站";
  134. default:
  135. return "未知";
  136. }
  137. }
  138. }
  139. public string MessageTypeString
  140. {
  141. get
  142. {
  143. string resultString = "";
  144. if (MessageType == 1)
  145. {
  146. resultString = "触发";
  147. }
  148. else if (MessageType == 2)
  149. {
  150. resultString = "";
  151. }
  152. else if (MessageType == 3)
  153. {
  154. resultString = "解除";
  155. }
  156. return resultString;
  157. }
  158. }
  159. }
  160. }