edu.nau.cs.scu
Class Status

java.lang.Object
  extended by edu.nau.cs.scu.Status

public class Status
extends java.lang.Object

This class embodies a status message that is sent to the MEU.

Author:
Sam Mallon

Field Summary
(package private)  boolean azimuthFoldBackError
          True if the unit is experiencing an azimuth current fold back error
(package private)  double azimuthPosition
          The current azimuth of the gimbal in radians
(package private)  boolean azimuthRDError
          True if the unit is experiencing an azimuth RD error
(package private)  boolean elevationFoldBackError
          True if the unit is experiencing an elevation current fold back error
(package private)  double elevationPosition
          The current elevation of the gimbal in radians
(package private)  boolean elevationRDError
          True if the unit is experiencing an elevation RD error
(package private)  boolean invalidCommandRecieved
          True if the last command received from the MEU was invalid or malformed
(package private)  Mode mode
          The mode the gimbal is in
(package private)  double negativeSoftStopPositionAzimuth
          The location of the azimuth negative soft stop in radians
(package private)  double negativeSoftStopPositionElevation
          The location of the elecation negative soft stop in radians
(package private)  boolean portAntennaSelected
          True if the port antenna is selected, false if the starboard antenna is selected.
(package private)  double positiveSoftStopPositionAzimuth
          The location of the azimuth positive soft stop in radians
(package private)  double positiveSoftStopPositionElevation
          The location of the elevation postitive soft stop in radians
(package private)  boolean powerUpPassed
          True if the BIT passed the last time it was run, false if the BIT failed the last time it was run
(package private)  boolean runningPowerUp
          True if the unit is currently runnning the BIT, false otherwise
(package private)  int selectedSensor
          The currently selected temperature sensor - 1 through 6
static byte START_CHARACTER
          A constant indicating the first byte that is sent when sending a status packet over serial communications
static int STATUS_PACKET_LENGTH
          A constant indicating the length of a status byte packet as sent over a serial connection
(package private)  double temperature
          The temperature of the selected temperature sensor in degrees Celsius
(package private)  boolean torquersEnabled
          True if the torquers are enabled, false if they are disabled
(package private)  boolean vendorError0
          True if the unit is experiencing a vendor defined error 0
(package private)  boolean vendorError1
          True if the unit is experiencing a vendor defined error 1
 
Constructor Summary
Status()
          Generic constructor for making empty Status objects.
Status(byte[] packet)
          Constructs a Status object from a Status byte packet.
 
Method Summary
static byte calculateChecksum(byte[] packet)
          This is a utility method that calculates the checksum for a status byte packet.
 byte[] getAzimuthBytes()
          This is a utility method that converts this Status object's current azimuth position into the appropriate 24 bit two's complement format as specified in the document.
 byte[] getElevationBytes()
          This is a utility method that converts this Status object's current elevation position into the appropriate 24 bit two's complement format as specified in the document.
 byte getErrorStatusByte()
          This is a utility method that composes all of the errors in this Status object into a single byte as specified in the Servo Controller Unit documentation.
 byte[] toBytes()
          Converts this status object into its corresponding byte packet.
 java.lang.String toString()
          Generate a string representing this status object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mode

Mode mode
The mode the gimbal is in


elevationPosition

double elevationPosition
The current elevation of the gimbal in radians


azimuthPosition

double azimuthPosition
The current azimuth of the gimbal in radians


positiveSoftStopPositionAzimuth

double positiveSoftStopPositionAzimuth
The location of the azimuth positive soft stop in radians


negativeSoftStopPositionAzimuth

double negativeSoftStopPositionAzimuth
The location of the azimuth negative soft stop in radians


positiveSoftStopPositionElevation

double positiveSoftStopPositionElevation
The location of the elevation postitive soft stop in radians


negativeSoftStopPositionElevation

double negativeSoftStopPositionElevation
The location of the elecation negative soft stop in radians


selectedSensor

int selectedSensor
The currently selected temperature sensor - 1 through 6


temperature

double temperature
The temperature of the selected temperature sensor in degrees Celsius


portAntennaSelected

boolean portAntennaSelected
True if the port antenna is selected, false if the starboard antenna is selected.


torquersEnabled

boolean torquersEnabled
True if the torquers are enabled, false if they are disabled


runningPowerUp

boolean runningPowerUp
True if the unit is currently runnning the BIT, false otherwise


powerUpPassed

boolean powerUpPassed
True if the BIT passed the last time it was run, false if the BIT failed the last time it was run


invalidCommandRecieved

boolean invalidCommandRecieved
True if the last command received from the MEU was invalid or malformed


elevationRDError

boolean elevationRDError
True if the unit is experiencing an elevation RD error


azimuthRDError

boolean azimuthRDError
True if the unit is experiencing an azimuth RD error


elevationFoldBackError

boolean elevationFoldBackError
True if the unit is experiencing an elevation current fold back error


azimuthFoldBackError

boolean azimuthFoldBackError
True if the unit is experiencing an azimuth current fold back error


vendorError1

boolean vendorError1
True if the unit is experiencing a vendor defined error 1


vendorError0

boolean vendorError0
True if the unit is experiencing a vendor defined error 0


STATUS_PACKET_LENGTH

public static final int STATUS_PACKET_LENGTH
A constant indicating the length of a status byte packet as sent over a serial connection

See Also:
Constant Field Values

START_CHARACTER

public static final byte START_CHARACTER
A constant indicating the first byte that is sent when sending a status packet over serial communications

See Also:
Constant Field Values
Constructor Detail

Status

public Status(byte[] packet)
Constructs a Status object from a Status byte packet. This method of constructing a Status object is primarily for testing the automatic status responses being sent to the MEU

Parameters:
packet - The bytes representing the current status.

Status

public Status()
Generic constructor for making empty Status objects. All fields of a status object should be set before using the object.

Method Detail

toString

public java.lang.String toString()
Generate a string representing this status object. Used primarily for testing purposes.

Overrides:
toString in class java.lang.Object

toBytes

public byte[] toBytes()
Converts this status object into its corresponding byte packet. This is the byte packet that is sent over serial communications to the MEU.

Returns:
The byte packet representing this Status object

getAzimuthBytes

public byte[] getAzimuthBytes()
This is a utility method that converts this Status object's current azimuth position into the appropriate 24 bit two's complement format as specified in the document.

Returns:
The three bytes indicating azimuth position

getElevationBytes

public byte[] getElevationBytes()
This is a utility method that converts this Status object's current elevation position into the appropriate 24 bit two's complement format as specified in the document.

Returns:
The three bytes indicating elevation position

getErrorStatusByte

public byte getErrorStatusByte()
This is a utility method that composes all of the errors in this Status object into a single byte as specified in the Servo Controller Unit documentation.

Returns:
The error byte representing the errors in this Status

calculateChecksum

public static byte calculateChecksum(byte[] packet)
This is a utility method that calculates the checksum for a status byte packet. Note that this method will not work for Command packets.

Parameters:
packet - The byte packet to calculate the checksum for
Returns:
The checksum of bytes 1 through (STATUS_PACKET_LENGTH - 2)