Class Thermostat
Switches a load on and off around a setpoint, with hysteresis to stop chatter.
public sealed class Thermostat : IDisposable
- Inheritance
-
Thermostat
- Implements
- Inherited Members
Remarks
Without a dead band a load switches rapidly around the setpoint and wears out; the hysteresis is what makes on/off control safe for a compressor or a pump.
Properties
IsOn
Gets whether the load should currently be on.
public bool IsOn { get; }
Property Value
Methods
Cooling(float, float)
Creates a cooling thermostat, which switches on when the reading rises.
public static Thermostat Cooling(float setpoint, float hysteresis)
Parameters
Returns
- Thermostat
The thermostat.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Heating(float, float)
Creates a heating thermostat, which switches on when the reading falls.
public static Thermostat Heating(float setpoint, float hysteresis)
Parameters
Returns
- Thermostat
The thermostat.
Update(float)
Feeds a reading in and reports whether the load should be on.
public bool Update(float reading)
Parameters
readingfloatThe latest measured value.
Returns
- bool
truewhile the load should run.