Class Setup

java.lang.Object
  extended by Setup

 class Setup
extends java.lang.Object

The class Setup provides methods for commanding the robot to move fibres to a variety of target postions, such as parked, circled or user provided setup configurations.


Field Summary
private  boolean aborted
           
private  int currentFibreNumber
           
private  boolean[] FibreDone
           
private  int SETUP_ITERATION_LOOPS
           
private  Stopwatch setupTimer
           
 
Constructor Summary
Setup()
           
 
Method Summary
(package private)  void abort()
          Abort a setup
(package private)  void circleFibres(FibreModule theFibreModule)
          Set all the fibres in a circle
(package private)  int getCurrentFibreNumber()
          Get the number of the fibre currently being moved
(package private)  Fibre getNextFibre(FibreModule theFibreModule)
          Get the next fibre to be moved in the setup
(package private)  double getPercentageProgress()
          Get the setup progress as a percentage
(package private)  int getTimeLeft()
          Get an estimate of the time left for the setup in seconds
private  java.lang.String getUnmovedFibres(FibreModule theFibreModule)
          Get a list of unmoved fibres
private  boolean hasSetupDoneAllFibres(FibreModule theFibreModule)
          Have all of the fibres been moved
private  void inititaliseFibreSetup(FibreModule theFibreModule)
          Initialise the setup
private  boolean isFibreDone(Fibre theFibre)
          Check whether a fibre has been moved
private  boolean isFibreDone(int FibreNumber)
          Check whether a fibre has been moved
(package private)  void parkFibres(FibreModule theFibreModule)
          Park all of the fibres in the fibre module
private  void parkUnmovedFibres(FibreModule theFibreModule)
          Park all fibres that have not yet been moved
private  void setFibreDone(int FibreNumber)
          Set the fibre done state
(package private)  void setupConfiguration(Configuration thisConfiguration, FibreModule theFibreModule)
          Setup a field configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FibreDone

private boolean[] FibreDone

SETUP_ITERATION_LOOPS

private final int SETUP_ITERATION_LOOPS
See Also:
Constant Field Values

currentFibreNumber

private int currentFibreNumber

aborted

private boolean aborted

setupTimer

private Stopwatch setupTimer
Constructor Detail

Setup

public Setup()
Method Detail

setupConfiguration

void setupConfiguration(Configuration thisConfiguration,
                        FibreModule theFibreModule)
Setup a field configuration. This moves all of the fibres in the fibre module according to the target positions specified in the field configuration

Parameters:
thisConfiguration - The field configuration
theFibreModule - The fibre module

parkFibres

void parkFibres(FibreModule theFibreModule)
Park all of the fibres in the fibre module

Parameters:
theFibreModule - The fibre module

circleFibres

void circleFibres(FibreModule theFibreModule)
Set all the fibres in a circle

Parameters:
theFibreModule - The fibre module

abort

void abort()
Abort a setup


getNextFibre

Fibre getNextFibre(FibreModule theFibreModule)
Get the next fibre to be moved in the setup

Parameters:
theFibreModule - The fibre module
Returns:
The next fibre to be moved

getCurrentFibreNumber

int getCurrentFibreNumber()
Get the number of the fibre currently being moved

Returns:
The number of the fibre currently being moved

getPercentageProgress

double getPercentageProgress()
Get the setup progress as a percentage

Returns:
The percentage setup progress

getTimeLeft

int getTimeLeft()
Get an estimate of the time left for the setup in seconds

Returns:
The time left in seconds

setFibreDone

private void setFibreDone(int FibreNumber)
Set the fibre done state

Parameters:
FibreNumber - The number of the fibre

parkUnmovedFibres

private void parkUnmovedFibres(FibreModule theFibreModule)
Park all fibres that have not yet been moved

Parameters:
theFibreModule - The fibre module

hasSetupDoneAllFibres

private boolean hasSetupDoneAllFibres(FibreModule theFibreModule)
Have all of the fibres been moved

Parameters:
theFibreModule - The fibre module
Returns:
Whether all of the fibres been moved

getUnmovedFibres

private java.lang.String getUnmovedFibres(FibreModule theFibreModule)
Get a list of unmoved fibres

Parameters:
theFibreModule - The fibre module
Returns:
The list of unmoved fibres

isFibreDone

private boolean isFibreDone(Fibre theFibre)
Check whether a fibre has been moved

Parameters:
theFibre - The fibre
Returns:
Whether the fibre has been moved

isFibreDone

private boolean isFibreDone(int FibreNumber)
Check whether a fibre has been moved

Parameters:
FibreNumber - The number of the fibre
Returns:
Whether the fibre has been moved

inititaliseFibreSetup

private void inititaliseFibreSetup(FibreModule theFibreModule)
Initialise the setup

Parameters:
theFibreModule - The fibre module