public NumericValueSensorHasValueLowerThanCondition(INumericValueSensor sensor, float value)
        {
            if (sensor == null)
            {
                throw new ArgumentNullException(nameof(sensor));
            }

            WithExpression(() => sensor.GetCurrentNumericValue() < value);
        }
        private void CheckValue(INumericValueSensor sensor)
        {
            var newValue = sensor.GetCurrentNumericValue();

            if (newValue >= Target)
            {
                if (_invoked)
                {
                    return;
                }

                _invoked = true;
                Execute();

                return;
            }

            if (newValue < Target - Delta)
            {
                _invoked = false;
            }
        }
Exemplo n.º 3
0
        private void CheckValue(INumericValueSensor sensor)
        {
            var newValue = sensor.GetCurrentNumericValue();

            if (newValue >= Target)
            {
                if (_invoked)
                {
                    return;
                }

                _invoked = true;
                Execute();

                return;
            }

            if (newValue < Target - Delta)
            {
                _invoked = false;
            }
        }
        public NumericValueSensorHasValueLowerThanCondition(INumericValueSensor sensor, float value)
        {
            if (sensor == null) throw new ArgumentNullException(nameof(sensor));

            WithExpression(() => sensor.GetCurrentNumericValue() < value);
        }