stella.parameter
Class FocusStar

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractTargetParameter
                      extended by stella.parameter.FocusStar
All Implemented Interfaces:
Cloneable, Parameter, ParameterDepending, TargetDepending, TargetDependingParameter, Trigger, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying

public class FocusStar
extends AbstractTargetParameter
implements ParameterDepending, Trigger, Reloadable

A general variable representing the visual magnitude of the actual object. Extends the AbstractValue base class. Does not need any registereed additional Parameters.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  TargetDependingParameter alt
          The height of the target.
private static String DEFALTTARGET
          The default name of the sidereal parameter to use.
private static double DEFFOCUSMAG
          The default magnitude limit.
private static String DEFMAGTARGET
          The default name of the latitude parameter to use.
private static double DEFMINDISTANCE
          The default minimum distance in degrees.
private static double DEFMINHEIGHT
          The default minimum height in degrees.
private static double DEFMINMAG
          The default minimum magnitude difference.
static String DEFNAME
          The name of this global (ra).
private  Trigger fov
          If the field-of-view is crowded, this is true.
static String KEY_ALTTARGET
          The name of the sidereal time to use.
static String KEY_FOCUSMAG
          The minimum magnitude to act as a focus star.
static String KEY_MAGTARGET
          The name of the latitude to use.
static String KEY_MINDISTANCE
          The minimum distance for a companions.
static String KEY_MINHEIGHT
          The minimum height to be used as a focus star.
static String KEY_MINMAG
          The minimum magnitude difference on companions.
private  TargetDependingParameter mag
          The magnitude of the target.
 
Fields inherited from class stella.parameter.AbstractTargetParameter
KEY_INDEX
 
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
FocusStar(Map prop)
          Constructs a new global representing the actual object's v mag.
 
Method Summary
private  boolean checkMagAndHeight(Object magnitude, Object height)
          Checks if the magnitude of the star is bright enough and its height is high enough to be used as a target star.
 Object get()
          Returns true, if this star is a possible focus star.
 long getElapsedToggleTime()
          Returns the elapsed time since the last toggle event.
 Object getForTarget(TargetDefinition star)
          Gets the declination of the target star.
 Date getLastToggleTime()
          Returns the time of the last toggle event as a date.
 Boolean getTrigger()
          Returns true, if this star is a possible focus star.
private static boolean isCrowded(TargetDefinition target, double mag, double distance, String id)
          Cecks the field of view for close companions.
 boolean isTrue()
          Returns the primitive boolean getTrigger()
 void registerParameter(Parameter what)
          Registers the required additional globals for the Z target.
 void registerTarget(TargetDefinition star)
          Registers a star to this parameter.
 double rescanned(String key, String old, String newval)
          As any parameter depending instance we fail if the parameter we depend on is now a different one.
 Object set(Object to)
          UnsupportedOperationExeption.
 Boolean setTrigger(Boolean to)
          UnsupportedOperationExeption.
 Boolean toggleTrigger()
          UnsupportedOperationExeption.
 
Methods inherited from class stella.parameter.AbstractTargetParameter
getAsStar, getConstant, getFormattedFor, getSetup
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, exit, getFormatted, 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 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.Initializable
init
 
Methods inherited from interface util.Reloadable
reload
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_FOCUSMAG

public static final String KEY_FOCUSMAG
The minimum magnitude to act as a focus star.

See Also:
Constant Field Values

KEY_MINMAG

public static final String KEY_MINMAG
The minimum magnitude difference on companions.

See Also:
Constant Field Values

KEY_MINDISTANCE

public static final String KEY_MINDISTANCE
The minimum distance for a companions.

See Also:
Constant Field Values

KEY_MINHEIGHT

public static final String KEY_MINHEIGHT
The minimum height to be used as a focus star.

See Also:
Constant Field Values

KEY_ALTTARGET

public static final String KEY_ALTTARGET
The name of the sidereal time to use.

See Also:
Constant Field Values

KEY_MAGTARGET

public static final String KEY_MAGTARGET
The name of the latitude to use.

See Also:
Constant Field Values

DEFNAME

