AlarmInfo.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace NEIntelligentControl2.Models.Alarm
  8. {
  9. /// <summary>
  10. /// 报警信息
  11. /// </summary>
  12. public class AlarmInfo
  13. {
  14. public long Id { get; set; }
  15. public DateTime? AlertTime { get; set; }
  16. public int MessageType { get; set; }
  17. public long SnapId { get; set; }
  18. public string StationId { get; set; }
  19. public string ProjectId { get; set; }
  20. public string LineId { get; set; }
  21. public string WindturbineId { get; set; }
  22. public int AlertValue { get; set; }
  23. public string Category1 { get; set; }
  24. public string Category2 { get; set; }
  25. public string Category3 { get; set; }
  26. public string Rank { get; set; }
  27. public string StationName { get; set; }
  28. public string WindturbineName { get; set; }
  29. public string AlertText { get; set; }
  30. public string ModelId { get; set; }
  31. public int IsOpened { get; set; }
  32. public DateTime? LastUpdateTime { get; set; }
  33. public string AlertTimeTimeString { get => AlertTime?.ToString("yyyy-MM-dd HH:mm:ss"); }
  34. public string LatestUpdateTimeString { get => LastUpdateTime?.ToString("yyyy-MM-dd HH:mm:ss"); }
  35. private string objectName;
  36. public string ObjectName
  37. {
  38. set => objectName = value;
  39. get
  40. {
  41. if (objectName != null) return objectName;
  42. if (Category1 == "SYZ" || Category1 == "GF")
  43. {
  44. return StationName;
  45. }
  46. return WindturbineName;
  47. }
  48. }
  49. public string RankString
  50. {
  51. get
  52. {
  53. switch (Rank)
  54. {
  55. case "1":
  56. return "低";
  57. case "2":
  58. return "中低";
  59. case "3":
  60. return "中";
  61. case "4":
  62. return "中高";
  63. case "5":
  64. return "高";
  65. default: return "";
  66. }
  67. }
  68. }
  69. public string Category1String
  70. {
  71. get
  72. {
  73. switch (Category1)
  74. {
  75. case "custom":
  76. return "自定义";
  77. case "SYZ":
  78. return "升压站";
  79. case "windturbine":
  80. return "风机";
  81. default:return "";
  82. }
  83. }
  84. }
  85. }
  86. }