WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
frc::LiveWindow Class Reference

The LiveWindow class is the public interface for putting sensors and actuators on the LiveWindow. More...

#include <LiveWindow.h>

Public Member Functions

 LiveWindow (const LiveWindow &)=delete
 
LiveWindowoperator= (const LiveWindow &)=delete
 
void Run ()
 
void AddSensor (const wpi::Twine &subsystem, const wpi::Twine &name, Sendable *component)
 Add a Sensor associated with the subsystem and call it by the given name. More...
 
void AddSensor (const wpi::Twine &subsystem, const wpi::Twine &name, Sendable &component)
 Add a Sensor associated with the subsystem and call it by the given name. More...
 
void AddSensor (const wpi::Twine &subsystem, const wpi::Twine &name, std::shared_ptr< Sendable > component)
 Add a Sensor associated with the subsystem and call it by the given name. More...
 
void AddActuator (const wpi::Twine &subsystem, const wpi::Twine &name, Sendable *component)
 Add an Actuator associated with the subsystem and call it by the given name. More...
 
void AddActuator (const wpi::Twine &subsystem, const wpi::Twine &name, Sendable &component)
 Add an Actuator associated with the subsystem and call it by the given name. More...
 
void AddActuator (const wpi::Twine &subsystem, const wpi::Twine &name, std::shared_ptr< Sendable > component)
 Add an Actuator associated with the subsystem and call it by the given name. More...
 
void AddSensor (const wpi::Twine &type, int channel, Sendable *component)
 Meant for internal use in other WPILib classes. More...
 
void AddActuator (const wpi::Twine &type, int channel, Sendable *component)
 Meant for internal use in other WPILib classes. More...
 
void AddActuator (const wpi::Twine &type, int module, int channel, Sendable *component)
 Meant for internal use in other WPILib classes. More...
 
void Add (std::shared_ptr< Sendable > component)
 Add a component to the LiveWindow. More...
 
void Add (Sendable *component)
 Add a component to the LiveWindow. More...
 
void AddChild (Sendable *parent, std::shared_ptr< Sendable > component)
 Add a child component to a component. More...
 
void AddChild (Sendable *parent, void *component)
 Add a child component to a component. More...
 
void Remove (Sendable *component)
 Remove the component from the LiveWindow. More...
 
void EnableTelemetry (Sendable *component)
 Enable telemetry for a single component. More...
 
void DisableTelemetry (Sendable *component)
 Disable telemetry for a single component. More...
 
void DisableAllTelemetry ()
 Disable ALL telemetry.
 
bool IsEnabled () const
 
void SetEnabled (bool enabled)
 Change the enabled status of LiveWindow. More...
 
void UpdateValues ()
 Tell all the sensors to update (send) their values. More...
 

Static Public Member Functions

static LiveWindowGetInstance ()
 Get an instance of the LiveWindow main class. More...
 

Detailed Description

The LiveWindow class is the public interface for putting sensors and actuators on the LiveWindow.

Member Function Documentation

void frc::LiveWindow::Add ( std::shared_ptr< Sendable component)

Add a component to the LiveWindow.

Parameters
sendablecomponent to add
void frc::LiveWindow::Add ( Sendable component)

Add a component to the LiveWindow.

Parameters
sendablecomponent to add
void frc::LiveWindow::AddActuator ( const wpi::Twine subsystem,
const wpi::Twine name,
Sendable component 
)

Add an Actuator associated with the subsystem and call it by the given name.

Parameters
subsystemThe subsystem this component is part of.
nameThe name of this component.
componentA Sendable component that represents a actuator.
void frc::LiveWindow::AddActuator ( const wpi::Twine subsystem,
const wpi::Twine name,
Sendable component 
)

Add an Actuator associated with the subsystem and call it by the given name.

Parameters
subsystemThe subsystem this component is part of.
nameThe name of this component.
componentA Sendable component that represents a actuator.
void frc::LiveWindow::AddActuator ( const wpi::Twine subsystem,
const wpi::Twine name,
std::shared_ptr< Sendable component 
)

Add an Actuator associated with the subsystem and call it by the given name.

Parameters
subsystemThe subsystem this component is part of.
nameThe name of this component.
componentA Sendable component that represents a actuator.
void frc::LiveWindow::AddActuator ( const wpi::Twine type,
int  channel,
Sendable component 
)

Meant for internal use in other WPILib classes.

Deprecated:
Use SendableBase::SetName() instead.
void frc::LiveWindow::AddActuator ( const wpi::Twine type,
int  module,
int  channel,
Sendable component 
)

Meant for internal use in other WPILib classes.

Deprecated:
Use SendableBase::SetName() instead.
void frc::LiveWindow::AddChild ( Sendable parent,
std::shared_ptr< Sendable component 
)

Add a child component to a component.

Parameters
parentparent component
childchild component
void frc::LiveWindow::AddChild ( Sendable parent,
void *  component 
)

Add a child component to a component.

Parameters
parentparent component
childchild component
void frc::LiveWindow::AddSensor ( const wpi::Twine subsystem,
const wpi::Twine name,
Sendable component 
)

Add a Sensor associated with the subsystem and call it by the given name.

Parameters
subsystemThe subsystem this component is part of.
nameThe name of this component.
componentA Sendable component that represents a sensor.
void frc::LiveWindow::AddSensor ( const wpi::Twine subsystem,
const wpi::Twine name,
Sendable component 
)

Add a Sensor associated with the subsystem and call it by the given name.

Parameters
subsystemThe subsystem this component is part of.
nameThe name of this component.
componentA Sendable component that represents a sensor.
void frc::LiveWindow::AddSensor ( const wpi::Twine subsystem,
const wpi::Twine name,
std::shared_ptr< Sendable component 
)

Add a Sensor associated with the subsystem and call it by the given name.

Parameters
subsystemThe subsystem this component is part of.
nameThe name of this component.
componentA Sendable component that represents a sensor.
void frc::LiveWindow::AddSensor ( const wpi::Twine type,
int  channel,
Sendable component 
)

Meant for internal use in other WPILib classes.

Deprecated:
Use SendableBase::SetName() instead.
void frc::LiveWindow::DisableTelemetry ( Sendable component)

Disable telemetry for a single component.

Parameters
sendablecomponent
void frc::LiveWindow::EnableTelemetry ( Sendable component)

Enable telemetry for a single component.

Parameters
sendablecomponent
static LiveWindow* frc::LiveWindow::GetInstance ( )
static

Get an instance of the LiveWindow main class.

This is a singleton to guarantee that there is only a single instance regardless of how many times GetInstance is called.

void frc::LiveWindow::Remove ( Sendable component)

Remove the component from the LiveWindow.

Parameters
sendablecomponent to remove
void frc::LiveWindow::SetEnabled ( bool  enabled)

Change the enabled status of LiveWindow.

If it changes to enabled, start livewindow running otherwise stop it

void frc::LiveWindow::UpdateValues ( )

Tell all the sensors to update (send) their values.

Actuators are handled through callbacks on their value changing from the SmartDashboard widgets.


The documentation for this class was generated from the following file: