stella.parameter
Class AltTelescope

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractCachedParameter
                      extended by stella.parameter.AbstractStatusRequestor
                          extended by stella.parameter.AltTelescope
All Implemented Interfaces:
Cloneable, ErrorDependingParameter, Parameter, StatusRequesting, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying

public class AltTelescope
extends AbstractStatusRequestor
implements Value, Reloadable

The current position of the telescope, altitude in degrees. It uses a TelescopeStatus error event to retrieve a most accurate position of the telescope. Note that there will still be some deviation from the true position due to the following reasons:


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static double DEFALTHOME
          The home position of the telescope.
private static String DEFCOMMAND
          The default class name of the status command to send.
static String DEFNAME
          The default name of this parameter.
private static DecimalFormat df
          The formatter for the telescope altitude.
static String KEY_ALTHOME
          The key pointing to the home position of the telescope.
 
Fields inherited from class stella.parameter.AbstractStatusRequestor
KEY_COMMAND, KEY_DISABLE, KEY_TIMEOUT
 
Fields inherited from class stella.parameter.AbstractCachedParameter
KEY_CACHE
 
Fields inherited from class stella.parameter.AbstractParameter
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN
 
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 util.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface stella.ErrorDependingParameter
NAMING_EXTENSION
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
AltTelescope(Map prop)
          Constructs a new alt telescope parameter.
 
Method Summary
 Object getForError(ErrorEvent ee)
          Returns the azimuth of the telescope deduced from a freshly received TelescopeStatus.
 String getFormatted()
          Returns the azimuth of the telescope in a properly formatted way.
 Number getValue()
          Returns the azimuth of the telescope.
protected  boolean isStatusRequested(ErrorEvent ee)
          Returns true if the error event received is of TelescopeStatus
 double rescanned(String key, String old, String newval)
          Makes this method public, no further changes.
 Number setValue(Number newalt)
          Sets the azimuth of the telescope.
 
Methods inherited from class stella.parameter.AbstractStatusRequestor
getUncached, init, registerError, registerLauncher
 
Methods inherited from class stella.parameter.AbstractCachedParameter
get, getCache, getCacheFormatted, set
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, exit, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString
 
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, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.Parameter
get, getName, getString, set
 
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
 
Methods inherited from interface util.Reloadable
reload
 
Methods inherited from interface stella.StatusRequesting
getCache, getCacheFormatted
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_ALTHOME

public static final String KEY_ALTHOME
The key pointing to the home position of the telescope.

See Also:
Constant Field Values

DEFNAME

public static final String DEFNAME
The default name of this parameter.

See Also:
Constant Field Values

DEFALTHOME

private static final double DEFALTHOME
The home position of the telescope. Value adopted at construct.

See Also:
Constant Field Values

DEFCOMMAND

private static final String DEFCOMMAND
The default class name of the status command to send.

See Also:
Constant Field Values

df

private static final DecimalFormat df
The formatter for the telescope altitude.

Constructor Detail

AltTelescope

public AltTelescope(Map prop)
Constructs a new alt telescope parameter. Until the first TelescopeStatus event is registered, this parameter points to the home position of the telescope KEY_ALTHOME.

Method Detail

rescanned

public double rescanned(String key,
                        String old,
                        String newval)
Makes this method public, no further changes.

Specified by:
rescanned in interface Reloadable
Overrides:
rescanned in class AbstractStatusRequestor

setValue

public Number setValue(Number newalt)
Sets the azimuth of the telescope.

Specified by:
setValue in interface Value

getValue

public Number getValue()
Returns the azimuth of the telescope. Deduced from the last TelescopeStatus event registered to this parameter.

Specified by:
getValue in interface Value

getFormatted

public String getFormatted()
Returns the azimuth of the telescope in a properly formatted way.

Specified by:
getFormatted in interface Parameter
Overrides:
getFormatted in class AbstractParameter

getForError

public Object getForError(ErrorEvent ee)
Returns the azimuth of the telescope deduced from a freshly received TelescopeStatus. This method is probably not extremly useful, normally a TelescopeStatus error will be registered to this parameter and its value queried later.

Specified by:
getForError in interface ErrorDependingParameter

isStatusRequested

protected boolean isStatusRequested(ErrorEvent ee)
Returns true if the error event received is of TelescopeStatus

Specified by:
isStatusRequested in class AbstractStatusRequestor