Esempio n. 1
0
 private ParameterMonitoringConfig(ParameterMonitoringConfig config)
 {
     ConfigMode            = config.ConfigMode;
     ExtendedConfig        = config.ExtendedConfig == null ? null : config.ExtendedConfig.Select(item => (ParameterExtendedConfig)item.Clone()).ToList();
     MonitoringEnable      = config.MonitoringEnable;
     GeneralExtendedConfig = config.GeneralExtendedConfig;
     Type           = config.Type;
     ReservedConfig = config.ReservedConfig;
 }
Esempio n. 2
0
        public object Clone()
        {
            ParameterMonitoringConfig config = new ParameterMonitoringConfig(this);

            return(config);
        }
 private ParameterMonitoringConfig(ParameterMonitoringConfig config)
 {
     ConfigMode = config.ConfigMode;
     ExtendedConfig = config.ExtendedConfig == null ? null : config.ExtendedConfig.Select(item => (ParameterExtendedConfig)item.Clone()).ToList();
     MonitoringEnable = config.MonitoringEnable;
     GeneralExtendedConfig = config.GeneralExtendedConfig;
     Type = config.Type;
     ReservedConfig = config.ReservedConfig;
 }
 public object Clone()
 {
     ParameterMonitoringConfig config = new ParameterMonitoringConfig(this);
     return config;
 }
Esempio n. 5
0
        private LedMonitoringConfig SetMonitorCfg()
        {
            LedMonitoringConfig ledHWCfg = new LedMonitoringConfig();
            ledHWCfg.SN = _sn;
            ledHWCfg.MonitoringCardConfig = new MonitoringCardConfig();
            ledHWCfg.MonitoringCardConfig.MonitoringEnable = IsMonitorCardConnected;
            if (!IsMonitorCardConnected)
            {
                return ledHWCfg;
            }
            ledHWCfg.MonitoringCardConfig.ParameterConfigTable = new List<ParameterMonitoringConfig>();
            ParameterMonitoringConfig pCfg = new ParameterMonitoringConfig();
            //Humidity
            pCfg.ConfigMode = ParameterConfigMode.NoneExtendedMode;
            pCfg.MonitoringEnable = IsRefreshHumidity;
            pCfg.Type = StateQuantityType.Humidity;
            ledHWCfg.MonitoringCardConfig.ParameterConfigTable.Add(pCfg);
            //smoke
            ParameterMonitoringConfig pCfg1 = new ParameterMonitoringConfig();
            pCfg1.ConfigMode = ParameterConfigMode.NoneExtendedMode;
            pCfg1.Type = StateQuantityType.Smoke;
            pCfg1.MonitoringEnable = IsRefreshSmoke;
            ledHWCfg.MonitoringCardConfig.ParameterConfigTable.Add(pCfg1);
            //cabinet
            ParameterMonitoringConfig pCfg2 = new ParameterMonitoringConfig();
            pCfg2.Type = StateQuantityType.FlatCableStatus;
            pCfg2.ConfigMode = ParameterConfigMode.NoneExtendedMode;
            pCfg2.MonitoringEnable = IsRefreshCabinet;
            ledHWCfg.MonitoringCardConfig.ParameterConfigTable.Add(pCfg2);
            //cabinetdoor
            ParameterMonitoringConfig pCfg3 = new ParameterMonitoringConfig();
            pCfg3.ConfigMode = ParameterConfigMode.NoneExtendedMode;
            pCfg3.Type = StateQuantityType.DoorStatus;
            pCfg3.MonitoringEnable = IsRefreshCabinetDoor;
            ledHWCfg.MonitoringCardConfig.ParameterConfigTable.Add(pCfg3);
            //fan
            ParameterMonitoringConfig pCfg4 = new ParameterMonitoringConfig();
            if (FanInfo != null)
            {
                pCfg4.ReservedConfig = FanInfo.FanSpeed;
                if (FanInfo.IsRefreshFan)
                {
                    if (FanInfo.AllFanOfCabinetSame)
                    {
                        pCfg4.ConfigMode = ParameterConfigMode.GeneralExtendedMode;
                        pCfg4.MonitoringEnable = FanInfo.IsRefreshFan;
                        pCfg4.GeneralExtendedConfig = FanInfo.FanCount;
                    }
                    else if (FanInfo.AllFanOfCabinetDif)
                    {
                        pCfg4.ConfigMode = ParameterConfigMode.AdvanceExtendedMode;
                        pCfg4.ExtendedConfig = new List<ParameterExtendedConfig>();
                        if (FanInfo.AllFanCountDif != null)
                        {
                            foreach (KeyValuePair<string, byte> keyValue in FanInfo.AllFanCountDif)
                            {
                                ParameterExtendedConfig param = new ParameterExtendedConfig();
                                param.ReceiveCardId = keyValue.Key;
                                param.ParameterCount = keyValue.Value;
                                pCfg4.ExtendedConfig.Add(param);
                            }
                        }
                    }
                }
                pCfg4.MonitoringEnable = FanInfo.IsRefreshFan;
                pCfg4.Type = StateQuantityType.FanSpeed;
                ledHWCfg.MonitoringCardConfig.ParameterConfigTable.Add(pCfg4);
            }
            //Power

            ParameterMonitoringConfig pCfg5 = new ParameterMonitoringConfig();
            if (MCPower != null)
            {
                if (MCPower.IsRefreshPower)
                {
                    if (MCPower.AllPowerOfCabinetSame)
                    {
                        pCfg5.ConfigMode = ParameterConfigMode.GeneralExtendedMode;
                        pCfg5.MonitoringEnable = MCPower.IsRefreshPower;
                        pCfg5.GeneralExtendedConfig = MCPower.PowerCount;
                    }
                    else if (MCPower.AllPowerOfCabinetDif)
                    {
                        pCfg5.ConfigMode = ParameterConfigMode.AdvanceExtendedMode;
                        pCfg5.ExtendedConfig = new List<ParameterExtendedConfig>();
                        if (MCPower.AllPowerCountDif != null)
                        {
                            foreach (KeyValuePair<string, byte> keyValue in MCPower.AllPowerCountDif)
                            {
                                ParameterExtendedConfig param = new ParameterExtendedConfig();
                                param.ReceiveCardId = keyValue.Key;
                                param.ParameterCount = keyValue.Value;
                                pCfg5.ExtendedConfig.Add(param);
                            }
                        }
                    }
                }
                pCfg5.MonitoringEnable = MCPower.IsRefreshPower;
                pCfg5.Type = StateQuantityType.Voltage;
                ledHWCfg.MonitoringCardConfig.ParameterConfigTable.Add(pCfg5);
            }
            return ledHWCfg;
        }