
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 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 |
alertSeparater| Constructor and Description |
|---|
MobileItem() |
| 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.
|
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 |
postAction(FcsEnumerations.MobileItemAction action)
Deprecated.
|
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 |
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.
|
void |
stop(long delay)
just to avoid taping "sendSignal STOP"
|
void |
stopActionNow()
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.
|
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, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarningprotected static final Logger FCSLOG
@LookupName protected String name
@LookupField(strategy=TOP) protected org.lsst.ccs.Subsystem s
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)
@Deprecated public abstract void postAction(FcsEnumerations.MobileItemAction action)
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 - @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 stopActionNow()
@Command(type=SIGNAL, level=1, description="Stop the running action with a quickstop.") public void quickstop()
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 © 2018 LSST. All rights reserved.