Package edu.wpi.first.wpilibj
Class SendableBase
- java.lang.Object
-
- edu.wpi.first.wpilibj.SendableBase
-
- All Implemented Interfaces:
Sendable
,AutoCloseable
- Direct Known Subclasses:
ADXL345_I2C
,ADXL345_SPI
,ADXL362
,AnalogAccelerometer
,AnalogInput
,AnalogOutput
,AnalogPotentiometer
,AnalogTrigger
,BuiltInAccelerometer
,Command
,Compressor
,Counter
,DigitalGlitchFilter
,DigitalOutput
,Encoder
,GyroBase
,InterruptableSensorBase
,PIDBase
,PowerDistributionPanel
,Scheduler
,SendableCameraWrapper
,SendableChooser
,SolenoidBase
,SpeedControllerGroup
,Subsystem
,Trigger
,Ultrasonic
public abstract class SendableBase extends Object implements Sendable, AutoCloseable
Base class for all sensors. Stores most recent status information as well as containing utility functions for checking channels and error processing.
-
-
Constructor Summary
Constructors Constructor Description SendableBase()
Creates an instance of the sensor base.SendableBase(boolean addLiveWindow)
Creates an instance of the sensor base.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addChild(Object child)
Add a child component.void
close()
void
free()
Deprecated.String
getName()
Gets the name of thisSendable
object.String
getSubsystem()
Gets the subsystem name of thisSendable
object.void
setName(String name)
Sets the name of thisSendable
object.protected void
setName(String moduleType, int channel)
Sets the name of the sensor with a channel number.protected void
setName(String moduleType, int moduleNumber, int channel)
Sets the name of the sensor with a module and channel number.void
setSubsystem(String subsystem)
Sets the subsystem name of thisSendable
object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.wpi.first.wpilibj.Sendable
initSendable, setName
-
-
-
-
Method Detail
-
free
@Deprecated public void free()
Deprecated.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
getName
public final String getName()
Description copied from interface:Sendable
Gets the name of thisSendable
object.
-
setName
public final void setName(String name)
Description copied from interface:Sendable
Sets the name of thisSendable
object.
-
setName
protected final void setName(String moduleType, int channel)
Sets the name of the sensor with a channel number.- Parameters:
moduleType
- A string that defines the module name in the label for the valuechannel
- The channel number the device is plugged into
-
setName
protected final void setName(String moduleType, int moduleNumber, int channel)
Sets the name of the sensor with a module and channel number.- Parameters:
moduleType
- A string that defines the module name in the label for the valuemoduleNumber
- The number of the particular module typechannel
- The channel number the device is plugged into (usually PWM)
-
getSubsystem
public final String getSubsystem()
Description copied from interface:Sendable
Gets the subsystem name of thisSendable
object.- Specified by:
getSubsystem
in interfaceSendable
- Returns:
- Subsystem name
-
setSubsystem
public final void setSubsystem(String subsystem)
Description copied from interface:Sendable
Sets the subsystem name of thisSendable
object.- Specified by:
setSubsystem
in interfaceSendable
- Parameters:
subsystem
- subsystem name
-
addChild
protected final void addChild(Object child)
Add a child component.- Parameters:
child
- child component
-
-