
public class StateMachine extends Object implements org.lsst.ccs.framework.HasLifecycle, Events
PhysicalState.
Used by commands in the Main component which call the event methods implemented here.
Those methods place runnables on a queue for later execution. The runnables use
instances of FutureReply to send event accept/reject notices back to Main. This component
owns the queue and the task that reads from it and calls the state machine.
Used by the Controller component which reads messages from the shutter PLC task
and calls the appropriate event methods of this component, which also queue the events but with a
higher priority then events from Main. Keeping up to date with state changes in the PLC is
considered of higher priority than carrying out operator/script commands. There's a possibility of command
"starvation" here that isn't protected against.
Main,
Controller,
PhysicalState,
TopContext| Constructor and Description |
|---|
StateMachine()
Creates the state machine implementation and the priority queue.
|
| Modifier and Type | Method and Description |
|---|---|
EventReply |
calibDone(CalibDone calibResults)
Indicates that a Hall calibration operation has been successful.
|
EventReply |
calibrate(Calibrate calibParams)
Requests a Hall calibration.
|
EventReply |
changeAxisEnable(org.lsst.ccs.subsystem.motorplatform.bus.ChangeAxisEnable req)
Requests that the enable state of the given axis be changed.
|
EventReply |
changeBrakeState(Axis ax,
ChangeBrakeState.State newState)
Requests that the brake state on a given axis be changed.
|
EventReply |
clearAllFaults(org.lsst.ccs.subsystem.motorplatform.bus.ClearAllFaults req)
Requests that fault conditions be cleared for both axes.
|
EventReply |
clearAxisFaults(org.lsst.ccs.subsystem.motorplatform.bus.ClearAxisFaults req)
Requests that fault conditions be cleared for the given axis.
|
EventReply |
closeShutter()
Requests that a closing of the shutter be started.
|
EventReply |
contactLost()
Indicates that the subsystem can't communicate properly with the shutter PLC.
|
EventReply |
disable()
Indicates that the shutter hardware protection is forbidding shutter operation.
|
EventReply |
disableAllAxes(org.lsst.ccs.subsystem.motorplatform.bus.DisableAllAxes req)
Requests that both axes be disabled.
|
EventReply |
enable()
Indicates that the shutter hardware protection is is allowing shutter operation.
|
EventReply |
enableAllAxes(org.lsst.ccs.subsystem.motorplatform.bus.EnableAllAxes req)
Requests that both axes be enabled.
|
EventReply |
error()
Indicates that the shutter tried and failed to carry out a requested operation.
|
EventReply |
gotoCenter()
Requests that the shutter prepare for power-down by placing both blade sets in the center
position.
|
EventReply |
gotoProd()
Requests that the shutter, if it's ready to do so, accept subsequent requests to take exposures.
|
EventReply |
homeAxis(org.lsst.ccs.subsystem.motorplatform.bus.HomeAxis req)
Requests that shutter perform a homing operation for the given axis.
|
EventReply |
ignored(Ignored.Reason reason)
Indicates that the shutter PLC state machine has ignored an event sent to it.
|
void |
init()
Registers the shutter physical-state bundle and sets its initial value to
OTHER. |
EventReply |
motionDone(MotionDonePLC profileData)
Indicates that a blade set has successfully completed a motion.
|
EventReply |
moveAxisAbsolute(org.lsst.ccs.subsystem.motorplatform.bus.MoveAxisAbsolute req)
Requests that the given axis be moved to a given absolute position.
|
EventReply |
moveAxisRelative(org.lsst.ccs.subsystem.motorplatform.bus.MoveAxisRelative req)
Requests that an axis change its position by a certain offset.
|
EventReply |
openShutter()
Requests that an opening of the shutter be started.
|
EventReply |
plcIsDisabled()
Indicates that shutter controller has sent a status message in which the reported state
is Enabled.
|
EventReply |
plcIsEnabled()
Indicates that the shutter controller has sent a status message in which reported
state is Disabled.
|
void |
postStart()
Starts the shutter-control state machine along with a task for feeding it events from the queue.
|
EventReply |
reset()
Requests that the shutter controller stop any motion in progress and
reset its state machine to its initial state.
|
EventReply |
resync()
Triggers another attempt to synchronize states with the PLC.
|
void |
shutdown() |
EventReply |
syncTimeout()
Indicates that after a reset the PLC has taken too long to reach one of
the designated after-reset states.
|
EventReply |
takeExposure(Duration exposureTime)
Requests that an exposure of the given duration be started.
|
EventReply |
timer()
Indicates that an exposure in progress has run for its allotted time.
|
public StateMachine()
public void init()
OTHER.init in interface org.lsst.ccs.framework.HasLifecyclePhysicalStatepublic void postStart()
postStart in interface org.lsst.ccs.framework.HasLifecyclepublic void shutdown()
shutdown in interface org.lsst.ccs.framework.HasLifecyclepublic EventReply contactLost()
EventscontactLost in interface Eventspublic EventReply plcIsEnabled()
Eventsenable()
and disable() event messages sent from the controller.plcIsEnabled in interface Eventspublic EventReply plcIsDisabled()
Eventsenable()
and disable() event messages sent from the controller.plcIsDisabled in interface Eventspublic EventReply resync()
Eventspublic EventReply syncTimeout()
EventssyncTimeout in interface Eventspublic EventReply enable()
Eventspublic EventReply disable()
Eventspublic EventReply motionDone(MotionDonePLC profileData)
EventsmotionDone in interface EventsprofileData - The motion profile.public EventReply calibrate(Calibrate calibParams)
Eventspublic EventReply calibDone(CalibDone calibResults)
Eventspublic EventReply error()
Eventspublic EventReply reset()
Eventspublic EventReply takeExposure(Duration exposureTime)
EventstakeExposure in interface EventsexposureTime - The length of the exposure. If null or too short a duration the
event is rejected.public EventReply openShutter()
EventsopenShutter in interface Eventspublic EventReply timer()
Eventspublic EventReply closeShutter()
EventscloseShutter in interface Eventspublic EventReply ignored(Ignored.Reason reason)
Eventspublic EventReply gotoProd()
Eventspublic EventReply gotoCenter()
EventsgotoCenter in interface Eventspublic EventReply homeAxis(org.lsst.ccs.subsystem.motorplatform.bus.HomeAxis req)
Eventspublic EventReply moveAxisAbsolute(org.lsst.ccs.subsystem.motorplatform.bus.MoveAxisAbsolute req)
EventsmoveAxisAbsolute in interface Eventsreq - Contains the request parameters. If null then the event is rejected.public EventReply moveAxisRelative(org.lsst.ccs.subsystem.motorplatform.bus.MoveAxisRelative req)
EventsmoveAxisRelative in interface Eventsreq - Contains the request parameters. If null then event is rejected.public EventReply clearAllFaults(org.lsst.ccs.subsystem.motorplatform.bus.ClearAllFaults req)
EventsclearAllFaults in interface Eventsreq - Contains the request parameters. If null then the event is rejected.public EventReply changeAxisEnable(org.lsst.ccs.subsystem.motorplatform.bus.ChangeAxisEnable req)
EventschangeAxisEnable in interface Eventsreq - Contains the request parameters. If null then the event is rejected.public EventReply changeBrakeState(Axis ax, ChangeBrakeState.State newState)
EventschangeBrakeState in interface Eventsax - The PLC task axis to affect.newState - The desired brake state.public EventReply clearAxisFaults(org.lsst.ccs.subsystem.motorplatform.bus.ClearAxisFaults req)
EventsclearAxisFaults in interface Eventsreq - Contains the request parameters. If null then the event is rejected.public EventReply enableAllAxes(org.lsst.ccs.subsystem.motorplatform.bus.EnableAllAxes req)
EventsenableAllAxes in interface Eventsreq - Contains the request parameters. If null then event is rejected.public EventReply disableAllAxes(org.lsst.ccs.subsystem.motorplatform.bus.DisableAllAxes req)
EventsdisableAllAxes in interface Eventsreq - Contains the request parameters. If null then the event is rejected.Copyright © 2019 LSST. All rights reserved.