Class LiveWindow


  • public class LiveWindow
    extends Object
    The LiveWindow class is the public interface for putting sensors and actuators on the LiveWindow.
    • 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 required
        The 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.
        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.
        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 to
        component - A reference to the object being added
      • addActuator

        @Deprecated
        public static void addActuator​(String subsystem,
                                       String name,
                                       Sendable component)
        Deprecated.
        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.
        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
        channel - 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.
        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
      • 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 component
        child - 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.