Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

FlashIPAddrBehavior Class Reference

#include <FlashIPAddrBehavior.h>

Inheritance diagram for FlashIPAddrBehavior:

Inheritance graph
[legend]
List of all members.

Detailed Description

Displays IP address by speaking the digits and flashing a series of numbers on the LED face panel.

Will only run the display on DoStart() if the flash_on_start config variable is set. Otherwise you will need to hold down the buttons specified by button1 and button2 to trigger the display. Note that if the e-stop is active it will intercept the button events, so turn off e-stop first.

Definition at line 15 of file FlashIPAddrBehavior.h.

Public Member Functions

 FlashIPAddrBehavior ()
 constructor
virtual void DoStart ()
 if the Config::behavior_config::flash_on_start flag is set, will setup and run
virtual void DoStop ()
 halts any display which may be in progress
virtual void processEvent (const EventBase &e)
 Receives button events, timers, and motman manager pruning notifications.
virtual std::string getDescription () const
 Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).

Static Public Member Functions

static std::string getClassDescription ()
 Gives a short description of what this class of behaviors does... you should override this (but don't have to).

Protected Types

typedef XLargeMotionSequenceMC MSMC_t
 used to flash the LEDs to report the IP address

Protected Member Functions

void loadSounds ()
 loads the numeric sounds into memory
void releaseSounds ()
 releases the numeric sounds
void setupSequence ()
 construct the motion sequence for flashing leds, request timers to play corresponding sound file

Protected Attributes

std::vector< std::string > sounds
 sound to play, corresponding to timers to coincide with corresponding digit on the LEDs (could be done with chained sounds, but this is cooler)
SharedObject< MSMC_tms
 motion sequence used to control the LEDs
MotionManager::MC_ID ms_id
 id number of ms

Static Protected Attributes

static const unsigned int button1 = ChinButOffset
 one of two buttons which must be pressed together to trigger the report without using the Controller
static const unsigned int button2 = HeadFrButOffset
 one of two buttons which must be pressed together to trigger the report without using the Controller
static const unsigned int ACTIVATE_TIMER = -1U
 timer id to specify both trigger buttons have been down long enough
static const unsigned int delay = 64
 time (in milliseconds) to expect ms to be delayed before it actually starts


Member Typedef Documentation

typedef XLargeMotionSequenceMC FlashIPAddrBehavior::MSMC_t [protected]
 

used to flash the LEDs to report the IP address

Definition at line 39 of file FlashIPAddrBehavior.h.


Constructor & Destructor Documentation

FlashIPAddrBehavior::FlashIPAddrBehavior  )  [inline]
 

constructor

Definition at line 18 of file FlashIPAddrBehavior.h.


Member Function Documentation

void FlashIPAddrBehavior::DoStart  )  [virtual]
 

if the Config::behavior_config::flash_on_start flag is set, will setup and run

Reimplemented from BehaviorBase.

Definition at line 11 of file FlashIPAddrBehavior.cc.

void FlashIPAddrBehavior::DoStop  )  [virtual]
 

halts any display which may be in progress

Reimplemented from BehaviorBase.

Definition at line 23 of file FlashIPAddrBehavior.cc.

static std::string FlashIPAddrBehavior::getClassDescription  )  [inline, static]
 

Gives a short description of what this class of behaviors does... you should override this (but don't have to).

If you do override this, also consider overriding getDescription() to return it

Reimplemented from BehaviorBase.

Definition at line 28 of file FlashIPAddrBehavior.h.

Referenced by getDescription().

virtual std::string FlashIPAddrBehavior::getDescription  )  const [inline, virtual]
 

Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).

By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~getClassDescription(), because static functions can't be virtual in C++ (doh!)

This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so.

Reimplemented from BehaviorBase.

Definition at line 36 of file FlashIPAddrBehavior.h.

void FlashIPAddrBehavior::loadSounds  )  [protected]
 

loads the numeric sounds into memory

Definition at line 77 of file FlashIPAddrBehavior.cc.

Referenced by DoStart(), and processEvent().

void FlashIPAddrBehavior::processEvent const EventBase e  )  [virtual]
 

Receives button events, timers, and motman manager pruning notifications.

Reimplemented from BehaviorBase.

Definition at line 31 of file FlashIPAddrBehavior.cc.

void FlashIPAddrBehavior::releaseSounds  )  [protected]
 

releases the numeric sounds

Definition at line 82 of file FlashIPAddrBehavior.cc.

Referenced by DoStop(), processEvent(), and setupSequence().

void FlashIPAddrBehavior::setupSequence  )  [protected]
 

construct the motion sequence for flashing leds, request timers to play corresponding sound file

Definition at line 88 of file FlashIPAddrBehavior.cc.

Referenced by DoStart(), and processEvent().


Member Data Documentation

const unsigned int FlashIPAddrBehavior::ACTIVATE_TIMER = -1U [static, protected]
 

timer id to specify both trigger buttons have been down long enough

Definition at line 48 of file FlashIPAddrBehavior.h.

Referenced by processEvent().

const unsigned int FlashIPAddrBehavior::button1 = ChinButOffset [static, protected]
 

one of two buttons which must be pressed together to trigger the report without using the Controller

Definition at line 45 of file FlashIPAddrBehavior.h.

Referenced by DoStart(), getClassDescription(), and processEvent().

const unsigned int FlashIPAddrBehavior::button2 = HeadFrButOffset [static, protected]
 

one of two buttons which must be pressed together to trigger the report without using the Controller

Definition at line 46 of file FlashIPAddrBehavior.h.

Referenced by DoStart(), getClassDescription(), and processEvent().

const unsigned int FlashIPAddrBehavior::delay = 64 [static, protected]
 

time (in milliseconds) to expect ms to be delayed before it actually starts

Definition at line 50 of file FlashIPAddrBehavior.h.

Referenced by setupSequence().

SharedObject<MSMC_t> FlashIPAddrBehavior::ms [protected]
 

motion sequence used to control the LEDs

Definition at line 52 of file FlashIPAddrBehavior.h.

Referenced by DoStart(), processEvent(), and setupSequence().

MotionManager::MC_ID FlashIPAddrBehavior::ms_id [protected]
 

id number of ms

Definition at line 53 of file FlashIPAddrBehavior.h.

Referenced by DoStart(), DoStop(), and processEvent().

std::vector<std::string> FlashIPAddrBehavior::sounds [protected]
 

sound to play, corresponding to timers to coincide with corresponding digit on the LEDs (could be done with chained sounds, but this is cooler)

Definition at line 49 of file FlashIPAddrBehavior.h.

Referenced by loadSounds(), processEvent(), releaseSounds(), and setupSequence().


The documentation for this class was generated from the following files:

Tekkotsu v2.4.1
Generated Tue Aug 16 16:35:02 2005 by Doxygen 1.4.4