WarningInfoItem.cs 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using TMPro;
  2. using UnityEngine;
  3. public class WarningInfoItem : MonoBehaviour
  4. {
  5. public GameObject[] warningLevel;
  6. public TextMeshProUGUI level;// 告警级别
  7. public TextMeshProUGUI wangyuanName; // 网元名称
  8. public TextMeshProUGUI wangyuanIP; // 网元IP
  9. public TextMeshProUGUI equipmentAlarmTime; // 设备告警时间
  10. public TextMeshProUGUI clearStatus; // 清除状态
  11. public TextMeshProUGUI dingweiDuixiangName; // 定位对象名称
  12. public TextMeshProUGUI dingweiInfo; // 定位信息
  13. public TextMeshProUGUI caijiFangshi; // 设备ID
  14. public TextMeshProUGUI laiYuan; // 来源
  15. public TextMeshProUGUI Pod; // 设备ID
  16. public TextMeshProUGUI type; // 告警类型
  17. public TextMeshProUGUI wangyuanType; // 网元类型
  18. public TextMeshProUGUI caijiTime; // 采集时间
  19. public TextMeshProUGUI deviceClearAlarmTime; // 设备清除告警时间
  20. public TextMeshProUGUI targetObjectType; // 定位对象类型
  21. public TextMeshProUGUI gongdanState; // 工单状态
  22. public TextMeshProUGUI gaojingZhengwen; // 告警正文
  23. public TextMeshProUGUI changjiaName; // 厂家名称
  24. public TextMeshProUGUI wangyuanzileixing; // 网元子类型
  25. public TextMeshProUGUI pingci; // 频次
  26. public void Init(AlarmData AlarmData)
  27. {
  28. level.text = "--";
  29. wangyuanName.text = "--";
  30. wangyuanIP.text = "--";
  31. equipmentAlarmTime.text = "--";
  32. clearStatus.text = "--";
  33. dingweiDuixiangName.text = "--";// 定位对象名称
  34. dingweiInfo.text = "--";
  35. caijiFangshi.text = "--";
  36. laiYuan.text = "--";
  37. Pod.text = "--";
  38. type.text = "--"; // 告警类型
  39. wangyuanType.text = "--";
  40. caijiTime.text = "--";
  41. deviceClearAlarmTime.text = "--";
  42. targetObjectType.text = "--";
  43. gongdanState.text = "--"; // 设备名称
  44. gaojingZhengwen.text = "--";
  45. changjiaName.text = "--";
  46. wangyuanzileixing.text = "--";
  47. pingci.text = "--";
  48. if (!string.IsNullOrEmpty(AlarmData.level)) // 告警级别
  49. {
  50. if (AlarmData.level == "重大告警")
  51. warningLevel[0].SetActive(true);
  52. else
  53. warningLevel[1].SetActive(true);
  54. level.text = AlarmData.level;
  55. }
  56. if (!string.IsNullOrEmpty(AlarmData.type)) // 告警类型
  57. {
  58. type.text = AlarmData.type;
  59. }
  60. if (!string.IsNullOrEmpty(AlarmData.equipmentAlarmTime)) // 设备告警时间
  61. {
  62. equipmentAlarmTime.text = AlarmData.equipmentAlarmTime;
  63. }
  64. if (!string.IsNullOrEmpty(AlarmData.deviceClearAlarmTime)) // 设备清除告警时间
  65. {
  66. deviceClearAlarmTime.text = AlarmData.deviceClearAlarmTime;
  67. }
  68. if (!string.IsNullOrEmpty(AlarmData.clearStatus)) // 清除状态
  69. {
  70. clearStatus.text = AlarmData.clearStatus;
  71. }
  72. if (!string.IsNullOrEmpty(AlarmData.targetObjectType)) // 定位对象类型
  73. {
  74. targetObjectType.text = AlarmData.targetObjectType;
  75. }
  76. }
  77. }