
public abstract class MobileItem extends Object implements org.lsst.ccs.framework.HardwareController, AlertRaiser, org.lsst.ccs.framework.SignalHandler, org.lsst.ccs.framework.HasLifecycle
| Modifier and Type | Field and Description |
|---|---|
protected org.lsst.ccs.services.AgentStateService |
agentStateService |
protected FcsEnumerations.MobileItemAction |
currentAction |
protected static Logger |
FCSLOG |
protected boolean |
hasToWaitForEndOfAction |
protected Lock |
lock |
protected String |
name |
protected ScheduledFuture<?> |
readSensorsHandle |
protected org.lsst.ccs.Subsystem |
s |
protected ScheduledThreadPoolExecutor |
scheduler |
alertSeparator| Constructor and Description |
|---|
MobileItem() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
abortAction(FcsEnumerations.MobileItemAction action,
long delay)
aborts action actually running.
|
protected void |
cancelReadingSensors()
This stops the thread reading sensors.
|
protected void |
checkReadyForAction() |
void |
checkStopped() |
protected void |
executeAction(FcsEnumerations.MobileItemAction action,
long timeoutForAction)
This executes an action which moves the MobileItem and waits for the end od
this action.
|
org.lsst.ccs.services.alert.AlertService |
getAlertService()
return alertService
|
AtomicBoolean |
getHaltRequired() |
String |
getName() |
org.lsst.ccs.Subsystem |
getSubsystem() |
abstract boolean |
isActionCompleted(FcsEnumerations.MobileItemAction action) |
boolean |
isMoving()
Return true if the MobileItemMobile is moving.
|
abstract boolean |
myDevicesReady()
Return True if all CAN open devices useful for this MobileItemMobile are
ready for an action.
|
abstract void |
publishData() |
abstract void |
quickStopAction(FcsEnumerations.MobileItemAction action,
long delay) |
void |
readSensorsUntilActionIsCompleted(FcsEnumerations.MobileItemAction action,
long beginTime,
long timeout)
Start reading the sensors at a fixed rate (scheduler.scheduleAtFixedRate)
until the action is completed or we received a halt signal or the timeout for
this action is past.
|
void |
shutdown()
This shutdowns the scheduler.
|
org.lsst.ccs.framework.TreeWalkerDiag |
signal(org.lsst.ccs.framework.Signal signal) |
abstract void |
startAction(FcsEnumerations.MobileItemAction action)
starts the action given as argument.
|
abstract void |
updateStateWithSensorsToCheckIfActionIsCompleted()
reads sensors or any device and updates state from sensors
Tt can be also reading a position or a current on a motor controller.
|
protected void |
waitForEndOfAction(FcsEnumerations.MobileItemAction action)
This method waits until the action is completed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckHardware, checkStartedclearAlarm, getAlertSeparator, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarningprotected static final Logger FCSLOG
@LookupName protected String name
@LookupField(strategy=TOP) protected org.lsst.ccs.Subsystem s
@LookupField(strategy=TREE) protected org.lsst.ccs.services.AgentStateService agentStateService
protected volatile boolean hasToWaitForEndOfAction
protected volatile FcsEnumerations.MobileItemAction currentAction
protected final Lock lock
protected ScheduledFuture<?> readSensorsHandle
protected final ScheduledThreadPoolExecutor scheduler
public org.lsst.ccs.services.alert.AlertService getAlertService()
AlertRaisergetAlertService in interface AlertRaiserpublic String getName()
getName in interface AlertRaiserpublic org.lsst.ccs.Subsystem getSubsystem()
getSubsystem in interface AlertRaiserpublic boolean isMoving()
public AtomicBoolean getHaltRequired()
protected void cancelReadingSensors()
public abstract boolean myDevicesReady()
public abstract boolean isActionCompleted(FcsEnumerations.MobileItemAction action)
public abstract void updateStateWithSensorsToCheckIfActionIsCompleted()
public abstract void startAction(FcsEnumerations.MobileItemAction action)
action - public abstract void abortAction(FcsEnumerations.MobileItemAction action, long delay)
action - delay - public abstract void quickStopAction(FcsEnumerations.MobileItemAction action, long delay)
public abstract void publishData()
protected void checkReadyForAction()
protected void executeAction(FcsEnumerations.MobileItemAction action, long timeoutForAction)
action, - timeouttimeoutForAction - FailedCommandException - if the action can't be completedFcsHardwareExceptionpublic void readSensorsUntilActionIsCompleted(FcsEnumerations.MobileItemAction action, long beginTime, long timeout)
action - beginTime - timeout - protected void waitForEndOfAction(FcsEnumerations.MobileItemAction action)
action - public void shutdown()
shutdown in interface org.lsst.ccs.framework.HasLifecyclepublic org.lsst.ccs.framework.TreeWalkerDiag signal(org.lsst.ccs.framework.Signal signal)
signal in interface org.lsst.ccs.framework.SignalHandlersignal - public void checkStopped()
throws org.lsst.ccs.HardwareException
checkStopped in interface org.lsst.ccs.framework.HardwareControllerorg.lsst.ccs.HardwareExceptionCopyright © 2019 LSST. All rights reserved.