public UPSForm(MapForm mapForm, UPSStatusList UPSStatus) { InitializeComponent(); this.mapForm = mapForm; UPSStatus = UPSStatus ?? new UPSStatusList(); expandablePanel1.TitleText = string.Empty; labelX_InVoltage.Text = UPSStatus.InVoltage + "V"; labelX_LVoltage.Text = UPSStatus.LVoltage + "V"; labelX_OutVoltage.Text = UPSStatus.OutVoltage + "V"; labelX_OutputLoad.Text = UPSStatus.OutputLoad + "%"; labelX_Freq.Text = UPSStatus.Freq + "Hz"; labelX_CellVoltage.Text = UPSStatus.CellVoltage + "V"; labelX_Temperature.Text = UPSStatus.Temperature + "℃"; labelX_Alarm.Text = OMCommon.UPSAlarmConvert(UPSStatus.Alarm); labelX_Time.Text = UPSStatus.Time.ToString(); labelX_Alarm.Visible = true; }
/// <summary> /// 更新界面UPS异常列表 /// </summary> /// <param name="UPSStatusList"></param> private void UpdateUPSExceptionList(List<UPSStatusList> UPSStatusList) { lock (UpdateUPSExceptionLockObj) { var UPSExceptionList = UPSStatusList.FindAll(_ => _.Alarm != "00000000").Select(u => { return new { DeviceID = u.DeviceID.ToString(), Name = u.Name, AlarmException = OMCommon.UPSAlarmConvert(u.Alarm), Time = u.Time, Map = "转到地图" }; }).ToList(); dataGridViewX_UPSExceptionList.DataSource = UPSExceptionList; } }
/// <summary> /// 更新界面摄像机异常列表 /// </summary> /// <param name="cameraStatusList"></param> private void UpdateCameraExceptionList(List<CameraStatusList> cameraStatusList) { lock (UpdateCameraExceptionLockObj) { var cameraExceptionList = cameraStatusList.FindAll(_ => _.SignalStatus == 2 || _.HardwareStatus == 2).Select(s => { return new { DeviceID = s.DeviceID.ToString(), Name = s.Name, AlarmException = OMCommon.CameraExceptionConvert(s.SignalStatus,s.HardwareStatus), Time = s.Time, Map = "转到地图" }; }).ToList(); dataGridViewX_CameraExceptionList.DataSource = cameraExceptionList; } }