Exemple #1
0
        /**********************************************************/

        public void addDescription(string rID, string resourceID, ReportEnumeratedType reportType, ReadingTypeEnumeratedType readingType,
                                   string marketContext, int minSamplingPeriod, int maxSamplingPeriod, bool onChange, DurationModifier durationModifier, ItemBaseType measuredValue = null)
        {
            oadrReportDescriptionType reportDescription = new oadrReportDescriptionType();

            reportDescription.rID = rID;
            reportDescription.reportDataSource               = new EiTargetType();
            reportDescription.reportDataSource.resourceID    = new string[1];
            reportDescription.reportDataSource.resourceID[0] = resourceID;

            reportDescription.reportType    = reportType;
            reportDescription.readingType   = readingType;
            reportDescription.marketContext = marketContext;

            reportDescription.oadrSamplingRate = new oadrSamplingRateType();
            reportDescription.oadrSamplingRate.oadrMaxPeriod = "PT" + maxSamplingPeriod.ToString() + durationModifier.Value;
            reportDescription.oadrSamplingRate.oadrMinPeriod = "PT" + minSamplingPeriod.ToString() + durationModifier.Value;

            reportDescription.oadrSamplingRate.oadrOnChange = onChange;

            reportDescription.itemBase = measuredValue;

            m_reportDescriptions.Add(rID, reportDescription);
        }
Exemple #2
0
        /**********************************************************/

        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);
        }
Exemple #3
0
        /**********************************************************/

        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);
        }
Exemple #4
0
        /**********************************************************/

        public void addDescription(string reportSpecifierID, string rID, string resourceID, ReportEnumeratedType reportType, ReadingTypeEnumeratedType readingType,
                                   string marketContext, int minSamplingPeriod, int maxSamplingPeriod, bool onChange, DurationModifier durationModifier, ItemBaseType measuredValue = null)
        {
            oadrReportDescriptionType reportDescription = new oadrReportDescriptionType();

            reportDescription.rID = rID;
            reportDescription.reportDataSource               = new EiTargetType();
            reportDescription.reportDataSource.resourceID    = new string[1];
            reportDescription.reportDataSource.resourceID[0] = resourceID;

            reportDescription.reportType    = reportType;
            reportDescription.readingType   = readingType;
            reportDescription.marketContext = marketContext;

            reportDescription.oadrSamplingRate = new oadrSamplingRateType();
            reportDescription.oadrSamplingRate.oadrMaxPeriod = "PT" + maxSamplingPeriod.ToString() + durationModifier.Value;
            reportDescription.oadrSamplingRate.oadrMinPeriod = "PT" + minSamplingPeriod.ToString() + durationModifier.Value;

            reportDescription.oadrSamplingRate.oadrOnChange = onChange;

            Dictionary <string, oadrReportDescriptionType> reportDescriptions = (_reportDescriptions.ContainsKey(reportSpecifierID) ? _reportDescriptions[reportSpecifierID] : null);

            if (reportDescriptions == null)
            {
                reportDescriptions = new Dictionary <string, oadrReportDescriptionType>();
                _reportDescriptions[reportSpecifierID] = reportDescriptions;
            }

            reportDescription.itemBase = measuredValue;

            reportDescriptions[rID] = reportDescription;
        }