CTRE Phoenix Pro C++ 23.0.12
|
#include <ctre/phoenixpro/StatusSignalValue.hpp>
Public Member Functions | |
std::string | ToString () const |
T | GetValue () const |
Gets the cached value from this status signal value. More... | |
StatusSignalValue< T > & | Refresh (bool ReportOnError=true) |
Refreshes this status signal value. More... | |
StatusSignalValue< T > & | WaitForUpdate (units::time::second_t timeoutSec, bool ReportOnError=true) |
Waits up to timeoutSec to get the up-to-date status signal value. More... | |
SignalMeasurement< T > | GetDataCopy () const |
Get a basic data-only container with this information, to be used for things such as data logging. More... | |
ctre::phoenix::StatusCode | SetUpdateFrequency (units::frequency::hertz_t frequencyHz, units::time::second_t timeoutSeconds=50_ms) |
Sets the rate at which the device will publish this signal. More... | |
std::function< T()> | AsSupplier () |
Returns a lambda that calls Refresh and GetValue on this object. More... | |
Public Member Functions inherited from ctre::phoenixpro::BaseStatusSignalValue | |
virtual | ~BaseStatusSignalValue ()=0 |
const std::string & | GetUnits () const |
Gets the units for this signal. More... | |
const AllTimestamps & | GetAllTimestamps () const |
Get the timestamps of this signals. More... | |
const Timestamp & | GetTimestamp () const |
Get the best timestamp available to this signal. More... | |
ctre::phoenix::StatusCode | GetError () const |
Get the error code from when we last received this signal. More... | |
Friends | |
class | hardware::ParentDevice |
std::ostream & | operator<< (std::ostream &os, const StatusSignalValue< T > &data) |
Additional Inherited Members | |
Static Public Member Functions inherited from ctre::phoenixpro::BaseStatusSignalValue | |
static ctre::phoenix::StatusCode | WaitForAll (units::time::second_t timeoutSeconds, std::initializer_list< BaseStatusSignalValue * > signals) |
Wait for all provided signals up to timeout. More... | |
static ctre::phoenix::StatusCode | WaitForAll (units::time::second_t timeoutSeconds, const std::vector< BaseStatusSignalValue * > &signals) |
Wait for all provided signals up to timeout. More... | |
template<typename U , typename U_PER_SEC > | |
static U | GetLatencyCompensatedValue (StatusSignalValue< U > &signal, StatusSignalValue< U_PER_SEC > &signalSlope) |
static ctre::phoenix::StatusCode | IsAllGood (std::initializer_list< BaseStatusSignalValue * > signals) |
Check if all signals have an OK error code. More... | |
Protected Member Functions inherited from ctre::phoenixpro::BaseStatusSignalValue | |
void | CopyFrom (const BaseStatusSignalValue &other) |
BaseStatusSignalValue (hardware::DeviceIdentifier deviceIdentifier, uint16_t spn, std::string signalName) | |
BaseStatusSignalValue (ctre::phoenix::StatusCode error) | |
ctre::phoenix::StatusCode | SetUpdateFrequency (const char *canbus, uint32_t deviceHash, uint16_t spn, units::frequency::hertz_t frequencyHz, units::time::second_t timeoutSeconds) |
Static Protected Member Functions inherited from ctre::phoenixpro::BaseStatusSignalValue | |
static ctre::phoenix::StatusCode | Status_WaitForAll (std::initializer_list< BaseStatusSignalValue * > signals, const char *network, units::time::second_t timeoutSeconds) |
Wait for multiple signals to arrive. More... | |
static ctre::phoenix::StatusCode | Status_WaitForAll (const std::vector< BaseStatusSignalValue * > &signals, const char *network, units::time::second_t timeoutSeconds) |
Wait for multiple signals to arrive. More... | |
static ctre::phoenix::StatusCode | Status_Get (const char *network, int deviceHash, uint32_t signal, bool bWaitForUpdate, units::time::second_t timeoutSeconds, double *outValue, std::string *units, double *hwtimestamp, double *swtimestamp, double *ecutimestamp, int32_t *timestampType) |
Get signal update. More... | |
Protected Attributes inherited from ctre::phoenixpro::BaseStatusSignalValue | |
hardware::DeviceIdentifier | deviceIdentifier |
uint16_t | spn |
std::string | units |
AllTimestamps | timestamps {} |
int | timestampType |
double | baseValue = 0 |
ctre::phoenix::StatusCode | error = ctre::phoenix::StatusCode::SigNotUpdated |
std::string | signalName |
|
inline |
Returns a lambda that calls Refresh and GetValue on this object.
This is useful for command-based programming.
|
inline |
Get a basic data-only container with this information, to be used for things such as data logging.
|
inline |
Gets the cached value from this status signal value.
Gets the cached value. To make sure the value is up-to-date call Refresh()
or WaitForUpdate()
|
inline |
Refreshes this status signal value.
If the user application caches this StatusSignalValue object instead of periodically fetching it from the hardware device, this function must be called to fetch fresh data.
This performs a non-blocking refresh operation. If you want to wait until you receive the signal, call WaitForUpdate()
instead.
ReportOnError | Report to the Driver Station if this refresh returns a StatusCode other than OK |
|
inline |
Sets the rate at which the device will publish this signal.
The minimum supported signal frequency is 4 Hz, and the maximum is 1000 Hz.
frequencyHz | Rate to publish the signal in Hz. |
timeoutSeconds | Maximum amount of time to wait when performing the action |
|
inline |
|
inline |
Waits up to timeoutSec to get the up-to-date status signal value.
This performs a blocking refresh operation. If you want to non-blocking refresh the signal, call Refresh()
instead.
timeoutSec | Timeout to wait for an update on the signal |
ReportOnError | Report to the Driver Station if this refresh returns a StatusCode other than OK |
|
friend |
|
friend |