stella.parameter
Class FocusQuality

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.FocusQuality
All Implemented Interfaces:
Cloneable, ErrorDependingParameter, Parameter, StatePreserving, ParameterDepending, ExitCleaning, Initializable, LocalizedSupplying, Preserving, PropertySupplying, ResourceSupplying

public class FocusQuality
extends AbstractParameter
implements ErrorDependingParameter, StatePreserving, ParameterDepending

This parameter returns the list of all exact focus determinations.


Nested Class Summary
static class FocusQuality.Poke
          We peek into the saved datas file and print its content.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  SortedMap<Date,List<Number>> exact
          The lookuptable of all measures per date.
private  Value focus
          The focus position.
private  Value height
          The height value.
static String KEY_FOCUS
          The parameter that is the focus value.
static String KEY_HEIGHT
          The parameter that is target height.
static String KEY_TEMPERATURES
          The list of parameter names that are temperatures.
private  SortedSet<Value> temp
          The temperature parameters.
 
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 stella.ErrorDependingParameter
NAMING_EXTENSION
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
FocusQuality(Map<String,String> prop)
          Constructs a new error trigger.
 
Method Summary
 Object get()
          Returns the last recorded line.
 Object getForError(ErrorEvent err)
          Sets the trigger value according to the error received.
 void init()
          We initialize the temperature list.
 boolean preserve()
          On exit, we save our current state if the serialize property is set.
private  List<Number> recordNow()
          Returns the focus value, the temperature and the height of the telescope as a list of numbers.
 void registerError(ErrorEvent err)
          Registers the error to this trigger.
 void registerParameter(Parameter p)
          Registers a parameter, which is kept if a value and is one of our temperature sensors, the focus position or the target height.
 double rescanned(String key, String old, String newval)
          Makes this method public, no further changes.
 boolean restore()
          We restore our old value by reading the last date and target count from a serialization file.
 Object set(Object o)
          Setting is not allowed.
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, exit, getFormatted, 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
getFormatted, 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.ExitCleaning
exit
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_TEMPERATURES

public static final String KEY_TEMPERATURES
The list of parameter names that are temperatures.

See Also:
Constant Field Values

KEY_FOCUS

public static final String KEY_FOCUS
The parameter that is the focus value.

See Also:
Constant Field Values

KEY_HEIGHT

public static final String KEY_HEIGHT
The parameter that is target height.

See Also:
Constant Field Values

temp

private SortedSet<Value> temp
The temperature parameters.


focus

private Value focus
The focus position.


height

private Value height
The height value.


exact

private SortedMap<Date,List<Number>> exact
The lookuptable of all measures per date.

Constructor Detail

FocusQuality

public FocusQuality(Map<String,String> prop)
Constructs a new error trigger. The initial state of the trigger is set.

Method Detail

init

public void init()
We initialize the temperature list.

Specified by:
init in interface Initializable
Overrides:
init in class AbstractParameter

registerParameter

public void registerParameter(Parameter p)
Registers a parameter, which is kept if a value and is one of our temperature sensors, the focus position or the target height.

Specified by:
registerParameter in interface ParameterDepending

restore

public boolean restore()
We restore our old value by reading the last date and target count from a serialization file.

Specified by:
restore in interface Preserving
Returns:
False, if restoring the value was not possible.

preserve

public boolean preserve()
On exit, we save our current state if the serialize property is set. First the date, then the targetnumber is writtn.

Specified by:
preserve in interface Preserving
Returns:
false, if preserving the current state was not possible

rescanned

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

Overrides:
rescanned in class AbstractParameter

getForError

public Object getForError(ErrorEvent err)
Sets the trigger value according to the error received. If the class name of the error matches the #KEY_TRUE or the #KEY_FALSE class name the trigger is set to true or false, respectively. If the error class is not known, null is returned;

Specified by:
getForError in interface ErrorDependingParameter

registerError

public void registerError(ErrorEvent err)
Registers the error to this trigger. If the class name of the error matches the #KEY_TRUE or the #KEY_FALSE class name the trigger is set to true or false, respectively. If the error class is not known, nothing changes.

Specified by:
registerError in interface ErrorDependingParameter

set

public Object set(Object o)
Setting is not allowed.

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

get

public Object get()
Returns the last recorded line.

Specified by:
get in interface Parameter

recordNow

private List<Number> recordNow()
Returns the focus value, the temperature and the height of the telescope as a list of numbers. Non-values are stored as null elements.