Main Page   Class Hierarchy   Compound List   Compound Members  

ArMode Class Reference

A class for different modes, mostly as related to keyboard input. More...

#include <ArMode.h>

Inheritance diagram for ArMode::

ArModeCamera ArModeGripper ArModeSonar ArModeTeleop ArModeWander List of all members.

Public Methods

 ArMode (ArRobot *robot, const char *name, char key, char key2)
 Constructor. More...

virtual ~ArMode (void)
 Destructor.

const char * getName (void)
 Gets the name of the mode.

virtual void activate (void)=0
 The function called when the mode is activated, subclass must provide.

virtual void deactivate (void)=0
 The function called when the mode is deactivated, subclass must provide.

virtual void userTask (void)
 The ArMode's user task, don't need one, subclass must provide if needed.

virtual void help (void)
 The mode's help print out... subclass must provide if needed. More...

bool baseActivate (void)
 The base activation, it MUST be called by inheriting classes, and inheriting classes MUST return if this returns false. More...

bool baseDeactivate (void)
 The base deactivation, it MUST be called by inheriting classes, and inheriting classes MUST return if this returns false. More...

char getKey (void)
 An internal function to get the first key this is bound to.

char getKey2 (void)
 An internal function to get the second key this is bound to.


Static Public Methods

void baseHelp (void)
 This is the base help function, its internal, bound to ? and h and H.


Detailed Description

A class for different modes, mostly as related to keyboard input.

Each mode is going to need to add its keys to the keyHandler... each mode should only use the keys 1-0, the arrow keys (movement), the space bar (stop), z (zoom in), x (zoom out), and e (exercise)... then when its activate is called by that key handler it needs to first deactivate the ourActiveMode (if its not itself, in which case its done) then add its key handling stuff... activate and deactivate will need to add and remove their user tasks (or call the base class activate/deactivate to do it) as well as the key handling things for their other part of modes. This mode will ALWAYS bind help to /, ?, h, and H when the first instance of an ArMode is made.


Constructor & Destructor Documentation

ArMode::ArMode ArRobot   robot,
const char *    name,
char    key,
char    key2
 

Constructor.

Parameters:
robot  the robot we're attaching to
name  the name of this mode
key  the first key to switch to this mode on... it can be '\0' if you don't want to use this
key  the first key to switch to this mode on... it can be '\0' if you don't want to use this


Member Function Documentation

bool ArMode::baseActivate void   
 

The base activation, it MUST be called by inheriting classes, and inheriting classes MUST return if this returns false.

Inheriting modes must first call this to get their user task called and to deactivate the active mode.... if it returns false then the inheriting class must return, as it means that his mode is already active

bool ArMode::baseDeactivate void   
 

The base deactivation, it MUST be called by inheriting classes, and inheriting classes MUST return if this returns false.

This gets called when the mode is deactivated, it removes the user task from the robot

virtual void ArMode::help void    [inline, virtual]
 

The mode's help print out... subclass must provide if needed.

This is called as soon as a mode is activated, and should give directions on to what keys do what and what this mode will do

Reimplemented in ArModeTeleop, ArModeWander, ArModeGripper, ArModeCamera, and ArModeSonar.


The documentation for this class was generated from the following files:
Generated on Tue Nov 12 17:43:57 2002 for Aria by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001