Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Representations/Motion/LEDRequest.h

Go to the documentation of this file.
00001 /**
00002 * @file LEDRequest.h
00003 * 
00004 * Declaration of class LEDRequest
00005 *
00006 * @author Max Risler
00007 */ 
00008 
00009 #ifndef __LEDRequest_h_
00010 #define __LEDRequest_h_
00011 
00012 
00013 #include "Tools/Streams/InOut.h"
00014 
00015 /**
00016 * LED settings requested by BehaviorControl
00017 */
00018 class LEDRequest
00019 {
00020 public:
00021   /** enum defining settings for two red LEDs */
00022   enum RedLEDPair
00023   {
00024     bothOn, /*!< both leds are on */
00025       bothFastBlink, /*!< both leds blink fast */
00026       bothSlowBlink, /*!< both leds blink slow */
00027       bothOff, /*!< both leds are off */
00028       leftOnly, /*!< only left led is on */
00029       rightOnly, /*!< only right led ist on */
00030       leftFastBlink, /*!< the left led blinks fast */
00031       rightFastBlink, /*!< the right led blinks fast */
00032       leftSlowBlink, /*!< the left led blinks slow */
00033       rightSlowBlink, /*!< the right led blinks slow */
00034       alternateFast, /*!< both leds alternate fast */
00035       alternateSlow, /*!< both leds alternate slow */
00036       numOfRedLEDPairs
00037   };
00038   
00039   /** returns name of a RedLEDPair mode */
00040   static const char* getRedLEDPairName(RedLEDPair id)
00041   {
00042     switch (id)
00043     {
00044     case bothOn: return "bothOn";
00045     case bothFastBlink: return "bothFastBlink";
00046     case bothSlowBlink: return "bothSlowBlink";
00047     case bothOff: return "bothOff";
00048     case leftOnly: return "left";
00049     case rightOnly: return "right";
00050     case leftFastBlink: return "leftFastBlink";
00051     case rightFastBlink: return "rightFastBlink";
00052     case leftSlowBlink: return "leftSlowBlink";
00053     case rightSlowBlink: return "rightSlowBlink";
00054     case alternateFast: return "alternateFast";
00055     case alternateSlow: return "alternateSlow";
00056     default: return "Unknown RedLEDPair, please edit LEDRequest::getRedLEDPairName";
00057     }
00058   }
00059   
00060   /** enum defining different blink modi */
00061   enum BlinkMode
00062   {
00063     oooo,
00064       oool,
00065       oolo,
00066       ooll,
00067       oloo,
00068       olol,
00069       ollo,
00070       olll,
00071       looo,
00072       lool,
00073       lolo,
00074       loll,
00075       lloo,
00076       llol,
00077       lllo,
00078       llll,
00079       numOfBlinkModes
00080   };
00081   
00082   /** returns name of a blink mode */
00083   static const char* getBlinkModeName(BlinkMode id)
00084   {
00085     switch (id)
00086     {
00087     case oooo: return "oooo";
00088     case oool: return "oool";
00089     case oolo: return "oolo";
00090     case ooll: return "ooll";
00091     case oloo: return "oloo";
00092     case olol: return "olol";
00093     case ollo: return "ollo";
00094     case olll: return "olll";
00095     case looo: return "looo";
00096     case lool: return "lool";
00097     case lolo: return "lolo";
00098     case loll: return "loll";
00099     case lloo: return "lloo";
00100     case llol: return "llol";
00101     case lllo: return "lllo";
00102     case llll: return "llll";
00103     default: return "Unknown blink mode, please edit LEDRequest::BlinkModes";
00104     }
00105   }
00106   
00107   /** enum defining settings for tail LED modes */
00108   enum TailMode
00109   {
00110     on, /*!<  led is on */
00111       slowBlink, /*!< led blinks slow */
00112       fastBlink, /*!< led blinks slow */
00113       numOfTailModes
00114   };
00115   
00116   /** returns name of a TailMode */
00117   static const char* getTailModeName(TailMode id)
00118   {
00119     switch (id)
00120     {
00121     case on: return "on";
00122     case slowBlink: return "slowBlink";
00123     case fastBlink: return "fastBlink";
00124     default: return "Unknown TailMode, please edit LEDRequest::getTailModeName";
00125     }
00126   }
00127 
00128   /** Show xmas tree on frame loss */
00129   bool showCognitionFrameLostWarning;
00130   
00131   /** fps of cognition process to show as a led bar, 0 to disable */
00132   int cognitionFps;
00133 
00134   /** setting for the two top red leds */
00135   RedLEDPair redTopLEDs;
00136   
00137   /** setting for the two bottom red leds */
00138   RedLEDPair redBottomLEDs;
00139   
00140   /** setting for the tail led */
00141   TailMode tailMode;
00142   
00143   /** setting for the face leds */
00144   BlinkMode faceLED[14];
00145   
00146   /** setting for the face leds */
00147   mutable bool faceLEDModeA;
00148   
00149   /** setting for the back front white led */
00150   BlinkMode backFrontWhiteLED;
00151   
00152   /** setting for the back front blue led */
00153   BlinkMode backFrontBlueLED;
00154   
00155   /** setting for the back middle white led */
00156   BlinkMode backMiddleWhiteLED;
00157   
00158   /** setting for the back middle orange led */
00159   BlinkMode backMiddleOrangeLED;
00160   
00161   /** setting for the back rear white led */
00162   BlinkMode backRearWhiteLED;
00163   
00164   /** setting for the back rear red led */
00165   BlinkMode backRearRedLED;
00166 
00167   /** setting for the head orange led */
00168   BlinkMode headOrangeLED;
00169   
00170   /** setting for the head white led */
00171   BlinkMode headWhiteLED;
00172 
00173   /** Constructor */
00174   LEDRequest();
00175 };
00176 
00177 /**
00178 * Streaming operator that reads a LEDRequest from a stream.
00179 * @param stream The stream from which is read.
00180 * @param ledRequest The LEDRequest object.
00181 * @return The stream.
00182 */ 
00183 In& operator>>(In& stream,LEDRequest& ledRequest);
00184 
00185 /**
00186 * Streaming operator that writes a LEDRequest to a stream.
00187 * @param stream The stream to write on.
00188 * @param ledRequest The LEDRequest object.
00189 * @return The stream.
00190 */ 
00191 Out& operator<<(Out& stream, const LEDRequest& ledRequest);
00192 
00193 #endif //__LEDRequest_h_

Generated on Mon Mar 20 22:00:02 2006 for GT2005 by doxygen 1.3.6