Class Ramp
Limits how fast a value may change, so a load is never slammed.
public sealed class Ramp : IDisposable
- Inheritance
-
Ramp
- Implements
- Inherited Members
Remarks
Jumping a motor or a valve straight to a new target draws a surge and wears the mechanism; a ramp walks it there instead.
Constructors
Ramp(float, float)
Creates a rate limiter.
public Ramp(float start, float maxStep)
Parameters
Properties
Value
Gets the current value.
public float Value { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Set(float)
Forces the value without rate limiting.
public void Set(float value)
Parameters
valuefloatThe value to jump to.
Update(float)
Moves one step toward a target and returns the new value.
public float Update(float target)
Parameters
targetfloatThe value being approached.
Returns
- float
The rate-limited value.