public void Set(T value) { if (!value.Equals(cachedValue)) { cachedValue = value; backing.Set(value); } }
private async Task RunAsync() { while (true) { await valueUpdatedLatch.WaitAsync(); inner.Set(value); } }
private async Task RunAsync() { while (true) { await updateLatch.WaitAsync(); while (Math.Abs(actualValue - desiredValue) >= 0.02) { lock (sync) { actualValue = actualValue * tweenFactor + desiredValue * invTweenFactor; deviceValue.Set(actualValue); } await Task.Delay(kStepIntervalMillis); } } }
public void Set(float value) { _deviceValue.Set((int)(value * _multiplier - _offset)); }
public void Initialize() { position.Set(defaultAngle); }
public void Set(float value) { _value.Set(value * _multiplier + _offset); }
public void Set(T newValue) => value.Set(newValue);