WPILibC++ 2024.1.1-beta-4
frc2::NetworkButton Class Reference

A Button that uses a NetworkTable boolean field. More...

#include <frc2/command/button/NetworkButton.h>

Inheritance diagram for frc2::NetworkButton:
frc2::Trigger

Public Member Functions

 NetworkButton (nt::BooleanTopic topic)
 Creates a NetworkButton that commands can be bound to. More...
 
 NetworkButton (nt::BooleanSubscriber sub)
 Creates a NetworkButton that commands can be bound to. More...
 
 NetworkButton (std::shared_ptr< nt::NetworkTable > table, std::string_view field)
 Creates a NetworkButton that commands can be bound to. More...
 
 NetworkButton (std::string_view table, std::string_view field)
 Creates a NetworkButton that commands can be bound to. More...
 
 NetworkButton (nt::NetworkTableInstance inst, std::string_view table, std::string_view field)
 Creates a NetworkButton that commands can be bound to. More...
 
- Public Member Functions inherited from frc2::Trigger
 Trigger (std::function< bool()> condition)
 Creates a new trigger based on the given condition. More...
 
 Trigger (frc::EventLoop *loop, std::function< bool()> condition)
 Creates a new trigger based on the given condition. More...
 
 Trigger ()
 Create a new trigger that is always false. More...
 
 Trigger (const Trigger &other)
 
Trigger OnTrue (Command *command)
 Starts the given command whenever the condition changes from false to true. More...
 
Trigger OnTrue (CommandPtr &&command)
 Starts the given command whenever the condition changes from false to true. More...
 
Trigger OnFalse (Command *command)
 Starts the given command whenever the condition changes from true to false. More...
 
Trigger OnFalse (CommandPtr &&command)
 Starts the given command whenever the condition changes from true to false. More...
 
Trigger WhileTrue (Command *command)
 Starts the given command when the condition changes to true and cancels it when the condition changes to false. More...
 
Trigger WhileTrue (CommandPtr &&command)
 Starts the given command when the condition changes to true and cancels it when the condition changes to false. More...
 
Trigger WhileFalse (Command *command)
 Starts the given command when the condition changes to false and cancels it when the condition changes to true. More...
 
Trigger WhileFalse (CommandPtr &&command)
 Starts the given command when the condition changes to false and cancels it when the condition changes to true. More...
 
Trigger ToggleOnTrue (Command *command)
 Toggles a command when the condition changes from false to true. More...
 
Trigger ToggleOnTrue (CommandPtr &&command)
 Toggles a command when the condition changes from false to true. More...
 
Trigger ToggleOnFalse (Command *command)
 Toggles a command when the condition changes from true to the low state. More...
 
Trigger ToggleOnFalse (CommandPtr &&command)
 Toggles a command when the condition changes from true to false. More...
 
Trigger operator&& (std::function< bool()> rhs)
 Composes two triggers with logical AND. More...
 
Trigger operator&& (Trigger rhs)
 Composes two triggers with logical AND. More...
 
Trigger operator|| (std::function< bool()> rhs)
 Composes two triggers with logical OR. More...
 
Trigger operator|| (Trigger rhs)
 Composes two triggers with logical OR. More...
 
Trigger operator! ()
 Composes a trigger with logical NOT. More...
 
Trigger Debounce (units::second_t debounceTime, frc::Debouncer::DebounceType type=frc::Debouncer::DebounceType::kRising)
 Creates a new debounced trigger from this trigger - it will become active when this trigger has been active for longer than the specified period. More...
 
bool Get () const
 Returns the current state of this trigger. More...
 

Detailed Description

A Button that uses a NetworkTable boolean field.

This class is provided by the NewCommands VendorDep

Constructor & Destructor Documentation

◆ NetworkButton() [1/5]

frc2::NetworkButton::NetworkButton ( nt::BooleanTopic  topic)
explicit

Creates a NetworkButton that commands can be bound to.

Parameters
topicThe boolean topic that contains the value.

◆ NetworkButton() [2/5]

frc2::NetworkButton::NetworkButton ( nt::BooleanSubscriber  sub)
explicit

Creates a NetworkButton that commands can be bound to.

Parameters
subThe boolean subscriber that provides the value.

◆ NetworkButton() [3/5]

frc2::NetworkButton::NetworkButton ( std::shared_ptr< nt::NetworkTable table,
std::string_view  field 
)

Creates a NetworkButton that commands can be bound to.

Parameters
tableThe table where the networktable value is located.
fieldThe field that is the value.

◆ NetworkButton() [4/5]

frc2::NetworkButton::NetworkButton ( std::string_view  table,
std::string_view  field 
)

Creates a NetworkButton that commands can be bound to.

Parameters
tableThe table where the networktable value is located.
fieldThe field that is the value.

◆ NetworkButton() [5/5]

frc2::NetworkButton::NetworkButton ( nt::NetworkTableInstance  inst,
std::string_view  table,
std::string_view  field 
)

Creates a NetworkButton that commands can be bound to.

Parameters
instThe NetworkTable instance to use
tableThe table where the networktable value is located.
fieldThe field that is the value.

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