public abstract class MobileItemModule
extends org.lsst.ccs.framework.Module
implements org.lsst.ccs.framework.HardwareController
| Modifier and Type | Field and Description |
|---|---|
protected FcsEnumerations.MobileItemAction |
currentAction |
protected static org.lsst.ccs.utilities.logging.Logger |
fcslog |
protected AtomicBoolean |
haltRequired |
protected boolean |
hasToWaitForEndOfAction |
protected Lock |
lock |
protected Condition |
motionCompleted |
protected boolean |
moving |
protected AtomicBoolean |
stopRequired |
| Constructor and Description |
|---|
MobileItemModule(String moduleName,
int aTickMillis) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort() |
void |
abort(long delay)
just to avoid taping "sendSignal HALT"
|
abstract void |
abortAction(FcsEnumerations.MobileItemAction action,
long delay) |
org.lsst.ccs.framework.TreeWalkerDiag |
checkHardware() |
void |
checkStarted() |
void |
checkStopped() |
protected String |
executeAction(FcsEnumerations.MobileItemAction action,
long timeoutForAction)
This executes an action which moves the MobileItem and waits for the end od this action.
|
AtomicBoolean |
getHaltRequired() |
void |
initModule() |
abstract boolean |
isActionCompleted(FcsEnumerations.MobileItemAction action) |
abstract boolean |
isHardwareReady() |
boolean |
isMoving() |
abstract void |
postAction(FcsEnumerations.MobileItemAction action) |
abstract void |
publishData() |
void |
quickstop()
just to avoid taping "sendSignal STOP"
|
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 |
shutdownNow()
This shutdowns the scheduler.
|
org.lsst.ccs.framework.TreeWalkerDiag |
signal(org.lsst.ccs.framework.Signal signal) |
abstract void |
startAction(FcsEnumerations.MobileItemAction action) |
void |
stop()
just to avoid taping "sendSignal STOP"
|
void |
stop(long delay)
just to avoid taping "sendSignal STOP"
|
abstract void |
updateStateWithSensorsToCheckIfActionIsCompleted() |
alias, getComponentTree, getEnvironment, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, percolateSignal, postStart, processUpdate, sendSignal, sendSignalWithTimeLimit, setEnvironment, setName, setNObserverThreads, setObservables, setTickMillis, startTicking, tick, updateaddObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedprotected static final org.lsst.ccs.utilities.logging.Logger fcslog
protected volatile boolean hasToWaitForEndOfAction
protected volatile FcsEnumerations.MobileItemAction currentAction
protected volatile boolean moving
protected final Lock lock
protected final Condition motionCompleted
protected AtomicBoolean haltRequired
protected AtomicBoolean stopRequired
public MobileItemModule(String moduleName, int aTickMillis)
public boolean isMoving()
public AtomicBoolean getHaltRequired()
public void initModule()
initModule in class org.lsst.ccs.framework.Modulepublic abstract boolean isHardwareReady()
public abstract boolean isActionCompleted(FcsEnumerations.MobileItemAction action)
public abstract void updateStateWithSensorsToCheckIfActionIsCompleted()
throws Exception
Exceptionpublic abstract void startAction(FcsEnumerations.MobileItemAction action) throws org.lsst.ccs.messaging.BadCommandException, org.lsst.ccs.messaging.ErrorInCommandExecutionException, FcsHardwareException
org.lsst.ccs.messaging.BadCommandExceptionorg.lsst.ccs.messaging.ErrorInCommandExecutionExceptionFcsHardwareExceptionpublic abstract void abortAction(FcsEnumerations.MobileItemAction action, long delay) throws org.lsst.ccs.messaging.BadCommandException, org.lsst.ccs.messaging.ErrorInCommandExecutionException, FcsHardwareException
org.lsst.ccs.messaging.BadCommandExceptionorg.lsst.ccs.messaging.ErrorInCommandExecutionExceptionFcsHardwareExceptionpublic abstract void quickStopAction(FcsEnumerations.MobileItemAction action, long delay) throws org.lsst.ccs.messaging.BadCommandException, org.lsst.ccs.messaging.ErrorInCommandExecutionException, FcsHardwareException
org.lsst.ccs.messaging.BadCommandExceptionorg.lsst.ccs.messaging.ErrorInCommandExecutionExceptionFcsHardwareExceptionpublic abstract void postAction(FcsEnumerations.MobileItemAction action) throws org.lsst.ccs.messaging.BadCommandException, org.lsst.ccs.messaging.ErrorInCommandExecutionException, FcsHardwareException
org.lsst.ccs.messaging.BadCommandExceptionorg.lsst.ccs.messaging.ErrorInCommandExecutionExceptionFcsHardwareExceptionpublic abstract void publishData()
protected String executeAction(FcsEnumerations.MobileItemAction action, long timeoutForAction) throws org.lsst.ccs.messaging.BadCommandException, org.lsst.ccs.messaging.ErrorInCommandExecutionException, FcsHardwareException
action, - timeouttimeoutForAction - org.lsst.ccs.messaging.BadCommandExceptionorg.lsst.ccs.messaging.ErrorInCommandExecutionException - if the action can't be completedFcsHardwareExceptionpublic void readSensorsUntilActionIsCompleted(FcsEnumerations.MobileItemAction action, long beginTime, long timeout)
action - beginTime - timeout - @Command(type=ABORT,
level=1,
description="Abort the running action within a delay.")
public void abort(long delay)
throws org.lsst.ccs.messaging.BadCommandException
delay - org.lsst.ccs.messaging.BadCommandException@Command(type=ABORT,
level=1,
description="Abort the running action.")
public void abort()
throws org.lsst.ccs.messaging.BadCommandException
org.lsst.ccs.messaging.BadCommandException@Command(type=ABORT,
level=1,
description="Stop the running action with a quickstop.")
public void stop(long delay)
throws org.lsst.ccs.messaging.BadCommandException
delay - org.lsst.ccs.messaging.BadCommandException@Command(type=ABORT,
level=1,
description="Stop the running action with a quickstop.")
public void stop()
throws org.lsst.ccs.messaging.BadCommandException
org.lsst.ccs.messaging.BadCommandException@Command(type=ABORT,
level=1,
description="Stop the running action with a quickstop.")
public void quickstop()
throws org.lsst.ccs.messaging.BadCommandException
org.lsst.ccs.messaging.BadCommandExceptionpublic void shutdownNow()
shutdownNow in interface org.lsst.ccs.framework.ConfigurableshutdownNow in class org.lsst.ccs.framework.Modulepublic org.lsst.ccs.framework.TreeWalkerDiag signal(org.lsst.ccs.framework.Signal signal)
signal in interface org.lsst.ccs.framework.SignalHandlersignal in class org.lsst.ccs.framework.Modulepublic org.lsst.ccs.framework.TreeWalkerDiag checkHardware()
throws org.lsst.ccs.HardwareException
checkHardware in interface org.lsst.ccs.framework.HardwareControllerorg.lsst.ccs.HardwareExceptionpublic void checkStarted()
throws org.lsst.ccs.HardwareException
checkStarted in interface org.lsst.ccs.framework.HardwareControllerorg.lsst.ccs.HardwareExceptionpublic void checkStopped()
throws org.lsst.ccs.HardwareException
checkStopped in interface org.lsst.ccs.framework.HardwareControllerorg.lsst.ccs.HardwareExceptionCopyright © 2015 LSST. All rights reserved.