stella.error
Class TelescopeOffsets

java.lang.Object
  extended by java.util.EventObject
      extended by util.rmi.RmiEvent
          extended by stella.MessageEvent
              extended by stella.ErrorEvent
                  extended by stella.error.TelescopeOffsets
All Implemented Interfaces:
Serializable, ParameterConnected, PointingKnowledge, PointingModelKnowledge, UniqueKnowledge, Uniquely

public class TelescopeOffsets
extends ErrorEvent
implements ParameterConnected, PointingModelKnowledge, UniqueKnowledge

A status mesage from the telescope delivering its position, plus pointing model offsets and applied offsets. If the pointing model is not known, the values will be zero. To get the input for a pointing model calculation, you have to add the offset and the pointing model correction, as seen in PointingKnowledge. We additionally stor information on the applied pointing model, thus we implement PointingModelKnowledge.

See Also:
Serialized Form

Field Summary
private  double alt
          The value of the flux.
private  double altoff
          The value of the flux.
private  double az
          The value of the FWHM.
private  double azoff
          The value of the FWHM.
private static String FOLLOWUP
          The follow-up (none).
private static boolean PIPING
          The pipe flag (true).
private  double pmalt
          The value of the flux.
private  double pmaz
          The value of the FWHM.
private static int SEVERENESS
          The severness level (interesting importance).
private  Object unique
          The unique id, on a separate line.
private static String[] VARS
          The names of the variables in the command line, index 1.
 
Fields inherited from class stella.ErrorEvent
ABORT_EXPOSURE, ABORT_TARGET, ALARM_OFF, ALARM_ON, BAD_SEEING, BAD_WEATHER, CLEAR_TEL, CLOSE_COVER, CLOSE_ROOF, CLOSE_SHUTTER, CONT_TIME, ERROR_TOKEN, ERRORCOMBINE, ERRORPACKAGE, GOOD_WEATHER, HIGH_WIND, MAIL_HOME, MAIL_LOCAL, MOVE_HOME, MOVE_PARK, NONE, OPEN_COVER, OPEN_SHUTTER, PIPE, REACQUIRE, REPOSITION, RESEND_COMMAND, RESET_ADAPTER, RESET_CALIBRATION, RESET_CCD, RESET_ENV, RESET_ERRORS, RESET_SPEC, RESET_TEL, SHUT_DOWN, STATUS_TOKEN, STOP_TIME
 
Fields inherited from class stella.MessageEvent
SEPCHAR
 
Fields inherited from class util.rmi.RmiEvent
localHost, sourceName
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
TelescopeOffsets(Object src)
          Constructs a new adapter fwhm status message.
 
Method Summary
 double getAltitude()
          Returns the value of the fwhm.
 double getAltitudeOffset()
          Returns the value of the altitude offset, which is PM offset plus applied offset.
 double getAzimuth()
          Returns the value of the fwhm.
 double getAzimuthOffset()
          Returns the value of the azimuth offset, which is PM offset plus applied offset.
 String getHuman()
          Returns the human-readable part of the string.
 String[] getLine()
          Returns the command lines as an string array.
 double getPointingModelAltitude()
          Returns the value of the altitude offset, which is PM offset plus applied offset.
 double getPointingModelAzimuth()
          Returns the value of the azimuth offset, which is PM offset plus applied offset.
 Object getUnique()
          Sets the unique ID.
 boolean parseLine(String[] all)
          Parses the command lines submitted with the adapter fwhm status.
 void registerUnique(Parameter uniq)
          Sets the unique ID.
 void setAzAltAndOffsets(double naz, double npmaz, double nazoff, double nalt, double npmalt, double naltoff)
          Sets the fwhm and the flux.
 void setUniqueValue(Object u)
          Sets the unique value, if we have no access to the parameter.
private  void updateHuman()
          Updates the human readable part of the status message.
 
Methods inherited from class stella.ErrorEvent
consume, createError, createError, createError, createError, createError, createStatus, createStatus, createStatus, extractClassName, extractFollowUp, extractPipe, getErrorClass, getFollowUp, getSevereness, isConsumed, isPipe, isStatus, parseClassName, parseHeader, setFollowUp, setHuman, setHuman, setPipe
 
