00001 /*************************************************************************** 00002 * Copyright (C) 2005-2011 LpzRobots development team * 00003 * Georg Martius <georg dot martius at web dot de> * 00004 * Frank Guettler <guettler at informatik dot uni-leipzig dot de * 00005 * Frank Hesse <frank at nld dot ds dot mpg dot de> * 00006 * Ralf Der <ralfder at mis dot mpg dot de> * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This program is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this program; if not, write to the * 00020 * Free Software Foundation, Inc., * 00021 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00022 * * 00023 ***************************************************************************/ 00024 #ifndef __WIRINGSEQUENCE_H 00025 #define __WIRINGSEQUENCE_H 00026 00027 #include "abstractwiring.h" 00028 #include <vector> 00029 00030 /** Implements a sequence of wirings 00031 */ 00032 class WiringSequence :public AbstractWiring{ 00033 public: 00034 00035 /** constructor: The wirings given in the list 00036 are applied in the sequence. For the sensors in normal order and 00037 for the motors in reverse order*/ 00038 WiringSequence(std::list<AbstractWiring*>); 00039 /** constructor provided for convinience, essentially calls addWiring(w1);addWiring(w2) 00040 */ 00041 WiringSequence(AbstractWiring* w1, AbstractWiring* w2); 00042 00043 virtual ~WiringSequence(); 00044 00045 protected: 00046 virtual bool initIntern(); 00047 00048 virtual bool wireSensorsIntern(const sensor* rsensors, int rsensornumber, 00049 sensor* csensors, int csensornumber, 00050 double noise); 00051 00052 virtual bool wireMotorsIntern(motor* rmotors, int rmotornumber, 00053 const motor* cmotors, int cmotornumber); 00054 00055 00056 public: 00057 00058 /** adds a wiring to the list of wirings*/ 00059 virtual void addWiring(AbstractWiring* wiring); 00060 00061 00062 protected: 00063 std::vector<AbstractWiring*> wirings; 00064 bool initialised; 00065 00066 }; 00067 00068 #endif