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

# Modules/BehaviorControl/CommonXabsl2Symbols/LEDAndSoundSymbols.cpp

Go to the documentation of this file.

    00001 /**
    00002 * @file LEDAndSoundSymbols.cpp
    00003 *
    00004 * Implementation of class LEDAndSoundSymbols.
    00005 *
    00006 * @author Uwe Düffert
    00007 * @author Martin Lötzsch
    00008 */
    00009
    00010 #include "LEDAndSoundSymbols.h"
    00011 #include "Tools/StringFunctions.h"
    00012
    00013 LEDAndSoundSymbols::LEDAndSoundSymbols(const BehaviorControlInterfaces& interfaces)
    00014 : BehaviorControlInterfaces(interfaces)
    00015 {
    00016 }
    00017
    00018
    00019 void LEDAndSoundSymbols::registerSymbols(Xabsl2Engine& engine)
    00020 {
    00021   int i;
    00022   char s[256];
    00023
    00024   // "leds.top-red"
    00025   engine.registerEnumeratedOutputSymbol("leds.top-red",(int*)&ledRequest.redTopLEDs);
    00026   for (i=0;i<LEDRequest::numOfRedLEDPairs;i++)
    00027   {
    00028     sprintf(s,"top.");
    00029     getXmlString(s+strlen(s),LEDRequest::getRedLEDPairName((LEDRequest::RedLEDPair)i));
    00030     engine.registerEnumeratedOutputSymbolEnumElement("leds.top-red",s,i);
    00031   }
    00032
    00033   // "leds.bottom-red"
    00034   engine.registerEnumeratedOutputSymbol("leds.bottom-red",(int*)&ledRequest.redBottomLEDs);
    00035   for (i=0;i<LEDRequest::numOfRedLEDPairs;i++)
    00036   {
    00037     char s[256];
    00038     sprintf(s,"bottom.");
    00039     getXmlString(s+strlen(s),LEDRequest::getRedLEDPairName((LEDRequest::RedLEDPair)i));
    00040     engine.registerEnumeratedOutputSymbolEnumElement("leds.bottom-red",s,i);
    00041   }
    00042
    00043   // "leds.face"
    00044   for(int faceLEDNumber = 1; faceLEDNumber <= 14; faceLEDNumber++)
    00045   {
    00046     char symbolName[256];
    00047     sprintf(symbolName,"leds.face%i", faceLEDNumber);
    00048     engine.registerEnumeratedOutputSymbol(symbolName,(int*)&ledRequest.faceLED[faceLEDNumber-1]);
    00049     for (i=0;i<LEDRequest::numOfBlinkModes;i++)
    00050     {
    00051       char s[256];
    00052       sprintf(s,"face%i.", faceLEDNumber);
    00053       getXmlString(s+strlen(s),LEDRequest::getBlinkModeName((LEDRequest::BlinkMode)i));
    00054       engine.registerEnumeratedOutputSymbolEnumElement(symbolName,s,i);
    00055     }
    00056   }
    00057
    00058   // leds.back-front-white
    00059   engine.registerEnumeratedOutputSymbol("leds.back-front-white",(int*)&ledRequest.backFrontWhiteLED);
    00060   for (i=0;i<LEDRequest::numOfBlinkModes;i++)
    00061   {
    00062     char s[256];
    00063     sprintf(s,"back-front-white.");
    00064     getXmlString(s+strlen(s),LEDRequest::getBlinkModeName((LEDRequest::BlinkMode)i));
    00065     engine.registerEnumeratedOutputSymbolEnumElement("leds.back-front-white",s,i);
    00066   }
    00067
    00068   // leds.back-front-blue
    00069   engine.registerEnumeratedOutputSymbol("leds.back-front-blue",(int*)&ledRequest.backFrontBlueLED);
    00070   for (i=0;i<LEDRequest::numOfBlinkModes;i++)
    00071   {
    00072     char s[256];
    00073     sprintf(s,"back-front-blue.");
    00074     getXmlString(s+strlen(s),LEDRequest::getBlinkModeName((LEDRequest::BlinkMode)i));
    00075     engine.registerEnumeratedOutputSymbolEnumElement("leds.back-front-blue",s,i);
    00076   }
    00077
    00078   // leds.back-middle-white
    00079   engine.registerEnumeratedOutputSymbol("leds.back-middle-white",(int*)&ledRequest.backMiddleWhiteLED);
    00080   for (i=0;i<LEDRequest::numOfBlinkModes;i++)
    00081   {
    00082     char s[256];
    00083     sprintf(s,"back-middle-white.");
    00084     getXmlString(s+strlen(s),LEDRequest::getBlinkModeName((LEDRequest::BlinkMode)i));
    00085     engine.registerEnumeratedOutputSymbolEnumElement("leds.back-middle-white",s,i);
    00086   }
    00087
    00088   // leds.back-middle-orange
    00089   engine.registerEnumeratedOutputSymbol("leds.back-middle-orange",(int*)&ledRequest.backMiddleOrangeLED);
    00090   for (i=0;i<LEDRequest::numOfBlinkModes;i++)
    00091   {
    00092     char s[256];
    00093     sprintf(s,"back-middle-orange.");
    00094     getXmlString(s+strlen(s),LEDRequest::getBlinkModeName((LEDRequest::BlinkMode)i));
    00095     engine.registerEnumeratedOutputSymbolEnumElement("leds.back-middle-orange",s,i);
    00096   }
    00097
    00098   // leds.back-rear-white
    00099   engine.registerEnumeratedOutputSymbol("leds.back-rear-white",(int*)&ledRequest.backRearWhiteLED);
    00100   for (i=0;i<LEDRequest::numOfBlinkModes;i++)
    00101   {
    00102     char s[256];
    00103     sprintf(s,"back-rear-white.");
    00104     getXmlString(s+strlen(s),LEDRequest::getBlinkModeName((LEDRequest::BlinkMode)i));
    00105     engine.registerEnumeratedOutputSymbolEnumElement("leds.back-rear-white",s,i);
    00106   }
    00107
    00108   // leds.back-rear-red
    00109   engine.registerEnumeratedOutputSymbol("leds.back-rear-red",(int*)&ledRequest.backRearRedLED);
    00110   for (i=0;i<LEDRequest::numOfBlinkModes;i++)
    00111   {
    00112     char s[256];
    00113     sprintf(s,"back-rear-red.");
    00114     getXmlString(s+strlen(s),LEDRequest::getBlinkModeName((LEDRequest::BlinkMode)i));
    00115     engine.registerEnumeratedOutputSymbolEnumElement("leds.back-rear-red",s,i);
    00116   }
    00117
    00118   // leds.head-white
    00119   engine.registerEnumeratedOutputSymbol("leds.head-white",(int*)&ledRequest.headWhiteLED);
    00120   for (i=0;i<LEDRequest::numOfBlinkModes;i++)
    00121   {
    00122     char s[256];
    00123     sprintf(s,"head-white.");
    00124     getXmlString(s+strlen(s),LEDRequest::getBlinkModeName((LEDRequest::BlinkMode)i));
    00125     engine.registerEnumeratedOutputSymbolEnumElement("leds.head-white",s,i);
    00126   }
    00127
    00128   // leds.head-orange
    00129   engine.registerEnumeratedOutputSymbol("leds.head-orange",(int*)&ledRequest.headOrangeLED);
    00130   for (i=0;i<LEDRequest::numOfBlinkModes;i++)
    00131   {
    00132     char s[256];
    00133     sprintf(s,"head-orange.");
    00134     getXmlString(s+strlen(s),LEDRequest::getBlinkModeName((LEDRequest::BlinkMode)i));
    00135     engine.registerEnumeratedOutputSymbolEnumElement("leds.head-orange",s,i);
    00136   }
    00137
    00138
    00139   // "leds.tail-mode"
    00140   engine.registerEnumeratedOutputSymbol("leds.tail-mode",(int*)&ledRequest.tailMode);
    00141   for (i=0;i<LEDRequest::numOfTailModes;i++)
    00142   {
    00143     char s[256];
    00144     sprintf(s,"tail.");
    00145     getXmlString(s+strlen(s),LEDRequest::getTailModeName((LEDRequest::TailMode)i));
    00146     engine.registerEnumeratedOutputSymbolEnumElement("leds.tail-mode",s,i);
    00147   }
    00148
    00149   // "sound-request"
    00150   engine.registerEnumeratedOutputSymbol("sound-request",(int*)&soundRequest.soundID);
    00151   for (i=0;i<SoundRequest::numOfSoundIDs;i++)
    00152   {
    00153     sprintf(s,"sound-request.");
    00154     getXmlString(s+strlen(s),SoundRequest::getSoundIDName((SoundRequest::SoundID)i));
    00155     engine.registerEnumeratedOutputSymbolEnumElement("sound-request",s,i);
    00156   }
    00157 }
    00158