public static final String DEFNAME
The name of this global (ra).

See Also:
Constant Field Values

DEFFOCUSMAG

private static final double DEFFOCUSMAG
The default magnitude limit.

See Also:
Constant Field Values

DEFMINMAG

private static final double DEFMINMAG
The default minimum magnitude difference.

See Also:
Constant Field Values

DEFMINDISTANCE

private static final double DEFMINDISTANCE
The default minimum distance in degrees.

See Also:
Constant Field Values

DEFMINHEIGHT

private static final double DEFMINHEIGHT
The default minimum height in degrees.

See Also:
Constant Field Values

DEFALTTARGET

private static final String DEFALTTARGET
The default name of the sidereal parameter to use.

See Also:
Constant Field Values

DEFMAGTARGET

private static final String DEFMAGTARGET
The default name of the latitude parameter to use.

See Also:
Constant Field Values

mag

private TargetDependingParameter mag
The magnitude of the target.


alt

private TargetDependingParameter alt
The height of the target.


fov

private Trigger fov
If the field-of-view is crowded, this is true.

Constructor Detail

FocusStar

public FocusStar(Map prop)
Constructs a new global representing the actual object's v mag.

Method Detail

rescanned

public double rescanned(String key,
                        String old,
                        String newval)
As any parameter depending instance we fail if the parameter we depend on is now a different one.

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

registerParameter

public void registerParameter(Parameter what)
Registers the required additional globals for the Z target. For this particular object, target dec and tau and teide latitude are required. Note that the argumental global is checked for being of instance types of TauTarget, DecTarget or Latitude, rather than querrying for the global name.

Specified by:
registerParameter in interface ParameterDepending

registerTarget

public void registerTarget(TargetDefinition star)
Registers a star to this parameter. The brightness of the star and the target height get this target. Additionally, if a field-of-view is specified, we see if we have close neighbours.

Specified by:
registerTarget in interface TargetDepending

get

public Object get()
Returns true, if this star is a possible focus star. The star must be at a certain altituide, KEY_MINHEIGHT, has a certain magnitude KEY_FOCUSMAG, and no bright neighbor nearby.

Specified by:
get in interface Parameter

getTrigger

public Boolean getTrigger()
Returns true, if this star is a possible focus star. The star must be at a certain altituide, KEY_MINHEIGHT, has a certain magnitude KEY_FOCUSMAG, and no bright neighbor nearby.

Specified by:
getTrigger in interface Trigger

getForTarget

public Object getForTarget(TargetDefinition star)
Gets the declination of the target star.

Specified by:
getForTarget in interface TargetDependingParameter
Returns:
A Double holding the target star's declination.

isTrue

public boolean isTrue()
Returns the primitive boolean getTrigger()

Specified by:
isTrue in interface Trigger

getLastToggleTime

public Date getLastToggleTime()
Returns the time of the last toggle event as a date. If this trigger was never toggled, i.e. its state changed from one logical state to the other, null is returned.

Specified by:
getLastToggleTime in interface Trigger

getElapsedToggleTime

public long getElapsedToggleTime()
Returns the elapsed time since the last toggle event. If this trigger was never toggled, i.e. its state changed from one logical state to the other, -1 is returned.

Specified by:
getElapsedToggleTime in interface Trigger
Returns:
The time since the last toggle event, in ms.

set

public Object set(Object to)
UnsupportedOperationExeption.

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

setTrigger

public Boolean setTrigger(Boolean to)
UnsupportedOperationExeption.

Specified by:
setTrigger in interface Trigger

toggleTrigger

public Boolean toggleTrigger()
UnsupportedOperationExeption.

Specified by:
toggleTrigger in interface Trigger

checkMagAndHeight

private boolean checkMagAndHeight(Object magnitude,
                                  Object height)
Checks if the magnitude of the star is bright enough and its height is high enough to be used as a target star. If the magnitude is null, false is returned, if the height is null, it is ignored.


isCrowded

private static final boolean isCrowded(TargetDefinition target,
                                       double mag,
                                       double distance,
                                       String id)
Cecks the field of view for close companions.