Beispiel #1
0
        public static System.Collections.Generic.List <VarBinding> GetThresholdsRequestEatonPDU_M2(DevModelConfig modelcfg, DevRealConfig realcfg)
        {
            int num       = 1;
            int portNum   = realcfg.portNum;
            int bankNum   = realcfg.bankNum;
            int sensorNum = realcfg.sensorNum;

            System.Collections.Generic.List <VarBinding> list = new System.Collections.Generic.List <VarBinding>();
            LeafVarBinding leafVarBinding = new LeafVarBinding();

            leafVarBinding.Add(EatonPDUBaseMib_M2.Mac);
            leafVarBinding.Add(EatonPDUBaseMib_M2.FWversion);
            leafVarBinding.Add(EatonPDUBaseMib_M2.DeviceName);
            for (int i = 1; i <= num; i++)
            {
                EatonInputCurrentMib_M2 eatonInputCurrentMib_M = new EatonInputCurrentMib_M2(i);
                leafVarBinding.Add(eatonInputCurrentMib_M.MaxCurrentMT);
                EatonInputVoltageMib_M2 eatonInputVoltageMib_M = new EatonInputVoltageMib_M2(i);
                leafVarBinding.Add(eatonInputVoltageMib_M.MinVoltageMt);
                leafVarBinding.Add(eatonInputVoltageMib_M.MaxVoltageMT);
            }
            for (int j = 1; j <= sensorNum; j++)
            {
                EatonSensorTemperatureMib_M2 eatonSensorTemperatureMib_M = new EatonSensorTemperatureMib_M2(j);
                leafVarBinding.Add(eatonSensorTemperatureMib_M.MinTemperatureMt);
                leafVarBinding.Add(eatonSensorTemperatureMib_M.MaxTemperatureMT);
                EatonSensorHumidityMib_M2 eatonSensorHumidityMib_M = new EatonSensorHumidityMib_M2(j);
                leafVarBinding.Add(eatonSensorHumidityMib_M.MinHumidityMt);
                leafVarBinding.Add(eatonSensorHumidityMib_M.MaxHumidityMT);
            }
            list.Add(leafVarBinding);
            LeafVarBinding leafVarBinding2 = new LeafVarBinding();

            for (int k = 1; k <= bankNum; k++)
            {
                EatonGroupEntryMib_M2 eatonGroupEntryMib_M = new EatonGroupEntryMib_M2(k);
                leafVarBinding2.Add(eatonGroupEntryMib_M.GroupName);
                EatonGroupCurrentMib_M2 eatonGroupCurrentMib_M = new EatonGroupCurrentMib_M2(k);
                leafVarBinding2.Add(eatonGroupCurrentMib_M.MaxCurrentMT);
            }
            if (bankNum > 0)
            {
                list.Add(leafVarBinding2);
            }
            if (portNum > 0)
            {
                int           nodes         = 4;
                LeafVBBuilder leafVBBuilder = new LeafVBBuilder(nodes, portNum);
                System.Collections.Generic.List <LeafVarBinding> list2 = new System.Collections.Generic.List <LeafVarBinding>();
                leafVBBuilder.BuildVbByIndex(list2, delegate(int index, LeafVarBinding leafVb)
                {
                    EatonOutletEntryMib_M2 eatonOutletEntryMib_M = new EatonOutletEntryMib_M2(index);
                    leafVb.Add(eatonOutletEntryMib_M.OutletName);
                    EatonOutletVoltageMib_M2 eatonOutletVoltageMib_M = new EatonOutletVoltageMib_M2(index);
                    leafVb.Add(eatonOutletVoltageMib_M.MinVoltageMt);
                    leafVb.Add(eatonOutletVoltageMib_M.MaxVoltageMT);
                    EatonOutletCurrentMib_M2 eatonOutletCurrentMib_M = new EatonOutletCurrentMib_M2(index);
                    leafVb.Add(eatonOutletCurrentMib_M.MaxCurrentMT);
                });
                foreach (LeafVarBinding current in list2)
                {
                    list.Add(current);
                }
            }
            return(list);
        }
