Class to read quad encoders.
Definition: Encoder.h:41
Class to control a simulated encoder.
Definition: EncoderSim.h:20
double GetRate()
Get the rate of the encoder.
int GetSamplesToAverage() const
Get the samples-to-average value.
std::unique_ptr< CallbackStore > RegisterInitializedCallback(NotifyCallback callback, bool initialNotify)
Register a callback on the Initialized property of the encoder.
bool GetDirection() const
Get the direction of the encoder.
bool GetInitialized() const
Read the Initialized value of the encoder.
double GetPeriod() const
Read the period of the encoder.
std::unique_ptr< CallbackStore > RegisterReverseDirectionCallback(NotifyCallback callback, bool initialNotify)
Register a callback on the reverse direction.
EncoderSim(const Encoder &encoder)
Constructs from an Encoder object.
std::unique_ptr< CallbackStore > RegisterCountCallback(NotifyCallback callback, bool initialNotify)
Register a callback on the count property of the encoder.
void SetPeriod(double period)
Change the encoder period.
void ResetData()
Resets all simulation data for this encoder.
int GetCount() const
Read the count of the encoder.
void SetDirection(bool direction)
Set the direction of the encoder.
double GetMaxPeriod() const
Get the max period of the encoder.
double GetDistancePerPulse() const
Read the distance per pulse of the encoder.
void SetMaxPeriod(double maxPeriod)
Change the max period of the encoder.
std::unique_ptr< CallbackStore > RegisterDistancePerPulseCallback(NotifyCallback callback, bool initialNotify)
Register a callback on the distance per pulse value of this encoder.
double GetDistance()
Read the distance of the encoder.
std::unique_ptr< CallbackStore > RegisterDirectionCallback(NotifyCallback callback, bool initialNotify)
Register a callback on the direction of the encoder.
std::unique_ptr< CallbackStore > RegisterResetCallback(NotifyCallback callback, bool initialNotify)
Register a callback to be called whenever the encoder is reset.
std::unique_ptr< CallbackStore > RegisterSamplesToAverageCallback(NotifyCallback callback, bool initialNotify)
Register a callback on the samples-to-average value of this encoder.
std::unique_ptr< CallbackStore > RegisterMaxPeriodCallback(NotifyCallback callback, bool initialNotify)
Register a callback to be run whenever the max period of the encoder is changed.
void SetSamplesToAverage(int samplesToAverage)
Set the samples-to-average value.
void SetCount(int count)
Change the count of the encoder.
bool GetReverseDirection() const
Get the reverse direction of the encoder.
void SetReverseDirection(bool reverseDirection)
Set the reverse direction.
std::unique_ptr< CallbackStore > RegisterPeriodCallback(NotifyCallback callback, bool initialNotify)
Register a callback on the period of the encoder.
void SetReset(bool reset)
Change the reset property of the encoder.
void SetDistance(double distance)
Change the encoder distance.
static EncoderSim CreateForChannel(int channel)
Creates an EncoderSim for a digital input channel.
void SetRate(double rate)
Change the rate of the encoder.
bool GetReset() const
Check if the encoder has been reset.
void SetInitialized(bool initialized)
Change the Initialized value of the encoder.
void SetDistancePerPulse(double distancePerPulse)
Change the encoder distance per pulse.
static EncoderSim CreateForIndex(int index)
Creates an EncoderSim for a simulated index.
constexpr auto count() -> size_t
Definition: core.h:1204
std::function< void(std::string_view, const HAL_Value *)> NotifyCallback
Definition: CallbackStore.h:14
Definition: AprilTagFieldLayout.h:22