public object Clone() { ParameterExtendedConfig config = new ParameterExtendedConfig(this); return(config); }
private ParameterExtendedConfig(ParameterExtendedConfig config) { ReceiveCardId = config.ReceiveCardId == null ? string.Empty : config.ReceiveCardId.Clone() as string; ParameterCount = config.ParameterCount; }
public object Clone() { ParameterExtendedConfig config = new ParameterExtendedConfig(this); return config; }
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; }