stella.error
Class TelescopeStatus

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.TelescopeStatus
All Implemented Interfaces:
Serializable, ParameterConnected, PointingKnowledge

public class TelescopeStatus
extends ErrorEvent
implements ParameterConnected, PointingKnowledge

The status event sent as a response to a StatusTelescope command. The four status lines carried are of the following format:

   POWER=[0/1] REFERENCED=[0/1] TRACK=[0/1] GUIDE=[0/1]
   AZ=[azimuth, deg] AZOFF=[AZ offset, deg] ALT=[altitude, deg] ALTOFF=[alt. offset, deg] DEROT=[derotator position, deg] FOCUS=[focus position, mm]
   TEMP_CABINET=[Temp. in switchboard, deg] TEMP_M2=[T of M2, deg] TEMP_M1=[T of M1, deg] TEMP_M3=[T of M3, deg]
   ERRORS=[error symbols]
   
The first line is translated into booleans. It is considered false when the value is zero, true in any other case. The true telescope position is AZ+AZOFF and ALT+ALTOFF, respectively. Currently it is not clear if the inversion of the pointing model is totally accurate. It might introduce an error of a few arc seconds. The list of error symbols is specific to the controler. Their meanings are unclear in the moment. The format of the line carrying temperatures has the M2 temperature first. Internally, we threat it in the 'logical' way.

See Also:
Serialized Form

Field Summary
private  double altitude
          Telescope altitude, degrees.
private  double altoffset
          Telescope altitude offset, degrees.
private  double azimuth
          Telescope azimuth, degrees.
private  double azoffset
          Telescope azimuth offset, degrees.
private  double derot
          Derotator position, degrees.
private  String errorsymbols
          Error symbols active on telescope controller.
private static String[] FIRST
          The variables in the first command line, index 1.
private  double focus
          Focus position.
private static String FOLLOWUP
          The follow-up (shutdown).
private static String[] FOURTH
          The variables in the fifth command line, index 4.
private  boolean guide
          Telescope is guiding.
static String NOERROR
          To avoid empty error lists.
private static boolean PIPING
          The pipe flag (false).
private  boolean power
          Telescope has power.
private  boolean referenced
          Telescope is referenced, i.e.
private static String[] SECOND
          The variables in the second command line, index 2.
private static int SEVERENESS
          The severness level (status message).
private  double tcabinet
          Temperature of the switch board.
private static String[] THIRD
          The variables in the fourth command line, index 3.
private  double tm1
          Temperature of mirror M1.
private  double tm2
          Temperature of mirror M2.
private  double tm3
          Temperature of mirror M3.
private  boolean track
          Telescope is tracking.
 
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
TelescopeStatus(Object src)
          Constructs a new TelescopeStatus status event.
 
Method Summary
static TelescopeStatus createTest(Object src)
          Creates a test status message.
 double getAltitude()
          Returns the altitude of the telescope, as read in from the encoders.
 double getAltitudeOffset()
          Returns the altitude offset of the telescope, as read in from the encoders.
 double getApparentAltitude()
          Returns the apparent altitude of the telescope.
 double getApparentAzimuth()
          Returns the apparent azimuth of the telescope.
 double getAzimuth()
          Returns the azimuth of the telescope, as read in from the encoders.
 double getAzimuthOffset()
          Returns the azimuth offset of the telescope, as read in from the encoders.
 double getDerotator()
          Returns the derotator position.
 String getErrors()
          Returns the error codes currently active on the telescope motor controlers.
 double getFocus()
          Returns the focus position.
 boolean getGuide()
          Returns true if the telescope is guiding.
 String getHuman()
          Returns the human-readable part of the string.
 String[] getLine()
          Returns the command lines as an string array.
 boolean getPower()
          Returns true if the telescope has power.
 boolean getReferenced()
          Returns true if the telescope is referenced, i.e.
 double getTempCabinet()
          Returns the temperature of the cabinet.
 double getTempM1()
          Returns the temperature of M1.
 double getTempM2()
          Returns the temperature of M1.
 double getTempM3()
          Returns the temperature of M1.
 boolean getTrack()
          Returns true if the telescope is tracking.
 boolean parseLine(String[] all)
          Parses the command lines submitted with this status event.
 void setAltitude(double z)
          Sets the raw zenith distance of the status message.
 void setAltitudeOffset(double zoff)
          Sets the zenith distance offset in the status message.
 void setAzimuth(double az)
          Sets the raw azimuth of the telescope status.
 void setAzimuthOffset(double azoff)
          Sets the azimuth offset of the status message.
 void setDerotator(double dr)
          Sets the derotator position.
 void setErrors(String err)
          Sets the error symbols of the status message.
 void setFocus(double foc)
          Sets the focus position.
 void setGuide(boolean doguide)
          Sets the guiding flag of the status message.
 void setPower(boolean poweron)
          Sets the power flag in the status message.
 void setReferenced(boolean isref)
          Sets the referenced flag of the status message.
 void setTrack(boolean dotrack)
          Sets the tracking flag of the status message.
private  void updateHuman()
          Updates the human-readable part of the error event.
 
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 (status message).

See Also:
Constant Field Values

FOLLOWUP

