stella.parameter
Class PowerTelescope

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.PowerTelescope
All Implemented Interfaces:
Cloneable, ErrorDependingParameter, Parameter, StatusRequesting, Trigger, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying

public class PowerTelescope
extends AbstractStatusRequestor
implements Trigger, Reloadable

The current power state of the telescope, as parsed from a status event.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static String DEFCOMMAND
          The default class name of the status command to send.
static String DEFNAME
          The default name of this parameter.
private  Trigger power
          My simple trigger that reflects the state.
 
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
PowerTelescope(Map<String,String> prop)
          Constructs a new power telescope trigger.
 
Method Summary
 long getElapsedToggleTime()
          Might be grossly wrong, event trigger steps might be lost, depending on the update time.
 Object getForError(ErrorEvent ee)
          Returns the power of the telescope deduced from a freshly received TelescopeStatus.
 String getFormatted()
          Returns the azimuth of the telescope in a properly formatted way.
 Date getLastToggleTime()
          Might be grossly wrong, event trigger steps might be lost, depending on the update time.
 Boolean getTrigger()
          Returns the power of the telescope.
protected  boolean isStatusRequested(ErrorEvent ee)
          Returns true if the error event received is of TelescopeStatus
 boolean isTrue()
          Returns the state of the trigger.
 double rescanned(String key, String old, String newval)
          Makes this method public, no further changes.
 Object set(Object newval)
          Reflect the set change also in my trigger for time updates.
 Boolean setTrigger(Boolean newpower)
          Sets the azimuth of the telescope.
 Boolean toggleTrigger()
          Setting is only allowed by receive of a status event.
 
Methods inherited from class stella.parameter.AbstractStatusRequestor
getUncached, init, registerError, registerLauncher
 
Methods inherited from class stella.parameter.AbstractCachedParameter
get, getCache, getCacheFormatted
 
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
 
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

DEFNAME

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

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

power

private Trigger power
My simple trigger that reflects the state.

Constructor Detail

PowerTelescope

public PowerTelescope(Map<String,String> prop)
Constructs a new power telescope trigger. Until the first TelescopeStatus event is registered, this parameter returns false.

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

setTrigger

public Boolean setTrigger(Boolean newpower)
Sets the azimuth of the telescope.

Specified by:
setTrigger in interface Trigger

set

public Object set(Object newval)
Reflect the set change also in my trigger for time updates.

Specified by:
set in interface Parameter
Overrides:
set in class AbstractCachedParameter
Returns:
The previous value of this parameter.

getTrigger

public Boolean getTrigger()
Returns the power of the telescope. Deduced from the last TelescopeStatus event registered to this parameter.

Specified by:
getTrigger in interface Trigger

isTrue

public boolean isTrue()
Returns the state of the trigger.

Specified by:
isTrue in interface Trigger

toggleTrigger

public Boolean toggleTrigger()
Setting is only allowed by receive of a status event.

Specified by:
toggleTrigger in interface Trigger

getLastToggleTime

public Date getLastToggleTime()
Might be grossly wrong, event trigger steps might be lost, depending on the update time.

Specified by:
getLastToggleTime in interface Trigger

getElapsedToggleTime

public long getElapsedToggleTime()
Might be grossly wrong, event trigger steps might be lost, depending on the update time.

Specified by:
getElapsedToggleTime in interface Trigger

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 power 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