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 voidaddChild(Object child)Add a child component.voidclose()voidfree()Deprecated.StringgetName()Gets the name of thisSendableobject.StringgetSubsystem()Gets the subsystem name of thisSendableobject.voidsetName(String name)Sets the name of thisSendableobject.protected voidsetName(String moduleType, int channel)Sets the name of the sensor with a channel number.protected voidsetName(String moduleType, int moduleNumber, int channel)Sets the name of the sensor with a module and channel number.voidsetSubsystem(String subsystem)Sets the subsystem name of thisSendableobject.-
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:
closein interfaceAutoCloseable
-
getName
public final String getName()
Description copied from interface:SendableGets the name of thisSendableobject.
-
setName
public final void setName(String name)
Description copied from interface:SendableSets the name of thisSendableobject.
-
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:SendableGets the subsystem name of thisSendableobject.- Specified by:
getSubsystemin interfaceSendable- Returns:
- Subsystem name
-
setSubsystem
public final void setSubsystem(String subsystem)
Description copied from interface:SendableSets the subsystem name of thisSendableobject.- Specified by:
setSubsystemin interfaceSendable- Parameters:
subsystem- subsystem name
-
addChild
protected final void addChild(Object child)
Add a child component.- Parameters:
child- child component
-
-