PER.basicGUI
Class Sequencer

java.lang.Object
  extended byPER.basicGUI.Sequencer

public class Sequencer
extends java.lang.Object


Field Summary
static int ERROR
          mission ended due to rover error
static int INCOMPLETE
          mission terminated early: tried to leave the exhibit
static int INTERRUPTED
          mission terminated early: ran into something early (also for e-stop)
static int NO_MISSION
          no missions have been run; sequencer is waiting for a new mission
static int NO_ROCK
          mission terminated early: no rock was found
static int POSSIBLE_ERROR
          mission ended due to a possible error.
static int RUNNING
          mission is still running
static int SUCCESS
          mission completed successfully
 
Constructor Summary
Sequencer(Rover rov)
          Creates a new instance of Sequencer
 
Method Summary
 Action getCurrentAction()
          Returns the Action that is currently being executed, or null if no such Action exists.
 int getStatus()
          Return the current status of the sequencer (e.g. RUNNING).
 boolean runA()
           
 boolean runAction(Action a)
          Begin execution of an action.
 void setStatus(int s)
           
 void stop()
          Immediately stop the current mission.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_MISSION

public static final int NO_MISSION
no missions have been run; sequencer is waiting for a new mission

See Also:
Constant Field Values

RUNNING

public static final int RUNNING
mission is still running

See Also:
Constant Field Values

SUCCESS

public static final int SUCCESS
mission completed successfully

See Also:
Constant Field Values

NO_ROCK

public static final int NO_ROCK
mission terminated early: no rock was found

See Also:
Constant Field Values

INCOMPLETE

public static final int INCOMPLETE
mission terminated early: tried to leave the exhibit

See Also:
Constant Field Values

INTERRUPTED

public static final int INTERRUPTED
mission terminated early: ran into something early (also for e-stop)

See Also:
Constant Field Values

ERROR

public static final int ERROR
mission ended due to rover error

See Also:
Constant Field Values

POSSIBLE_ERROR

public static final int POSSIBLE_ERROR
mission ended due to a possible error. More checks are required to determine if this is a real error. For example when a driveToAction is interrupted within the buffer distance, it is not really an error. If this is the sequencer status, the mission should not be considered complete.

See Also:
Constant Field Values
Constructor Detail

Sequencer

public Sequencer(Rover rov)
Creates a new instance of Sequencer

Method Detail

runAction

public boolean runAction(Action a)
Begin execution of an action.

Returns:
a boolean indicating whether the mission began (false implies that something else is already running; call stop first)

runA

public boolean runA()

getStatus

public int getStatus()
Return the current status of the sequencer (e.g. RUNNING).


setStatus

public void setStatus(int s)

stop

public void stop()
Immediately stop the current mission.


getCurrentAction

public Action getCurrentAction()
Returns the Action that is currently being executed, or null if no such Action exists. Returns the last Action to begin execution, if the Mission failed.