Ejemplo n.º 1
0
        public void ResetDue <T>(T item)
            where T : ISensorScanRateItem
        {
            if (!LastMeasurement.ContainsKey(item))
            {
                throw new InvalidOperationException("Sensor configuration item has not been registered earlier");
            }

            LastMeasurement[item].Restart();
        }
Ejemplo n.º 2
0
        public bool IsDue <T>(T item)
            where T : ISensorScanRateItem
        {
            if (!LastMeasurement.ContainsKey(item))
            {
                throw new InvalidOperationException("Sensor configuration item has not been registered earlier");
            }

            var stopwatch = LastMeasurement[item];

            return(stopwatch.Elapsed >= item.ScanRate);
        }