|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
org.lsst.ccs.framework.Module
org.lsst.ccs.subsystems.fcs.common.MobileItemModule
public abstract class MobileItemModule
This represents a Mechanical Item which can be moved by a motor. Generaly we want to execute an action on this mechanical item : - start the action, - read sensors to know if the action is completed, - wait for the end of the action. This module provides a general way to start an action and wait until the action is completed. It factorises some code that otherwise would have to be duplicated in each Module that needs such fonctionnalities.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.lsst.ccs.framework.Module |
|---|
org.lsst.ccs.framework.Module.ValueUpdate |
| Nested classes/interfaces inherited from interface org.lsst.ccs.framework.Configurable |
|---|
org.lsst.ccs.framework.Configurable.Environment |
| Field Summary | |
|---|---|
protected boolean |
itemMoving
|
Lock |
lock
|
Condition |
motionCompleted
|
| Fields inherited from class org.lsst.ccs.framework.Module |
|---|
environment, log, name, nObserverThreads, registry, tickMillis |
| Constructor Summary | |
|---|---|
MobileItemModule()
|
|
| Method Summary | |
|---|---|
void |
cancelReadingSensors()
This stops the reading of the sensors. |
String |
executeAction(FcsEnumerations.MobileItemAction action,
long timeoutForAction)
This executes an action which moves the MobileItem and waits for the end od this action. |
abstract boolean |
isActionCompleted(FcsEnumerations.MobileItemAction action)
|
abstract void |
postAction(FcsEnumerations.MobileItemAction action)
|
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 the timeout for this action is past. |
void |
shutdownNow()
This shutdowns the scheduler. |
abstract void |
startAction(FcsEnumerations.MobileItemAction action)
|
abstract void |
updateStateWithSensorsToCheckIfActionIsCompleted()
|
void |
waitForEndOfAction(FcsEnumerations.MobileItemAction action)
This method waits until the action is completed. |
| Methods inherited from class org.lsst.ccs.framework.Module |
|---|
alias, change, checkHardware, dropConfigurationContext, getAvailableCommands, getCheckedValueFromConfiguration, getChildren, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, initModule, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, processUpdate, publishData, publishData, publishData, publishData, publishData, publishData, publishData, register, register, removeLogPanicState, sendToReply, sendToStatus, setBeanName, setContext, setEnvironment, setHandlerLevel, setLogLevel, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownCommand, start, startTicking, tick, update |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean itemMoving
public final Lock lock
public final Condition motionCompleted
| Constructor Detail |
|---|
public MobileItemModule()
| Method Detail |
|---|
public void cancelReadingSensors()
public abstract boolean isActionCompleted(FcsEnumerations.MobileItemAction action)
public abstract void updateStateWithSensorsToCheckIfActionIsCompleted()
throws Exception
Exception
public abstract void startAction(FcsEnumerations.MobileItemAction action)
throws org.lsst.ccs.bus.BadCommandException,
org.lsst.ccs.bus.ErrorInCommandExecutionException,
HardwareException
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareException
public abstract void postAction(FcsEnumerations.MobileItemAction action)
throws org.lsst.ccs.bus.BadCommandException,
org.lsst.ccs.bus.ErrorInCommandExecutionException,
HardwareException
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareException
public String executeAction(FcsEnumerations.MobileItemAction action,
long timeoutForAction)
throws org.lsst.ccs.bus.BadCommandException,
org.lsst.ccs.bus.ErrorInCommandExecutionException,
HardwareException
action, - timeout
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareException
public void readSensorsUntilActionIsCompleted(FcsEnumerations.MobileItemAction action,
long beginTime,
long timeout)
action - beginTime - timeout - public void waitForEndOfAction(FcsEnumerations.MobileItemAction action)
public void shutdownNow()
shutdownNow in class org.lsst.ccs.framework.Module
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||