stella.telescope
Class AbstractPilarDriver

java.lang.Object
  extended by util.PropertyContainer
      extended by io.AbstractDriver
          extended by stella.telescope.AbstractPilarDriver
All Implemented Interfaces:
Driver, Cloneable, PilarDriver, ParameterDepending, Initializable, PropertyBearing
Direct Known Subclasses:
OpenPilarSocket, Pilar3Socket

public abstract class AbstractPilarDriver
extends AbstractDriver
implements PilarDriver

Case implementation of the pilar3 driver.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
private  IntegerId commandid
          The command id counter.
private static double DEFAVERAGEPRESS
          The overall pressure in Tenerife, hPa.
private static double DEFAVERAGETEMP
          The overall temperature in Tenerife, Celcius.
static String DEFDRIVERNAME
          Default name of the driver.
private static String DEFPRESSURE
          The default name of the pressure value.
private static String DEFTEMPERATURE
          The default name of the temperature value.
static String KEY_AVERAGEPRESS
          The overall temperature in Tenerife.
static String KEY_AVERAGETEMP
          The overall temperature in Tenerife.
static String KEY_COMMANDID
          The name of the ID value, may be null (=use any).
static String KEY_PRESSURE
          The name of the pressure value.
static String KEY_TEMPERATURE
          The name of the temperature value.
private  boolean pressnull
          Gets true as soon as we have reported an invalid temperature.
private  Value pressure
          The ambient pressure.
private  Value temperature
          The ambient temperature.
private  boolean tempnull
          Gets true as soon as we have reported an invalid temperature.
 
Fields inherited from class io.AbstractDriver
KEY_DRIVERNAME
 
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 AbstractPilarDriver(Map prop)
          Constructs a new abstract pilar3 driver.
 
Method Summary
protected  int getNextId()
          If we have no command id, we construct a default one, otherwise we use the preserved state.
protected  double getPressure()
          Returns the ambient pressure or the default value, if the pressure parameter cannot be queried.
protected  double getTemperature()
          Returns the ambient temperature or the default value, if the temperature parameter cannot be queried.
 void registerParameter(Parameter env)
          Registers the parameters temperature and pressure to the pilar driver.
 
Methods inherited from class io.AbstractDriver
createDriver, equals, getDriverName, hashCode
 
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
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.net.tpl.PilarDriver
commenceAbort, commenceAbsoluteOffset, commenceAbsoluteOffset, commenceClear, commenceDerotator, commenceDerotatorOffset, commenceFocus, commenceFocusOffset, commenceGuiding, commenceInit, commenceMove, commenceMove, commenceMoveAzAlt, commencePark, commenceRelativeOffset, commenceRelativeOffset, commenceSetCovers, commenceTracking, commenceUsePort, getErrors, getValue, rebuild, setValue, waitForValue
 
Methods inherited from interface io.Driver
close, getDriverName, isOpen, open
 

Field Detail

KEY_TEMPERATURE

public static final String KEY_TEMPERATURE
The name of the temperature value.

See Also:
Constant Field Values

KEY_PRESSURE

public static final String KEY_PRESSURE
The name of the pressure value.

See Also:
Constant Field Values

KEY_COMMANDID

public static final String KEY_COMMANDID
The name of the ID value, may be null (=use any).

See Also:
Constant Field Values

KEY_AVERAGETEMP

public static final String KEY_AVERAGETEMP
The overall temperature in Tenerife.

See Also:
Constant Field Values

KEY_AVERAGEPRESS

public static final String KEY_AVERAGEPRESS
The overall temperature in Tenerife.

See Also:
Constant Field Values

DEFDRIVERNAME

public static final String DEFDRIVERNAME
Default name of the driver.

See Also:
Constant Field Values

DEFTEMPERATURE

private static final String DEFTEMPERATURE
The default name of the temperature value.

See Also:
Constant Field Values

DEFPRESSURE

private static final String DEFPRESSURE
The default name of the pressure value.

See Also:
Constant Field Values

DEFAVERAGETEMP

private static final double DEFAVERAGETEMP
The overall temperature in Tenerife, Celcius.

See Also:
Constant Field Values

DEFAVERAGEPRESS

private static final double DEFAVERAGEPRESS
The overall pressure in Tenerife, hPa.

See Also:
Constant Field Values

temperature

private Value temperature
The ambient temperature.


tempnull

private boolean tempnull
Gets true as soon as we have reported an invalid temperature.


pressure

private Value pressure
The ambient pressure.


pressnull

private boolean pressnull
Gets true as soon as we have reported an invalid temperature.


commandid

private IntegerId commandid
The command id counter.

Constructor Detail

AbstractPilarDriver

protected AbstractPilarDriver(Map prop)
Constructs a new abstract pilar3 driver.

Method Detail

registerParameter

public void registerParameter(Parameter env)
Registers the parameters temperature and pressure to the pilar driver.

Specified by:
registerParameter in interface ParameterDepending

getTemperature

protected double getTemperature()
Returns the ambient temperature or the default value, if the temperature parameter cannot be queried.

Returns:
The ambient temperature in Celsius.

getPressure

protected double getPressure()
Returns the ambient pressure or the default value, if the pressure parameter cannot be queried.

Returns:
The ambient pressure in hPa.

getNextId

protected int getNextId()
If we have no command id, we construct a default one, otherwise we use the preserved state.