/**********************************************************/

        private void captureEnergyInterval(DateTime dateTime)
        {
            float      value = 0;
            PowerValue historicalInterval;

            foreach (PowerValue iv in m_currentInterval)
            {
                value += iv.Value;
            }

            value = value / m_currentInterval.Count;

            value = value / (60 / m_intervalMinutes);

            historicalInterval = new PowerValue(dateTime, value);

            m_intervals.Insert(0, historicalInterval);

            if (m_intervals.Count > m_maxIntervals)
            {
                m_intervals.RemoveAt(m_intervals.Count - 1);
            }

            m_currentInterval.Clear();
        }
Exemple #2
0
        /**********************************************************/

        public override void addPayloadToReport(ReportWrapper reportWrapper, IntervalValue intervalValue)
        {
            PowerValue pv = (PowerValue)intervalValue;

            // TODO: point in time values should not include a duration, but the test set will fail
            // certain test cases duration is not included.  once the test set is fixed, change to not inlcude
            // the duration
            reportWrapper.addIntervalReportPayload(pv.DateTime.ToUniversalTime(), RID, pv.Confidence, pv.Accuracy, pv.Value, DataQuality.qualityGoodNonSpecific, 10, DurationModifier.SECONDS);
            // reportWrapper.addIntervalReportPayload(pv.DateTime.ToUniversalTime(), RID, pv.Confidence, pv.Accuracy, pv.Value, DataQuality.qualityGoodNonSpecific);
        }
        /**********************************************************/

        public void addIntervalValue(DateTime dateTime, float value)
        {
            PowerValue iv = new PowerValue(dateTime, value);

            m_currentInterval.Insert(0, iv);

            if (dateTime.Minute % m_intervalMinutes == 0 && dateTime.Second == 0)
            {
                captureEnergyInterval(dateTime);
            }
        }
Exemple #4
0
        /**********************************************************/

        /*public List<PowerValue> Intervals
         * {
         *  get { return m_intervals; }
         * }*/

        /**********************************************************/

        public void addIntervalValue(DateTime dateTime, float value)
        {
            PowerValue iv = new PowerValue(dateTime, value);

            m_intervals.Insert(0, iv);

            if (m_intervals.Count > m_maxIntervals)
            {
                m_intervals.RemoveAt(m_intervals.Count - 1);
            }
        }
        /**********************************************************/

        public void addEnergyInterval(DateTime dateTime, float value)
        {
            PowerValue historicalInterval;

            historicalInterval = new PowerValue(dateTime, value);

            m_intervals.Insert(0, historicalInterval);

            if (m_intervals.Count > m_maxIntervals)
            {
                m_intervals.RemoveAt(m_intervals.Count - 1);
            }
        }
        /**********************************************************/

        public override void addPayloadToReport(ReportWrapper reportWrapper, IntervalValue intervalValue)
        {
            PowerValue pv = (PowerValue)intervalValue;

            reportWrapper.addIntervalReportPayload(pv.DateTime.ToUniversalTime(), RID, pv.Confidence, pv.Accuracy, pv.Value, DataQuality.qualityGoodNonSpecific, m_intervalMinutes, DurationModifier.MINUTES);
        }