WPILibC++ 2023.4.3
|
Class to control a simulated analog trigger. More...
#include <frc/simulation/AnalogTriggerSim.h>
Public Member Functions | |
AnalogTriggerSim (const AnalogTrigger &analogTrigger) | |
Constructs from an AnalogTrigger object. More... | |
std::unique_ptr< CallbackStore > | RegisterInitializedCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on whether the analog trigger is initialized. More... | |
bool | GetInitialized () const |
Check if this analog trigger has been initialized. More... | |
void | SetInitialized (bool initialized) |
Change whether this analog trigger has been initialized. More... | |
std::unique_ptr< CallbackStore > | RegisterTriggerLowerBoundCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on the lower bound. More... | |
double | GetTriggerLowerBound () const |
Get the lower bound. More... | |
void | SetTriggerLowerBound (double triggerLowerBound) |
Change the lower bound. More... | |
std::unique_ptr< CallbackStore > | RegisterTriggerUpperBoundCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on the upper bound. More... | |
double | GetTriggerUpperBound () const |
Get the upper bound. More... | |
void | SetTriggerUpperBound (double triggerUpperBound) |
Change the upper bound. More... | |
void | ResetData () |
Reset all simulation data for this object. More... | |
Static Public Member Functions | |
static AnalogTriggerSim | CreateForChannel (int channel) |
Creates an AnalogTriggerSim for an analog input channel. More... | |
static AnalogTriggerSim | CreateForIndex (int index) |
Creates an AnalogTriggerSim for a simulated index. More... | |
Class to control a simulated analog trigger.
|
explicit |
Constructs from an AnalogTrigger object.
analogTrigger | AnalogTrigger to simulate |
|
static |
Creates an AnalogTriggerSim for an analog input channel.
channel | analog input channel |
std::out_of_range | if no AnalogTrigger is configured for that channel |
|
static |
Creates an AnalogTriggerSim for a simulated index.
The index is incremented for each simulated AnalogTrigger.
index | simulator index |
bool frc::sim::AnalogTriggerSim::GetInitialized | ( | ) | const |
Check if this analog trigger has been initialized.
double frc::sim::AnalogTriggerSim::GetTriggerLowerBound | ( | ) | const |
Get the lower bound.
double frc::sim::AnalogTriggerSim::GetTriggerUpperBound | ( | ) | const |
Get the upper bound.
std::unique_ptr< CallbackStore > frc::sim::AnalogTriggerSim::RegisterInitializedCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on whether the analog trigger is initialized.
callback | the callback that will be called whenever the analog trigger is initialized |
initialNotify | if true, the callback will be run on the initial value |
std::unique_ptr< CallbackStore > frc::sim::AnalogTriggerSim::RegisterTriggerLowerBoundCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on the lower bound.
callback | the callback that will be called whenever the lower bound is changed |
initialNotify | if true, the callback will be run on the initial value |
std::unique_ptr< CallbackStore > frc::sim::AnalogTriggerSim::RegisterTriggerUpperBoundCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on the upper bound.
callback | the callback that will be called whenever the upper bound is changed |
initialNotify | if true, the callback will be run on the initial value |
void frc::sim::AnalogTriggerSim::ResetData | ( | ) |
Reset all simulation data for this object.
void frc::sim::AnalogTriggerSim::SetInitialized | ( | bool | initialized | ) |
Change whether this analog trigger has been initialized.
initialized | the new value |
void frc::sim::AnalogTriggerSim::SetTriggerLowerBound | ( | double | triggerLowerBound | ) |
Change the lower bound.
triggerLowerBound | the new lower bound |
void frc::sim::AnalogTriggerSim::SetTriggerUpperBound | ( | double | triggerUpperBound | ) |
Change the upper bound.
triggerUpperBound | the new upper bound |