public class AutochangerOnlineClamp extends MobileItem implements MovedByEPOSController, ControlledBySensors
| Modifier and Type | Field and Description |
|---|---|
static String |
CURRENT_MONITOR_TASK_NAME |
static String |
ONLINE_CLAMP_CONFIG_CATEGORY |
static int |
TIMEOUT_FOR_CLOSING |
static int |
TIMEOUT_FOR_OPENING |
agentStateService, currentAction, FCSLOG, hasToWaitForEndOfAction, lock, name, readSensorsHandle, s, scheduleralertSeparator| Constructor and Description |
|---|
AutochangerOnlineClamp(EPOSControllerForOnlineClamp controller,
ComplementarySensors closeSensors,
ComplementarySensors openSensors)
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 |
build() |
void |
checkConditionsForClosing()
Check if it's safe to closeClampInCurrentMode the clamp.
|
void |
checkConditionsForOpening()
Check if it's safe to openClampInCurrentMode the clamp.
|
void |
checkControllerWhenGoingFromEngineeringModeToNormal() |
void |
close()
Closes the ONLINE clamp in mode PROFILE_POSITION.
|
void |
closeClampInCurrentMode()
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(FcsEnumerations.MobileItemAction action)
Enables controller, change mode depending on action and checkFault.
|
void |
executeCurrentRamp(int initialCurrent,
int finalCurrent,
int incrementCurrent,
int maxTime,
int waitTime)
Sends current to controller with a ramp : from initialCurrent to finalCurrent
in a given number of steps (nbStep) and waits until the final value is
reached.
|
ComplementarySensors |
getCloseSensors()
returns closeSensors for tests
|
EPOSControllerWithBrake |
getController()
Return ONLINE clamp controller
|
String |
getControllerName()
return controller name
|
int |
getCurrentToClamp()
For simulator
|
int |
getCurrentToOpen()
For simulator
|
int |
getFinalCurrentToClose() |
int |
getIncrementCurrentToClamp() |
int |
getIncrementCurrentToClose() |
int |
getIncrementCurrentToOpen() |
int |
getInitialCurrentToClose() |
int |
getMaxTimeToClose() |
int |
getMaxTimeToLock() |
int |
getMaxTimeToOpen() |
int |
getMaxTimeToUnlock() |
ComplementarySensors |
getOpenSensors()
returns openSensors for tests
|
int |
getSentCurrent()
returns last value of current sent to controller
|
int |
getTargetPositionToClose() |
int |
getTargetPositionToOpen() |
int |
getWaitTimeToClose() |
int |
getWaitTimeToOpen() |
void |
init()
*** lifecycle methods *************************************************
|
boolean |
isActionCompleted(FcsEnumerations.MobileItemAction action) |
boolean |
isAtPosition(int pos)
return true if position of online clamp is around pos given as argument
|
boolean |
isAtPositionClose()
return true if clamp position is around targetPositionToClose
|
boolean |
isAtPositionOpen()
return true if clamp position is around targetPositionToOpen
|
boolean |
isClosed()
Returns true if LockStatus=CLOSED.
|
boolean |
isCloseSensorsInError()
Returns true if closeSensor and closeSensorC return the same value.
|
boolean |
isHomingDone() |
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 opened 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.
|
boolean |
myDevicesReady()
Return true when ONLINE clamp hardware is ready.
|
void |
open()
openClampInCurrentMode clamp in mode PROFILE_POSITION condition : homing
must have been done before, and latches must be closed.
|
void |
openClampInCurrentMode()
Opens the ONLINE clamp.
|
void |
openInCurrentModeAndHoming()
openClampInCurrentMode clamp in CURRENT mode and do homing.
|
void |
postStart()
This method is called during INITIALIZATION phase.
|
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 |
setCurrentToClamp(int currentToClamp) |
void |
setCurrentToOpen(int currentToOpen) |
void |
setFinalCurrentToClose(int finalCurrentToClose) |
void |
setIncrementCurrentToClamp(int stepHeightAbsValue) |
void |
setIncrementCurrentToClose(int incrementCurrentToClose) |
void |
setIncrementCurrentToOpen(int incrementCurrentToOpen) |
void |
setInitialCurrentToClose(int initialCurrentToClose) |
void |
setMaxTimeToClose(int maxTimeToClose) |
void |
setMaxTimeToLock(int maxTimeToLock) |
void |
setMaxTimeToOpen(int maxTimeToOpen) |
void |
setMaxTimeToUnlock(int maxTimeToUnlock) |
void |
setSentCurrent(int sentCurrent) |
void |
setWaitTimeToClose(int waitTimeToClose) |
void |
setWaitTimeToOpen(int waitTimeToOpen) |
void |
startAction(FcsEnumerations.MobileItemAction action)
Start action of openClampInCurrentMode or closeClampInCurrentMode 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 |
updateCurrent()
read actual current on controller, update field current and publish it on
STATUS bus.
|
void |
updatePosition() |
void |
updateState()
This methods updates lockStatus from the values return by the sensors.
|
void |
updateStateAndCheckSensors()
reads sensors, computes and state and raises an ALERT if sensors are in
error.
|
void |
updateStateWithSensorsToCheckIfActionIsCompleted()
reads sensors or any device and updates state from sensors
Tt can be also reading a position or a current on a motor controller.
|
cancelReadingSensors, checkReadyForAction, checkStopped, executeAction, getAlertService, getHaltRequired, getName, getSubsystem, isMoving, readSensorsUntilActionIsCompleted, shutdown, signal, waitForEndOfActionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmonitorCurrentcheckSensorsclearAlarm, getAlertSeparator, getAlertService, getName, getSubsystem, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarningpublic static final String ONLINE_CLAMP_CONFIG_CATEGORY
public static final String CURRENT_MONITOR_TASK_NAME
public static final int TIMEOUT_FOR_CLOSING
public static final int TIMEOUT_FOR_OPENING
public AutochangerOnlineClamp(EPOSControllerForOnlineClamp controller, ComplementarySensors closeSensors, ComplementarySensors openSensors)
controller - closeSensors - openSensors - @ConfigurationParameterChanger public void setCurrentToClamp(int currentToClamp)
@ConfigurationParameterChanger public void setCurrentToOpen(int currentToOpen)
@ConfigurationParameterChanger public void setInitialCurrentToClose(int initialCurrentToClose)
@ConfigurationParameterChanger public void setFinalCurrentToClose(int finalCurrentToClose)
public void setSentCurrent(int sentCurrent)
sentCurrent - @ConfigurationParameterChanger public void setIncrementCurrentToClamp(int stepHeightAbsValue)
stepHeightAbsValue - @ConfigurationParameterChanger public void setIncrementCurrentToOpen(int incrementCurrentToOpen)
@ConfigurationParameterChanger public void setIncrementCurrentToClose(int incrementCurrentToClose)
@ConfigurationParameterChanger public void setWaitTimeToClose(int waitTimeToClose)
@ConfigurationParameterChanger public void setWaitTimeToOpen(int waitTimeToOpen)
@ConfigurationParameterChanger public void setMaxTimeToClose(int maxTimeToClose)
@ConfigurationParameterChanger public void setMaxTimeToOpen(int maxTimeToOpen)
@ConfigurationParameterChanger public void setMaxTimeToLock(int maxTimeToLock)
@ConfigurationParameterChanger public void setMaxTimeToUnlock(int maxTimeToUnlock)
public int getInitialCurrentToClose()
public int getFinalCurrentToClose()
public int getIncrementCurrentToOpen()
public int getIncrementCurrentToClamp()
public int getIncrementCurrentToClose()
public int getMaxTimeToClose()
public int getWaitTimeToClose()
public int getMaxTimeToOpen()
public int getMaxTimeToLock()
public int getMaxTimeToUnlock()
public int getWaitTimeToOpen()
@Command(type=QUERY) public int getSentCurrent()
public EPOSControllerWithBrake getController()
public int getCurrentToOpen()
public int getCurrentToClamp()
public ComplementarySensors getCloseSensors()
public int getTargetPositionToOpen()
public int getTargetPositionToClose()
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 homing of controller has been done.")
public boolean isHomingDone()
@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 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 opened and controller is configured.")
public boolean isInitialized()
public void init()
init in interface org.lsst.ccs.framework.HasLifecyclepublic void build()
build in interface org.lsst.ccs.framework.HasLifecycle@Command(type=QUERY,
level=1,
description="Returns true if controller is initialized and configured.")
public boolean myDevicesReady()
myDevicesReady in class MobileItem@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()
FcsHardwareExceptionpublic void postStart()
postStart in interface org.lsst.ccs.framework.HasLifecycle@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(FcsEnumerations.MobileItemAction action)
action - FcsHardwareExceptionpublic void checkControllerWhenGoingFromEngineeringModeToNormal()
@Command(type=ACTION,
level=1,
description="Configure controller.")
public void configureController()
FcsHardwareExceptionpublic void updateCurrent()
updateCurrent in interface MovedByEPOSControllerpublic void updatePosition()
public void updateStateAndCheckSensors()
@Command(type=ACTION,
level=1,
description="Update state from sensors values.")
public void updateState()
public void updateStateWithSensorsToCheckIfActionIsCompleted()
MobileItemupdateStateWithSensorsToCheckIfActionIsCompleted in class MobileItempublic boolean isActionCompleted(FcsEnumerations.MobileItemAction action)
isActionCompleted in class MobileItempublic boolean isAtPositionClose()
public boolean isAtPositionOpen()
public boolean isAtPosition(int pos)
pos - @Command(type=ACTION,
level=1,
description="Closes the ONLINE clamp.",
timeout=15000)
public void closeClampInCurrentMode()
@Command(type=ACTION,
level=1,
description="Closes the ONLINE clamp in mode PROFILE_POSITION.",
timeout=15000)
public void close()
@Command(type=ACTION,
level=1,
description="Opens the ONLINE clamp.",
timeout=15000)
public void openClampInCurrentMode()
@Command(type=ACTION,
level=1,
description="Opens the ONLINE clamp in PROFILE_POSITION.",
timeout=15000)
public void open()
@Command(type=ACTION,
level=1,
description="open clamp in CURRENT mode and do homing")
public void openInCurrentModeAndHoming()
@Command(type=ACTION,
level=1,
description="Locks the ONLINE clamp : sends currentToClamp to the controller with a ramp of currentfrom currentToClose to currentToRamp.",
timeout=15000)
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=15000)
public void unlock()
public void startAction(FcsEnumerations.MobileItemAction action)
startAction in class MobileItemaction - FcsHardwareException@Command(type=ACTION,
description="sent current to control and save this value")
public void sendCurrentToControllerAndSaveValue(int current)
current - to send to controllerpublic void abortAction(FcsEnumerations.MobileItemAction action, long delay)
abortAction in class MobileItemaction - delay - 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 StatusDataPublishedByAutochangerOnlineClamp createStatusDataPublishedByOnlineClamp()
public void publishData()
MovedByEPOSControllerpublishData in interface MovedByEPOSControllerpublishData in class MobileItempublic void quickStopAction(FcsEnumerations.MobileItemAction action, long delay)
quickStopAction in class MobileItempublic void executeCurrentRamp(int initialCurrent,
int finalCurrent,
int incrementCurrent,
int maxTime,
int waitTime)
initialCurrent - first value to be sent to controllerfinalCurrent - last value to send to controllerincrementCurrent - maxTime - waitTime - time to wait after sending initialCurrent to
controller.Copyright © 2019 LSST. All rights reserved.