public class AdapterTelescopeCaster extends CasterClient implements OffsetCaster
CasterClient is the ability to
send a single command and wait until the final done is received or a
KEY_MINTIMEOUT, KEY_DEGREETIMEOUT is surpassed. This is
done by invoking castOffsetAndWaitCasterClient.CommandSenderPropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private static long |
DEFDEGREETIMEOUT
The default time-out for the
OffsetTelescope command. |
private static long |
DEFMINTIMEOUT
The default time-out for the
OffsetTelescope command. |
private List |
guideoffsets
A list of offset commands sent during guiding where we don't wait.
|
static String |
KEY_DEGREETIMEOUT
The time-out added per degree shift.
|
static String |
KEY_MINTIMEOUT
The minimum time-out for non-successful command submission.
|
private ReplySubscriber |
reply
The reply subscriber used for blocking command-sends.
|
private Object |
wait
A locking object.
|
KEY_ACKNOWLEDGETIMEOUT, KEY_ALARMGROUP, KEY_BIND, KEY_BUFFERSIZE, KEY_CASTERNAME, KEY_MAXWAITONCLOSE, KEY_PORT, KEY_RECEIVER, KEY_RETRYCOUNT, KEY_RETRYSLEEPALTERNATEHOST, ALTERNATEPORT, KEY_BINDNAME, KEY_EXPORTPORT, KEY_REGISTRYHOST, KEY_REGISTRYPORTKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSNAMING_EXTENSIONNAMING_EXTENSIONNAMING_EXTENSIONKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
AdapterTelescopeCaster(Map prop)
Constructs a new adapter-to-telescope caster.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
castCommandAndWait(TelescopeCommand tc,
long timeout)
Only used for manual acquire.
|
boolean |
castDitherAndWait(DitherTelescope offset)
Casts the dither command to the telescope and waits for notification on
the appropriate done event.
|
boolean |
castOffsetAndWait(OffsetTelescope offset)
Casts the offset command to the telescope and waits for notification on
the appropriate done event.
|
void |
castOffsetAtGuide(OffsetTelescope offset)
Casts the offset command to the telescope during guiding phase.
|
int |
getActiveOffsets()
At guide, the guider task may want to know how many offsets are currently
active to avoid overloading the telescope.
|
CommandEvent |
getShutdownCommand()
Needed to be non-abstract.
|
boolean |
handles(CommandEvent ce)
This caster handles only
OffsetTelescope commands. |
void |
init()
Registers a new reply subscriber to this command sender.
|
addRmiAcknowledgeListener, addRmiCommandListener, addRmiDoneListener, announceInterest, castCommand, checkForward, close, exit, getAcknowledgeTimeOut, getAlarmGroup, getBufferSize, getClientName, getExitCommand, getPort, getReceiver, isReady, notifyAcknowledgeListener, notifyCommandListener, notifyDoneListener, recastCommand, registerReplySubscriber, removeRmiAcknowledgeListener, removeRmiCommandListener, removeRmiDoneListenercreateCommandLauncheraddErrorListener, addRmiErrorListener, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatus, sendStatusbindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, casterExit, casterExit, getBindName, getBindName, unbindFromRegistry, unbindFromRegistrycontainsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemotePropertyclone, 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, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcastCommand, getClientName, getExitCommand, isReady, recastCommandannounceInterest, registerReplySubscriberdefaultBoolean, 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, stringPropertiesaddRmiErrorListener, removeRmiErrorListenerbindToRegistry, isValid, unbindFromRegistryaddErrorListener, removeErrorListenerpublic static final String KEY_MINTIMEOUT
public static final String KEY_DEGREETIMEOUT
private static final long DEFMINTIMEOUT
OffsetTelescope command.private static final long DEFDEGREETIMEOUT
OffsetTelescope command.private ReplySubscriber reply
private final Object wait
private List guideoffsets
public AdapterTelescopeCaster(Map prop) throws RemoteException
init() method.RemoteExceptionpublic boolean castDitherAndWait(DitherTelescope offset)
OffsetTelescope command was received or a time-out
has occured. The time-out depends on the offset: to the minimal time-out
KEY_MINTIMEOUT an offset-depending KEY_DEGREETIMEOUT is
added by multiplying the second number with the desired offset in
degrees. Note that we have access to the telescope altitude via the
enclosing class.castDitherAndWait in interface OffsetCasteroffset - A OffsetTelescope command WARNING: This is actually a
ZD offset in degrees.public void init()
#sendBlocking method.init in interface Initializableinit in class CasterClientCasterClient.KEY_RETRYCOUNT,
CasterClient.KEY_RETRYSLEEPpublic void castOffsetAtGuide(OffsetTelescope offset)
castOffsetAtGuide in interface OffsetCasteroffset - A OffsetTelescope command WARNING: This is actually a
ZD offset in degrees.public int getActiveOffsets()
getActiveOffsets in interface OffsetCasterpublic boolean castOffsetAndWait(OffsetTelescope offset)
OffsetTelescope command was received or a time-out
has occured. The time-out depends on the offset: to the minimal time-out
KEY_MINTIMEOUT an offset-depending KEY_DEGREETIMEOUT is
added by multiplying the second number with the desired offset in
degrees. Note that we have access to the telescope altitude via the
enclosing class.castOffsetAndWait in interface OffsetCasteroffset - A OffsetTelescope command WARNING: This is actually a
ZD offset in degrees.public boolean castCommandAndWait(TelescopeCommand tc, long timeout)
castCommandAndWait in interface OffsetCasterpublic CommandEvent getShutdownCommand()
getShutdownCommand in interface CommandLaunchingpublic boolean handles(CommandEvent ce)
OffsetTelescope commands.handles in interface CommandLaunchinghandles in class CasterClient