Package com.acmerobotics.dashboard
Class DashboardCore
java.lang.Object
com.acmerobotics.dashboard.DashboardCore
Main class for interacting with the instance.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> voidaddConfigVariable(String category, String name, ValueProvider<T> provider) Add config variable with custom provider.voidClears telemetry data from all clients.intintReturns the telemetry transmission interval in milliseconds.voidremoveConfigVariable(String category, String name) Remove a config variable.voidvoidsendTelemetryPacket(TelemetryPacket telemetryPacket) Queues a telemetry packet to be sent to all clients.voidsetTelemetryTransmissionInterval(int newTransmissionInterval) Sets the telemetry transmission interval.voidSends updated configuration data to all instance clients.voidwithConfigRoot(CustomVariableConsumer function) Executes in an exclusive context for thread-safe config tree modification and callsupdateConfig()to keep clients up to date.
-
Field Details
-
enabled
public boolean enabled -
GSON
public static final com.google.gson.Gson GSON
-
-
Constructor Details
-
DashboardCore
public DashboardCore()
-
-
Method Details
-
newSocket
-
sendTelemetryPacket
Queues a telemetry packet to be sent to all clients. Packets are sent in batches of approximate periodgetTelemetryTransmissionInterval(). Clients display the most recent value received for each key, and the data is cleared upon op mode init or a call toclearTelemetry().- 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
Executes in an exclusive context for thread-safe config tree modification and callsupdateConfig()to keep clients up to date. Do not leak the config tree outside the function.- Parameters:
function-
-
addConfigVariable
Add config variable with custom provider.- Type Parameters:
T- variable type- Parameters:
category- top-level categoryname- variable nameprovider- getter/setter for the variable
-
removeConfigVariable
Remove a config variable.- Parameters:
category- top-level categoryname- variable name
-
sendAll
-
clientCount
public int clientCount()
-