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;
            }
        }
Exemple #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);
        }