public class CalibrationMaster extends GenericMaster implements CalibrationControlling, Reloadable
AdapterMaster. This class handles the following commands:
ThArOnCalibration: Turns the calibration light, i.e. ThAr on. If
a movement of the calibration unit is required, this is also done. The input
source is NOT changed, normally this requires a different filter
position.ThArOffCalibration: Turns the calibration light off. The
calibration unit is only moved if the KEY_RETRACEUNIT points to
true.FlatFieldOnCalibration: Turns the flat-field light, i.e. Halogen
on. If a movement of the calibration unit is required, this is also done. The
input source is NOT changed, normally this requires a different filter
position.FlatFieldOffCalibration: Turns the flat-field light off. The
calibration unit is only moved if the KEY_RETRACEUNIT points to
true.SelectFilterCalibration: Takes a verbal description like 'V' as
an argument. A lookup table is provided with KEY_WHEELPOSITIONS that
translate filter names to integer postions of the filter wheel(s).GenericMaster.KEY_DRIVERS list, though for switching of the lamps we relie on
OneWireSwitchs and not interfere with the switch driver itself.GenericMaster.StandaloneReceiverTorso.CommandHandlerPropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private static long |
DEFALIGHTQUARTZ
The default time the quartz may be turned on.
|
private static long |
DEFALIGHTTHAR
The default time the ThAr may be turned on.
|
private static String |
DEFCALIBRATION
The name of the calibration unit driver for postioning lamps.
|
private static long |
DEFCALIBRATIONOFFTIME
The default time to turn off calibration.
|
private static long |
DEFCALIBRATIONONTIME
The default time to turn on calibration.
|
private static String |
DEFFILTERCLEAR
The default name of the filter wheel position for star into fiber.
|
private static String |
DEFFILTERQUARTZ
The default name of the filter wheel position for Quartz into fiber.
|
private static String |
DEFFILTERTHAR
The default name of the filter wheel position for ThAr into fiber.
|
private static String |
DEFFILTERWHEEL
The name of the filter wheel driver.
|
private static long |
DEFFLATFIELDOFFTIME
The default time to turn off flat-fielding.
|
private static long |
DEFFLATFIELDONTIME
The default time to turn on flat-fielding.
|
private static long |
DEFMOVETIME
The default time to change the filter.
|
private static String |
DEFPOSITIONHOME
The position name in the calibration unit for home position.
|
private static String |
DEFPOSITIONQUARTZ
The position name in the calibration unit for choosing ThAr.
|
private static String |
DEFPOSITIONTHAR
The position name in the calibration unit for choosing ThAr.
|
private static long |
DEFSELECTFILTERTIME
The default time to change the filter.
|
private static String |
DEFSET
The default properties file for the adapter master parameters.
|
private static String |
DEFSWITCHQUARTZ
The name of the halogen lamp switch in the parameter set.
|
private static String |
DEFSWITCHTHAR
The name of the thorium lamp switch in the parameter set.
|
private static String |
DEFWHEELPOSITIONS
The default names to position lookup table for the wheel.
|
static String |
KEY_ALIGHTQUARTZ
The time the quartz is allowed to be on at maximum, ms.
|
static String |
KEY_ALIGHTTHAR
The time the ThAr is allowed to be on at maximum, ms.
|
static String |
KEY_CALIBRATION
The name of the calibration unit driver for postioning lamps.
|
static String |
KEY_CALIBRATIONOFFTIME
Time for turning off calibration light.
|
static String |
KEY_CALIBRATIONONTIME
Time for turning on calibration light.
|
static String |
KEY_FILTERCLEAR
The filter wheel position for calibration light.
|
static String |
KEY_FILTERQUARTZ
The filter wheel position for calibration light.
|
static String |
KEY_FILTERTHAR
The filter wheel position for calibration light.
|
static String |
KEY_FILTERWHEEL
The name of the filter wheel drivers.
|
static String |
KEY_FLATFIELDOFFTIME
Time for turning off flat-fielding light.
|
static String |
KEY_FLATFIELDONTIME
Time for turning on flat-fielding light.
|
static String |
KEY_MOVETIME
Time for moving the calibration unit.
|
static String |
KEY_POSITIONHOME
The position name in the calibration unit for home position
|
static String |
KEY_POSITIONQUARTZ
The position name in the calibration unit for choosing Halogen.
|
static String |
KEY_POSITIONTHAR
The position name in the calibration unit for choosing ThAr.
|
static String |
KEY_RETRACEUNIT
The position name in the calibration unit for choosing ThAr.
|
static String |
KEY_SELECTFILTERTIME
Time for selecting the filter.
|
static String |
KEY_SWITCHQUARTZ
The name of the halogen lamp switch in the parameter set.
|
static String |
KEY_SWITCHTHAR
The name of the thorium lamp switch in the parameter set.
|
static String |
KEY_WHEELPOSITIONS
The filter wheel position for telescope light.
|
private List<String> |
wheeldriver
A list of filter-wheel driver names.
|
private Map<String,List<Integer>> |
wheelposition
A lookup-table for filter names to integer position in filter wheels.
|
DEFUNIQUE, KEY_ABORTTIME, KEY_AUTOMATIC, KEY_COMMTIME, KEY_COMMUNICATOR, KEY_DRIVERS, KEY_HISTORYDB, KEY_INITTIME, KEY_NODB, KEY_OBSERVEDB, KEY_OVERRULEAUTO, KEY_PARKTIME, KEY_PERMISSIONDB, KEY_PROPOSALDB, KEY_QUITTIME, KEY_REAUTO, KEY_RESETTIME, KEY_SET, KEY_SHUTDOWNDELAY, KEY_STATUSTIME, KEY_TARGETDB, KEY_TASKDB, KEY_UNIQUE, KEY_USERDB, lastabort, lastinit, lastpark, lastreset, telescopeKEY_BIND, KEY_BINDNAME, KEY_COMMANDCASTER, KEY_ERRORCOOLKEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEPKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORNAMING_EXTENSIONNAMING_EXTENSIONKEY_INITDEPTHKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOMECONFIG, KEY_CLASS| Constructor and Description |
|---|
CalibrationMaster(Map<String,String> prop)
Constructs a new adapter master.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(CommandEvent ce)
Checks if the command received is accepted by the adapter master.
|
private boolean |
calibrationLight()
Returns the trigger state of the calibration light switch.
|
boolean |
calibrationMove()
Changes the calibration unit for input of thar.
|
boolean |
calibrationOff()
Switches calibration light off.
|
boolean |
calibrationOn()
Switches calibration light on.
|
boolean |
changeCalibrationPosition(String newpos)
To allow the a cahnge of the positioning of the calibration unit during
operation.
|
boolean |
changeCalibrationSwitch(String newswitch)
To allow the change of the calibration-light switch without change in the
properties this method takes the name of the new calibration-light
switch.
|
boolean |
changeFlatFieldPosition(String newpos)
To allow the a change of the positioning of the flat-field unit during
operation.
|
boolean |
changeFlatFieldSwitch(String newswitch)
To allow the change of the flat-field light switch without change in the
properties this method takes the name of the new flat-field light switch.
|
void |
exit()
Turn lamps off on exit.
|
boolean |
filterOffset(String name,
int off)
Steps the filter wheel on the given index back or forth for the given
number of steps.
|
private boolean |
filterWheelZero()
Does a zero-positioning on all filter wheels found.
|
private boolean |
flatFieldLight()
Returns the trigger state of the calibration light switch.
|
boolean |
flatFieldMove()
Changes the calibration unit for input of quartz.
|
boolean |
flatFieldOff()
Switches flat-fielding light off.
|
boolean |
flatFieldOn()
Switches flat-fielding light.
|
protected int |
getAcknowledgeNumber(CommandEvent cmd)
Returns the number of acknowledge events produced for each command.
|
protected long |
getCompletionTime(CommandEvent cmd,
int acknr)
Returns the individual completion times.
|
String |
getFilterPosition()
Gets the current fiber input source as the filter wheel position.
|
boolean |
homeMove()
Changes the calibration unit to home position
|
private void |
init2()
Additionally initializes the filter-to-position lookup tables.
|
protected boolean |
initializeMaster(CommandEvent cmd)
Initializes the calibration master.
|
void |
initStep(int curstep)
Additionally initializes the filter-to-position lookup tables.
|
boolean |
isCalibration()
Returns true if calibration light, i.e.
|
boolean |
isFlatField()
Returns true if flatfield light is switched on.
|
static void |
main(String[] arg)
Constructs a new adapter master.
|
private boolean |
offFlat(CommandEvent cmd)
Turns the flat-fielding light off and does whatever adjustments necessary
to feed telescope light into the spectrograph again.
|
private boolean |
offThAr(CommandEvent cmd)
Turns the calibration light off and does whatever adjustments necessary
to feed telescope light into the spectrograph.
|
private boolean |
onFlat(CommandEvent cmd)
Turns the flat-fielding light on and does whatever adjustments necessary
to feed it into the spectrograph.
|
private boolean |
onThAr(CommandEvent cmd)
Turns on the calibration light.
|
protected boolean |
parkMaster(CommandEvent cmd)
Parks the adapter.
|
private String |
parseFilter()
Parses the state of all filter wheels to get the current active filter.
|
boolean |
prepareCalibration()
Prepares a calibration exposure.
|
boolean |
prepareFlatField()
Prepares a flat field exposure.
|
boolean |
prepareScience()
Prepares a science operation.
|
protected boolean |
processCommand(CommandEvent cmd,
int acknr)
Process the command.
|
void |
quit()
Gracefully quite the adapter master.
|
double |
rescanned(String key,
String old,
String newval)
On reload, we can rebuild the filter lookup table.
|
boolean |
reset()
Zero positions all filter wheels and sets the calibration sledge to home.
|
protected boolean |
resetMaster(CommandEvent cmd)
Resets the adapter.
|
private boolean |
selectFilter(CommandEvent cmd,
String filter)
Selects a new filter or filter wheel position within the adapter.
|
boolean |
setFilterPosition(String pos)
Selects fiber input / ccd onput by changing the filter wheel position
|
private Map<String,List<Integer>> |
setupFilterTable(List<String> wheels,
String pos)
Sets up the filter wheel table by parsing the individual filter wheel
entries into integer positions.
|
private boolean |
shiftCalibrationUnit(CommandEvent cmd,
String position)
Shift the calibration unit to the position specified, if we have it.
|
private boolean |
sledgeHome()
Does a homing on the calibration unit sledge.
|
protected Object |
statusMaster(CommandEvent dummy)
Returns a short description of the status of the adapter.
|
abortMaster, addErrorListener, addRmiErrorListener, automatic, createCommunicator, createCommunicator, external, formatWithGlobals, getAllDrivers, getDriver, getHistorySql, getObserveSql, getOffsetCaster, getParameterByKey, getParameterByName, getParameterCluster, getParameterValueByKey, getParameterValueByName, getPermissionSql, getProposalSql, getStatus, getTargetSql, getTaskSql, getUnique, getUniqueId, getUserSql, initialize, isAlive, isAuto, isManual, isPassive, manual, park, quitMaster, reload, resetAlarm, resetAllDrivers, restartAllDrivers, revert, rmiAddParameter, rmiCommand, rmiGet, rmiGetAllParameterNames, rmiRemoveParameter, rmiSet, setLastError, setOff, setParameterValueByKey, setParameterValueByName, setPassive, shutdown, zeroAllOmcaddRmiAcknowledgeListener, addRmiDoneListener, bindDefault, containsRemoteProperty, deregisterAtCaster, equals, getLastError, getRemoteProperties, getRemoteProperty, hashCode, notifyAcknowledgeListener, notifyDoneListener, registerAtCaster, removeRmiAcknowledgeListener, removeRmiDoneListener, sendAllPrematureDone, sendPrematureDone, setRemoteProperty, toString, unbindDefaultbindToRegistry, getBindName, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatus, sendStatus, unbindFromRegistryallBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, startBinding, startBindingclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, parseObject, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesfinalize, getClass, notify, notifyAll, wait, wait, waitautomatic, external, getStatus, initialize, manual, park, setPassivereloadbindToRegistry, isValid, unbindFromRegistryremoveErrorListenergetListenerNamedisconnect, isConnecteddefaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringPropertiespublic static final String KEY_FILTERWHEEL
public static final String KEY_CALIBRATION
public static final String KEY_POSITIONHOME
public static final String KEY_POSITIONTHAR
public static final String KEY_POSITIONQUARTZ
public static final String KEY_RETRACEUNIT
public static final String KEY_SWITCHTHAR
public static final String KEY_SWITCHQUARTZ
public static final String KEY_ALIGHTTHAR
public static final String KEY_ALIGHTQUARTZ
public static final String KEY_WHEELPOSITIONS
public static final String KEY_FILTERTHAR
public static final String KEY_FILTERQUARTZ
public static final String KEY_FILTERCLEAR
public static final String KEY_CALIBRATIONONTIME
public static final String KEY_CALIBRATIONOFFTIME
public static final String KEY_FLATFIELDONTIME
public static final String KEY_FLATFIELDOFFTIME
public static final String KEY_SELECTFILTERTIME
public static final String KEY_MOVETIME
private static final String DEFSET
private static final String DEFFILTERWHEEL
private static final String DEFCALIBRATION
private static final String DEFPOSITIONHOME
private static final String DEFPOSITIONTHAR
private static final String DEFPOSITIONQUARTZ
private static final String DEFSWITCHTHAR
private static final String DEFSWITCHQUARTZ
private static final long DEFALIGHTQUARTZ
private static final long DEFALIGHTTHAR
private static final String DEFWHEELPOSITIONS
private static final String DEFFILTERTHAR
private static final String DEFFILTERQUARTZ
private static final String DEFFILTERCLEAR
private static final long DEFCALIBRATIONONTIME
private static final long DEFCALIBRATIONOFFTIME
private static final long DEFFLATFIELDONTIME
private static final long DEFFLATFIELDOFFTIME
private static final long DEFSELECTFILTERTIME
private static final long DEFMOVETIME
private Map<String,List<Integer>> wheelposition
public CalibrationMaster(Map<String,String> prop) throws RemoteException
#init section of the parent class.RemoteExceptionpublic void initStep(int curstep)
throws InitException
initStep in interface StepInitializableinitStep in class GenericMasterInitExceptionprivate void init2()
private Map<String,List<Integer>> setupFilterTable(List<String> wheels, String pos)
public void exit()
exit in interface ExitCleaningexit in class GenericMasterpublic double rescanned(String key, String old, String newval)
rescanned in interface Reloadablerescanned in class GenericMasterpublic boolean accepts(CommandEvent ce) throws RemoteException
AdapterCommands.accepts in interface RmiCommandListenerRemoteExceptionpublic boolean calibrationOn()
throws RemoteException
calibrationOn in interface CalibrationControllingRemoteExceptionpublic boolean reset()
throws RemoteException
reset in interface ListenerControllingreset in class GenericMasterRemoteExceptionpublic boolean calibrationOff()
throws RemoteException
calibrationOff in interface CalibrationControllingRemoteExceptionpublic boolean calibrationMove()
throws RemoteException
calibrationMove in interface CalibrationControllingRemoteExceptionpublic boolean flatFieldOn()
throws RemoteException
flatFieldOn in interface CalibrationControllingRemoteExceptionpublic boolean flatFieldOff()
throws RemoteException
flatFieldOff in interface CalibrationControllingRemoteExceptionpublic boolean flatFieldMove()
throws RemoteException
flatFieldMove in interface CalibrationControllingRemoteExceptionpublic boolean homeMove()
throws RemoteException
RemoteExceptionpublic boolean prepareCalibration()
throws RemoteException
prepareCalibration in interface CalibrationControllingRemoteExceptionpublic boolean prepareFlatField()
throws RemoteException
prepareFlatField in interface CalibrationControllingRemoteExceptionpublic boolean prepareScience()
throws RemoteException
prepareScience in interface CalibrationControllingRemoteExceptionpublic boolean setFilterPosition(String pos) throws RemoteException
setFilterPosition in interface CalibrationControllingRemoteExceptionpublic boolean filterOffset(String name, int off) throws RemoteException
filterOffset in interface CalibrationControllingRemoteExceptionpublic String getFilterPosition() throws RemoteException
getFilterPosition in interface CalibrationControllingRemoteExceptionpublic boolean isCalibration()
throws RemoteException
isCalibration in interface CalibrationControllingRemoteExceptionpublic boolean isFlatField()
throws RemoteException
isFlatField in interface CalibrationControllingRemoteExceptionpublic boolean changeCalibrationSwitch(String newswitch) throws RemoteException
changeCalibrationPosition(java.lang.String)
.changeCalibrationSwitch in interface CalibrationControllingRemoteExceptionpublic boolean changeFlatFieldSwitch(String newswitch) throws RemoteException
changeCalibrationPosition(java.lang.String)
.changeFlatFieldSwitch in interface CalibrationControllingRemoteExceptionpublic boolean changeCalibrationPosition(String newpos) throws RemoteException
changeCalibrationSwitch(java.lang.String).changeCalibrationPosition in interface CalibrationControllingRemoteExceptionpublic boolean changeFlatFieldPosition(String newpos) throws RemoteException
changeFlatFieldSwitch(java.lang.String).changeFlatFieldPosition in interface CalibrationControllingRemoteExceptionpublic void quit()
throws RemoteException
quit in interface ListenerControllingquit in class GenericMasterRemoteExceptionprotected int getAcknowledgeNumber(CommandEvent cmd)
getAcknowledgeNumber in class GenericMasterprotected long getCompletionTime(CommandEvent cmd, int acknr)
getCompletionTime in class GenericMastercmd - The command to process.acknr - The number of the acknowledge that will be sent back.protected boolean processCommand(CommandEvent cmd, int acknr)
processCommand in class GenericMasterprotected Object statusMaster(CommandEvent dummy)
statusMaster in class GenericMasterdummy - Non-null in automatic mode.ErrorEvent.protected boolean initializeMaster(CommandEvent cmd)
initializeMaster in class GenericMastercmd - Non-null in automatic mode.protected boolean resetMaster(CommandEvent cmd)
resetMaster in class GenericMastercmd - Non-null in automatic mode.protected boolean parkMaster(CommandEvent cmd)
parkMaster in class GenericMastercmd - Non-null in automatic mode.private String parseFilter()
private boolean filterWheelZero()
private boolean sledgeHome()
private boolean calibrationLight()
private boolean flatFieldLight()
private boolean onThAr(CommandEvent cmd)
cmd - Non-null in automatic mode.private boolean offThAr(CommandEvent cmd)
cmd - Non-null in automatic mode.private boolean onFlat(CommandEvent cmd)
cmd - Non-null in automatic mode.private boolean offFlat(CommandEvent cmd)
cmd - Non-null in automatic mode.private boolean selectFilter(CommandEvent cmd, String filter)
cmd - Non-null in automatic mode.private boolean shiftCalibrationUnit(CommandEvent cmd, String position)
cmd - Non-null in automatic mode.public static void main(String[] arg) throws RemoteException
RemoteException