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 org.lsst.ccs.utilities.logging.Logger |
FCSLOG |
protected boolean |
hasToWaitForEndOfAction |
protected Lock |
lock |
protected String |
name |
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 |
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.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) |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckHardware, checkStartedclearAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarning, raiseWarning, raiseWarning, raiseWarningprotected static final org.lsst.ccs.utilities.logging.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 final ScheduledThreadPoolExecutor scheduler
public org.lsst.ccs.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()
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)
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 - @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()
stop in interface org.lsst.ccs.framework.HasLifecycle@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.HasLifecyclepublic org.lsst.ccs.framework.TreeWalkerDiag signal(org.lsst.ccs.framework.Signal signal)
signal in interface org.lsst.ccs.framework.SignalHandlerpublic void checkStopped()
throws org.lsst.ccs.HardwareException
checkStopped in interface org.lsst.ccs.framework.HardwareControllerorg.lsst.ccs.HardwareExceptionCopyright © 2017 LSST. All rights reserved.