/// <summary> /// Merge the data from the given source to the destination structure /// </summary> /// <param name="lpDestination" type="Itron.Metering.DeviceDataTypes.LoadProfilePulseData"> /// </param> /// <param name="lpSource" type="Itron.Metering.DeviceDataTypes.LoadProfileData"> /// </param> /// <param name="dtCurrentInterval" type="System.DateTime"> /// </param> /// <remarks> /// Revision History /// MM/DD/YY Who Version Issue# Description /// -------- --- ------- ------ --------------------------------------------- /// 12/15/08 mah 9.50.26 CQ124360 Incremented the interval end time to advance /// to the next interval /// /// </remarks> private void MergeContributorData(LoadProfilePulseData lpDestination, LoadProfileData lpSource, ref DateTime dtCurrentInterval) { int nIntervalIndex = lpSource.GetIntervalIndexAt(dtCurrentInterval); while (nIntervalIndex < lpSource.NumberIntervals) { // We found useful data - now add all that we can to the result data. // We don't have to worry about the end date since the whole purpose of // aggregation is to join as much data as possible LPInterval nextInterval = lpSource.Intervals[nIntervalIndex]; lpDestination.AddInterval( nextInterval.Data, nextInterval.ChannelStatuses, nextInterval.IntervalStatus, nextInterval.Time, DisplayScaleOptions.UNITS); dtCurrentInterval = lpDestination.EndTime; nIntervalIndex++; } // Advance the clock to the next interval dtCurrentInterval = dtCurrentInterval.AddMinutes((double)IntervalLength); }
/// <summary> /// /// </summary> /// <param name="lpResult" type="Itron.Metering.DeviceDataTypes.LoadProfilePulseData"> /// </param> /// <param name="dtCurrentInterval" type="System.DateTime"> /// </param> /// <param name="dtGapEndTime" type="System.DateTime"> /// </param> /// <remarks> /// Revision History /// MM/DD/YY Who Version Issue# Description /// -------- --- ------- ------ --------------------------------------------- /// 08/26/08 mah 9.50.00 Created /// /// </remarks> private void FillDataGap(LoadProfilePulseData lpResult, ref DateTime dtCurrentInterval, DateTime dtGapEndTime) { double[] dblIntervalData = new double[NumProfileChannels]; String[] strChannelStatus = new String[NumProfileChannels]; String strIntervalStatus = "K"; // Every interval in the gap will have a value of 0 with an empty channel // status for (int nChannelIndex = 0; nChannelIndex < NumProfileChannels; nChannelIndex++) { dblIntervalData[nChannelIndex] = 0.0; strChannelStatus[nChannelIndex] = ""; } // Now simply walk through the time period defined by the gap and adding // one interval at a time while (dtCurrentInterval < dtGapEndTime) { lpResult.AddInterval(dblIntervalData, strChannelStatus, strIntervalStatus, dtCurrentInterval, DisplayScaleOptions.UNITS); // Advance the clock one interval at a time. dtCurrentInterval = dtCurrentInterval.AddMinutes((double)IntervalLength); } }