|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiListener
stella.rmi.AbstractRmiCasterAndListener
stella.rmi.ReceiverTorso
stella.rmi.GenericSimulator
stella.telescope.TelescopeSimulator
public class TelescopeSimulator
A telescope simulator. This simulator is based on rmi, not on socket communication which is used for STELLA. It is intended for testing scheduling, sequencing and error handling. It does the following:
NoTelescope and
RepositionTelescope. The second one is only allowed if the
telescope is guiding.AbortTelescope, FocusTelescope,
InitTelescope, MoveTelescope, ParkTelescope,
StartGuideTelescope, StopGuideTelescope, and
StatusTelescope. Error as result to these commands are found
in the processCommand(stella.CommandEvent, int) section. MoveTelescope and
StatusTelescope spawn a TracktimeRemaining and a
TelescopeStatus status-event, respectively.CommandEvent.getExpectedAcknowledgeNumber().KEY_INITTRIGGER,
KEY_GUIDETRIGGER, KEY_FOCUSVALUE,
KEY_RAVALUE, KEY_DECVALUE, KEY_AZVALUE,
and KEY_ALTVALUE. Note that additional parameters needed especially
for the target-depending parameters must also be present in the set.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class stella.rmi.ReceiverTorso |
|---|
ReceiverTorso.CommandHandler |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static String[] |
ACKTIMES
The acknowledge times for the known commands. |
private static String[] |
COMMANDS
The known command types, used for acknowledges and true dones. |
private String |
curerror
The currently active error symbols. |
private static String |
DEFALTVALUE
The default name of the telescope altitude value. |
private static String |
DEFAZVALUE
The default name of the telescope azimuth value. |
private static String |
DEFDECVALUE
The default name of the telescope dec value. |
private static String |
DEFERRORCLASSES
The default error list. |
private static String |
DEFERRORPROBABILITIES
The default error probabilities. |
private static String |
DEFERRORSYMBOLS
The default error symbols to set in the status message. |
private static double |
DEFFAILDEROT
The default of the failure probability of the focus telescope command. |
private static double |
DEFFAILFOCUS
The default of the failure probability of the focus telescope command. |
private static double |
DEFFAILINIT
The default of the failure probability of the init telescope command. |
private static double |
DEFFAILMIRROR
The default of the failure probability of the focus telescope command. |
private static double |
DEFFAILMOVE
The default of the failure probability of the move telescope command. |
private static double |
DEFFAILOFFSET
The default of the failure probability of the focus telescope command. |
private static double |
DEFFAILPARK
The default to the failure probability of the park telescope command. |
private static String |
DEFFOCUSVALUE
The default name of the focus position value. |
private static String |
DEFGUIDETRIGGER
The default name of the guiding-telescope trigger. |
private static String |
DEFINITTRIGGER
The default name of the init-telescope trigger.. |
private static String |
DEFRAVALUE
The default name of the telescope ra value. |
private static String |
DEFSET
The default properties of the hidden parameter set of the simulator. |
private static double |
DEFSTARTUPALT
The startup-value of the telescope zenith distance. |
private static double |
DEFSTARTUPAZ
The startup-value of the telescope azimuth. |
private static long |
DEFTRACKTIMEBASE
The default to the base-time of the track-time remaining status event. |
private static double |
DEFTRACKTIMEDIVERT
The default to the divergence of the track-time remaining status. |
private static String[] |
DIVERT
The actual divert factors for the commands. |
private static String[] |
DONETIMES
The actual execution times for the commands. |
static String |
KEY_ALTVALUE
The key to the value naming altitude of the telescope. |
static String |
KEY_AZVALUE
The key to the value naming azimuth of the telescope. |
static String |
KEY_DECVALUE
The key to the value naming the dec of the telescope. |
static String |
KEY_ERRORSYMBOLS
The key to the error sysmbols to set in the status message. |
static String |
KEY_FAILDEROT
The key to the failure probability of the focus telescope command. |
static String |
KEY_FAILFOCUS
The key to the failure probability of the focus telescope command. |
static String |
KEY_FAILINIT
The key to the failure probability of the init telescope command. |
static String |
KEY_FAILMIRROR
The key to the failure probability of the focus telescope command. |
static String |
KEY_FAILMOVE
The key to the failure probability of the move telescope command. |
static String |
KEY_FAILOFFSET
The key to the failure probability of the focus telescope command. |
static String |
KEY_FAILPARK
The key to the failure probability of the park telescope command. |
static String |
KEY_FOCUSVALUE
The key to the value naming the focus position of the telescope. |
static String |
KEY_GUIDETRIGGER
The key to the trigger naming the is-guiding state of the telescope. |
static String |
KEY_INITTRIGGER
The key to the trigger naming the is-init state of the telescope. |
static String |
KEY_RAVALUE
The key to the value naming the ra of the telescope. |
static String |
KEY_SET
The key to the properties of the parameter set. |
static String |
KEY_STARTUPALT
The key to the default telescope zenith distance if val is undefined. |
static String |
KEY_STARTUPAZ
The key to the default telescope azimuth if value is undefined. |
static String |
KEY_TRACKTIMEBASE
The key to the base-time of the track-time remaining status event. |
static String |
KEY_TRACKTIMEDIVERT
The key to the divergence of the track-time remaining status event. |
private ErrorEvent |
lasterror
The error occured at the last command processing simulation. |
| Fields inherited from class stella.rmi.GenericSimulator |
|---|
ACKNOWLEDGEPREFIX, DEFUNIQUE, DEVIATEPREFIX, DONEPREFIX, KEY_ACCELERATE, KEY_ERRORCLASSES, KEY_ERRORINTERVAL, KEY_ERRORPROBABILITIES, KEY_GENERICACKNOWLEDGE, KEY_GENERICDEVIATE, KEY_GENERICDONE, KEY_UNIQUE, random |
| Fields inherited from class stella.rmi.ReceiverTorso |
|---|
KEY_BIND, KEY_BINDNAME, KEY_COMMANDCASTER, KEY_ERRORCOOL |
| Fields inherited from class util.rmi.AbstractRmiListener |
|---|
KEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEP, KEY_SHUTDOWNDELAY |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface stella.rmi.RmiAcknowledgeCaster |
|---|
NAMING_EXTENSION |
| Fields inherited from interface stella.rmi.RmiDoneCaster |
|---|
NAMING_EXTENSION |
| Fields inherited from interface util.StepInitializable |
|---|
KEY_INITDEPTH |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
TelescopeSimulator(Map prop)
Constructs a new telescope simulator. |
|
| Method Summary | |
|---|---|
boolean |
accepts(CommandEvent ce)
Returns true if this receiver accepts commands of the type handed over as an argument. |
protected ErrorEvent |
getLastError()
Returns the last error that occured during command processing. |
protected boolean |
isAllowed(ErrorEvent ee)
Returns true if the error handed over is either a NoTelescope
instance or, if guiding is on, a RepositionTelescope. |
static void |
main(String[] arg)
Constructs a new telescope simulator. |
private static Map |
myAugment(Map def)
Augments the properties three times, for acknowledge and done times and for d factors. |
protected boolean |
processCommand(CommandEvent ce,
int acknr)
Simulated command execution. |
| 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, startBinding, startBinding |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, 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 class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.rmi.RmiCaster |
|---|
bindToRegistry, isValid, unbindFromRegistry |
| Methods inherited from interface stella.ErrorCaster |
|---|
addErrorListener, removeErrorListener |
| Methods inherited from interface util.rmi.RmiEventListener |
|---|
getListenerName |
| Methods inherited from interface util.rmi.RmiListener |
|---|
disconnect, isConnected |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| 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 |
| Methods inherited from interface util.Initializable |
|---|
init |
| Field Detail |
|---|
public static final String KEY_FAILOFFSET
public static final String KEY_FAILDEROT
public static final String KEY_FAILMIRROR
public static final String KEY_FAILFOCUS
public static final String KEY_FAILINIT
public static final String KEY_FAILMOVE
public static final String KEY_FAILPARK
public static final String KEY_TRACKTIMEBASE
public static final String KEY_TRACKTIMEDIVERT
public static final String KEY_ERRORSYMBOLS
public static final String KEY_SET
public static final String KEY_INITTRIGGER
public static final String KEY_GUIDETRIGGER
public static final String KEY_FOCUSVALUE
public static final String KEY_RAVALUE
public static final String KEY_DECVALUE
public static final String KEY_AZVALUE
public static final String KEY_ALTVALUE
public static final String KEY_STARTUPAZ
public static final String KEY_STARTUPALT
private static final double DEFFAILOFFSET
private static final double DEFFAILDEROT
private static final double DEFFAILMIRROR
private static final double DEFFAILFOCUS
private static final double DEFFAILINIT
private static final double DEFFAILMOVE
private static final double DEFFAILPARK
private static final long DEFTRACKTIMEBASE
private static final double DEFTRACKTIMEDIVERT
private static final String DEFERRORSYMBOLS
private static final String DEFSET
private static final String DEFINITTRIGGER
private static final String DEFGUIDETRIGGER
private static final String DEFFOCUSVALUE
private static final String DEFRAVALUE
private static final String DEFDECVALUE
private static final String DEFAZVALUE
private static final String DEFALTVALUE
private static final double DEFSTARTUPAZ
private static final double DEFSTARTUPALT
private static final String DEFERRORCLASSES
private static final String DEFERRORPROBABILITIES
private static final String[] COMMANDS
private static final String[] ACKTIMES
private static final String[] DONETIMES
private static final String[] DIVERT
private ErrorEvent lasterror
private String curerror
| Constructor Detail |
|---|
public TelescopeSimulator(Map prop)
throws RemoteException
RemoteException| Method Detail |
|---|
private static Map myAugment(Map def)
public boolean accepts(CommandEvent ce)
throws RemoteException
TelescopeCommands.
RemoteExceptionprotected boolean isAllowed(ErrorEvent ee)
NoTelescope
instance or, if guiding is on, a RepositionTelescope.
isAllowed in class GenericSimulatorprotected ErrorEvent getLastError()
getLastError in class ReceiverTorso
protected boolean processCommand(CommandEvent ce,
int acknr)
AbortTelescope: Does not throw any special errors.
Aborts all commands currently processed with a premature done event.
FocusTelescope: Fails for a CannotFocusMirror error
with a probaility of KEY_FAILFOCUS. Sets the internal
variable focus position to the required value.InitTelescope: Fails with a CannotInitTelescope
or a CannotOpenMirrorCover, both with a probability of
KEY_FAILINIT.MoveTelescope: Fails with a CannotMoveTelescope
error with a KEY_FAILMOVE probability. Sends back a
TracktimeRemaining status event with a random tracking time.
ParkTelescope: Fails with a CannotMoveTelescope
error with a KEY_FAILMOVE probability or a
CannotCloseMirrorCover with a KEY_FAILPARKStartGuideTelescope: Toggles the guiding trigger,
does not fail.StopGuideTelescope: Toggles the guiding trigger,
does not fail.StatusTelescope: Does not fail, produces a
TelescopeStatus event prior to sending the final done. Uses the
correct settings of guiding, power, init, and focus position. The
azimuth and the zenith distance are calculated from the last telescope
position. Note that the parameter set houses only an altitude parameter.
Derotator position is always zero.
processCommand in class GenericSimulator
public static void main(String[] arg)
throws RemoteException
RemoteException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||