![]() |
WPILibC++ 2025.3.2
|
A Button that uses a NetworkTable boolean field. More...
#include <frc2/command/button/NetworkButton.h>
Public Member Functions | |
| NetworkButton (nt::BooleanTopic topic) | |
| Creates a NetworkButton that commands can be bound to. | |
| NetworkButton (nt::BooleanSubscriber sub) | |
| Creates a NetworkButton that commands can be bound to. | |
| NetworkButton (std::shared_ptr< nt::NetworkTable > table, std::string_view field) | |
| Creates a NetworkButton that commands can be bound to. | |
| NetworkButton (std::string_view table, std::string_view field) | |
| Creates a NetworkButton that commands can be bound to. | |
| NetworkButton (nt::NetworkTableInstance inst, std::string_view table, std::string_view field) | |
| Creates a NetworkButton that commands can be bound to. | |
Public Member Functions inherited from frc2::Trigger | |
| Trigger (std::function< bool()> condition) | |
| Creates a new trigger based on the given condition. | |
| Trigger (frc::EventLoop *loop, std::function< bool()> condition) | |
| Creates a new trigger based on the given condition. | |
| Trigger () | |
Create a new trigger that is always false. | |
| Trigger (const Trigger &other) | |
| Trigger | OnChange (Command *command) |
| Starts the command when the condition changes. | |
| Trigger | OnChange (CommandPtr &&command) |
| Starts the command when the condition changes. | |
| Trigger | OnTrue (Command *command) |
Starts the given command whenever the condition changes from false to true. | |
| Trigger | OnTrue (CommandPtr &&command) |
Starts the given command whenever the condition changes from false to true. | |
| Trigger | OnFalse (Command *command) |
Starts the given command whenever the condition changes from true to false. | |
| Trigger | OnFalse (CommandPtr &&command) |
Starts the given command whenever the condition changes from true to false. | |
| Trigger | WhileTrue (Command *command) |
Starts the given command when the condition changes to true and cancels it when the condition changes to false. | |
| Trigger | WhileTrue (CommandPtr &&command) |
Starts the given command when the condition changes to true and cancels it when the condition changes to false. | |
| Trigger | WhileFalse (Command *command) |
Starts the given command when the condition changes to false and cancels it when the condition changes to true. | |
| Trigger | WhileFalse (CommandPtr &&command) |
Starts the given command when the condition changes to false and cancels it when the condition changes to true. | |
| Trigger | ToggleOnTrue (Command *command) |
Toggles a command when the condition changes from false to true. | |
| Trigger | ToggleOnTrue (CommandPtr &&command) |
Toggles a command when the condition changes from false to true. | |
| Trigger | ToggleOnFalse (Command *command) |
Toggles a command when the condition changes from true to the low state. | |
| Trigger | ToggleOnFalse (CommandPtr &&command) |
Toggles a command when the condition changes from true to false. | |
| Trigger | operator&& (std::function< bool()> rhs) |
| Composes two triggers with logical AND. | |
| Trigger | operator&& (Trigger rhs) |
| Composes two triggers with logical AND. | |
| Trigger | operator|| (std::function< bool()> rhs) |
| Composes two triggers with logical OR. | |
| Trigger | operator|| (Trigger rhs) |
| Composes two triggers with logical OR. | |
| Trigger | operator! () |
| Composes a trigger with logical NOT. | |
| 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. | |
| bool | Get () const |
| Returns the current state of this trigger. | |
A Button that uses a NetworkTable boolean field.
This class is provided by the NewCommands VendorDep
|
explicit |
Creates a NetworkButton that commands can be bound to.
| topic | The boolean topic that contains the value. |
|
explicit |
Creates a NetworkButton that commands can be bound to.
| sub | The boolean subscriber that provides the value. |
| frc2::NetworkButton::NetworkButton | ( | std::shared_ptr< nt::NetworkTable > | table, |
| std::string_view | field ) |
Creates a NetworkButton that commands can be bound to.
| table | The table where the networktable value is located. |
| field | The field that is the value. |
| frc2::NetworkButton::NetworkButton | ( | std::string_view | table, |
| std::string_view | field ) |
Creates a NetworkButton that commands can be bound to.
| table | The table where the networktable value is located. |
| field | The field that is the value. |
| frc2::NetworkButton::NetworkButton | ( | nt::NetworkTableInstance | inst, |
| std::string_view | table, | ||
| std::string_view | field ) |
Creates a NetworkButton that commands can be bound to.
| inst | The NetworkTable instance to use |
| table | The table where the networktable value is located. |
| field | The field that is the value. |