at.ac.sbg.cosy.soccerbot.controller
Class Controller_State_port

java.lang.Object
  extended by at.ac.sbg.cosy.soccerbot.controller.Controller_State_port
All Implemented Interfaces:
giotto.functionality.interfaces.PortVariable, java.io.Serializable

public class Controller_State_port
extends java.lang.Object
implements giotto.functionality.interfaces.PortVariable, java.io.Serializable

A port for transfering internal state information of the controller between cycles consists of an (int _state, byte _lastCommand) tuple

Author:
Peter Wild, Krystian Szczurek, Georg Klima
See Also:
Serialized Form

Field Summary
static int FOUND_CAUGHT
          ball found and caught
static int FOUND_CENTER
          ball found in center
static int FOUND_LEFT
          ball found in left part of the image
static int FOUND_RIGHT
          ball found in right part of the image
static int SEARCH_LEFT_TURN
          searching for the ball turning left
static int SEARCH_RIGHT_TURN
          searching for the ball turning right
 
Constructor Summary
Controller_State_port()
           
 
Method Summary
 void copyValueFrom(giotto.functionality.interfaces.PortVariable source)
          Copies its internal state from a source port variable.
 byte getLastCommand()
          Returns last command
 int getState()
          Returns state
 void setLastCommand(byte newCommand)
          Sets last command
 void setState(int newState)
          Sets state
 java.lang.String toString()
          Prints internal state
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FOUND_CENTER

public static final int FOUND_CENTER
ball found in center

See Also:
Constant Field Values

FOUND_LEFT

public static final int FOUND_LEFT
ball found in left part of the image

See Also:
Constant Field Values

FOUND_RIGHT

public static final int FOUND_RIGHT
ball found in right part of the image

See Also:
Constant Field Values

FOUND_CAUGHT

public static final int FOUND_CAUGHT
ball found and caught

See Also:
Constant Field Values

SEARCH_LEFT_TURN

public static final int SEARCH_LEFT_TURN
searching for the ball turning left

See Also:
Constant Field Values

SEARCH_RIGHT_TURN

public static final int SEARCH_RIGHT_TURN
searching for the ball turning right

See Also:
Constant Field Values
Constructor Detail

Controller_State_port

public Controller_State_port()
Method Detail

copyValueFrom

public void copyValueFrom(giotto.functionality.interfaces.PortVariable source)
Copies its internal state from a source port variable.

Specified by:
copyValueFrom in interface giotto.functionality.interfaces.PortVariable

getState

public int getState()
Returns state

Returns:
controller state

setState

public void setState(int newState)
Sets state

Parameters:
newState - new controller state

getLastCommand

public byte getLastCommand()
Returns last command

Returns:
last rcxcommand.CommandEvent

setLastCommand

public void setLastCommand(byte newCommand)
Sets last command

Parameters:
newCommand - last rcxcommand.CommandEvent

toString

public java.lang.String toString()
Prints internal state

Overrides:
toString in class java.lang.Object