Package yams.telemetry
Class DoubleTelemetry
java.lang.Object
yams.telemetry.DoubleTelemetry
Double Telemetry for SmartMotorControllers.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDoubleTelemetry(String keyString, double defaultVal, SmartMotorControllerTelemetry.DoubleTelemetryField field, boolean tunable, String unit) Setup double telemetry for a field. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the telemetry field.voiddisable()Disable the telemetry.voiddisplay(boolean state) Display the telemetry.voidenable()Enable the telemetry.doubleget()Get the value.getField()Get the field.booleanset(double value) Set the value of the publisher, checking to see if the value is the same as the subscriber.voidsetDefaultValue(double defaultValue) Set default values.voidsetupNetworkTable(NetworkTable dataTable) Setup network tables.voidsetupNetworkTables(NetworkTable dataTable, NetworkTable tuningTable) Setup network tables.Set the unit.booleantunable()Check to see if the value has changed.
-
Field Details
-
enabled
protected boolean enabledEnabled?
-
-
Constructor Details
-
DoubleTelemetry
public DoubleTelemetry(String keyString, double defaultVal, SmartMotorControllerTelemetry.DoubleTelemetryField field, boolean tunable, String unit) Setup double telemetry for a field.- Parameters:
keyString- Key to use.defaultVal- Default value.field- Field representing.tunable- Tunable.unit- Unit to display.
-
-
Method Details
-
setDefaultValue
public void setDefaultValue(double defaultValue) Set default values.- Parameters:
defaultValue- Default for the entry.
-
setupNetworkTables
Setup network tables.- Parameters:
dataTable- Data tables.tuningTable- Tuning table.
-
transformUnit
Set the unit.- Parameters:
cfg-SmartMotorControllerConfigused to determine the unit. If the MechanismCircumference is set it will be in meters, else it will be in degrees.- Returns:
DoubleTelemetryfor chaining.
-
setupNetworkTable
Setup network tables.- Parameters:
dataTable- Data tables.
-
set
public boolean set(double value) Set the value of the publisher, checking to see if the value is the same as the subscriber.- Parameters:
value- Value to set.- Returns:
- True if value was able to be set.
-
get
public double get()Get the value.- Returns:
- value of telemetry.
-
tunable
public boolean tunable()Check to see if the value has changed.- Returns:
- True if the value has changed.
-
enable
public void enable()Enable the telemetry. -
disable
public void disable()Disable the telemetry. -
display
public void display(boolean state) Display the telemetry.- Parameters:
state- Enable or disable.
-
getField
Get the field.- Returns:
- field.
-
close
public void close()Close the telemetry field.
-