public abstract class MobileItem extends Object implements NamedComponent, 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 long |
beginTime |
protected long |
commandDuration |
protected FcsEnumerations.MobileItemAction |
currentAction |
protected org.lsst.ccs.services.DataProviderDictionaryService |
dataProviderDictionaryService |
static Logger |
FCSLOG |
protected boolean |
hasToWaitForEndOfAction |
protected Lock |
lock |
protected boolean |
moving |
protected String |
name |
protected String |
path |
protected ScheduledFuture<?> |
readSensorsHandle |
protected ScheduledThreadPoolExecutor |
scheduler |
protected org.lsst.ccs.Subsystem |
subs |
protected boolean |
timeoutExceeded |
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.
|
void |
checkReadyForAction() |
abstract void |
endAction(FcsEnumerations.MobileItemAction action)
end current action.
|
protected void |
executeAction(FcsEnumerations.MobileItemAction action,
long timeoutForAction)
This executes an action which moves the MobileItem and waits for the end od
this action.
|
String |
getActionDurationPath(String actionName)
return the publication path for an action duration to be used to register and publish data.
|
org.lsst.ccs.services.alert.AlertService |
getAlertService()
return alertService
|
AtomicBoolean |
getHaltRequired() |
String |
getName() |
String |
getPath() |
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 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 |
registerAction(FcsEnumerations.MobileItemAction action)
To be used in build method by children to register actions.
|
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
It 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, waitclearAlarm, getAlertSeparator, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarmOnlyIfNew, raiseAlertOnlyEveryTenMinutes, raiseAlertOnlyEveryTenMinutes, raiseAlertOnlyIfNew, raiseWarning, raiseWarning, raiseWarning, raiseWarning, raiseWarningOnlyEveryTenMinutes, raiseWarningOnlyIfNewpublic static final Logger FCSLOG
@LookupName protected String name
@LookupPath protected String path
@LookupField(strategy=TOP) protected org.lsst.ccs.Subsystem subs
@LookupField(strategy=TREE) protected org.lsst.ccs.services.AgentStateService agentStateService
@LookupField(strategy=TREE) protected org.lsst.ccs.services.DataProviderDictionaryService dataProviderDictionaryService
protected volatile boolean hasToWaitForEndOfAction
protected volatile FcsEnumerations.MobileItemAction currentAction
protected long commandDuration
protected long beginTime
protected boolean timeoutExceeded
protected volatile boolean moving
protected final Lock lock
protected ScheduledFuture<?> readSensorsHandle
protected final ScheduledThreadPoolExecutor scheduler
public void registerAction(FcsEnumerations.MobileItemAction action)
action - public org.lsst.ccs.services.alert.AlertService getAlertService()
AlertRaisergetAlertService in interface AlertRaiserpublic String getName()
getName in interface NamedComponentpublic String getPath()
getPath in interface NamedComponentpublic String getActionDurationPath(String actionName)
actionName - public 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 endAction(FcsEnumerations.MobileItemAction action)
action - public abstract void quickStopAction(FcsEnumerations.MobileItemAction action, long delay)
public abstract void publishData()
public 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 timeout)
action - 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 - Copyright © 2022 LSST. All rights reserved.