stella.adapter
Class AdapterUnit

java.lang.Object
  extended by util.PropertyContainer
      extended by stella.adapter.AdapterUnit
All Implemented Interfaces:
Cloneable, Initializable, PropertyBearing
Direct Known Subclasses:
AcquiringUnit, FocussingUnit, GuidingUnit

public abstract class AdapterUnit
extends PropertyContainer

The base class for adapter master sub-units that use the guider-ccd in some way. Methods exist for checking consitancy. Currently, a FocusUnit, a AcquireUnit and a GuiderUnit exits.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
static String ACQUIRETYPE
          Acquire frames start with this header, followed by date and count.
private  AbstractStarGuider guider
          The image-processing unit.
static String GUIDERTYPE
          Guiding frames start with this header, followed by date and count.
private  boolean manual
          If true, we are in manual mode and do not generate status events.
private  AdapterMaster master
          The reference to the master.
static String PYRAMIDTYPE
          Guiding frames start with this header, followed by date and count.
private  OffsetCaster telescope
          The communicator to send offset commands.
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
protected AdapterUnit(Map prop)
          No default settings.
 
Method Summary
protected abstract  ErrorEvent doUnitTask(String mode)
          Commits the task of this unit.
protected  AbstractStarGuider getGuider()
          Get the adapter helper that can be used for calculating image-realted quantities.
protected  AdapterMaster getMaster()
          Returns the adapter master registered to this unit.
protected  OffsetCaster getTelescope()
          Get the telescope communication.
protected abstract  String getUnitType()
          Returns the type of this unit.
protected  boolean isManual()
          Returns the manual status, normally inherited from the adapter master.
protected  boolean isValid()
          Checks if all the required quantities are set and non-null.
protected  void resetUnit()
          Resets the unit.
protected  void setGuider(AbstractStarGuider calculus)
          Sets the adapter helper who knows everything image related.
protected  void setManual(boolean nostatus)
          Sets manual mode, in which case we should not send status event, but rather use syslog.
protected  void setMaster(AdapterMaster chef)
          Sets the adapter master.
protected  void setTelescope(OffsetCaster sendto)
          Set the telescope communication.
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, init, isNew, keyCreate, keyCreate, parseObject, reload, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACQUIRETYPE

public static final String ACQUIRETYPE
Acquire frames start with this header, followed by date and count.

See Also:
Constant Field Values

GUIDERTYPE

public static final String GUIDERTYPE
Guiding frames start with this header, followed by date and count.

See Also:
Constant Field Values

PYRAMIDTYPE

public static final String PYRAMIDTYPE
Guiding frames start with this header, followed by date and count.

See Also:
Constant Field Values

manual

private boolean manual
If true, we are in manual mode and do not generate status events.


telescope

private OffsetCaster telescope
The communicator to send offset commands.


guider

private AbstractStarGuider guider
The image-processing unit.


master

private AdapterMaster master
The reference to the master.

Constructor Detail

AdapterUnit

protected AdapterUnit(Map prop)
No default settings.

Method Detail

setManual

protected void setManual(boolean nostatus)
Sets manual mode, in which case we should not send status event, but rather use syslog.


isManual

protected boolean isManual()
Returns the manual status, normally inherited from the adapter master.


setTelescope

protected void setTelescope(OffsetCaster sendto)
Set the telescope communication.


getTelescope

protected OffsetCaster getTelescope()
Get the telescope communication. If isValid() returns true, this will never return null.


resetUnit

protected void resetUnit()
Resets the unit. This is done only on first start of target, not at each restart, as we than lose the targetcounts.


setGuider

protected void setGuider(AbstractStarGuider calculus)
Sets the adapter helper who knows everything image related.


setMaster

protected void setMaster(AdapterMaster chef)
Sets the adapter master.


getMaster

protected AdapterMaster getMaster()
Returns the adapter master registered to this unit.


getGuider

protected AbstractStarGuider getGuider()
Get the adapter helper that can be used for calculating image-realted quantities. If isValid() returns true, this will never return null.


isValid

protected boolean isValid()
Checks if all the required quantities are set and non-null.


doUnitTask

protected abstract ErrorEvent doUnitTask(String mode)
Commits the task of this unit. All relevant information must be available to this object before commencing this call. This method may not return a status event, those generated should be sent immediately.

Parameters:
mode - If the unit supports more than a single mode, otherwise null
Returns:
null on okay, or an ErrorEvent desribing the failure.

getUnitType

protected abstract String getUnitType()
Returns the type of this unit.