stella.parameter
Class PowerTelescope
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractCachedParameter
stella.parameter.AbstractStatusRequestor
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.
|
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. |
| Methods inherited from class stella.parameter.AbstractParameter |
createParameter, delivers, exit, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString |
| 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 |
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.
PowerTelescope
public PowerTelescope(Map<String,String> prop)
- Constructs a new power telescope trigger. Until the first
TelescopeStatus event is registered, this parameter returns
false.
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