/// <summary> /// Identifies the PSU vendor at each psu slot using the modelnumber API of the PsuBase class /// (Assumes all PSU vendors implement the MFR_MODEL Pmbus command) /// Based on the model number, we bind the Psu class object to the corresponding child (vendor) class object /// </summary> private static void PsuInitialize() { for (uint psuIndex = 0; psuIndex < ConfigLoaded.NumPsus; psuIndex++) { // Initially create instance of the base class // Later.. based on the psu model number, we create the appropriate psu class object Psu[psuIndex] = new PsuBase((byte)(psuIndex + 1)); PsuModelNumberPacket modelNumberPacket = new PsuModelNumberPacket(); modelNumberPacket = Psu[psuIndex].GetPsuModel(); string psuModelNumber = modelNumberPacket.ModelNumber; PsuModel model = ConvertPsuModelNumberToPsuModel(psuModelNumber); switch (model) { case PsuModel.Delta: Psu[psuIndex] = new DeltaPsu((byte)(psuIndex + 1)); Tracer.WriteInfo("Delta PSU identified at slot-{0}, Model Number: {1}", psuIndex + 1, psuModelNumber); break; case PsuModel.EmersonWithLes: Psu[psuIndex] = new EmersonPsu((byte)(psuIndex + 1), true); Tracer.WriteInfo("Emerson with LES PSU identified at slot-{0}, Model Number: {1}", psuIndex + 1, psuModelNumber); break; case PsuModel.EmersonNonLes: Psu[psuIndex] = new EmersonPsu((byte)(psuIndex + 1), false); Tracer.WriteInfo("Emerson non-LES PSU identified at slot-{0}, Model Number: {1}", psuIndex + 1, psuModelNumber); break; default: // Unknown PSUs if (ConfigLoaded.ForceEmersonPsu) { // Force to Emerson PSU without LES to enable FW update methods in the EmersonPsu class to be called. // This is useful when a previous FW update did not complete successfully. // The PSU stays in bootloader mode and does not recognize the // MFR_MODEL command and will return all 0xFFs for this command. Psu[psuIndex] = new EmersonPsu((byte)(psuIndex + 1), false); Tracer.WriteWarning("Forcing PSU instantiation to Emerson non-LES PSU at slot-{0}, Model Number: {1}", psuIndex + 1, psuModelNumber); } else { Psu[psuIndex] = new PsuBase((byte)(psuIndex + 1)); Tracer.WriteInfo("Unidentified PSU at slot-{0}, Model Number: {1}. Default to base PSU class.", psuIndex + 1, psuModelNumber); } break; } // Enable/disable Battery Extended Operation Mode Psu[psuIndex].SetBatteryExtendedOperationMode(ConfigLoaded.DatasafeOperationsEnabled ? true: false); } }
internal static void Initialize() { for (int i = 0; i < ConfigLoaded.Population; i++) { _lock[i] = new object(); } // Create Serial Console Port Metadata objects and initialize the sessiontoken and timestamp using the class constructor SerialConsolePortsMetadata = new SerialConsoleMetadata[(uint)ConfigLoaded.MaxSerialConsolePorts]; for (int numPorts = 0; numPorts < (int)ConfigLoaded.MaxSerialConsolePorts; numPorts++) { SerialConsolePortsMetadata[numPorts] = new SerialConsoleMetadata(ChassisManagerUtil.GetSerialConsolePortIdFromIndex(numPorts), ConfigLoaded.InactiveSerialPortSessionToken, DateTime.Now); } // Create AC Power Socket objects AcPowerSockets = new AcSocket[(uint)ConfigLoaded.NumPowerSwitches]; for (int numSockets = 0; numSockets < (int)ConfigLoaded.NumPowerSwitches; numSockets++) { AcPowerSockets[numSockets] = new AcSocket((byte)(numSockets + 1)); } // Create PSU objects for (int psuIndex = 0; psuIndex < (int)ConfigLoaded.NumPsus; psuIndex++) { // Initially create instance of the base class // Later.. based on the psu model number, we create the appropriate psu class object Psu[psuIndex] = new PsuBase((byte)(psuIndex + 1)); } // Create fan objects for (int fanId = 0; fanId < (int)ConfigLoaded.NumPsus; fanId++) { Fans[fanId] = new Fan((byte)(fanId + 1)); } // Initialize Hard Power On/Off Switches (Blade Enable) for (int bladeId = 0; bladeId < BladePower.Length; bladeId++) { BladePower[bladeId] = new BladePowerSwitch(Convert.ToByte(bladeId + 1)); } }
internal static void Initialize() { for (int i = 0; i < ConfigLoaded.Population; i++) { _lock[i] = new object(); } // Create Serial Console Port Metadata objects and initialize the sessiontoken and timestamp using the class constructor SerialConsolePortsMetadata = new SerialConsoleMetadata[(uint)ConfigLoaded.MaxSerialConsolePorts]; for (int numPorts = 0; numPorts < (int)ConfigLoaded.MaxSerialConsolePorts; numPorts++) { SerialConsolePortsMetadata[numPorts] = new SerialConsoleMetadata(ChassisManagerUtil.GetSerialConsolePortIdFromIndex(numPorts), ConfigLoaded.InactiveSerialPortSessionToken, DateTime.Now); } // Create AC Power Socket objects AcPowerSockets = new AcSocket[(uint)ConfigLoaded.NumPowerSwitches]; for (int numSockets = 0; numSockets < (int)ConfigLoaded.NumPowerSwitches; numSockets++) { AcPowerSockets[numSockets] = new AcSocket((byte)(numSockets + 1)); } // Create PSU objects for (int psuIndex = 0; psuIndex < (int)ConfigLoaded.NumPsus; psuIndex++) { // Initially create instance of the base class // Later.. based on the psu model number, we create the appropriate psu class object Psu[psuIndex] = new PsuBase((byte)(psuIndex + 1)); } // Create fan objects for (int fanId = 0; fanId < (int)ConfigLoaded.NumPsus; fanId++) { Fans[fanId] = new Fan((byte)(fanId + 1)); } // Initialize Hard Power On/Off Switches (Blade Enable) for (int bladeId = 0; bladeId < BladePower.Length; bladeId++) { BladePower[bladeId] = new BladePowerSwitch(Convert.ToByte(bladeId + 1)); } }
/// <summary> /// Identifies the PSU vendor at each psu slot using the modelnumber API of the PsuBase class /// (Assumes all PSU vendors implement the MFR_MODEL Pmbus command) /// Based on the model number, we bind the Psu class object to the corresponding child (vendor) class object /// </summary> private static void PsuInitialize() { for (uint psuIndex = 0; psuIndex < ConfigLoaded.NumPsus; psuIndex++) { // Initially create instance of the base class // Later.. based on the psu model number, we create the appropriate psu class object Psu[psuIndex] = new PsuBase((byte)(psuIndex + 1)); PsuModelNumberPacket modelNumberPacket = new PsuModelNumberPacket(); modelNumberPacket = Psu[psuIndex].GetPsuModel(); string psuModelNumber = modelNumberPacket.ModelNumber; PsuModel model = ConvertPsuModelNumberToPsuModel(psuModelNumber); switch (model) { case PsuModel.Delta: Psu[psuIndex] = new DeltaPsu((byte)(psuIndex + 1)); Tracer.WriteInfo("Delta Psu identified at slot-{0}, Model Number: {1}", psuIndex + 1, psuModelNumber); break; case PsuModel.Emerson: Psu[psuIndex] = new EmersonPsu((byte)(psuIndex + 1)); Tracer.WriteInfo("Emerson Psu identified at slot-{0}, Model Number: {1}", psuIndex + 1, psuModelNumber); break; default: // Default to Emerson PSU to enable FW update methods in the EmersonPsu class to be called. // This is useful when previous FW update did not complete successfully and the PSU // is not returning valid MFR_MODEL Psu[psuIndex] = new EmersonPsu((byte)(psuIndex + 1)); Tracer.WriteInfo("Unidentified PSU at slot-{0}, Model Number: {1}. Default to Emerson PSU.", psuIndex + 1, psuModelNumber); break; } } }