Beispiel #1
0
        /// <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 void PsuInitialize()
        {
            for (uint psuIndex = 0; psuIndex < MaxPsuCount; psuIndex++)
            {
                PsuModelNumberPacket modelNumberPacket = new PsuModelNumberPacket();
                modelNumberPacket = ChassisState.Psu[psuIndex].GetPsuModel();
                string   psuModelNumber = modelNumberPacket.ModelNumber;
                PsuModel model          = ChassisState.ConvertPsuModelNumberToPsuModel(psuModelNumber);

                switch (model)
                {
                case PsuModel.Delta:
                    ChassisState.Psu[psuIndex] = new DeltaPsu((byte)(psuIndex + 1));
                    Tracer.WriteInfo("Delta Psu identified at slot-{0}", psuIndex + 1);
                    break;

                case PsuModel.Emerson:
                    ChassisState.Psu[psuIndex] = new EmersonPsu((byte)(psuIndex + 1));
                    Tracer.WriteInfo("Emerson Psu identified at slot-{0}", psuIndex + 1);
                    break;

                default:
                    ChassisState.Psu[psuIndex] = new PsuBase((byte)(psuIndex + 1));
                    Tracer.WriteInfo("Unidentified PSU at slot-{0}", psuIndex + 1);
                    break;
                }
            }
        }