Class StatusSignalValue<T>

java.lang.Object
com.ctre.phoenixpro.BaseStatusSignalValue
com.ctre.phoenixpro.StatusSignalValue<T>
All Implemented Interfaces:
Cloneable

@Deprecated(forRemoval=true)
public class StatusSignalValue<T>
extends BaseStatusSignalValue
implements Cloneable
Deprecated, for removal: This API element is subject to removal in a future version.
StatusSignalValue has been renamed to StatusSignal. Additionally, Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.
Represents a status signal with data of type T, and operations available to retrieve information about the signal.
  • Constructor Details

    • StatusSignalValue

      @Deprecated(forRemoval=true) public StatusSignalValue​(DeviceIdentifier deviceIdentifier, int spn, Runnable reportIfOldFunc, Class<T> classOfSignal, String signalName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      StatusSignalValue has been renamed to StatusSignal. Additionally, Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.
    • StatusSignalValue

      @Deprecated(forRemoval=true) public StatusSignalValue​(DeviceIdentifier deviceIdentifier, int spn, Runnable reportIfOldFunc, Class<T> classOfSignal, ParentDevice.MapGenerator<T> generator, String signalName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      StatusSignalValue has been renamed to StatusSignal. Additionally, Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.
    • StatusSignalValue

      @Deprecated(forRemoval=true) public StatusSignalValue​(Class<T> classOfSignal, StatusCode error)
      Deprecated, for removal: This API element is subject to removal in a future version.
      StatusSignalValue has been renamed to StatusSignal. Additionally, Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.
      Constructor for an invalid StatusSignalValue
  • Method Details

    • asSupplier

      public Supplier<T> asSupplier()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a lambda that calls Refresh and GetValue on this object. This is useful for command-based programming.
      Returns:
      Supplier that refreshes this signal and returns it
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object
    • clone

      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      clone in class Object
    • getTypeClass

      public Class<T> getTypeClass()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getValue

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

      Returns:
      Cached value
    • refresh

      public StatusSignalValue<T> refresh​(boolean reportError)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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(double) instead.

      Parameters:
      reportError - Whether to report any errors to the Driver Station/stderr. Defaults true
      Returns:
      Reference to itself
    • refresh

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

      Returns:
      Reference to itself
    • waitForUpdate

      public StatusSignalValue<T> waitForUpdate​(double timeoutSec, boolean reportError)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.

      Parameters:
      timeoutSec - Maximum time to wait for the signal to update
      reportError - Whether to report any errors to the Driver Station/stderr. Defaults true
      Returns:
      Reference to itself
    • waitForUpdate

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

      Parameters:
      timeoutSec - Maximum time to wait for the signal to update
      Returns:
      Reference to itself
    • getDataCopy

      Deprecated, for removal: This API element is subject to removal in a future version.
      Get a basic data-only container with this information, to be used for things such as data logging.
      Returns:
      Basic structure with all relevant information