예제 #1
0
 private LedBasicInfo(LedBasicInfo info)
 {
     _sn        = info.Sn.Clone() as string;
     _width     = info.Width;
     _height    = info.Height;
     _partInfos = info.PartInfos.Select(item => (PartInfo)item.Clone()).ToList();
 }
예제 #2
0
 private LedBasicInfo(LedBasicInfo info)
 {
     _sn = info.Sn.Clone() as string;
     _width = info.Width;
     _height = info.Height;
     _partInfos = info.PartInfos.Select(item => (PartInfo)item.Clone()).ToList();
 }
예제 #3
0
 public object Clone()
 {
     LedBasicInfo basicInfo = new LedBasicInfo(this);
     return basicInfo;
 }
예제 #4
0
        public object Clone()
        {
            LedBasicInfo basicInfo = new LedBasicInfo(this);

            return(basicInfo);
        }
예제 #5
0
 private void GetScreenListInfo()
 {
     _fLogService.Info("需要获取屏信息...");
     WriteLog("需要获取屏信息...");
     if (_moniDatareader == null)
     {
         _fLogService.Error("获取屏失败,原因硬件为空...");
         WriteLog("获取屏失败,原因硬件为空...");
         return;
     }
     _screenInfos = _moniDatareader.GetAllScreenInfo();
     if (_screenInfos == null)
     {
         _fLogService.Error("获取屏对象为Null");
         return;
     }
     _fLogService.Debug("Mars给的屏个数为:" + _screenInfos.Count);
     List<LedBasicInfo> LedDeviceInfos = new List<LedBasicInfo>();
     LedBasicInfo lInfo = new LedBasicInfo();
     for (int i = 0; i < _screenInfos.Count; i++)
     {
         LedDeviceInfos.Add(DataConverter(_screenInfos[i]));
     }
     SendAllPhysicalDisplayInfo();
     SendData("ScreenBaseInfoList", CommandTextParser.GetJsonSerialization<List<LedBasicInfo>>(LedDeviceInfos));
     WriteLog("对外已发出屏信息...");
     _fLogService.Info("对外已发出屏信息...");
 }
예제 #6
0
 private LedBasicInfo DataConverter(ScreenInfo sInfo)
 {
     if (sInfo == null) return null;
     LedBasicInfo lInfo = new LedBasicInfo();
     lInfo.Width = sInfo.LedWidth;
     lInfo.Height = sInfo.LedHeight;
     lInfo.Sn = sInfo.LedSN;
     lInfo.PointCount = sInfo.PointCount;
     lInfo.LedIndexOfCom = sInfo.LedIndexOfCom;
     lInfo.Commport = sInfo.Commport;
     lInfo.IsSupportPointDetect = sInfo.IsSupportPointDetect;
     lInfo.PartInfos = new List<PartInfo>();
     lInfo.PartInfos.Add(new PartInfo() { Type = DeviceType.SendCard, Amount = sInfo.SenderCardCount });
     lInfo.PartInfos.Add(new PartInfo() { Type = DeviceType.ReceiverCard, Amount = sInfo.ScannerCardCount });
     lInfo.PartInfos.Add(new PartInfo() { Type = DeviceType.MonitoringCard, Amount = sInfo.MonitorCardCount });
     return lInfo;
 }
        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;
                }
            }
        }
 public void SetSenderMonitor(LedBasicInfo ledInfo, List<SenderMonitorInfo> senderInfos, MonitorDataFlag monitorFlag)
 {
     monitorFlag.IsSenderDVIValid = DeviceWorkStatus.Unknown;
     foreach (SenderMonitorInfo senderInfo in senderInfos)
     {
         if (senderInfo.DeviceStatus == DeviceWorkStatus.Error || senderInfo.IsDviConnected == false)
         {
             monitorFlag.IsSenderDVIValid = DeviceWorkStatus.Error;
             if(!_lctData.FaultMonitorInfos.ContainsKey(ledInfo.Commport))
             {
                 _lctData.FaultMonitorInfos.Add(ledInfo.Commport,new MonitorErrData());
             }
             _lctData.FaultMonitorInfos[ledInfo.Commport].SenderDviExceptionCnt++;
         }
         else if (senderInfo.DeviceStatus == DeviceWorkStatus.OK &&
             monitorFlag.IsSenderDVIValid == DeviceWorkStatus.Unknown)
         {
             monitorFlag.IsSenderDVIValid = DeviceWorkStatus.OK;
         }
     }
     _lctData.ValidInfo.IsSenderDVIValid = true;
 }