Package edu.wpi.first.wpilibj.livewindow
Class LiveWindow
java.lang.Object
edu.wpi.first.wpilibj.livewindow.LiveWindow
The LiveWindow class is the public interface for putting sensors and actuators on the LiveWindow.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidDisable ALL telemetry.static voiddisableTelemetry(Sendable sendable) Disable telemetry for a single component.static voidEnable ALL telemetry.static voidenableTelemetry(Sendable sendable) Enable telemetry for a single component.static booleanReturns true if LiveWindow is enabled.static voidsetDisabledListener(Runnable runnable) Sets function to be called when LiveWindow is disabled.static voidsetEnabled(boolean enabled) Set the enabled state of LiveWindow.static voidsetEnabledListener(Runnable runnable) Sets function to be called when LiveWindow is enabled.static voidTell all the sensors to update (send) their values.
-
Method Details
-
setEnabledListener
Sets function to be called when LiveWindow is enabled.- Parameters:
runnable- function (or null for none)
-
setDisabledListener
Sets function to be called when LiveWindow is disabled.- Parameters:
runnable- function (or null for none)
-
isEnabled
Returns true if LiveWindow is enabled.- Returns:
- True if LiveWindow is enabled.
-
setEnabled
Set the enabled state of LiveWindow.If it's being enabled, turn off the scheduler and remove all the commands from the queue and enable all the components registered for LiveWindow. If it's being disabled, stop all the registered components and re-enable the scheduler.
TODO: add code to disable PID loops when enabling LiveWindow. The commands should re-enable the PID loops themselves when they get rescheduled. This prevents arms from starting to move around, etc. after a period of adjusting them in LiveWindow mode.
- Parameters:
enabled- True to enable LiveWindow.
-
enableTelemetry
Enable telemetry for a single component.- Parameters:
sendable- component
-
disableTelemetry
Disable telemetry for a single component.- Parameters:
sendable- component
-
disableAllTelemetry
Disable ALL telemetry. -
enableAllTelemetry
Enable ALL telemetry. -
updateValues
Tell all the sensors to update (send) their values.Actuators are handled through callbacks on their value changing from the SmartDashboard widgets.
-