Class DoubleTelemetry

java.lang.Object
yams.telemetry.DoubleTelemetry

public class DoubleTelemetry extends Object
Double Telemetry for SmartMotorControllers.
  • Field Details

    • enabled

      protected boolean enabled
      Enabled?
  • 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

      public void setupNetworkTables(NetworkTable dataTable, NetworkTable tuningTable)
      Setup network tables.
      Parameters:
      dataTable - Data tables.
      tuningTable - Tuning table.
    • transformUnit

      public DoubleTelemetry transformUnit(SmartMotorControllerConfig cfg)
      Set the unit.
      Parameters:
      cfg - SmartMotorControllerConfig used to determine the unit. If the MechanismCircumference is set it will be in meters, else it will be in degrees.
      Returns:
      DoubleTelemetry for chaining.
    • setupNetworkTable

      public void setupNetworkTable(NetworkTable dataTable)
      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.