Class BaseStatusSignalValue

java.lang.Object
com.ctre.phoenixpro.BaseStatusSignalValue
Direct Known Subclasses:
StatusSignalValue

@Deprecated(forRemoval=true)
public abstract class BaseStatusSignalValue
extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
BaseStatusSignalValue has been renamed to BaseStatusSignal. Additionally, Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.
Class that provides operations to retrieve information about a status signal.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected double baseValue
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected DeviceIdentifier deviceIdentifier
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected StatusCode error
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected StatusSignalJNI jni
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String signalName
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected int spn
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected AllTimestamps timestamps
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String units
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type Method Description
    protected void copyFrom​(BaseStatusSignalValue other)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    AllTimestamps getAllTimestamps()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get all timestamps relevant for this signal
    StatusCode getError()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the error code from when we last received this signal
    static double getLatencyCompensatedValue​(StatusSignalValue<Double> signal, StatusSignalValue<Double> signalSlope)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Performs latency compensation on signal using the signalSlope and signal's latency to determine the magnitude of compensation.
    Timestamp getTimestamp()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the best available timestamp for this signal
    String getUnits()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the units for this signal
    static boolean isAllGood​(BaseStatusSignalValue... signals)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if all signals have an OK error code.
    StatusCode setUpdateFrequency​(double frequencyHz)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the rate at which the device will publish this signal.
    StatusCode setUpdateFrequency​(double frequencyHz, double timeoutSeconds)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the rate at which the device will publish this signal.
    static StatusCode waitForAll​(double timeoutSeconds, BaseStatusSignalValue... signals)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Waits for new data on all provided signals up to timeout.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • deviceIdentifier

      Deprecated, for removal: This API element is subject to removal in a future version.
    • spn

      protected int spn
      Deprecated, for removal: This API element is subject to removal in a future version.
    • units

      protected String units
      Deprecated, for removal: This API element is subject to removal in a future version.
    • error

      protected StatusCode error
      Deprecated, for removal: This API element is subject to removal in a future version.
    • baseValue

      protected double baseValue
      Deprecated, for removal: This API element is subject to removal in a future version.
    • timestamps

      Deprecated, for removal: This API element is subject to removal in a future version.
    • signalName

      protected final String signalName
      Deprecated, for removal: This API element is subject to removal in a future version.
    • jni

      protected StatusSignalJNI jni
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • copyFrom

      protected void copyFrom​(BaseStatusSignalValue other)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • waitForAll

      public static StatusCode waitForAll​(double timeoutSeconds, BaseStatusSignalValue... signals)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Waits for new data on all provided signals up to timeout. This API is typically used with CANivore Bus signals as they will be synced using the CANivore Timesync feature and arrive simultaneously. Signals on a roboRIO bus cannot be synced and may require a significantly longer blocking call to receive all signals. This can also be used with a timeout of zero to refresh many signals at once, which is faster than calling refresh() on every signal.
      Parameters:
      timeoutSeconds - Maximum time to wait for new data in seconds. Pass zero to refresh all signals without blocking.
      signals - Signals to wait for new data against
      Returns:
      An InvalidParamValue if signals array is empty, InvalidNetwork if signals are on different CAN bus networks, RxTimeout if it took longer than timeoutSeconds to receive all the signals, MultiSignalNotSupported if using the roboRIO bus with more than one signal and a non-zero timeout. An OK status code means that all signals arrived within timeoutSeconds and they are all OK. Any other value represents the StatusCode of the first failed signal. Call getError() on each signal to determine which ones failed.
    • getLatencyCompensatedValue

      public static double getLatencyCompensatedValue​(StatusSignalValue<Double> signal, StatusSignalValue<Double> signalSlope)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Performs latency compensation on signal using the signalSlope and signal's latency to determine the magnitude of compensation. The caller must refresh these StatusSignalValues beforehand; this function only does the math required for latency compensation.

      Important: The signalSlope must be the rate of change of the signal. If it is not the latency compensation may not perform as expected.

      Example: double compensatedTurns = getLatencyCompensatedValue(fx.getPosition(), fx.getVelocity());

      Parameters:
      signal - Signal to be latency compensated. Caller must make sure this signal is up to date either by calling StatusSignalValue.refresh() or StatusSignalValue.waitForUpdate(double).
      signalSlope - Derivative of signal that informs compensation magnitude. Caller must make sure this signal is up to date either by calling StatusSignalValue.refresh() or StatusSignalValue.waitForUpdate(double).
      Returns:
      Latency compensated value from the signal StatusSignalValue.
    • isAllGood

      public static boolean isAllGood​(BaseStatusSignalValue... signals)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if all signals have an OK error code.
      Parameters:
      signals - Signals to check error code of.
      Returns:
      True if all are good, false otherwise
    • setUpdateFrequency

      public StatusCode setUpdateFrequency​(double frequencyHz)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.

      This will wait up to 0.050 seconds (50ms) by default.

      Parameters:
      frequencyHz - Rate to publish the signal in Hz.
      Returns:
      Status code of setting the update frequency
    • setUpdateFrequency

      public StatusCode setUpdateFrequency​(double frequencyHz, double timeoutSeconds)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.

      Parameters:
      frequencyHz - Rate to publish the signal in Hz.
      timeoutSeconds - Maximum amount of time to wait when performing the action
      Returns:
      Status code of setting the update frequency
    • getUnits

      public String getUnits()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the units for this signal
      Returns:
      String representation of units for this signal
    • getAllTimestamps

      Deprecated, for removal: This API element is subject to removal in a future version.
      Get all timestamps relevant for this signal
      Returns:
      All timestamps available for this signal
    • getTimestamp

      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the best available timestamp for this signal
      Returns:
      Best available timestamp
    • getError

      public StatusCode getError()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the error code from when we last received this signal
      Returns:
      Last cached Error Code