public Led() { this.AcquistionConfig = new LedAcquisitionConfig(); this.AlarmConfig = new LedAlarmConfig(); this.Components = new List <ComponentBase>(); this.Description = string.Empty; this.Height = -1; this.Width = -1; this.Mac = string.Empty; this.MonitoringConfig = new LedMonitoringConfig(); this.RegistationInfo = new LedRegistationInfo(); this.SerialNumber = string.Empty; }
private Led(Led led) { this.AcquistionConfig = led.AcquistionConfig == null?null:led.AcquistionConfig.Clone() as LedAcquisitionConfig; this.AlarmConfig = led.AlarmConfig == null? null: led.AlarmConfig.Clone() as LedAlarmConfig; this.Components = led.Components == null? null: led.Components.Select(t => (ComponentBase)t.Clone()).ToList() as List <ComponentBase>; this.Description = string.IsNullOrEmpty(led.Description)?string.Empty: led.Description.Clone() as string; this.Height = led.Height; this.Width = led.Width; this.Mac = string.IsNullOrEmpty(led.Mac)?string.Empty: led.Mac.Clone() as string; this.MonitoringConfig = led.MonitoringConfig == null?null: led.MonitoringConfig.Clone() as LedMonitoringConfig; this.RegistationInfo = led.RegistationInfo == null?null: led.RegistationInfo.Clone() as LedRegistationInfo; this.SerialNumber = string.IsNullOrEmpty(led.SerialNumber)?string.Empty:led.SerialNumber.Clone() as string; }
/// <summary> /// 更新Led告警配置 /// </summary> /// <param name="sn">Led标识号</param> /// <param name="alarmConfig">Led告警配置对象</param> /// <returns></returns> public bool UpdateLedAlarmConfig(string sn, LedAlarmConfig alarmConfig) { string serializeStr = JsonConvert.SerializeObject(alarmConfig); SetLedAlarmConfig(serializeStr); return SaveLedAlarmConfig(alarmConfig.SN, serializeStr); }
public AlarmConfigSynchronizedEventArgs(LedAlarmConfig config) { AlarmConfig = config; }
public bool UpdateLedAlarmConfig(string sn, LedAlarmConfig alarmConfig) { _fLogService.Info("开始更新告警配置..."); bool isResult = true; if (IsAllScreen(sn)) { _ledAlarmConfigs.Clear(); foreach (LedBasicInfo ledinfo in LedInfoList) { if (IsAllScreen(ledinfo.Sn)) { _ledAlarmConfigs.Add((LedAlarmConfig)alarmConfig.Clone()); continue; } LedAlarmConfig ledAlarm = (LedAlarmConfig)alarmConfig.Clone(); ledAlarm.SN = ledinfo.Sn; isResult = isResult && DataDispatcher.ClientDispatcher.Instance.UpdateLedAlarmConfig(ledinfo.Sn, ledAlarm); _ledAlarmConfigs.Add(ledAlarm); } } else { isResult = DataDispatcher.ClientDispatcher.Instance.UpdateLedAlarmConfig(sn, (LedAlarmConfig)alarmConfig.Clone()); _ledAlarmConfigs.Remove(_ledAlarmConfigs.Find(a => a.SN == sn)); _ledAlarmConfigs.Add((LedAlarmConfig)alarmConfig.Clone()); } _fLogService.Info("完成更新告警配置..."); return isResult; }
private LedAlarmConfig GetInitialAlarmConfg(string sn) { LedAlarmConfig ledAlarm = new LedAlarmConfig(); ledAlarm.SN = sn; ledAlarm.ParameterAlarmConfigList = new List<ParameterAlarmConfig>(); ParameterAlarmConfig param = new ParameterAlarmConfig(); param.ParameterType = StateQuantityType.Temperature; param.HighThreshold = 60; ledAlarm.ParameterAlarmConfigList.Add((ParameterAlarmConfig)param.Clone()); param.ParameterType = StateQuantityType.Humidity; param.HighThreshold = 60; ledAlarm.ParameterAlarmConfigList.Add((ParameterAlarmConfig)param.Clone()); param.ParameterType = StateQuantityType.Voltage; param.LowThreshold = 4; param.HighThreshold = 12; param.Level = AlarmLevel.Warning; ledAlarm.ParameterAlarmConfigList.Add((ParameterAlarmConfig)param.Clone()); param.ParameterType = StateQuantityType.Voltage; param.HighThreshold = 3.5; param.LowThreshold = 0; param.Level = AlarmLevel.Malfunction; ledAlarm.ParameterAlarmConfigList.Add((ParameterAlarmConfig)param.Clone()); param.ParameterType = StateQuantityType.FanSpeed; param.LowThreshold = 1000; param.LowThreshold = 0; ledAlarm.ParameterAlarmConfigList.Add((ParameterAlarmConfig)param.Clone()); return ledAlarm; }
private void GetScanBoardErrData(string sn,LedAlarmConfig alarmConfig,List<ScannerMonitorInfo> scannerMonitor) { FLogService.Info("EMailSendMonitorErrMsg" + "接收卡数据解析开始"); if (scannerMonitor == null || alarmConfig == null) { return; } MonitorErrData temp = null; for (int i = 0; i < scannerMonitor.Count; i++) { if(scannerMonitor[i].DeviceStatus==DeviceWorkStatus.Unknown) { continue; } //接收卡 if (scannerMonitor[i].DeviceStatus==DeviceWorkStatus.Error) { temp = new MonitorErrData(); temp.SN = sn; temp.ErrorType = ErrType.SBStatus; temp.MonitorResult = MonitorInfoResult.Fault; temp.DeviceRegInfo = (DeviceRegionInfo)scannerMonitor[i].DeviceRegInfo.Clone(); _newAllScreenMonitorErrData.Add(temp); AddSystemRunData(ErrType.SBStatus, 1); } //板载温度 ParameterAlarmConfig info = alarmConfig.ParameterAlarmConfigList.Find(a => a.ParameterType == StateQuantityType.Temperature);// && a.Disable == false); if (info != null && info.HighThreshold < scannerMonitor[i].Temperature) { temp = new MonitorErrData(); temp.SN = sn; temp.ErrorType = ErrType.Temperature; temp.MonitorResult = MonitorInfoResult.Alarm; temp.DeviceRegInfo = (DeviceRegionInfo)scannerMonitor[i].DeviceRegInfo.Clone(); _newAllScreenMonitorAlarmData.Add(temp); AddSystemRunData(ErrType.Temperature, 1); } } FLogService.Info("EMailSendMonitorErrMsg" + "接收卡数据解析完成"); }
private void GetMonitorErrData(string sn,LedAlarmConfig alarmConfig,List<MonitorCardMonitorInfo> monitorCardInfo) { FLogService.Info("EMailSendMonitorErrMsg" + "监控数据解析开始"); if (monitorCardInfo == null || alarmConfig == null) { return; } MonitorErrData temp = null; for (int i = 0; i < monitorCardInfo.Count; i++) { //监控卡 if(monitorCardInfo[i].DeviceStatus==DeviceWorkStatus.Error) { temp = new MonitorErrData(); temp.SN = sn; temp.ErrorType = ErrType.MonitorCard; temp.MonitorResult = MonitorInfoResult.Fault; temp.DeviceRegInfo = (DeviceRegionInfo)monitorCardInfo[i].DeviceRegInfo.Clone(); _newAllScreenMonitorErrData.Add(temp); AddSystemRunData(ErrType.MonitorCard, 1); continue; } else if (monitorCardInfo[i].DeviceStatus == DeviceWorkStatus.Unknown) { continue; } //湿度 ParameterAlarmConfig info = alarmConfig.ParameterAlarmConfigList.Find(a => a.ParameterType == StateQuantityType.Humidity);// && a.Disable == false); if (monitorCardInfo[i].HumidityUInfo!=null && monitorCardInfo[i].HumidityUInfo.IsUpdate && info != null && info.HighThreshold < monitorCardInfo[i].HumidityUInfo.Humidity) { temp = new MonitorErrData(); temp.SN = sn; temp.ErrorType = ErrType.Humidity; temp.MonitorResult = MonitorInfoResult.Alarm; temp.DeviceRegInfo = (DeviceRegionInfo)monitorCardInfo[i].DeviceRegInfo.Clone(); _newAllScreenMonitorAlarmData.Add(temp); AddSystemRunData(ErrType.Humidity, 1); }//烟雾 if (monitorCardInfo[i].SmokeUInfo!=null && monitorCardInfo[i].SmokeUInfo.IsUpdate && monitorCardInfo[i].SmokeUInfo.IsSmokeAlarm) { temp = new MonitorErrData(); temp.SN = sn; temp.ErrorType = ErrType.Smoke; temp.MonitorResult = MonitorInfoResult.Alarm; temp.DeviceRegInfo = (DeviceRegionInfo)monitorCardInfo[i].DeviceRegInfo.Clone(); _newAllScreenMonitorAlarmData.Add(temp); AddSystemRunData(ErrType.Smoke, 1); }//箱门 if (monitorCardInfo[i].CabinetDoorUInfo!=null && monitorCardInfo[i].CabinetDoorUInfo.IsUpdate && monitorCardInfo[i].CabinetDoorUInfo.IsDoorOpen) { temp = new MonitorErrData(); temp.SN = sn; temp.ErrorType = ErrType.CabinetDoor; temp.MonitorResult = MonitorInfoResult.Alarm; temp.DeviceRegInfo = (DeviceRegionInfo)monitorCardInfo[i].DeviceRegInfo.Clone(); _newAllScreenMonitorAlarmData.Add(temp); AddSystemRunData(ErrType.CabinetDoor, 1); }//风扇 info = alarmConfig.ParameterAlarmConfigList.Find(a => a.ParameterType == StateQuantityType.FanSpeed);// && a.Disable == false); if (monitorCardInfo[i].FansUInfo != null && monitorCardInfo[i].FansUInfo.IsUpdate && info != null) { foreach (var item in monitorCardInfo[i].FansUInfo.FansMonitorInfoCollection.Keys) { if(monitorCardInfo[i].FansUInfo.FansMonitorInfoCollection[item] < info.LowThreshold) { temp = new MonitorErrData(); temp.SN = sn; temp.ErrorType = ErrType.Fan; temp.MonitorResult = MonitorInfoResult.Alarm; temp.DeviceRegInfo = (DeviceRegionInfo)monitorCardInfo[i].DeviceRegInfo.Clone(); _newAllScreenMonitorAlarmData.Add(temp); AddSystemRunData(ErrType.Fan, 1); break; } } } //电源 info = alarmConfig.ParameterAlarmConfigList.Find(a => a.ParameterType == StateQuantityType.Voltage);// && a.Disable == false); if (monitorCardInfo[i].PowerUInfo!=null && monitorCardInfo[i].PowerUInfo.IsUpdate && info != null) { foreach (var item in monitorCardInfo[i].PowerUInfo.PowerMonitorInfoCollection.Keys) { //告警 if (monitorCardInfo[i].PowerUInfo.PowerMonitorInfoCollection[item] > info.HighThreshold) { temp = new MonitorErrData(); temp.SN = sn; temp.ErrorType = ErrType.Power; temp.MonitorResult = MonitorInfoResult.Alarm; temp.DeviceRegInfo = (DeviceRegionInfo)monitorCardInfo[i].DeviceRegInfo.Clone(); _newAllScreenMonitorAlarmData.Add(temp); AddSystemRunData(ErrType.Power, 1); break; } } foreach (var item in monitorCardInfo[i].PowerUInfo.PowerMonitorInfoCollection.Keys) { //故障 if (monitorCardInfo[i].PowerUInfo.PowerMonitorInfoCollection[item] < info.LowThreshold) { temp = new MonitorErrData(); temp.SN = sn; temp.ErrorType = ErrType.Power; temp.MonitorResult = MonitorInfoResult.Fault; temp.DeviceRegInfo = (DeviceRegionInfo)monitorCardInfo[i].DeviceRegInfo.Clone(); _newAllScreenMonitorErrData.Add(temp); AddSystemRunData(ErrType.Power, 1); break; } } } //排线 if (monitorCardInfo[i].SocketCableUInfo != null && monitorCardInfo[i].SocketCableUInfo.IsUpdate) { GetSocketErrData(sn,monitorCardInfo[i].SocketCableUInfo.SocketCableInfoCollection, monitorCardInfo[i].DeviceRegInfo); } } FLogService.Info("EMailSendMonitorErrMsg" + "监控数据解析完成"); }
public object Clone() { LedAlarmConfig config = new LedAlarmConfig(this); return(config); }
private LedAlarmConfig(LedAlarmConfig config) { this.SN = string.IsNullOrEmpty(config.SN) ? null : config.SN; this.ParameterAlarmConfigList = config.ParameterAlarmConfigList == null ? null : config.ParameterAlarmConfigList.Select(T => (ParameterAlarmConfig)T.Clone()).ToList(); }
public object Clone() { LedAlarmConfig config = new LedAlarmConfig(this); return config; }
private void InitialAlarmConfg(LedAlarmConfig ledAlarm) { if (ledAlarm.ParameterAlarmConfigList == null || ledAlarm.ParameterAlarmConfigList.Count == 0) { return; } foreach (ParameterAlarmConfig param in ledAlarm.ParameterAlarmConfigList) { if (param != null) { switch (param.ParameterType) { case StateQuantityType.Temperature: IsEnableTempAlarm = !param.Disable; TemperatureThreshold = (int)param.HighThreshold; break; case StateQuantityType.Humidity: IsEnableHumidityAlarm = !param.Disable; HumidityThreshold = (int)param.HighThreshold; break; case StateQuantityType.Voltage: if (param.Level == AlarmLevel.Warning) { IsEnableVoltageAlarm = !param.Disable; VoltageThreshold = (float)param.LowThreshold; VoltageThresholdMax = (float)param.HighThreshold; } else if (param.Level == AlarmLevel.Malfunction) { IsEnableVoltageErrorAlarm = !param.Disable; VoltageErrorThreshold = (float)param.HighThreshold; } break; case StateQuantityType.FanSpeed: IsEnableFanSpeedAlarm = !param.Disable; FanSpeedThreshold = (int)param.LowThreshold; break; } } } if (MonitorAllConfig.Instance().UserConfigInfo != null) { if (_tempType == TemperatureType.Celsius) { StrTempFlag = "℃"; } else { StrTempFlag = "℉"; } } }
private LedAlarmConfig GetAlarmConfg() { LedAlarmConfig ledAlarm = new LedAlarmConfig(); ledAlarm.SN = SN; ledAlarm.ParameterAlarmConfigList = new List<ParameterAlarmConfig>(); ParameterAlarmConfig param = new ParameterAlarmConfig(); param.Disable = !IsEnableTempAlarm; param.ParameterType = StateQuantityType.Temperature; if (_tempType == TemperatureType.Fahrenheit) { param.HighThreshold = (int)MonitorAllConfig.Instance().GetTempValueChanged(TemperatureType.Celsius, TemperatureThreshold); } else { param.HighThreshold = TemperatureThreshold; } ledAlarm.ParameterAlarmConfigList.Add((ParameterAlarmConfig)param.Clone()); param.Disable = !IsEnableHumidityAlarm; param.ParameterType = StateQuantityType.Humidity; param.HighThreshold = HumidityThreshold; ledAlarm.ParameterAlarmConfigList.Add((ParameterAlarmConfig)param.Clone()); param.Disable = !IsEnableVoltageAlarm; param.ParameterType = StateQuantityType.Voltage; param.LowThreshold = VoltageThreshold; if (param.LowThreshold >= param.HighThreshold) { param.HighThreshold = VoltageThreshold + 0.1; } if (param.HighThreshold > 12) { param.HighThreshold = 12; } param.Level = AlarmLevel.Warning; ledAlarm.ParameterAlarmConfigList.Add((ParameterAlarmConfig)param.Clone()); param.Disable = !IsEnableVoltageErrorAlarm; param.ParameterType = StateQuantityType.Voltage; param.HighThreshold = VoltageErrorThreshold; param.LowThreshold = 0; param.Level = AlarmLevel.Malfunction; ledAlarm.ParameterAlarmConfigList.Add((ParameterAlarmConfig)param.Clone()); param.Disable = !IsEnableFanSpeedAlarm; param.ParameterType = StateQuantityType.FanSpeed; param.LowThreshold = FanSpeedThreshold; param.HighThreshold = 0; ledAlarm.ParameterAlarmConfigList.Add((ParameterAlarmConfig)param.Clone()); return ledAlarm; }
private void SetScannerMonitor(LedBasicInfo ledInfo, List<ScannerMonitorInfo> scannerInfos, LedAlarmConfig ledAlarmConfig, MonitorDataFlag monitorFlag) { monitorFlag.IsSBStatusValid = DeviceWorkStatus.Unknown; monitorFlag.IsTemperatureValid = DeviceWorkStatus.Unknown; float tempValue = 79; if (ledAlarmConfig.ParameterAlarmConfigList != null) { ParameterAlarmConfig param = ledAlarmConfig.ParameterAlarmConfigList.Find(a => a.ParameterType == StateQuantityType.Temperature); if (param != null) { tempValue = (float)param.HighThreshold; } } foreach (ScannerMonitorInfo scannerInfo in scannerInfos) { if (scannerInfo.DeviceStatus == DeviceWorkStatus.Error) { monitorFlag.IsSBStatusValid = DeviceWorkStatus.Error; if (!_lctData.FaultMonitorInfos.ContainsKey(ledInfo.Commport)) { _lctData.FaultMonitorInfos.Add(ledInfo.Commport, new MonitorErrData()); } _lctData.FaultMonitorInfos[ledInfo.Commport].SBStatusErrCount++; } else if (scannerInfo.DeviceStatus == DeviceWorkStatus.OK && monitorFlag.IsSBStatusValid == DeviceWorkStatus.Unknown) { monitorFlag.IsSBStatusValid = DeviceWorkStatus.OK; } if (scannerInfo.TemperatureIsVaild == true) { if (scannerInfo.Temperature > tempValue) { monitorFlag.IsTemperatureValid = DeviceWorkStatus.Error; if (!_lctData.AlarmMonitorInfos.ContainsKey(ledInfo.Commport)) { _lctData.AlarmMonitorInfos.Add(ledInfo.Commport, new MonitorErrData()); } _lctData.AlarmMonitorInfos[ledInfo.Commport].TemperatureAlarmCount++; _lctData.ValidInfo.IsTemperatureValid = true; } else if (monitorFlag.IsTemperatureValid != DeviceWorkStatus.Error) { monitorFlag.IsTemperatureValid = DeviceWorkStatus.OK; _lctData.ValidInfo.IsTemperatureValid = true; } } } _lctData.ValidInfo.IsSBStatusValid = true; }
private void SetMonitorCardMonitor(LedBasicInfo ledInfo, List<MonitorCardMonitorInfo> monitorCardInfos, LedAlarmConfig ledAlarmConfig, LedMonitoringConfig ledMonitorConfig, MonitorDataFlag monitorFlag) { if (ledMonitorConfig.MonitoringCardConfig == null || ledMonitorConfig.MonitoringCardConfig.MonitoringEnable == false) { monitorFlag.IsMCStatusValid = DeviceWorkStatus.UnAvailable; monitorFlag.IsFanValid = DeviceWorkStatus.UnAvailable; monitorFlag.IsHumidityValid = DeviceWorkStatus.UnAvailable; monitorFlag.IsPowerValid = DeviceWorkStatus.UnAvailable; monitorFlag.IsRowLineValid = DeviceWorkStatus.UnAvailable; monitorFlag.IsSmokeValid = DeviceWorkStatus.UnAvailable; monitorFlag.IsGeneralStatusValid = DeviceWorkStatus.UnAvailable; return; } monitorFlag.IsMCStatusValid = DeviceWorkStatus.Unknown; monitorFlag.IsFanValid = DeviceWorkStatus.Unknown; monitorFlag.IsHumidityValid = DeviceWorkStatus.Unknown; monitorFlag.IsPowerValid = DeviceWorkStatus.Unknown; monitorFlag.IsRowLineValid = DeviceWorkStatus.Unknown; monitorFlag.IsSmokeValid = DeviceWorkStatus.Unknown; monitorFlag.IsGeneralStatusValid = DeviceWorkStatus.Unknown; float fanValue = 1000; float humValue = 100; float valValue = 4; if (ledAlarmConfig.ParameterAlarmConfigList != null) { ParameterAlarmConfig param = ledAlarmConfig.ParameterAlarmConfigList.Find(a => a.ParameterType == StateQuantityType.FanSpeed); if (param != null) { fanValue = (float)param.LowThreshold; } param = ledAlarmConfig.ParameterAlarmConfigList.Find(a => a.ParameterType == StateQuantityType.Humidity); if (param != null) { humValue = (float)param.HighThreshold; } } ParameterMonitoringConfig monitorConfig = ledMonitorConfig.MonitoringCardConfig.ParameterConfigTable.Find (a => a.Type == StateQuantityType.FanSpeed); bool isFan = monitorConfig == null ? false : monitorConfig.MonitoringEnable; monitorConfig = ledMonitorConfig.MonitoringCardConfig.ParameterConfigTable.Find (a => a.Type == StateQuantityType.Humidity); bool isHumidity = monitorConfig == null ? false : monitorConfig.MonitoringEnable; monitorConfig = ledMonitorConfig.MonitoringCardConfig.ParameterConfigTable.Find (a => a.Type == StateQuantityType.Smoke); bool isSmoke = monitorConfig == null ? false : monitorConfig.MonitoringEnable; monitorConfig = ledMonitorConfig.MonitoringCardConfig.ParameterConfigTable.Find (a => a.Type == StateQuantityType.Voltage); bool isVoltage = monitorConfig == null ? false : monitorConfig.MonitoringEnable; monitorConfig = ledMonitorConfig.MonitoringCardConfig.ParameterConfigTable.Find (a => a.Type == StateQuantityType.DoorStatus); bool isDoorStatus = monitorConfig == null ? false : monitorConfig.MonitoringEnable; monitorConfig = ledMonitorConfig.MonitoringCardConfig.ParameterConfigTable.Find (a => a.Type == StateQuantityType.FlatCableStatus); bool isFlatCableStatus = monitorConfig == null ? false : monitorConfig.MonitoringEnable; _lctData.ValidInfo.IsMCStatusValid = true; foreach (MonitorCardMonitorInfo monitorCardInfo in monitorCardInfos) { if (monitorCardInfo.DeviceStatus == DeviceWorkStatus.Error) { monitorFlag.IsMCStatusValid = DeviceWorkStatus.Error; if (!_lctData.FaultMonitorInfos.ContainsKey(ledInfo.Commport)) { _lctData.FaultMonitorInfos.Add(ledInfo.Commport, new MonitorErrData()); } _lctData.FaultMonitorInfos[ledInfo.Commport].MCStatusErrCount++; } else if (monitorCardInfo.DeviceStatus == DeviceWorkStatus.OK && monitorFlag.IsMCStatusValid == DeviceWorkStatus.Unknown) { monitorFlag.IsMCStatusValid = DeviceWorkStatus.OK; } if (isFan == false) { monitorFlag.IsFanValid = DeviceWorkStatus.UnAvailable; } else if (monitorCardInfo.FansUInfo == null) { //if (monitorFlag.IsFanValid == DeviceWorkStatus.OK) //{ // monitorFlag.IsFanValid = DeviceWorkStatus.Error; //} } else if (monitorCardInfo.FansUInfo.IsUpdate && monitorCardInfo.FansUInfo.FansMonitorInfoCollection != null && monitorCardInfo.FansUInfo.FansMonitorInfoCollection.Count > 0) { foreach (int tmpValue in monitorCardInfo.FansUInfo.FansMonitorInfoCollection.Values) { if (tmpValue < fanValue) { monitorFlag.IsFanValid = DeviceWorkStatus.Error; if (!_lctData.AlarmMonitorInfos.ContainsKey(ledInfo.Commport)) { _lctData.AlarmMonitorInfos.Add(ledInfo.Commport, new MonitorErrData()); } _lctData.AlarmMonitorInfos[ledInfo.Commport].FanAlarmSwitchCount++; } else if (monitorCardInfo.DeviceStatus == DeviceWorkStatus.OK && monitorFlag.IsFanValid == DeviceWorkStatus.Unknown) { monitorFlag.IsFanValid = DeviceWorkStatus.OK; } } _lctData.ValidInfo.IsFanValid = true; } if (isHumidity == false) { monitorFlag.IsHumidityValid = DeviceWorkStatus.UnAvailable; } else if (monitorCardInfo.HumidityUInfo == null) { //if (monitorFlag.IsHumidityValid == DeviceWorkStatus.OK) //{ // monitorFlag.IsHumidityValid = DeviceWorkStatus.Error; //} } else if (monitorCardInfo.HumidityUInfo.IsUpdate) { if (monitorCardInfo.HumidityUInfo.Humidity > humValue) { monitorFlag.IsHumidityValid = DeviceWorkStatus.Error; if (!_lctData.AlarmMonitorInfos.ContainsKey(ledInfo.Commport)) { _lctData.AlarmMonitorInfos.Add(ledInfo.Commport, new MonitorErrData()); } _lctData.AlarmMonitorInfos[ledInfo.Commport].HumidityAlarmCount++; } else if (monitorFlag.IsHumidityValid != DeviceWorkStatus.Error) { monitorFlag.IsHumidityValid = DeviceWorkStatus.OK; } _lctData.ValidInfo.IsHumidityValid = true; } if (isDoorStatus == false) { monitorFlag.IsGeneralStatusValid = DeviceWorkStatus.UnAvailable; } else if (monitorCardInfo.CabinetDoorUInfo == null) { //if (monitorFlag.IsGeneralStatusValid == DeviceWorkStatus.OK) //{ // monitorFlag.IsGeneralStatusValid = DeviceWorkStatus.Error; //} } else if (monitorCardInfo.CabinetDoorUInfo.IsUpdate) { if (monitorCardInfo.CabinetDoorUInfo.IsDoorOpen) { monitorFlag.IsGeneralStatusValid = DeviceWorkStatus.Error; if (!_lctData.FaultMonitorInfos.ContainsKey(ledInfo.Commport)) { _lctData.FaultMonitorInfos.Add(ledInfo.Commport, new MonitorErrData()); } _lctData.FaultMonitorInfos[ledInfo.Commport].GeneralSwitchErrCount++; } else if (monitorFlag.IsGeneralStatusValid != DeviceWorkStatus.Error) { monitorFlag.IsGeneralStatusValid = DeviceWorkStatus.OK; } _lctData.ValidInfo.IsGeneralStatusValid = true; } if (isVoltage == false) { monitorFlag.IsPowerValid = DeviceWorkStatus.UnAvailable; } else if (monitorCardInfo.PowerUInfo == null) { //if (monitorFlag.IsPowerValid == DeviceWorkStatus.OK) //{ // monitorFlag.IsPowerValid = DeviceWorkStatus.Error; //} } else if (monitorCardInfo.PowerUInfo.IsUpdate && monitorCardInfo.PowerUInfo.PowerMonitorInfoCollection != null) { foreach (float tmpValue in monitorCardInfo.PowerUInfo.PowerMonitorInfoCollection.Values) { if (tmpValue < valValue) { monitorFlag.IsPowerValid = DeviceWorkStatus.Error; if (!_lctData.FaultMonitorInfos.ContainsKey(ledInfo.Commport)) { _lctData.FaultMonitorInfos.Add(ledInfo.Commport, new MonitorErrData()); } _lctData.FaultMonitorInfos[ledInfo.Commport].PowerAlarmSwitchCount++; } else if (monitorCardInfo.DeviceStatus == DeviceWorkStatus.OK && monitorFlag.IsPowerValid == DeviceWorkStatus.Unknown) { monitorFlag.IsPowerValid = DeviceWorkStatus.OK; } } _lctData.ValidInfo.IsPowerValid = true; } if (isSmoke == false) { monitorFlag.IsSmokeValid = DeviceWorkStatus.UnAvailable; } else if (monitorCardInfo.SmokeUInfo == null) { //if (monitorFlag.IsSmokeValid == DeviceWorkStatus.OK) //{ // monitorFlag.IsSmokeValid = DeviceWorkStatus.Error; //} } else if (monitorCardInfo.SmokeUInfo.IsUpdate) { if (monitorCardInfo.SmokeUInfo.IsSmokeAlarm) { monitorFlag.IsSmokeValid = DeviceWorkStatus.Error; if (!_lctData.AlarmMonitorInfos.ContainsKey(ledInfo.Commport)) { _lctData.AlarmMonitorInfos.Add(ledInfo.Commport, new MonitorErrData()); } _lctData.AlarmMonitorInfos[ledInfo.Commport].SmokeAlarmCount++; } else if (monitorFlag.IsSmokeValid != DeviceWorkStatus.Error) { monitorFlag.IsSmokeValid = DeviceWorkStatus.OK; } _lctData.ValidInfo.IsSmokeValid = true; } if (isFlatCableStatus == false) { monitorFlag.IsRowLineValid = DeviceWorkStatus.UnAvailable; } else if (monitorCardInfo.SocketCableUInfo == null) { // if (monitorFlag.IsRowLineValid == DeviceWorkStatus.OK) // { // monitorFlag.IsRowLineValid = DeviceWorkStatus.Error; // } } else if (monitorCardInfo.SocketCableUInfo.IsUpdate && monitorCardInfo.SocketCableUInfo.SocketCableInfoCollection != null && monitorCardInfo.SocketCableUInfo.SocketCableInfoCollection.Count > 0) { foreach (SocketCableMonitorInfo socket in monitorCardInfo.SocketCableUInfo.SocketCableInfoCollection) { if (socket.SocketCableInfoDict == null || socket.SocketCableInfoDict.Count == 0) { monitorFlag.IsRowLineValid = DeviceWorkStatus.Error; break; } foreach (List<SocketCableStatus> socketCables in socket.SocketCableInfoDict.Values) { foreach (SocketCableStatus socketcable in socketCables) { if (socketcable.IsCableOK == false) { monitorFlag.IsRowLineValid = DeviceWorkStatus.Error; if (!_lctData.AlarmMonitorInfos.ContainsKey(ledInfo.Commport)) { _lctData.AlarmMonitorInfos.Add(ledInfo.Commport, new MonitorErrData()); } _lctData.AlarmMonitorInfos[ledInfo.Commport].SoketAlarmCount++; } else if (socketcable.IsCableOK == true && monitorFlag.IsRowLineValid == DeviceWorkStatus.Unknown) { monitorFlag.IsRowLineValid = DeviceWorkStatus.OK; } } } if (monitorFlag.IsRowLineValid == DeviceWorkStatus.Error) { break; } } _lctData.ValidInfo.IsRowLineValid = true; } } }