stella.adapter
Class PilarTelescopeCaster
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiListener
stella.rmi.AbstractRmiCasterAndListener
stella.rmi.CasterTorso
stella.rmi.TelescopeCaster
stella.util.TelescopeAuxiliaryCaster
stella.adapter.PilarTelescopeCaster
- All Implemented Interfaces:
- Cloneable, Remote, EventListener, OffsetCaster, Caster, CommandLaunching, ErrorSending, ErrorCaster, ReplyDeliverer, RmiAcknowledgeListener, RmiCommandCaster, RmiDoneListener, RmiErrorCaster, AlarmHandler, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiEventListener, RmiListener, RmiPropertyBearing
public class PilarTelescopeCaster
- extends TelescopeAuxiliaryCaster
- implements OffsetCaster
A simple class that allows sending of offset-commands from the adapter
to
the telescope. The main extension to the 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 castOffsetAndWait
| Methods inherited from class stella.rmi.CasterTorso |
addRmiCommandListener, announceInterest, castCommand, deregisterAtCaster, exit, getAcknowledgeTimeOut, getAlarmGroup, getClientName, isReady, recastCommand, registerAtCaster, registerReplySubscriber, removeRmiCommandListener, rmiGotAcknowledge, rmiGotDone, setOff, toString |
| Methods inherited from class stella.rmi.AbstractRmiCasterAndListener |
addErrorListener, addRmiErrorListener, bindToRegistry, getBindName, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatus, sendStatus, unbindFromRegistry |
| Methods inherited from class util.rmi.AbstractRmiListener |
allBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, rescanned, startBinding, startBinding |
| Methods inherited from class util.PropertyResources |
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
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, reload, removeProperty, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from interface util.PropertySupplying |
defaultBoolean, 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, stringProperties |
KEY_MINTIMEOUT
public static final String KEY_MINTIMEOUT
- The minimum time-out for non-successful command submission.
- See Also:
- Constant Field Values
KEY_DEGREETIMEOUT
public static final String KEY_DEGREETIMEOUT
- The time-out added per degree shift.
- See Also:
- Constant Field Values
DEFMINTIMEOUT
private static final long DEFMINTIMEOUT
- The default time-out for the
OffsetTelescope command.
- See Also:
- Constant Field Values
DEFDEGREETIMEOUT
private static final long DEFDEGREETIMEOUT
- The default time-out for the
OffsetTelescope command.
- See Also:
- Constant Field Values
PilarTelescopeCaster
public PilarTelescopeCaster(Map<String,String> prop)
throws RemoteException
- Constructs a new adapter-to-telescope caster. A reply-subscriber
that is used for blocking command transfer is registered to the
caster client in the
TelescopeAuxiliaryCaster.init() method.
- Throws:
RemoteException
castOffsetAtGuide
public void castOffsetAtGuide(OffsetTelescope offset)
- Casts the offset command to the telescope during guiding phase. We
immedeately return to the guiding loop.
- Specified by:
castOffsetAtGuide in interface OffsetCaster
- Parameters:
offset - A OffsetTelescope command
getActiveOffsets
public int getActiveOffsets()
- At guide, the guider task may want to know how many offsets are
currently active to avoid overloading the telescope.
- Specified by:
getActiveOffsets in interface OffsetCaster
castOffsetAndWait
public boolean castOffsetAndWait(OffsetTelescope offset)
- Casts the offset command to the telescope and waits for notification
on the appropriate done event. This method only returns if the final
done event to this
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.
The method returns true, if the done-event was
received on time.
- Specified by:
castOffsetAndWait in interface OffsetCaster
- Parameters:
offset - A OffsetTelescope command
- Returns:
- True, if command was sent successful and done was received.
getTimeoutFor
public long getTimeoutFor(TelescopeCommand ce)
- On some commands, we might be able to calculate a variable offset.
- Specified by:
getTimeoutFor in class TelescopeAuxiliaryCaster