Esempio n. 1
0
        private void ProcessMeasurements(IEnumerable <IMeasurement> measurements)
        {
            foreach (IMeasurement measurement in measurements)
            {
                m_latestMeasurements.UpdateMeasurementValue(measurement);

                if (measurement.Timestamp > m_latestTimestamp && measurement.Timestamp.UtcTimeIsValid(LagTime, LeadTime))
                {
                    m_latestTimestamp = measurement.Timestamp;
                }
            }

            if (m_timerOperation.Delay <= 0)
            {
                ProcessLatestMeasurements();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Queues a collection of measurements for processing.
        /// </summary>
        /// <param name="measurements">Measurements to queue for processing.</param>
        public virtual void QueueMeasurementsForProcessing(IEnumerable <IMeasurement> measurements)
        {
            // If enabled, facile adapter will track the absolute latest measurement values.
            if (m_trackLatestMeasurements)
            {
                bool useLocalClockAsRealTime = UseLocalClockAsRealTime;

                foreach (IMeasurement measurement in measurements)
                {
                    m_latestMeasurements.UpdateMeasurementValue(measurement);

                    // Track latest timestamp as real-time, if requested.
                    // This class is not currently going through hassle of determining if
                    // the latest timestamp is reasonable...
                    if (!useLocalClockAsRealTime && measurement.Timestamp > m_realTimeTicks)
                    {
                        m_realTimeTicks = measurement.Timestamp;
                    }
                }
            }
        }