Package edu.wpi.first.wpilibj.livewindow
Class LiveWindow
- java.lang.Object
-
- edu.wpi.first.wpilibj.livewindow.LiveWindow
-
public class LiveWindow extends Object
The LiveWindow class is the public interface for putting sensors and actuators on the LiveWindow.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
add(Sendable sendable)
Add a component to the LiveWindow.static void
addActuator(String moduleType, int moduleNumber, int channel, Sendable component)
Deprecated.UseSendableBase.setName(String, int, int)
instead.static void
addActuator(String moduleType, int channel, Sendable component)
Deprecated.UseSendableBase.setName(String, int)
instead.static void
addActuator(String subsystem, String name, Sendable component)
Deprecated.UseSendable.setName(String, String)
instead.static void
addChild(Sendable parent, Object child)
Add a child component to a component.static void
addSensor(String moduleType, int channel, Sendable component)
Deprecated.UseSendableBase.setName(String, int)
instead.static void
addSensor(String subsystem, String name, Sendable component)
Deprecated.UseSendable.setName(String, String)
instead.static void
disableAllTelemetry()
Disable ALL telemetry.static void
disableTelemetry(Sendable sendable)
Disable telemetry for a single component.static void
enableTelemetry(Sendable sendable)
Enable telemetry for a single component.static boolean
isEnabled()
static void
remove(Sendable sendable)
Remove a component from the LiveWindow.static void
run()
Deprecated.No longer requiredstatic void
setEnabled(boolean enabled)
Set the enabled state of LiveWindow.static void
updateValues()
Tell all the sensors to update (send) their values.
-
-
-
Method Detail
-
isEnabled
public static boolean isEnabled()
-
setEnabled
public static void setEnabled(boolean enabled)
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 reenable the scheduler. TODO: add code to disable PID loops when enabling LiveWindow. The commands should reenable 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.
-
run
@Deprecated public static void run()
Deprecated.No longer requiredThe run method is called repeatedly to keep the values refreshed on the screen in test mode.
-
addSensor
@Deprecated public static void addSensor(String subsystem, String name, Sendable component)
Deprecated.UseSendable.setName(String, String)
instead.Add a Sensor associated with the subsystem and with call it by the given name.- Parameters:
subsystem
- The subsystem this component is part of.name
- The name of this component.component
- A LiveWindowSendable component that represents a sensor.
-
addSensor
@Deprecated public static void addSensor(String moduleType, int channel, Sendable component)
Deprecated.UseSendableBase.setName(String, int)
instead.Add Sensor to LiveWindow. The components are shown with the type and channel like this: Gyro[1] for a gyro object connected to the first analog channel.- Parameters:
moduleType
- A string indicating the type of the module used in the naming (above)channel
- The channel number the device is connected tocomponent
- A reference to the object being added
-
addActuator
@Deprecated public static void addActuator(String subsystem, String name, Sendable component)
Deprecated.UseSendable.setName(String, String)
instead.Add an Actuator associated with the subsystem and with call it by the given name.- Parameters:
subsystem
- The subsystem this component is part of.name
- The name of this component.component
- A LiveWindowSendable component that represents a actuator.
-
addActuator
@Deprecated public static void addActuator(String moduleType, int channel, Sendable component)
Deprecated.UseSendableBase.setName(String, int)
instead.Add Actuator to LiveWindow. The components are shown with the module type, slot and channel like this: Servo[1,2] for a servo object connected to the first digital module and PWM port 2.- Parameters:
moduleType
- A string that defines the module name in the label for the valuechannel
- The channel number the device is plugged into (usually PWM)component
- The reference to the object being added
-
addActuator
@Deprecated public static void addActuator(String moduleType, int moduleNumber, int channel, Sendable component)
Deprecated.UseSendableBase.setName(String, int, int)
instead.Add Actuator to LiveWindow. The components are shown with the module type, slot and channel like this: Servo[1,2] for a servo object connected to the first digital module and PWM port 2.- Parameters:
moduleType
- A string that defines the module name in the label for the valuemoduleNumber
- The number of the particular module typechannel
- The channel number the device is plugged into (usually PWM)component
- The reference to the object being added
-
add
public static void add(Sendable sendable)
Add a component to the LiveWindow.- Parameters:
sendable
- component to add
-
addChild
public static void addChild(Sendable parent, Object child)
Add a child component to a component.- Parameters:
parent
- parent componentchild
- child component
-
remove
public static void remove(Sendable sendable)
Remove a component from the LiveWindow.- Parameters:
sendable
- component to remove
-
enableTelemetry
public static void enableTelemetry(Sendable sendable)
Enable telemetry for a single component.- Parameters:
sendable
- component
-
disableTelemetry
public static void disableTelemetry(Sendable sendable)
Disable telemetry for a single component.- Parameters:
sendable
- component
-
disableAllTelemetry
public static void disableAllTelemetry()
Disable ALL telemetry.
-
updateValues
public static void updateValues()
Tell all the sensors to update (send) their values.Actuators are handled through callbacks on their value changing from the SmartDashboard widgets.
-
-