Class TrcDashboard

java.lang.Object
trclib.driverio.TrcDashboard
Direct Known Subclasses:
FtcDashboard

public abstract class TrcDashboard extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
     
    protected static TrcDashboard
     
    protected static final int
     
    protected final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TrcDashboard(int numLines)
    Constructor: Create an instance of the object.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract 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.
    This method allows any class to get an instance of the dashboard so that it can display information on its display.
    abstract double
    getNumber(String key, double defaultValue)
    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
    getString(String key, String defaultValue)
    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
    putNumber(String key, double value)
    This method sets the named double data with the given value and also sends it to the Driver Station.
    abstract void
    putString(String key, String value)
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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

      public abstract void displayPrintf(int lineNum, String msg)
      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

      public abstract void displayPrintf(int lineNum, String format, Object... args)
      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

      public abstract boolean getBoolean(String key, boolean defaultValue)
      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

      public 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.
      Parameters:
      key - specifies the name associated with the boolean data.
      value - specifies the data value.
    • getNumber

      public abstract double getNumber(String key, double defaultValue)
      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

      public abstract void putNumber(String key, double value)
      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

      public abstract String getString(String key, String defaultValue)
      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

      public abstract void putString(String key, String value)
      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

      public static TrcDashboard 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.