AlarmSnap.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace NEIntelligentControl2.Models.WinForms
  7. {
  8. public class AlarmSnap
  9. {
  10. // "id": 697232623436562436,
  11. // "stationId": "MHS_FDC",
  12. // "lineId": "MHS04_XL",
  13. // "windturbineId": "MG01_43",
  14. // "alertValue": 6116,
  15. // "category1": "custom",
  16. // "category2": "1",
  17. // "category3": "CDL",
  18. // "rank": "4",
  19. // "isOpened": 0,
  20. // "lastUpdateTime": "2020-09-14 11:06:55",
  21. // "stationName": "麻黄山风电场",
  22. // "windturbineName": "麻黄山43号风机",
  23. // "alertText": "主轴温升速度大于1.5",
  24. // "modelId": "UP105-2000-S"
  25. public long id { get; set; }
  26. public DateTime lastUpdateTime { get; set; }
  27. public string stationId { get; set; }
  28. public string lineId { get; set; }
  29. public string windturbineId { get; set; }
  30. public int alertValue { get; set; }
  31. public string category1 { get; set; }
  32. public string category2 { get; set; }
  33. public string rank { get; set; }
  34. public int isOpened { get; set; }
  35. public string stationName { get; set; }
  36. public string windturbineName { get; set; }
  37. public string alertText { get; set; }
  38. public string modelId { get; set; }
  39. public override bool Equals(object obj)
  40. {
  41. var tmp = obj as AlarmSnap;
  42. if (tmp != null && tmp.id == this.id)
  43. return true;
  44. return false;
  45. }
  46. public string categoryName
  47. {
  48. get
  49. {
  50. if (category1.Equals("windturbine"))
  51. {
  52. switch (category2)
  53. {
  54. case "bj":
  55. return "变桨系统";
  56. case "clx":
  57. return "齿轮箱";
  58. case "ph":
  59. return "偏航系统";
  60. case "kz":
  61. return "控制系统";
  62. case "zz":
  63. return "主轴";
  64. case "fdj":
  65. return "发电机";
  66. case "yy":
  67. return "液压系统";
  68. case "bpq":
  69. return "变频器";
  70. case "jc":
  71. return "机舱";
  72. }
  73. return "其它";
  74. }
  75. return "";
  76. }
  77. }
  78. public string RankName
  79. {
  80. get
  81. {
  82. switch (rank)
  83. {
  84. case "1":
  85. return "低";
  86. case "2":
  87. return "中低";
  88. case "3":
  89. return "中";
  90. case "4":
  91. return "中高";
  92. case "5":
  93. return "高";
  94. default:
  95. return "低";
  96. }
  97. }
  98. }
  99. }
  100. }