示例#1
0
        public void UpdateValue(float value)
        {
            value = value / _scale;

            if (Math.Abs(Value - value) > _minChange)
            {
                Value = value;
                OnPropertyChanged(nameof(Value));
            }

            float newAvg = _movingAverage.NextValue(value);

            if (Math.Abs(MovingAverage - newAvg) > _minChange)
            {
                MovingAverage = newAvg;
                OnPropertyChanged(nameof(MovingAverage));
            }

            if (Error != null)
            {
                Error = null;
                OnPropertyChanged(nameof(Error));
            }
        }