Beispiel #2
0
        public static System.Collections.Generic.List <LeafVarBinding> GetValuesRequestEatonPDU_M2(DevModelConfig modelcfg, DevRealConfig realcfg)
        {
            int num        = 1;
            int portNum    = realcfg.portNum;
            int bankNum    = realcfg.bankNum;
            int sensorNum  = realcfg.sensorNum;
            int contactNum = realcfg.contactNum;

            System.Collections.Generic.List <LeafVarBinding> list = new System.Collections.Generic.List <LeafVarBinding>();
            LeafVarBinding leafVarBinding = new LeafVarBinding();

            leafVarBinding.Add(EatonPDUBaseMib_M2.Mac);
            for (int l = 1; l <= num; l++)
            {
                EatonInputCurrentMib_M2 eatonInputCurrentMib_M = new EatonInputCurrentMib_M2(l);
                leafVarBinding.Add(eatonInputCurrentMib_M.CurrentValue);
                EatonInputVoltageMib_M2 eatonInputVoltageMib_M = new EatonInputVoltageMib_M2(l);
                leafVarBinding.Add(eatonInputVoltageMib_M.VoltageValue);
                EatonInputPowerMib_M2 eatonInputPowerMib_M = new EatonInputPowerMib_M2(1);
                leafVarBinding.Add(eatonInputPowerMib_M.PowerValue);
                leafVarBinding.Add(eatonInputPowerMib_M.PowerValue_VA);
            }
            for (int j = 1; j <= contactNum; j++)
            {
                EatonSensorContactMib_M2 eatonSensorContactMib_M = new EatonSensorContactMib_M2(j);
                leafVarBinding.Add(eatonSensorContactMib_M.ContactStatus);
            }
            for (int k = 1; k <= sensorNum; k++)
            {
                EatonSensorTemperatureMib_M2 eatonSensorTemperatureMib_M = new EatonSensorTemperatureMib_M2(k);
                leafVarBinding.Add(eatonSensorTemperatureMib_M.TemperatureValue);
                EatonSensorHumidityMib_M2 eatonSensorHumidityMib_M = new EatonSensorHumidityMib_M2(k);
                leafVarBinding.Add(eatonSensorHumidityMib_M.HumidityValue);
            }
            list.Add(leafVarBinding);
            if (portNum > 0)
            {
                LeafVBBuilder leafVBBuilder = new LeafVBBuilder(3, portNum);
                leafVBBuilder.BuildVbByIndex(list, delegate(int i, LeafVarBinding leafVb)
                {
                    EatonOutletVoltageMib_M2 eatonOutletVoltageMib_M = new EatonOutletVoltageMib_M2(i);
                    leafVb.Add(eatonOutletVoltageMib_M.VoltageValue);
                    EatonOutletCurrentMib_M2 eatonOutletCurrentMib_M = new EatonOutletCurrentMib_M2(i);
                    leafVb.Add(eatonOutletCurrentMib_M.CurrentValue);
                    EatonOutletPowerMib_M2 eatonOutletPowerMib_M = new EatonOutletPowerMib_M2(i);
                    leafVb.Add(eatonOutletPowerMib_M.PowerValue);
                });
            }
            if (bankNum > 0)
            {
                LeafVBBuilder leafVBBuilder2 = new LeafVBBuilder(2, bankNum);
                leafVBBuilder2.BuildVbByIndex(list, delegate(int i, LeafVarBinding leafVb)
                {
                    EatonGroupCurrentMib_M2 eatonGroupCurrentMib_M = new EatonGroupCurrentMib_M2(i);
                    leafVb.Add(eatonGroupCurrentMib_M.CurrentValue);
                    EatonGroupPowerMib_M2 eatonGroupPowerMib_M = new EatonGroupPowerMib_M2(i);
                    leafVb.Add(eatonGroupPowerMib_M.PowerValue);
                });
            }
            return(list);
        }