public abstract class LynxController extends LynxCommExceptionHandler implements Engagable, HardwareDevice, HardwareDeviceHealth, RobotArmingStateNotifier.Callback, RobotArmingStateNotifier
| Modifier and Type | Class and Description |
|---|---|
class |
LynxController.PretendLynxModule |
HardwareDevice.ManufacturerHardwareDeviceHealth.HealthStatusRobotArmingStateNotifier.ARMINGSTATE, RobotArmingStateNotifier.Callback| Modifier and Type | Field and Description |
|---|---|
protected Context |
context |
protected HardwareDeviceHealthImpl |
hardwareDeviceHealth |
protected boolean |
isEngaged |
protected boolean |
isHardwareInitialized |
protected boolean |
isHooked |
protected WeakReferenceSet<RobotArmingStateNotifier.Callback> |
registeredCallbacks |
tag| Constructor and Description |
|---|
LynxController(Context context,
LynxModule module) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
adjustHookingToMatchEngagement() |
void |
close()
Closes this device
|
void |
disengage()
Disengage the object from underlying services it uses to render its function.
|
protected void |
doHook() |
protected void |
doUnhook() |
void |
engage()
(Re)enage the object with its underlying services.
|
protected void |
finishConstruction() |
protected void |
floatHardware() |
void |
forgetLastKnown() |
RobotArmingStateNotifier.ARMINGSTATE |
getArmingState()
Returns the current arming state of the object.
|
java.lang.String |
getConnectionInfo()
Get connection information about this device in a human readable format
|
abstract java.lang.String |
getDeviceName()
Returns a string suitable for display to the user as to the type of device.
|
HardwareDeviceHealth.HealthStatus |
getHealthStatus() |
protected java.util.concurrent.Callable<HardwareDeviceHealth.HealthStatus> |
getHealthStatusOverride() |
HardwareDevice.Manufacturer |
getManufacturer()
Returns an indication of the manufacturer of this device.
|
protected LynxModuleIntf |
getModule() |
SerialNumber |
getSerialNumber()
Returns the serial number of this USB module
|
protected abstract java.lang.String |
getTag() |
int |
getVersion()
Version
|
protected void |
hook() |
protected void |
initializeHardware() |
protected boolean |
isArmed() |
boolean |
isEngaged()
Returns whether the object is currently in the engaged state.
|
protected void |
moduleNowArmedOrPretending() |
protected void |
moduleNowDisarmed() |
void |
onModuleStateChange(RobotArmingStateNotifier module,
RobotArmingStateNotifier.ARMINGSTATE state)
Notifies the callback that a module with which it has registered for notifications
has undergone a change of state.
|
void |
registerCallback(RobotArmingStateNotifier.Callback callback,
boolean doInitialCallback)
Registers a callback for arming state notifications from this module.
|
void |
resetDeviceConfigurationForOpMode()
Resets the device's configuration to that which is expected at the beginning of an OpMode.
|
void |
setHealthStatus(HardwareDeviceHealth.HealthStatus status) |
protected void |
setHealthyIfArmed() |
protected void |
unhook() |
void |
unregisterCallback(RobotArmingStateNotifier.Callback callback)
Unregister a callback which has been registered for notifications with this module.
|
handleException, handleSpecificException, handleSpecificException, handleSpecificException, handleSpecificExceptionprotected Context context
protected boolean isHardwareInitialized
protected boolean isEngaged
protected boolean isHooked
protected final WeakReferenceSet<RobotArmingStateNotifier.Callback> registeredCallbacks
protected final HardwareDeviceHealthImpl hardwareDeviceHealth
public LynxController(Context context,
LynxModule module)
protected abstract java.lang.String getTag()
getTag in class LynxCommExceptionHandlerprotected void finishConstruction()
public void onModuleStateChange(RobotArmingStateNotifier module, RobotArmingStateNotifier.ARMINGSTATE state)
RobotArmingStateNotifier.CallbackonModuleStateChange in interface RobotArmingStateNotifier.Callbackmodule - the module whose state has changedstate - the state into which that module has transitioned#registerCallback(Callback)protected void moduleNowArmedOrPretending()
protected void moduleNowDisarmed()
public SerialNumber getSerialNumber()
RobotArmingStateNotifiergetSerialNumber in interface RobotArmingStateNotifierpublic RobotArmingStateNotifier.ARMINGSTATE getArmingState()
RobotArmingStateNotifiergetArmingState in interface RobotArmingStateNotifierpublic void registerCallback(RobotArmingStateNotifier.Callback callback, boolean doInitialCallback)
RobotArmingStateNotifierregisterCallback in interface RobotArmingStateNotifierRobotArmingStateNotifier.unregisterCallback(Callback)public void unregisterCallback(RobotArmingStateNotifier.Callback callback)
RobotArmingStateNotifierunregisterCallback in interface RobotArmingStateNotifierRobotArmingStateNotifier.registerCallback(Callback, boolean)public HardwareDevice.Manufacturer getManufacturer()
HardwareDevicegetManufacturer in interface HardwareDevicepublic void close()
HardwareDeviceclose in interface HardwareDevicepublic java.lang.String getConnectionInfo()
HardwareDevicegetConnectionInfo in interface HardwareDevicepublic int getVersion()
HardwareDevicegetVersion in interface HardwareDevicepublic abstract java.lang.String getDeviceName()
HardwareDevicegetDeviceName in interface HardwareDevicepublic void resetDeviceConfigurationForOpMode()
HardwareDeviceresetDeviceConfigurationForOpMode in interface HardwareDeviceprotected void initializeHardware()
throws RobotCoreException,
java.lang.InterruptedException
RobotCoreExceptionjava.lang.InterruptedExceptionprotected void floatHardware()
public void forgetLastKnown()
protected void setHealthyIfArmed()
public void setHealthStatus(HardwareDeviceHealth.HealthStatus status)
setHealthStatus in interface HardwareDeviceHealthprotected java.util.concurrent.Callable<HardwareDeviceHealth.HealthStatus> getHealthStatusOverride()
public HardwareDeviceHealth.HealthStatus getHealthStatus()
getHealthStatus in interface HardwareDeviceHealthpublic void engage()
Engagablepublic void disengage()
Engagablepublic boolean isEngaged()
Engagableprotected LynxModuleIntf getModule()
protected void adjustHookingToMatchEngagement()
protected void hook()
protected void unhook()
protected void doHook()
protected void doUnhook()
protected boolean isArmed()