stella.parameter
Class ShutterTimes

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractValue
                      extended by stella.parameter.ShutterTimes
All Implemented Interfaces:
DriverDepending, Cloneable, Parameter, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying

public class ShutterTimes
extends AbstractValue
implements DriverDepending, Reloadable

Wraps on a shutter and provides timing information. The KEY_FLAVOR property points to the method queried.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static String DEFFLAVOR
          We link to the total shutter open time.
static String DEFNAME
          The default name.
private static String DEFSHUTTER
          We link to the default shutter name.
static String KEY_FLAVOR
          The name of the Shutter method to invoke.
static String KEY_SHUTTER
          The name of the Shutter driver.
private  Shutter shutter
          The reference to the Shutter driver.
private  Method timing
          The method to invoke for retrieving the time.
 
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 util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
ShutterTimes(Map<String,String> prop)
          Constructs a new filter wheel parameter, defaulting its name and the name of the Positioning driver.
 
Method Summary
 String getFormatted()
          Formatted return is in sec.
 Number getValue()
          Tries to get the position of the filterwheel as an integer.
private static Method probeMethod(String flavor, Class shutit)
          Scan for the method with the given name in the stated class.
 boolean registerDriver(Driver fw)
          Registers the driver.
 double rescanned(String key, String old, String newval)
          As any parameter depending instance we fail if the driver we depend on is now a different one.
private  boolean selectMethod()
          We try to select the method stated by its name as the method to get the shutter time.
 Number setValue(Number to)
          Not allowed.
 
Methods inherited from class stella.parameter.AbstractValue
get, set
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, exit, getFormatted, getName, getPreserveFile, getString, getString, init, 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 util.Reloadable
reload
 
Methods inherited from interface stella.Parameter
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.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_SHUTTER

public static final String KEY_SHUTTER
The name of the Shutter driver.

See Also:
Constant Field Values

KEY_FLAVOR

public static final String KEY_FLAVOR
The name of the Shutter method to invoke.

See Also:
Constant Field Values

DEFNAME

public static final String DEFNAME
The default name.

See Also:
Constant Field Values

DEFSHUTTER

private static final String DEFSHUTTER
We link to the default shutter name.

See Also:
Constant Field Values

DEFFLAVOR

private static final String DEFFLAVOR
We link to the total shutter open time.

See Also:
Constant Field Values

shutter

private Shutter shutter
The reference to the Shutter driver.


timing

private Method timing
The method to invoke for retrieving the time.

Constructor Detail

ShutterTimes

public ShutterTimes(Map<String,String> prop)
Constructs a new filter wheel parameter, defaulting its name and the name of the Positioning driver.

Method Detail

rescanned

public double rescanned(String key,
                        String old,
                        String newval)
As any parameter depending instance we fail if the driver we depend on is now a different one. If only the method has changed, we try to get it from the driver.

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

selectMethod

private boolean selectMethod()
We try to select the method stated by its name as the method to get the shutter time. If we already have a shutter driver assigned, we use this object to derive its class from, otherwise the shutter inter face is scanned. Only on reload, we might already have a shutter driver object.


probeMethod

private static Method probeMethod(String flavor,
                                  Class shutit)
Scan for the method with the given name in the stated class. The method must be callable with no arguments.


registerDriver

public boolean registerDriver(Driver fw)
Registers the driver. If it is Positioning and its name equals #KEY_FILTERWHEEL, we keep a reference to it.

Specified by:
registerDriver in interface DriverDepending
Returns:
True if registering at the driver was successful.

getValue

public Number getValue()
Tries to get the position of the filterwheel as an integer.

Specified by:
getValue in interface Value

setValue

public Number setValue(Number to)
Not allowed.

Specified by:
setValue in interface Value

getFormatted

public String getFormatted()
Formatted return is in sec.

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