edu.nau.cs.scu
Enum Mode

java.lang.Object
  extended by java.lang.Enum<Mode>
      extended by edu.nau.cs.scu.Mode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Mode>

public enum Mode
extends java.lang.Enum<Mode>

A set of enumeration constants which are used to describe what mode the simulated gimbal is currently in. The toString() method for each constant will return a UI friendly string representing the constant.

Author:
Sam Mallon

Enum Constant Summary
CAGE
           
DISABLE_TORQUERS
           
ENABLE_TORQUERS
           
NEGATIVE_SOFT_STOP
           
PORT_ANTENNA_SELECT
           
POSITION
           
POSITIVE_SOFT_STOP
           
POWERING_UP
           
RATE
           
STARBOARD_ANTENNA_SELECT
           
 
Method Summary
 byte commandByte()
          Retrieves the command/status byte that represents this gimbal mode.
static Mode getModeFromByte(byte val)
          Finds the Mode that represents the specified command/status byte
static Mode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Mode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

POSITIVE_SOFT_STOP

public static final Mode POSITIVE_SOFT_STOP

POSITION

public static final Mode POSITION

CAGE

public static final Mode CAGE

RATE

public static final Mode RATE

NEGATIVE_SOFT_STOP

public static final Mode NEGATIVE_SOFT_STOP

POWERING_UP

public static final Mode POWERING_UP

ENABLE_TORQUERS

public static final Mode ENABLE_TORQUERS

DISABLE_TORQUERS

public static final Mode DISABLE_TORQUERS

PORT_ANTENNA_SELECT

public static final Mode PORT_ANTENNA_SELECT

STARBOARD_ANTENNA_SELECT

public static final Mode STARBOARD_ANTENNA_SELECT
Method Detail

values

public static Mode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Mode c : Mode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Mode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

commandByte

public byte commandByte()
Retrieves the command/status byte that represents this gimbal mode. These correspond to the numerical constants found in the Command class and in the servo controller documentation

Returns:
The associated status/command byte for this mode

getModeFromByte

public static Mode getModeFromByte(byte val)
Finds the Mode that represents the specified command/status byte

Parameters:
val - The command byte representing a mode
Returns:
The corresponding Mode