Package com.acmerobotics.dashboard
Class DashboardCore
java.lang.Object
com.acmerobotics.dashboard.DashboardCore
Main class for interacting with the instance.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> void
addConfigVariable
(String category, String name, ValueProvider<T> provider) Add config variable with custom provider.void
Clears telemetry data from all clients.int
int
Returns the telemetry transmission interval in milliseconds.void
removeConfigVariable
(String category, String name) Remove a config variable.void
void
sendTelemetryPacket
(TelemetryPacket telemetryPacket) Queues a telemetry packet to be sent to all clients.void
setTelemetryTransmissionInterval
(int newTransmissionInterval) Sets the telemetry transmission interval.void
Sends updated configuration data to all instance clients.void
withConfigRoot
(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()
-