Package trclib.driverio
Class TrcDashboard
java.lang.Object
trclib.driverio.TrcDashboard
- Direct Known Subclasses:
FtcDashboard
This interface provides a platform independent way to display info to the dashboard. It is mainly for TrcLib
which is platform agnostic. A platform dependent class will implement methods in this interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static TrcDashboard
protected static final int
protected final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
This method clears all the display lines.abstract void
displayPrintf
(int lineNum, String msg) This method displays a message in the specified display line on the Driver Station.abstract void
displayPrintf
(int lineNum, String format, Object... args) This method displays a formatted message in the specified display line on the Driver Station.abstract boolean
getBoolean
(String key, boolean defaultValue) This method returns the value of the named boolean data read from the Telemetry class.static TrcDashboard
This method allows any class to get an instance of the dashboard so that it can display information on its display.abstract double
This method returns the value of the named double data read from the Telemetry class.int
This method returns the number of text lines on the dashboard display.abstract String
This method returns the value of the named string data read from the Telemetry class.abstract void
putBoolean
(String key, boolean value) This method sets the named boolean data with the given value and also sends it to the Driver Station.abstract void
This method sets the named double data with the given value and also sends it to the Driver Station.abstract void
This method sets the named string data with the given value and also sends it to the Driver Station.abstract void
This method refresh the display lines on the Driver Station.
-
Field Details
-
MAX_NUM_TEXTLINES
protected static final int MAX_NUM_TEXTLINES- See Also:
-
displayKeyFormat
- See Also:
-
instance
-
numLines
protected final int numLines
-
-
Constructor Details
-
TrcDashboard
public TrcDashboard(int numLines) Constructor: Create an instance of the object.- Parameters:
numLines
- specifies the number of display lines.
-
-
Method Details
-
clearDisplay
public abstract void clearDisplay()This method clears all the display lines. -
refreshDisplay
public abstract void refreshDisplay()This method refresh the display lines on the Driver Station. -
displayPrintf
This method displays a message in the specified display line on the Driver Station.- Parameters:
lineNum
- specifies the line number on the display.msg
- specifies the message string.
-
displayPrintf
This method displays a formatted message in the specified display line on the Driver Station.- Parameters:
lineNum
- specifies the line number on the display.format
- specifies the format string.args
- specifies variable number of substitution arguments.
-
getBoolean
This method returns the value of the named boolean data read from the Telemetry class. If the named data does not exist, it is created and assigned the given default value. Then it is sent to the Driver Station.- Parameters:
key
- specifies the name associated with the boolean data.defaultValue
- specifies the default value if it does not exist.- Returns:
- boolean data value.
-
putBoolean
This method sets the named boolean data with the given value and also sends it to the Driver Station.- Parameters:
key
- specifies the name associated with the boolean data.value
- specifies the data value.
-
getNumber
This method returns the value of the named double data read from the Telemetry class. If the named data does not exist, it is created and assigned the given default value. Then it is sent to the Driver Station.- Parameters:
key
- specifies the name associated with the double data.defaultValue
- specifies the default value if it does not exist.- Returns:
- double data value.
-
putNumber
This method sets the named double data with the given value and also sends it to the Driver Station.- Parameters:
key
- specifies the name associated with the double data.value
- specifies the data value.
-
getString
This method returns the value of the named string data read from the Telemetry class. If the named data does not exist, it is created and assigned the given default value. Then it is sent to the Driver Station.- Parameters:
key
- specifies the name associated with the string data.defaultValue
- specifies the default value if it does not exist.- Returns:
- string data value.
-
putString
This method sets the named string data with the given value and also sends it to the Driver Station.- Parameters:
key
- specifies the name associated with the string data.value
- specifies the data value.
-
getInstance
This method allows any class to get an instance of the dashboard so that it can display information on its display.- Returns:
- global instance of the dashboard object.
-
getNumTextLines
public int getNumTextLines()This method returns the number of text lines on the dashboard display.- Returns:
- number of text lines on the dashboard display.
-