Represents a status signal with data of type T, and operations available to retrieve information about the signal.
More...
|
| T | GetValue () const |
| | Gets the cached value from this status signal.
|
| |
| StatusSignal< T > & | Refresh (bool ReportOnError=true) |
| | Refreshes the value of this status signal.
|
| |
| StatusSignal< T > & | WaitForUpdate (units::time::second_t timeoutSec, bool ReportOnError=true) |
| | Waits up to timeoutSec to get the up-to-date status signal value.
|
| |
| bool | IsNear (T target, T tolerance) const |
| | Checks whether the signal is near a target value within the given tolerance.
|
| |
| bool | IsNear (T target, T tolerance) const |
| | Checks whether the signal is near a target value within the given tolerance.
|
| |
| SignalMeasurement< T > | GetDataCopy () const |
| | Get a basic data-only container with a copy of the current signal data.
|
| |
| std::function< T()> | AsSupplier () |
| | Returns a lambda that calls Refresh and GetValue on this object.
|
| |
| std::string | ToString () const |
| |
| virtual | ~BaseStatusSignal ()=0 |
| |
| std::string const & | GetName () const |
| | Gets the name of this signal.
|
| |
| std::string const & | GetUnits () const |
| | Gets the units for this signal.
|
| |
| double | GetValueAsDouble () const |
| | Gets the value of this signal as a double.
|
| |
| AllTimestamps const & | GetAllTimestamps () const |
| | Gets the timestamps of this signals.
|
| |
| Timestamp const & | GetTimestamp () const |
| | Gets the most accurate timestamp available for this signal.
|
| |
| ctre::phoenix::StatusCode | GetStatus () const |
| | Gets the error code from when we last received this signal.
|
| |
| bool | HasUpdated () |
| | Checks whether the signal has been updated since the last check.
|
| |
| ctre::phoenix::StatusCode | SetUpdateFrequency (units::frequency::hertz_t frequencyHz, units::time::second_t timeoutSeconds=100_ms) |
| | Sets the rate at which the device will publish this signal.
|
| |
| units::frequency::hertz_t | GetAppliedUpdateFrequency () const |
| | Gets the rate at which the device will publish this signal.
|
| |
|
template<typename U , typename U_PER_SEC >
requires units::traits::is_unit_t_v<U> && units::traits::is_unit_t_v<U_PER_SEC> && units::traits::is_convertible_unit_v< typename units::traits::unit_t_traits<U>::unit_type, units::compound_unit<typename units::traits::unit_t_traits<U_PER_SEC>::unit_type, units::seconds> > |
| static U | GetLatencyCompensatedValue (StatusSignal< U > const &signal, StatusSignal< U_PER_SEC > const &signalSlope, units::time::second_t maxLatencySeconds=0.300_s) |
| | Performs latency compensation on signal using the signalSlope and signal's latency to determine the magnitude of compensation.
|
| |
| template<std::derived_from< BaseStatusSignal >... Signals> |
| static ctre::phoenix::StatusCode | WaitForAll (units::time::second_t timeoutSeconds, Signals &... signals) |
| | Waits for new data on all provided signals up to timeout.
|
| |
| static ctre::phoenix::StatusCode | WaitForAll (units::time::second_t timeoutSeconds, std::span< BaseStatusSignal *const > signals) |
| | Waits for new data on all provided signals up to timeout.
|
| |
| template<std::derived_from< BaseStatusSignal >... Signals> |
| static ctre::phoenix::StatusCode | RefreshAll (Signals &... signals) |
| | Performs a non-blocking refresh on all provided signals.
|
| |
| static ctre::phoenix::StatusCode | RefreshAll (std::span< BaseStatusSignal *const > signals) |
| | Performs a non-blocking refresh on all provided signals.
|
| |
| template<std::derived_from< BaseStatusSignal >... Signals> |
| static bool | IsAllGood (Signals const &... signals) |
| | Checks if all signals have an OK error code.
|
| |
| static bool | IsAllGood (std::span< BaseStatusSignal const *const > signals) |
| | Checks if all signals have an OK error code.
|
| |
| template<std::derived_from< BaseStatusSignal >... Signals> |
| static ctre::phoenix::StatusCode | SetUpdateFrequencyForAll (units::frequency::hertz_t frequencyHz, Signals &... signals) |
| | Sets the update frequency of all specified status signals to the provided common frequency.
|
| |
| static ctre::phoenix::StatusCode | SetUpdateFrequencyForAll (units::frequency::hertz_t frequencyHz, std::span< BaseStatusSignal *const > signals) |
| | Sets the update frequency of all specified status signals to the provided common frequency.
|
| |
| | BaseStatusSignal (hardware::DeviceIdentifier deviceIdentifier, uint16_t spn, std::string signalName, std::function< void()> checkFirmVersFunction) |
| |
| | BaseStatusSignal (hardware::DeviceIdentifier deviceIdentifier, uint16_t spn, std::string signalName, std::function< void()> checkFirmVersFunction, std::function< std::map< uint16_t, std::string >()> const &unitsGenerator) |
| |
| | BaseStatusSignal (ctre::phoenix::StatusCode error) |
| |
| void | RefreshValue (bool waitForUpdate, units::time::second_t timeout, bool ReportOnError) |
| |
| void | UpdateUnits (uint16_t unitsKey) |
| |
| static std::string | Status_GetUnits (uint32_t signal) |
| |
| static ctre::phoenix::StatusCode | Status_Get (BaseStatusSignal &signal, char const *network, bool bWaitForUpdate, double timeoutSeconds) |
| |
| static ctre::phoenix::StatusCode | Status_WaitForAll (std::span< BaseStatusSignal *const > signals, char const *network, double timeoutSeconds) |
| |
| static ctre::phoenix::StatusCode | Status_SetUpdateFrequency (char const *canbus, uint32_t deviceHash, uint16_t spn, double frequencyHz, double timeoutSeconds) |
| |
| static ctre::phoenix::StatusCode | Status_SetUpdateFrequencyForAll (std::span< BaseStatusSignal *const > signals, double frequencyHz, double timeoutSeconds) |
| |
| static double | Status_GetAppliedUpdateFrequency (char const *canbus, uint32_t deviceHash, uint16_t spn) |
| |
| static ctre::phoenix::StatusCode | WaitForAllImpl (char const *location, units::time::second_t timeoutSeconds, std::span< BaseStatusSignal *const > signals) |
| |
| std::string | units |
| |
| double | baseValue = 0 |
| |
| AllTimestamps | timestamps {} |
| |
| ctre::phoenix::StatusCode | error = ctre::phoenix::StatusCode::SigNotUpdated |
| |
template<typename T>
class ctre::phoenix6::StatusSignal< T >
Represents a status signal with data of type T, and operations available to retrieve information about the signal.