Beispiel #1
0
        private void InitialHwConfg(LedMonitoringConfig ledMonitorCfg)
        {
            if (ledMonitorCfg == null || ledMonitorCfg.MonitoringCardConfig == null || ledMonitorCfg.SN == null)
            {
                return;
            }
            IsMonitorCardConnected = ledMonitorCfg.MonitoringCardConfig.MonitoringEnable;
            if (ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable == null || ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Count == 0)
            {
                return;
            }

            ParameterMonitoringConfig cfg = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.FlatCableStatus));

            if (cfg != null)
            {
                IsRefreshCabinet = cfg.MonitoringEnable;
            }
            cfg = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.DoorStatus));
            if (cfg != null)
            {
                IsRefreshCabinetDoor = cfg.MonitoringEnable;
            }
            cfg = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.Humidity));
            if (cfg != null)
            {
                IsRefreshHumidity = cfg.MonitoringEnable;
            }
            cfg = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.Smoke));
            if (cfg != null)
            {
                IsRefreshSmoke = cfg.MonitoringEnable;
            }
            cfg     = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.FanSpeed));
            FanInfo = new UC_HWConfig_CabinetFanInfo_VM();
            if (cfg != null)
            {
                FanInfo.IsRefreshFan = cfg.MonitoringEnable;
                if (FanInfo.IsRefreshFan)
                {
                    FanInfo.FanSpeed = cfg.ReservedConfig;
                    if (_sn == MonitorAllConfig.Instance().ALLScreenName)
                    {
                        cfg.ConfigMode = ParameterConfigMode.GeneralExtendedMode;
                    }
                    if (cfg.ConfigMode == ParameterConfigMode.GeneralExtendedMode)
                    {
                        FanInfo.AllFanOfCabinetSame = true;
                        FanInfo.AllFanOfCabinetDif  = false;
                        FanInfo.FanCount            = cfg.GeneralExtendedConfig;
                    }
                    else if (cfg.ConfigMode == ParameterConfigMode.AdvanceExtendedMode)
                    {
                        FanInfo.AllFanOfCabinetSame = false;
                        FanInfo.AllFanOfCabinetDif  = true;
                        FanInfo.AllFanCountDif      = new SerializableDictionary <string, byte>();
                        foreach (ParameterExtendedConfig param in cfg.ExtendedConfig)
                        {
                            FanInfo.AllFanCountDif.Add(param.ReceiveCardId, (byte)param.ParameterCount);
                        }
                    }
                }
            }
            cfg     = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.Voltage));
            MCPower = new UC_HWConfig_MonitorCardPower_VM();
            if (cfg != null)
            {
                MCPower.IsRefreshPower = cfg.MonitoringEnable;
                if (MCPower.IsRefreshPower)
                {
                    if (_sn == MonitorAllConfig.Instance().ALLScreenName)
                    {
                        cfg.ConfigMode = ParameterConfigMode.GeneralExtendedMode;
                    }
                    if (cfg.ConfigMode == ParameterConfigMode.GeneralExtendedMode)
                    {
                        MCPower.AllPowerOfCabinetSame = true;
                        MCPower.AllPowerOfCabinetDif  = false;
                        MCPower.PowerCount            = cfg.GeneralExtendedConfig;
                    }
                    else if (cfg.ConfigMode == ParameterConfigMode.AdvanceExtendedMode)
                    {
                        MCPower.AllPowerOfCabinetSame = false;
                        MCPower.AllPowerOfCabinetDif  = true;
                        MCPower.AllPowerCountDif      = new SerializableDictionary <string, byte>();
                        foreach (ParameterExtendedConfig param in cfg.ExtendedConfig)
                        {
                            MCPower.AllPowerCountDif.Add(param.ReceiveCardId, (byte)param.ParameterCount);
                        }
                    }
                }
            }
        }
        private void InitialHwConfg(LedMonitoringConfig ledMonitorCfg)
        {
            if (ledMonitorCfg == null || ledMonitorCfg.MonitoringCardConfig == null || ledMonitorCfg.SN == null)
            {
                return;
            }
            IsMonitorCardConnected = ledMonitorCfg.MonitoringCardConfig.MonitoringEnable;
            if (ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable == null || ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Count == 0)
            {
                return;
            }

            ParameterMonitoringConfig cfg = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.FlatCableStatus));
            if (cfg != null)
            {
                IsRefreshCabinet = cfg.MonitoringEnable;
            }
            cfg = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.DoorStatus));
            if (cfg != null)
            {
                IsRefreshCabinetDoor = cfg.MonitoringEnable;
            }
            cfg = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.Humidity));
            if (cfg != null)
            {
                IsRefreshHumidity = cfg.MonitoringEnable;
            }
            cfg = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.Smoke));
            if (cfg != null)
            {
                IsRefreshSmoke = cfg.MonitoringEnable;
            }
            cfg = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.FanSpeed));
            FanInfo = new UC_HWConfig_CabinetFanInfo_VM();
            if (cfg != null)
            {
                FanInfo.IsRefreshFan = cfg.MonitoringEnable;
                if (FanInfo.IsRefreshFan)
                {
                    FanInfo.FanSpeed = cfg.ReservedConfig;
                    if (_sn == MonitorAllConfig.Instance().ALLScreenName)
                    {
                        cfg.ConfigMode = ParameterConfigMode.GeneralExtendedMode;
                    }
                    if (cfg.ConfigMode == ParameterConfigMode.GeneralExtendedMode)
                    {
                        FanInfo.AllFanOfCabinetSame = true;
                        FanInfo.AllFanOfCabinetDif = false;
                        FanInfo.FanCount = cfg.GeneralExtendedConfig;
                    }
                    else if (cfg.ConfigMode == ParameterConfigMode.AdvanceExtendedMode)
                    {
                        FanInfo.AllFanOfCabinetSame = false;
                        FanInfo.AllFanOfCabinetDif = true;
                        FanInfo.AllFanCountDif = new SerializableDictionary<string, byte>();
                        foreach (ParameterExtendedConfig param in cfg.ExtendedConfig)
                        {
                            FanInfo.AllFanCountDif.Add(param.ReceiveCardId, (byte)param.ParameterCount);
                        }
                    }
                }
            }
            cfg = ledMonitorCfg.MonitoringCardConfig.ParameterConfigTable.Find(a => a.Type.Equals(StateQuantityType.Voltage));
            MCPower = new UC_HWConfig_MonitorCardPower_VM();
            if (cfg != null)
            {
                MCPower.IsRefreshPower = cfg.MonitoringEnable;
                if (MCPower.IsRefreshPower)
                {
                    if (_sn == MonitorAllConfig.Instance().ALLScreenName)
                    {
                        cfg.ConfigMode = ParameterConfigMode.GeneralExtendedMode;
                    }
                    if (cfg.ConfigMode == ParameterConfigMode.GeneralExtendedMode)
                    {
                        MCPower.AllPowerOfCabinetSame = true;
                        MCPower.AllPowerOfCabinetDif = false;
                        MCPower.PowerCount = cfg.GeneralExtendedConfig;
                    }
                    else if (cfg.ConfigMode == ParameterConfigMode.AdvanceExtendedMode)
                    {
                        MCPower.AllPowerOfCabinetSame = false;
                        MCPower.AllPowerOfCabinetDif = true;
                        MCPower.AllPowerCountDif = new SerializableDictionary<string, byte>();
                        foreach (ParameterExtendedConfig param in cfg.ExtendedConfig)
                        {
                            MCPower.AllPowerCountDif.Add(param.ReceiveCardId, (byte)param.ParameterCount);
                        }
                    }
                }
            }
        }