/**********************************************************/ public void addDescriptionPowerItem(string rID, string resourceID, ReportEnumeratedType reportType, ReadingTypeEnumeratedType readingType, string marketContext, int minSamplingPeriod, int maxSamplingPeriod, bool onChange, DurationModifier durationModifier, ePowerItemType powerItemType, string description, string units, SiScaleCodeType siScaleCode, decimal hertz, decimal voltage, bool ac) { PowerItemType powerItem = null; switch (powerItemType) { case ePowerItemType.PowerApparent: powerItem = new PowerApparentType(); break; case ePowerItemType.PowerReactive: powerItem = new PowerReactiveType(); break; case ePowerItemType.PowerReal: powerItem = new PowerRealType(); break; default: powerItem = new PowerApparentType(); break; } powerItem.itemDescription = description; powerItem.itemUnits = units; powerItem.siScaleCode = siScaleCode; powerItem.powerAttributes = new PowerAttributesType(); powerItem.powerAttributes.hertz = hertz; powerItem.powerAttributes.voltage = voltage; addDescription(rID, resourceID, reportType, readingType, marketContext, minSamplingPeriod, maxSamplingPeriod, onChange, durationModifier, powerItem); }
/******************************************************************************/ private PowerItemType generatePower(ePowerItemType powerType, decimal hertz, decimal voltage) { PowerItemType power = null; switch (powerType) { case ePowerItemType.PowerApparent: power = new PowerApparentType(); break; case ePowerItemType.PowerReactive: power = new PowerReactiveType(); break; case ePowerItemType.PowerReal: power = new PowerRealType(); break; } power.itemDescription = ""; power.itemUnits = "W"; power.siScaleCode = SiScaleCodeType.none; power.powerAttributes = new PowerAttributesType(); power.powerAttributes.hertz = hertz; power.powerAttributes.voltage = voltage; return(power); }