"

2013 FRC Java API

"

edu.wpi.first.wpilibj.livewindow
Class LiveWindow

java.lang.Object
  extended by 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.

Author:
Alex Henning

Constructor Summary
LiveWindow()
           
 
Method Summary
static void addActuator(String moduleType, int moduleNumber, int channel, LiveWindowSendable component)
          Add Actuator to LiveWindow.
static void addActuator(String subsystem, String name, LiveWindowSendable component)
          Add an Actuator associated with the subsystem and with call it by the given name.
static void addSensor(String moduleType, int moduleNumber, int channel, LiveWindowSendable component)
          Add Sensor to LiveWindow.
static void addSensor(String subsystem, String name, LiveWindowSendable component)
          Add a Sensor associated with the subsystem and with call it by the given name.
static void run()
          The run method is called repeatedly to keep the values refreshed on the screen in test mode.
static void setEnabled(boolean enabled)
          Set the enabled state of LiveWindow.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LiveWindow

public LiveWindow()
Method Detail

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

public static void run()
The run method is called repeatedly to keep the values refreshed on the screen in test mode.


addSensor

public static void addSensor(String subsystem,
                             String name,
                             LiveWindowSendable component)
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.

addActuator

public static void addActuator(String subsystem,
                               String name,
                               LiveWindowSendable component)
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.

addSensor

public static void addSensor(String moduleType,
                             int moduleNumber,
                             int channel,
                             LiveWindowSendable component)
Add Sensor to LiveWindow. The components are shown with the module type, slot and channel like this: Gyro[1, 2] for a gyro object connected to the first analog module in channel 2

Parameters:
moduleType - A string indicating the type of the module used in the naming (above)
moduleNumber - The number of the particular module type
channel - The channel number the device is connected to
component - A reference to the object being added

addActuator

public static void addActuator(String moduleType,
                               int moduleNumber,
                               int channel,
                               LiveWindowSendable component)
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 value
moduleNumber - The number of the particular module type
channel - The channel number the device is plugged into (usually PWM)
component - The reference to the object being added

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"