private static final String FOLLOWUP
The follow-up (shutdown).

See Also:
Constant Field Values

PIPING

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

See Also:
Constant Field Values

FIRST

private static final String[] FIRST
The variables in the first command line, index 1.


SECOND

private static final String[] SECOND
The variables in the second command line, index 2.


THIRD

private static final String[] THIRD
The variables in the fourth command line, index 3.


FOURTH

private static final String[] FOURTH
The variables in the fifth command line, index 4.


NOERROR

public static final String NOERROR
To avoid empty error lists.

See Also:
Constant Field Values

power

private boolean power
Telescope has power.


referenced

private boolean referenced
Telescope is referenced, i.e. initialized.


track

private boolean track
Telescope is tracking.


guide

private boolean guide
Telescope is guiding.


azimuth

private double azimuth
Telescope azimuth, degrees.


azoffset

private double azoffset
Telescope azimuth offset, degrees.


altitude

private double altitude
Telescope altitude, degrees.


altoffset

private double altoffset
Telescope altitude offset, degrees.


derot

private double derot
Derotator position, degrees.


focus

private double focus
Focus position.


tcabinet

private double tcabinet
Temperature of the switch board.


tm1

private double tm1
Temperature of mirror M1.


tm2

private double tm2
Temperature of mirror M2.


tm3

private double tm3
Temperature of mirror M3.


errorsymbols

private String errorsymbols
Error symbols active on telescope controller.

Constructor Detail

TelescopeStatus

public TelescopeStatus(Object src)
Constructs a new TelescopeStatus status event. Has no follow up and a raised PIPING flag.

Method Detail

parseLine

public boolean parseLine(String[] all)
Parses the command lines submitted with this status event. After doing the overall parsing with the parental method, the remaining status information is extracted out of lines with index 1-5, see main page for format details.

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 error event. This means calling of ErrorEvent.setHuman(java.lang.String) with values constructed from the internal variables.


getPower

public boolean getPower()
Returns true if the telescope has power.


getReferenced

public boolean getReferenced()
Returns true if the telescope is referenced, i.e. initialized.


getTrack

public boolean getTrack()
Returns true if the telescope is tracking.


getGuide

public boolean getGuide()
Returns true if the telescope is guiding.


getAzimuth

public double getAzimuth()
Returns the azimuth of the telescope, as read in from the encoders.

Specified by:
getAzimuth in interface PointingKnowledge
See Also:
getApparentAzimuth()

getAzimuthOffset

public double getAzimuthOffset()
Returns the azimuth offset of the telescope, as read in from the encoders.

Specified by:
getAzimuthOffset in interface PointingKnowledge
See Also:
getApparentAzimuth()

getApparentAzimuth

public double getApparentAzimuth()
Returns the apparent azimuth of the telescope. This is the sum of the encoder-azimuth and the offset.

See Also:
getAzimuth()

getAltitude

public double getAltitude()
Returns the altitude of the telescope, as read in from the encoders.

Specified by:
getAltitude in interface PointingKnowledge
See Also:
getApparentAltitude()

getAltitudeOffset

public double getAltitudeOffset()
Returns the altitude offset of the telescope, as read in from the encoders.

Specified by:
getAltitudeOffset in interface PointingKnowledge
See Also:
getApparentAltitude()

getApparentAltitude

public double getApparentAltitude()
Returns the apparent altitude of the telescope. This is the sum of the encoder-altitude and the offset.


getDerotator

public double getDerotator()
Returns the derotator position.


getFocus

public double getFocus()
Returns the focus position.


getTempCabinet

public double getTempCabinet()
Returns the temperature of the cabinet.


getTempM1

public double getTempM1()
Returns the temperature of M1.


getTempM2

public double getTempM2()
Returns the temperature of M1.


getTempM3

public double getTempM3()
Returns the temperature of M1.


getErrors

public String getErrors()
Returns the error codes currently active on the telescope motor controlers.


setPower

public void setPower(boolean poweron)
Sets the power flag in the status message.


setReferenced

public void setReferenced(boolean isref)
Sets the referenced flag of the status message.


setTrack

public void setTrack(boolean dotrack)
Sets the tracking flag of the status message.


setGuide

public void setGuide(boolean doguide)
Sets the guiding flag of the status message.


setAzimuth

public void setAzimuth(double az)
Sets the raw azimuth of the telescope status.


setAzimuthOffset

public void setAzimuthOffset(double azoff)
Sets the azimuth offset of the status message.

See Also:
getAzimuth()

setAltitude

public void setAltitude(double z)
Sets the raw zenith distance of the status message.

See Also:
getApparentAltitude()

setAltitudeOffset

public void setAltitudeOffset(double zoff)
Sets the zenith distance offset in the status message.


setDerotator

public void setDerotator(double dr)
Sets the derotator position.


setFocus

public void setFocus(double foc)
Sets the focus position.


setErrors

public void setErrors(String err)
Sets the error symbols of the status message.


createTest

public static final TelescopeStatus createTest(Object src)
Creates a test status message. Intended for testing the response of the AltTelescope and AzTelescope parameters. All triggers are true, the azimuth and altitude are randomly set. The error flags are set to NOERROR.