RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
org.wpilib.tunable.TunableBase Class Referenceabstract
Inheritance diagram for org.wpilib.tunable.TunableBase:
org.wpilib.tunable.Tunable< T > org.wpilib.tunable.TunableBoolean org.wpilib.tunable.TunableDouble org.wpilib.tunable.TunableFloat org.wpilib.tunable.TunableInt org.wpilib.tunable.TunableLong

Public Member Functions

boolean isRobust ()
String getProperties ()
TunableConfig getConfig ()
boolean hasChanged ()
boolean supportsChangeNotification ()
void resetChanged ()

Protected Member Functions

 TunableBase (TunableConfig config)
 TunableBase (TunableConfig config, boolean supportsChangeNotification)
void markChanged ()

Protected Attributes

boolean m_changed

Detailed Description

The base class for tunables.

Definition at line 9 of file TunableBase.java.

Constructor & Destructor Documentation

◆ TunableBase() [1/2]

org.wpilib.tunable.TunableBase.TunableBase ( TunableConfig config)
protected

Constructs a tunable base.

Parameters
configtunable config

Definition at line 24 of file TunableBase.java.

◆ TunableBase() [2/2]

org.wpilib.tunable.TunableBase.TunableBase ( TunableConfig config,
boolean supportsChangeNotification )
protected

Constructs a tunable base.

If supportsChangeNotification is true, subclasses must call markChanged() instead of setting m_changed directly.

Parameters
configtunable config
supportsChangeNotificationwhether the tunable notifies backends when it changes

Definition at line 37 of file TunableBase.java.

Member Function Documentation

◆ getConfig()

TunableConfig org.wpilib.tunable.TunableBase.getConfig ( )

Returns the configuration of this tunable.

Returns
the configuration of this tunable

Definition at line 67 of file TunableBase.java.

◆ getProperties()

String org.wpilib.tunable.TunableBase.getProperties ( )

Returns the properties of this tunable as a JSON string.

See also
TunableConfig.getProperties()
Returns
the properties of this tunable as a JSON string

Definition at line 58 of file TunableBase.java.

◆ hasChanged()

boolean org.wpilib.tunable.TunableBase.hasChanged ( )

Returns whether the tunable value has changed since the last time it was tuned.

Returns
true if the tunable value has changed, false otherwise

Definition at line 76 of file TunableBase.java.

◆ isRobust()

boolean org.wpilib.tunable.TunableBase.isRobust ( )

Returns whether this tunable is robust.

See also
TunableConfig.isRobust()
Returns
true if the tunable is robust, false otherwise

Definition at line 48 of file TunableBase.java.

◆ markChanged()

void org.wpilib.tunable.TunableBase.markChanged ( )
protected

Marks the tunable changed and notifies backends.

Definition at line 90 of file TunableBase.java.

◆ resetChanged()

void org.wpilib.tunable.TunableBase.resetChanged ( )

Resets the changed flag. Should generally only be used by backends.

Definition at line 100 of file TunableBase.java.

◆ supportsChangeNotification()

boolean org.wpilib.tunable.TunableBase.supportsChangeNotification ( )

Returns whether this tunable notifies backends when set() marks it changed.

Returns
true if this tunable notifies backends when changed, false otherwise

Definition at line 85 of file TunableBase.java.

Member Data Documentation

◆ m_changed

boolean org.wpilib.tunable.TunableBase.m_changed
protected

Whether the tunable value has changed since the last time it was tuned. This is set to true when set() is called and cleared when notifyTune() is called.

Definition at line 17 of file TunableBase.java.


The documentation for this class was generated from the following file: