public abstract class MobileItemModule extends org.lsst.ccs.framework.Module implements org.lsst.ccs.framework.HardwareController, AlertRaiser
| Modifier and Type | Field and Description |
|---|---|
protected FcsEnumerations.MobileItemAction |
currentAction |
protected static org.lsst.ccs.utilities.logging.Logger |
FCSLOG |
protected boolean |
hasToWaitForEndOfAction |
protected Lock |
lock |
protected ScheduledThreadPoolExecutor |
scheduler |
| Constructor and Description |
|---|
MobileItemModule()
Build a new MobileItemModule with a tickmillis value of 1000.
|
MobileItemModule(int tickMillis)
Build a new MobileItemModule with a tickmillis value given as argument.
|
| 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)
aborts action actually running.
|
org.lsst.ccs.framework.TreeWalkerDiag |
checkHardware() |
void |
checkStarted() |
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.
|
AtomicBoolean |
getHaltRequired() |
void |
initModule() |
abstract boolean |
isActionCompleted(FcsEnumerations.MobileItemAction action) |
abstract boolean |
isCANDevicesReady() |
boolean |
isMoving()
Return true if the MobileItemMobile is moving.
|
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)
starts the action given as argument.
|
void |
stop()
just to avoid taping "sendSignal STOP"
|
void |
stop(long delay)
just to avoid taping "sendSignal STOP"
|
abstract void |
updateStateWithSensorsToCheckIfActionIsCompleted()
reads sensors or any device and updates state from sensors
it can be also reading a position or a current on a motor controller.
|
getNObserverThreads, getObservables, getTickMillis, init, listens, processUpdate, sendSignal, sendSignalWithTimeLimit, setNObserverThreads, setObservables, setTickMillis, startTicking, tick, updateaddObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitraiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarning, raiseWarning, raiseWarninggetComponentConfigurationEnvironment, getComponentLookup, getName, getSubsystemchange, dropSubmittedChanges, getChildren, getComponentByName, getEnvironment, getParent, getParentObject, getSubmittedChanges, isParameterConfigurable, postStart, printConfigurableParameters, setBulkParameter, start, submitChange, submitChanges, validateBulkChangeprotected static final org.lsst.ccs.utilities.logging.Logger FCSLOG
protected volatile boolean hasToWaitForEndOfAction
protected volatile FcsEnumerations.MobileItemAction currentAction
protected final Lock lock
protected final ScheduledThreadPoolExecutor scheduler
public MobileItemModule()
public MobileItemModule(int tickMillis)
tickMillis - public boolean isMoving()
public AtomicBoolean getHaltRequired()
public void initModule()
initModule in class org.lsst.ccs.framework.Modulepublic abstract boolean isCANDevicesReady()
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 postAction(FcsEnumerations.MobileItemAction action)
public abstract void publishData()
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 - @Command(type=SIGNAL,
level=1,
description="Abort the running action within a delay.")
public void abort(long delay)
delay - @Command(type=SIGNAL,
level=1,
description="Abort the running action.")
public void abort()
@Command(type=SIGNAL,
level=1,
description="Stop the running action with a quickstop.")
public void stop(long delay)
delay - @Command(type=SIGNAL,
level=1,
description="Stop the running action with a quickstop.")
public void stop()
@Command(type=SIGNAL,
level=1,
description="Stop the running action with a quickstop.")
public void quickstop()
public void shutdownNow()
shutdownNow in interface org.lsst.ccs.framework.ConfigurableshutdownNow in interface org.lsst.ccs.framework.HasLifecycleshutdownNow 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 © 2017 LSST. All rights reserved.