Class DashboardCore

java.lang.Object
com.acmerobotics.dashboard.DashboardCore

public class DashboardCore extends Object
Main class for interacting with the instance.
  • Field Details

    • enabled

      public boolean enabled
    • GSON

      public static final com.google.gson.Gson GSON
  • Constructor Details

    • DashboardCore

      public DashboardCore()
  • Method Details

    • newSocket

      public SocketHandler newSocket(SendFun sendFun)
    • sendTelemetryPacket

      public void sendTelemetryPacket(TelemetryPacket telemetryPacket)
      Queues a telemetry packet to be sent to all clients. Packets are sent in batches of approximate period getTelemetryTransmissionInterval(). Clients display the most recent value received for each key, and the data is cleared upon op mode init or a call to clearTelemetry().
      Parameters:
      telemetryPacket - packet to send
    • clearTelemetry

      public void clearTelemetry()
      Clears telemetry data from all clients.
    • getTelemetryTransmissionInterval

      public int getTelemetryTransmissionInterval()
      Returns the telemetry transmission interval in milliseconds.
    • setTelemetryTransmissionInterval

      public void setTelemetryTransmissionInterval(int newTransmissionInterval)
      Sets the telemetry transmission interval.
      Parameters:
      newTransmissionInterval - transmission interval in milliseconds
    • updateConfig

      public void updateConfig()
      Sends updated configuration data to all instance clients.
    • withConfigRoot

      public void withConfigRoot(CustomVariableConsumer function)
      Executes in an exclusive context for thread-safe config tree modification and calls updateConfig() to keep clients up to date. Do not leak the config tree outside the function.
      Parameters:
      function -
    • addConfigVariable

      public <T> void addConfigVariable(String category, String name, ValueProvider<T> provider)
      Add config variable with custom provider.
      Type Parameters:
      T - variable type
      Parameters:
      category - top-level category
      name - variable name
      provider - getter/setter for the variable
    • removeConfigVariable

      public void removeConfigVariable(String category, String name)
      Remove a config variable.
      Parameters:
      category - top-level category
      name - variable name
    • sendAll

      public void sendAll(Message message)
    • clientCount

      public int clientCount()