public class Calibration
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
cur_val
Present value for the calibration.
|
double |
default_val
Default value the calibration will take on.
|
double |
max_cal
Upper limit on the allowed calibration range
|
double |
min_cal
Lower limit on the allowed calibration range
|
java.lang.String |
name
Human-readable name for the calibration.
|
boolean |
overridden
True if the user has (somehow) made this calibration a non-default value
|
Constructor and Description |
---|
Calibration(java.lang.String name_in,
double default_val_in)
Constructor for a new calibratable value.
|
Calibration(java.lang.String name_in,
double default_val_in,
double min_in,
double max_in)
Constructor for a new calibratable value with range limiting
|
Modifier and Type | Method and Description |
---|---|
void |
acknowledgeValUpdate()
For bookkeeping purposes, mark that the cal value update has been processed.
|
double |
get()
Retrieve the present value of this calibration.
|
double |
getDefault()
Get the default value of the calibration.
|
boolean |
isChanged()
Check if the calibration has been changed by the user.
|
void |
reset()
Returns the calibration back to the default value.
|
void |
setOverride(double val_in)
Set a new value to override the present calibration.
|
public final double default_val
public final java.lang.String name
public volatile double cur_val
public volatile boolean overridden
public double max_cal
public double min_cal
public Calibration(java.lang.String name_in, double default_val_in)
name_in
- String for the name of the calibration. Best to make it the same of the
variable name.default_val_in
- Default value for the calibration. Will keep this value unless the
wrangler overwrites it.public Calibration(java.lang.String name_in, double default_val_in, double min_in, double max_in)
name_in
- String for the name of the calibration. Best to make it the same of the
variable name.default_val_in
- Default value for the calibration. Will keep this value unless the
wrangler overwrites it.wrangler_in
- Reference to the wrangler which will control this calibration.min_in
- Minimum allowable calibration value. If a user attempts to override the value
outside this range, a WARNING: will be thrown and the calibrated value will be capped
at the minimum.max_in
- Maximum allowable calibration value. If a user attempts to override the value
outside this range, a WARNING: will be thrown and the calibrated value will be capped
at the maximum.public double get()
public boolean isChanged()
public void acknowledgeValUpdate()
public double getDefault()
public void setOverride(double val_in)
val_in
- Value to set.public void reset()