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   /** The frameNumber */
00129   bool showCognitionFrameLostWarning;
00130   
00131   /** setting for the two top red leds */
00132   RedLEDPair redTopLEDs;
00133   
00134   /** setting for the two bottom red leds */
00135   RedLEDPair redBottomLEDs;
00136   
00137   /** setting for the tail led */
00138   TailMode tailMode;
00139   
00140   /** setting for the face leds */
00141   BlinkMode faceLED[14];
00142   
00143   /** setting for the back front white led */
00144   BlinkMode backFrontWhiteLED;
00145   
00146   /** setting for the back front blue led */
00147   BlinkMode backFrontBlueLED;
00148   
00149   /** setting for the back middle white led */
00150   BlinkMode backMiddleWhiteLED;
00151   
00152   /** setting for the back middle orange led */
00153   BlinkMode backMiddleOrangeLED;
00154   
00155   /** setting for the back rear white led */
00156   BlinkMode backRearWhiteLED;
00157   
00158   /** setting for the back rear red led */
00159   BlinkMode backRearRedLED;
00160 
00161   /** setting for the head orange led */
00162   BlinkMode headOrangeLED;
00163   
00164   /** setting for the head white led */
00165   BlinkMode headWhiteLED;
00166 
00167   /** Constructor */
00168   LEDRequest();
00169 };
00170 
00171 /**
00172 * Streaming operator that reads a LEDRequest from a stream.
00173 * @param stream The stream from which is read.
00174 * @param ledRequest The LEDRequest object.
00175 * @return The stream.
00176 */ 
00177 In& operator>>(In& stream,LEDRequest& ledRequest);
00178 
00179 /**
00180 * Streaming operator that writes a LEDRequest to a stream.
00181 * @param stream The stream to write on.
00182 * @param ledRequest The LEDRequest object.
00183 * @return The stream.
00184 */ 
00185 Out& operator<<(Out& stream, const LEDRequest& ledRequest);
00186 
00187 #endif //__LEDRequest_h_
00188 
00189 /*
00190 * Change log :
00191 * 
00192 * $Log: LEDRequest.h,v $
00193 * Revision 1.2  2004/06/15 17:48:00  juengel
00194 * Added showCognitionFrameLostWarning.
00195 *
00196 * Revision 1.1.1.1  2004/05/22 17:25:18  cvsadm
00197 * created new repository GT2004_WM
00198 *
00199 * Revision 1.8  2004/03/25 21:20:19  juengel
00200 * Added head LEDs.
00201 *
00202 * Revision 1.7  2004/03/25 19:56:28  loetzsch
00203 * again changed the led request
00204 *
00205 * Revision 1.6  2004/03/25 18:07:01  loetzsch
00206 * added single variables for the back colored leds
00207 *
00208 * Revision 1.5  2004/03/25 17:39:17  loetzsch
00209 * renamed initial-setup-mode to back-mode
00210 *
00211 * Revision 1.4  2004/03/21 19:08:15  juengel
00212 * Added back*White LED support.
00213 *
00214 * Revision 1.3  2004/03/20 19:24:07  juengel
00215 * Added face LEDs to LEDRequest
00216 *
00217 * Revision 1.2  2004/03/01 12:37:22  wachter
00218 * Added LED-Request for button-interface
00219 *
00220 * Revision 1.1  2003/10/07 10:07:01  cvsadm
00221 * Created GT2004 (M.J.)
00222 *
00223 * Revision 1.2  2003/09/25 11:23:52  juengel
00224 * Removed BlobCollection.
00225 *
00226 * Revision 1.1.1.1  2003/07/02 09:40:22  cvsadm
00227 * created new repository for the competitions in Padova from the 
00228 * tamara CVS (Tuesday 2:00 pm)
00229 *
00230 * removed unused solutions
00231 *
00232 * Revision 1.4  2003/05/08 14:27:33  risler
00233 * added tailMode to LEDRequest
00234 *
00235 * Revision 1.3  2003/05/06 07:58:01  dueffert
00236 * output of LEDRequest names added
00237 *
00238 * Revision 1.2  2002/11/18 17:20:22  loetzsch
00239 * removed "old version" of LED request
00240 *
00241 * Revision 1.1  2002/09/10 15:26:40  cvsadm
00242 * Created new project GT2003 (M.L.)
00243 * - Cleaned up the /Src/DataTypes directory
00244 * - Removed Challenge Code
00245 * - Removed processing of incoming audio data
00246 * - Renamed AcousticMessage to SoundRequest
00247 *
00248 * Revision 1.3  2002/08/22 14:41:03  risler
00249 * added some doxygen comments
00250 *
00251 * Revision 1.2  2002/07/23 13:32:57  loetzsch
00252 * new streaming classes
00253 *
00254 * removed many #include statements
00255 *
00256 * Revision 1.1.1.1  2002/05/10 12:40:13  cvsadm
00257 * Moved GT2002 Project from ute to tamara.
00258 *
00259 * Revision 1.10  2002/05/07 05:49:56  dueffert
00260 * new LED handling implemented
00261 *
00262 * Revision 1.9  2002/05/04 17:42:27  loetzsch
00263 * extended the request by a new version
00264 *
00265 * Revision 1.8  2002/04/17 17:04:40  risler
00266 * Darmstadt GO
00267 *
00268 * Revision 1.7  2002/02/28 14:35:53  risler
00269 * changed names in LEDRequest
00270 *
00271 * Revision 1.6  2002/02/07 19:57:06  risler
00272 * DefaultLEDControl uses getPlayer now, removed team and role from LEDRequest
00273 *
00274 * Revision 1.5  2001/12/10 17:47:05  risler
00275 * change log added
00276 *
00277 */

Generated on Thu Sep 23 19:57:35 2004 for GT2004 by doxygen 1.3.6