internal static void Initialize() { // For each blade for (int i = 0; i < ConfigLoaded.Population; i++) { // Initialize lock object for performing atomic blade power operations locker[i] = new object(); // Initialize Hard Power On/Off Switches (Blade Enable) BladePower[i] = new BladePowerSwitch(Convert.ToByte(i + 1)); // Get Actual Power State BladePower[i].GetBladePowerState(); // Create Blade Serial Console Metadata objects and initialize token, timestamp and associated member objects using class constructor BladeSerialMetadata.Add(i + 1, new BladeSerialSessionMetadata(i + 1)); } // For each PSU for (int i = 0; i < ConfigLoaded.NumPsus; i++) { psuLock[i] = new object(); } PsuInitialize(); // For each serial port // 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), 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)); } WatchDogTimerInitialize(); // Create fan objects for (int fanId = 0; fanId < (int)ConfigLoaded.NumFans; fanId++) { Fans[fanId] = new Fan((byte)(fanId + 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)); } }
internal static void Initialize() { for (int i = 0; i < ConfigLoaded.Population; i++) { locker[i] = new object(); } for (int i = 0; i < ConfigLoaded.NumPsus; i++) { psuLock[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)); } PsuInitialize(); WatchDogTimerInitialize(); // Create fan objects for (int fanId = 0; fanId < (int)ConfigLoaded.NumFans; 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)); // Get Actual Power State BladePower[bladeId].GetBladePowerState(); } }