/**********************************************************/ public void addDescriptionEnergyItem(string rID, string resourceID, ReportEnumeratedType reportType, ReadingTypeEnumeratedType readingType, string marketContext, int minSamplingPeriod, int maxSamplingPeriod, bool onChange, DurationModifier durationModifier, eEnergyItemType energyItemType, string description, string units, SiScaleCodeType siScaleCode) { EnergyItemType energyItem = null; switch (energyItemType) { case eEnergyItemType.EnergyApparent: energyItem = new EnergyApparentType(); break; case eEnergyItemType.EnergyReactive: energyItem = new EnergyReactiveType(); break; case eEnergyItemType.EnergyReal: energyItem = new EnergyRealType(); break; default: energyItem = new EnergyApparentType(); break; } energyItem.itemDescription = description; energyItem.itemUnits = units; energyItem.siScaleCode = siScaleCode; addDescription(rID, resourceID, reportType, readingType, marketContext, minSamplingPeriod, maxSamplingPeriod, onChange, durationModifier, energyItem); }
public void generateSignalWEnergy() { eiEventSignalType signal = new eiEventSignalType(); EnergyApparentType energy = new EnergyApparentType(); energy.itemDescription = "Apparent Energy"; energy.itemUnits = "KWh"; energy.siScaleCode = SiScaleCodeType.none; signal.itemBase = energy; string xml = SerializeOadrObject.serializeOjbect(signal, signal.GetType()); Console.Out.WriteLine(xml); }
public void serializeItemBaseType() { EnergyApparentType energyApparent = new EnergyApparentType(); energyApparent.itemDescription = "description"; energyApparent.itemUnits = "units"; energyApparent.siScaleCode = SiScaleCodeType.n; string output = SerializeOadrObject.serializeOjbect(energyApparent, typeof(EnergyApparentType)); oadrReportDescriptionType reportDescription = new oadrReportDescriptionType(); reportDescription.itemBase = energyApparent; output = SerializeOadrObject.serializeOjbect(reportDescription, typeof(oadrReportDescriptionType)); // energy real EnergyRealType energyReal = new EnergyRealType(); energyReal.itemDescription = "description"; energyReal.itemUnits = "units"; energyReal.siScaleCode = SiScaleCodeType.n; reportDescription.itemBase = energyReal; output = SerializeOadrObject.serializeOjbect(reportDescription, typeof(oadrReportDescriptionType)); // power real PowerRealType powerReal = new PowerRealType(); powerReal.itemDescription = "description"; powerReal.itemUnits = "units"; powerReal.siScaleCode = SiScaleCodeType.n; powerReal.powerAttributes = new PowerAttributesType(); powerReal.powerAttributes.ac = true; powerReal.powerAttributes.hertz = 60; powerReal.powerAttributes.voltage = 110; reportDescription.itemBase = powerReal; output = SerializeOadrObject.serializeOjbect(reportDescription, typeof(oadrReportDescriptionType)); Assert.IsTrue(output.Contains("powerReal")); }
/******************************************************************************/ private EnergyItemType generateEnergy(eEnergyItemType energyType) { EnergyItemType energy = null; switch (energyType) { case eEnergyItemType.EnergyApparent: energy = new EnergyApparentType(); break; case eEnergyItemType.EnergyReactive: energy = new EnergyReactiveType(); break; case eEnergyItemType.EnergyReal: energy = new EnergyRealType(); break; } return(energy); }
public void energyApparent() { EnergyApparentType energy = new EnergyApparentType(); testEnergyItemType(energy); }