
public class AutochangerOnlineClampModule extends MobileItemModule implements MovedByEPOSController, ControlledBySensors
| Modifier and Type | Field and Description |
|---|---|
protected Condition |
currentRampEnded |
protected boolean |
hasToWaitForEndOfCurrentRamp |
static String |
ONLINE_CLAMP_CONFIG_CATEGORY |
protected boolean |
updatingState |
currentAction, FCSLOG, hasToWaitForEndOfAction, lock, scheduler| Constructor and Description |
|---|
AutochangerOnlineClampModule(EPOSControllerWithBrake controller,
ComplementarySensors closeSensors,
ComplementarySensors openSensors,
int currentToClose,
int currentToClamp)
Builds an AutochangerOnlineClampModule with a controller, 4 sensors and 2
maps of parameters for the controller.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortAction(FcsEnumerations.MobileItemAction action,
long delay)
What to do to abort an action.
|
void |
checkConditionsForClosing()
Check if it's safe to close the clamp.
|
void |
checkConditionsForOpening()
Check if it's safe to open the clamp.
|
org.lsst.ccs.framework.TreeWalkerDiag |
checkHardware()
This method is called during INITIALIZATION phase.
|
void |
close()
Closes the ONLINE clamp.
|
void |
configureController()
Configure ONLINE clamp controller.
|
void |
configureDigitalInputOfOnlineClamps()
This method is used to configure the controllers of the autochanger
online clamps.
|
void |
configureDigitalOutputOfOnlineClamps()
This method is used to configure the autochanger onlineClamps EPOS
controllers.
|
StatusDataPublishedByAutochangerOnlineClamp |
createStatusDataPublishedByOnlineClamp()
Creates and returns the object to be published on the STATUS bus.
|
void |
enableAndCheckControllerBeforeAction()
Enables controller, changes mode into CURRENT, Reads parameters for mode
CURRENT on controller CPU.
|
void |
executeCurrentRamp(int initialValue,
int finalValue,
long period)
Sends current to controller with a ramp : from initialValue to finalValue
in a given number of steps (nbStep) and waits until the final value is
reached.
|
int |
getAdjustedStepHeight(int initialValue,
int finalValue)
Returns an adjusted value of the increment in current ramp.
|
ComplementarySensors |
getCloseSensors()
returns closeSensors for tests
|
EPOSControllerWithBrake |
getController()
Return ONLINE clamp controller
|
String |
getControllerName()
return controller name
|
int |
getCurrentToClamp()
For simulator
|
int |
getCurrentToClose()
For simulator
|
int |
getCurrentToOpen()
For simulator
|
ComplementarySensors |
getOpenSensors()
returns openSensors for tests
|
int |
getSentCurrent()
returns last value of current sent to controller
|
void |
initModule()
Initialize fields autochanger, lockStatus and listens to its controller.
|
boolean |
isActionCompleted(FcsEnumerations.MobileItemAction action) |
boolean |
isCANDevicesReady()
Return true when ONLINE clamp hardware is ready.
|
boolean |
isClosed()
Returns true if LockStatus=CLOSED.
|
boolean |
isCloseSensorsInError()
Returns true if closeSensor and closeSensorC return the same value.
|
boolean |
isControllerInFault()
Returns true if controller is in fault.
|
boolean |
isInError()
Returns true if LockStatus=ERROR, this means closeSensor or openSensor is
in ERROR or openSensor and closeSensor return non consistant values.
|
boolean |
isInitialized()
Returns true if clamp is initialized : hardware is ready (at least
booted) and clamp controller is initialized (parameters in the controller
CPU have been checked and controller has been configured).
|
boolean |
isInTravel()
Returns true if LockStatus=INTRAVEL.
|
boolean |
isLocked()
Returns true if LockStatus=LOCKED.
|
boolean |
isOpened()
Returns true if LockStatus=OPENED.
|
boolean |
isOpenSensorsInError()
Returns true if openSensor and openSensorC retun the same value.
|
void |
lock()
Locks the ONLINE clamp : sends currentToClamp to the controller with a
ramp of current from currentToClose to currentToRamp.
|
void |
open()
Opens the ONLINE clamp.
|
void |
postAction(FcsEnumerations.MobileItemAction action)
What to be done after the action is completed.
|
void |
processUpdate(Observable source,
org.lsst.ccs.framework.Module.ValueUpdate v)
Updates field controllerInFault when the controller notifies its
observers and sends new values.
|
void |
publishData()
publishes data on the STATUS bus
|
void |
quickStopAction(FcsEnumerations.MobileItemAction action,
long delay) |
void |
sendCurrentToControllerAndSaveValue(int current)
Writes current to controller and saves the current value in the
ConfigurationParameter sentCurrent.
|
void |
setControllerInFault(boolean controllerInFault)
set controllerInFault
|
void |
setSentCurrent(int sentCurrent) |
void |
setStepHeightAbsValue(int stepHeightAbsValue) |
void |
startAction(FcsEnumerations.MobileItemAction action)
Start action of open or close or lock or unlock.
|
void |
unlock()
Unlocks the ONLINE clamp : sends currentToClamp to the controller with a
ramp of current from currentToClamp to currentToClose.
|
void |
updateStateAndCheckSensors()
reads sensors, computes and state and raises an ALERT if sensors are in error.
|
void |
updateStateWithSensors(String[] hexaValues)
This methods updates lockStatus from the values return by the sensors.
|
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.
|
abort, abort, checkStarted, checkStopped, executeAction, getHaltRequired, isMoving, quickstop, readSensorsUntilActionIsCompleted, shutdownNow, signal, stop, stopgetNObserverThreads, getObservables, getTickMillis, init, listens, sendSignal, sendSignalWithTimeLimit, setNObserverThreads, setObservables, setTickMillis, startTicking, tick, updateaddObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprocessEmergencyMessage, processFaultReset, updateControllerInFaultcheckSensorsraiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarning, raiseWarning, raiseWarninggetComponentConfigurationEnvironment, getComponentLookup, getName, getSubsystemchange, dropSubmittedChanges, getChildren, getComponentByName, getEnvironment, getParent, getParentObject, getSubmittedChanges, isParameterConfigurable, postStart, printConfigurableParameters, setBulkParameter, start, submitChange, submitChanges, validateBulkChangepublic static final String ONLINE_CLAMP_CONFIG_CATEGORY
protected volatile boolean updatingState
protected final Condition currentRampEnded
protected boolean hasToWaitForEndOfCurrentRamp
public AutochangerOnlineClampModule(EPOSControllerWithBrake controller, ComplementarySensors closeSensors, ComplementarySensors openSensors, int currentToClose, int currentToClamp)
controller - closeSensors - openSensors - currentToClose - currentToClamp - @ConfigurationParameterChanger public void setSentCurrent(int sentCurrent)
sentCurrent - @ConfigurationParameterChanger public void setStepHeightAbsValue(int stepHeightAbsValue)
stepHeightAbsValue - public int getAdjustedStepHeight(int initialValue,
int finalValue)
initialValue - finalValue - public int getSentCurrent()
public EPOSControllerWithBrake getController()
public int getCurrentToClose()
public int getCurrentToOpen()
public int getCurrentToClamp()
public ComplementarySensors getCloseSensors()
public ComplementarySensors getOpenSensors()
@Command(type=QUERY, level=1, description="Returns true if lockSensor and lockSensorC retun the same value. Doesn\'t read again sensors.") public boolean isCloseSensorsInError()
@Command(type=QUERY, level=1, description="Returns true if unlockSensor and unlockSensorC retun the same value. Doesn\'t read again sensors.") public boolean isOpenSensorsInError()
@Command(type=QUERY, level=1, description="Returns true if LockStatus=ERROR, this means that closeSensor or openSensor is in ERROR or thatopenSensor and closeSensor return non consistant values. Doesn\'t read again sensors.") public boolean isInError()
isInError in interface ControlledBySensors@Command(type=QUERY, level=1, description="Returns true if LockStatus=CLOSED. Doesn\'t read again sensors.") public boolean isClosed()
@Command(type=QUERY, level=1, description="Returns true if LockStatus=LOCKED. Doesn\'t read again sensors.") public boolean isLocked()
@Command(type=QUERY, level=1, description="Returns true if LockStatus=OPENED. Doesn\'t read again sensors.") public boolean isOpened()
@Command(type=QUERY, level=1, description="Returns true if LockStatus=INTRAVEL. Doesn\'t read again sensors.") public boolean isInTravel()
@Command(type=QUERY, level=1, description="Returns true if controller is in fault. Doesn\'t read controller CPU.") public boolean isControllerInFault()
isControllerInFault in interface MovedByEPOSControllerpublic void setControllerInFault(boolean controllerInFault)
setControllerInFault in interface MovedByEPOSControllercontrollerInFault - @Command(type=QUERY, level=1, description="Returns controller name.") public String getControllerName()
getControllerName in interface MovedByEPOSController@Command(type=QUERY, level=1, description="Returns true if clamp is initialized : controller is booted, parameters in the controller CPU have been checked and controller is configured.") public boolean isInitialized()
public void initModule()
initModule in class MobileItemModule@Command(type=QUERY, level=1, description="Returns true if controller is initialized and configured.") public boolean isCANDevicesReady()
isCANDevicesReady in class MobileItemModule@Command(type=QUERY, level=1, description="Check if the onlineClamp can be locked.") public void checkConditionsForOpening()
FcsHardwareException@Command(type=QUERY, level=1, description="Check if the onlineClamp can be locked.") public void checkConditionsForClosing()
FcsHardwareException@Command(type=QUERY, level=1, description="Initialize controller and check parameters.") public org.lsst.ccs.framework.TreeWalkerDiag checkHardware() throws org.lsst.ccs.HardwareException
checkHardware in interface org.lsst.ccs.framework.HardwareControllercheckHardware in class MobileItemModuleorg.lsst.ccs.HardwareException@Command(type=QUERY, level=1, description="Read in the CPU of the controller parameters for mode CURRENT.If a parameter has a different value than in configuration, throws an exception.") public void enableAndCheckControllerBeforeAction()
FcsHardwareException@Command(type=ACTION, level=1, description="Configure controller.") public void configureController() throws org.lsst.ccs.HardwareException
org.lsst.ccs.HardwareExceptionFcsHardwareExceptionpublic void updateStateAndCheckSensors()
@Command(type=ACTION, level=1, description="Update state in reading sensors.") public void updateStateWithSensors(String[] hexaValues)
hexaValues - public void updateStateWithSensorsToCheckIfActionIsCompleted()
MobileItemModuleupdateStateWithSensorsToCheckIfActionIsCompleted in class MobileItemModulepublic boolean isActionCompleted(FcsEnumerations.MobileItemAction action)
isActionCompleted in class MobileItemModule@Command(type=ACTION, level=1, description="Closes the ONLINE clamp.", timeout=10000) public void close()
@Command(type=ACTION, level=1, description="Opens the ONLINE clamp.", timeout=10000) public void open()
@Command(type=ACTION, level=1, description="Locks the ONLINE clamp : sends currentToClamp to the controller with a ramp of currentfrom currentToClose to currentToRamp.", timeout=10000) public void lock()
@Command(type=ACTION, level=1, description="Unlocks the ONLINE clamp : sends currentToClamp to the controller with a ramp of current from currentToClamp to currentToClose.", timeout=10000) public void unlock()
public void startAction(FcsEnumerations.MobileItemAction action)
startAction in class MobileItemModuleaction - FcsHardwareExceptionpublic void sendCurrentToControllerAndSaveValue(int current)
current - to send to controllerpublic void abortAction(FcsEnumerations.MobileItemAction action, long delay)
abortAction in class MobileItemModuleaction - delay - FcsHardwareExceptionpublic void postAction(FcsEnumerations.MobileItemAction action)
postAction in class MobileItemModuleaction - FcsHardwareException@Command(type=ACTION, level=1, description="To configure the online clamps controllers.") public void configureDigitalInputOfOnlineClamps()
@Command(type=ACTION, level=1, description="To configure the online clamps controllers.") public void configureDigitalOutputOfOnlineClamps()
FcsHardwareExceptionpublic void processUpdate(Observable source, org.lsst.ccs.framework.Module.ValueUpdate v)
processUpdate in class org.lsst.ccs.framework.Modulesource - v - public StatusDataPublishedByAutochangerOnlineClamp createStatusDataPublishedByOnlineClamp()
public void publishData()
MovedByEPOSControllerpublishData in interface MovedByEPOSControllerpublishData in class MobileItemModulepublic void quickStopAction(FcsEnumerations.MobileItemAction action, long delay)
quickStopAction in class MobileItemModulepublic void executeCurrentRamp(int initialValue,
int finalValue,
long period)
initialValue - first value to be sent to controllerfinalValue - last value to send to controllerperiod - of time to wait between 2 writes to the controller.Copyright © 2017 LSST. All rights reserved.