Methods inherited from class stella.MessageEvent
checkType, equals, equalTime, equalTime, fromAscii, getAllCommandLines, getExecuteGroupKey, getHead, getNr, getTime, getType, hashCode, isValid, parseFromSingleString, readFromBufferedStream, setNr, setTime, setType, setValid, toString
 
Methods inherited from class util.rmi.RmiEvent
getHost, getSourceName, setSourceName
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SEVERENESS

private static final int SEVERENESS
The severness level (interesting importance).

See Also:
Constant Field Values

FOLLOWUP

private static final String FOLLOWUP
The follow-up (none). Ignored anyhow.

See Also:
Constant Field Values

PIPING

private static final boolean PIPING
The pipe flag (true).

See Also:
Constant Field Values

VARS

private static final String[] VARS
The names of the variables in the command line, index 1.


az

private double az
The value of the FWHM.


pmaz

private double pmaz
The value of the FWHM.


azoff

private double azoff
The value of the FWHM.


alt

private double alt
The value of the flux.


pmalt

private double pmalt
The value of the flux.


altoff

private double altoff
The value of the flux.


unique

private Object unique
The unique id, on a separate line.

Constructor Detail

TelescopeOffsets

public TelescopeOffsets(Object src)
Constructs a new adapter fwhm status message. The FWHM must be set after construction by a call to #setFWHMAndFlux.

Method Detail

parseLine

public boolean parseLine(String[] all)
Parses the command lines submitted with the adapter fwhm status. Extracts the #fwhm and the #flux using the StringTool.parseNumbers(java.lang.String, java.lang.String[]) method.

Overrides:
parseLine in class ErrorEvent
Returns:
True, if parsing was successful.

getLine

public String[] getLine()
Returns the command lines as an string array. See also main class entry.

Overrides:
getLine in class ErrorEvent
Returns:
An array containing all command lines.

getHuman

public String getHuman()
Returns the human-readable part of the string. See also main class entry.

Overrides:
getHuman in class ErrorEvent
Returns:
A String holding a readable description of the error.

updateHuman

private void updateHuman()
Updates the human readable part of the status message. This means calling of ErrorEvent.setHuman(java.lang.String) with values constructed from the internal variables.


getAzimuth

public double getAzimuth()
Returns the value of the fwhm.

Specified by:
getAzimuth in interface PointingKnowledge
See Also:
#getApparentAzimuth

getPointingModelAzimuth

public double getPointingModelAzimuth()
Returns the value of the azimuth offset, which is PM offset plus applied offset.

Specified by:
getPointingModelAzimuth in interface PointingModelKnowledge

getAzimuthOffset

public double getAzimuthOffset()
Returns the value of the azimuth offset, which is PM offset plus applied offset.

Specified by:
getAzimuthOffset in interface PointingKnowledge
See Also:
#getApparentAzimuth

getAltitude

public double getAltitude()
Returns the value of the fwhm.

Specified by:
getAltitude in interface PointingKnowledge
See Also:
#getApparentAltitude

getPointingModelAltitude

public double getPointingModelAltitude()
Returns the value of the altitude offset, which is PM offset plus applied offset.

Specified by:
getPointingModelAltitude in interface PointingModelKnowledge

getAltitudeOffset

public double getAltitudeOffset()
Returns the value of the altitude offset, which is PM offset plus applied offset.

Specified by:
getAltitudeOffset in interface PointingKnowledge
See Also:
#getApparentAltitude

setAzAltAndOffsets

public void setAzAltAndOffsets(double naz,
                               double npmaz,
                               double nazoff,
                               double nalt,
                               double npmalt,
                               double naltoff)
Sets the fwhm and the flux. After a call to this method, the status event is set valid. See main entry for units.

Parameters:
newfwhm - The FWHM this status event should carry.
newflux - The flux this status event should carry.

registerUnique

public void registerUnique(Parameter uniq)
Sets the unique ID.

Specified by:
registerUnique in interface UniqueKnowledge

setUniqueValue

public void setUniqueValue(Object u)
Sets the unique value, if we have no access to the parameter.


getUnique

public Object getUnique()
Sets the unique ID.

Specified by:
getUnique in interface Uniquely