AlertRule.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. namespace GDNXFD.Data
  10. {
  11. /// <summary>
  12. /// 自定义报警规则
  13. /// </summary>
  14. [Table("ALERTRULE2")]
  15. public class AlertRule : INotifyPropertyChanged
  16. {
  17. private string _id; //编码
  18. private string _name; //名称
  19. private string _expression; //表达式
  20. private string _description; //描述
  21. private string _tag; //标签
  22. private string _rank; //级别
  23. private bool _enabled; //是否启用
  24. private string _modelId; //设备类型
  25. private long _ednaValue; //报警值
  26. private string _category; //报警类别
  27. private string _range; //范围
  28. private string _station; //场站
  29. private string _windturbine; //风机
  30. private string _line; //线路
  31. private string _project; //工程
  32. private string _electrical; //电气
  33. [Column("ID")]
  34. public string Id
  35. {
  36. get { return _id; }
  37. set
  38. {
  39. _id = value;
  40. RaisePropertyChanged();
  41. }
  42. }
  43. [Column("MODELID")]
  44. public string ModelId
  45. {
  46. get { return _modelId; }
  47. set
  48. {
  49. _modelId = value;
  50. RaisePropertyChanged();
  51. }
  52. }
  53. [Column("NAME")]
  54. public string Name
  55. {
  56. get { return _name; }
  57. set
  58. {
  59. _name = value;
  60. RaisePropertyChanged();
  61. }
  62. }
  63. [Column("DESCRIPTION")]
  64. public string Description
  65. {
  66. get { return _description; }
  67. set
  68. {
  69. _description = value;
  70. RaisePropertyChanged();
  71. }
  72. }
  73. [Column("EXPRESSION")]
  74. public string Expression
  75. {
  76. get { return _expression; }
  77. set
  78. {
  79. _expression = value;
  80. RaisePropertyChanged();
  81. }
  82. }
  83. [Column("TAG")]
  84. public string Tag
  85. {
  86. get { return _tag; }
  87. set
  88. {
  89. _tag = value;
  90. RaisePropertyChanged();
  91. }
  92. }
  93. [Column("RANK")]
  94. public string Rank
  95. {
  96. get { return _rank; }
  97. set { _rank = value; RaisePropertyChanged(); }
  98. }
  99. [Column("ENABLED")]
  100. public bool Enabled
  101. {
  102. get { return _enabled; }
  103. set
  104. {
  105. _enabled = value;
  106. RaisePropertyChanged();
  107. }
  108. }
  109. [Column("EDNAVALUE")]
  110. public long EdnaValue
  111. {
  112. get { return _ednaValue; }
  113. set
  114. {
  115. _ednaValue = value;
  116. RaisePropertyChanged();
  117. }
  118. }
  119. [Column("CATEGORY")]
  120. public string Category
  121. {
  122. get { return _category; }
  123. set { _category = value; RaisePropertyChanged(); }
  124. }
  125. [Column("RANGE")]
  126. public string Range
  127. {
  128. get { return _range; }
  129. set
  130. {
  131. _range = value;
  132. RaisePropertyChanged();
  133. }
  134. }
  135. [Column("STATION")]
  136. public string Station
  137. {
  138. get { return _station; }
  139. set
  140. {
  141. _station = value;
  142. RaisePropertyChanged();
  143. }
  144. }
  145. [Column("WINDTURBINE")]
  146. public string Windturbine
  147. {
  148. get { return _windturbine; }
  149. set
  150. {
  151. _windturbine = value;
  152. RaisePropertyChanged();
  153. }
  154. }
  155. [Column("PROJECT")]
  156. public string Project
  157. {
  158. get { return _project; }
  159. set
  160. {
  161. _project = value;
  162. RaisePropertyChanged();
  163. }
  164. }
  165. [Column("LINE")]
  166. public string Line
  167. {
  168. get { return _line; }
  169. set
  170. {
  171. _line = value;
  172. RaisePropertyChanged();
  173. }
  174. }
  175. [Column("ELECTRICAL")]
  176. public string Electrical
  177. {
  178. get { return _electrical; }
  179. set
  180. {
  181. _electrical = value;
  182. RaisePropertyChanged();
  183. }
  184. }
  185. /// <summary>
  186. /// Property changed event
  187. /// </summary>
  188. public event PropertyChangedEventHandler PropertyChanged;
  189. private void RaisePropertyChanged([CallerMemberName] string caller = "")
  190. {
  191. if (PropertyChanged != null)
  192. {
  193. PropertyChanged(this, new PropertyChangedEventArgs(caller));
  194. }
  195. }
  196. }
  197. }