Index: trunk/lib/FlairSensorActuator/src/SimuBldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuBldc.cpp	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuBldc.cpp	(revision 158)
@@ -33,10 +33,8 @@
 
 SimuBldc::SimuBldc(const IODevice *parent, Layout *layout, string name,
-                   uint8_t motors_count, uint32_t dev_id)
+                   uint8_t motors_count, uint32_t modelId,uint32_t deviceId)
     : Bldc(parent, layout, name, motors_count) {
-  ostringstream dev_name;
-  dev_name << "simu_bldc_" << dev_id;
   shmem =
-      new SharedMem(this, dev_name.str().c_str(), motors_count * sizeof(float));
+      new SharedMem(this, ShMemName(modelId, deviceId), motors_count * sizeof(float));
 
   GroupBox *groupbox = new GroupBox(layout->NewRow(), "simubldc");
@@ -47,10 +45,8 @@
 
 SimuBldc::SimuBldc(const Object *parent, string name, uint8_t motors_count,
-                   uint32_t dev_id)
+                   uint32_t modelId,uint32_t deviceId)
     : Bldc(parent, name, motors_count) {
-  ostringstream dev_name;
-  dev_name << "simu_bldc_" << dev_id;
   shmem =
-      new SharedMem(this, dev_name.str().c_str(), motors_count * sizeof(float));
+      new SharedMem(this, ShMemName(modelId, deviceId), motors_count * sizeof(float));
 
   // reset values
@@ -65,4 +61,10 @@
 
 SimuBldc::~SimuBldc() {}
+
+string SimuBldc::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_bldc_" << deviceId;
+  return dev_name.str().c_str();
+}
 
 void SimuBldc::SetMotors(float *value) {
Index: trunk/lib/FlairSensorActuator/src/SimuBldc.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuBldc.h	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuBldc.h	(revision 158)
@@ -46,8 +46,9 @@
   * \param name name
   * \param motors_count number of motors
-  * \param dev_id device id
+  * \param modelId Model id
+  * \param deviceId Bldc id of the Model
   */
   SimuBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
-           uint8_t motors_count, uint32_t dev_id);
+           uint8_t motors_count, uint32_t modelId,uint32_t deviceId);
 
   /*!
@@ -59,8 +60,9 @@
   * \param name name
   * \param motors_count number of motors
-  * \param dev_id device id
+  * \param modelId Model id
+  * \param deviceId Bldc id of the Model
   */
   SimuBldc(const core::Object *parent, std::string name, uint8_t motors_count,
-           uint32_t dev_id);
+           uint32_t modelId,uint32_t deviceId);
 
   /*!
@@ -107,5 +109,6 @@
   */
   void SetMotors(float *value);
-
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
   core::SharedMem *shmem;
   gui::DoubleSpinBox *k;
Index: trunk/lib/FlairSensorActuator/src/SimuCamera.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 158)
@@ -33,5 +33,5 @@
 SimuCamera::SimuCamera(string name,
                        uint16_t width, uint16_t height, uint8_t channels,
-                       uint32_t dev_id, uint8_t priority)
+                       uint32_t modelId,uint32_t deviceId, uint8_t priority)
     : Thread(getFrameworkManager(), name, priority),
       Camera(name, width, height, cvimage::Type::Format::BGR) {
@@ -43,6 +43,6 @@
 
   ostringstream dev_name;
-  dev_name << "simu_cam_" << dev_id;
-  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), buf_size, SharedMem::Type::producerConsumer);
+  dev_name << "simu" <<  modelId << "_cam_" << deviceId;
+  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId), buf_size, SharedMem::Type::producerConsumer);
   
   SetIsReady(true);
@@ -51,12 +51,10 @@
 //simulation part
 SimuCamera::SimuCamera(const IODevice *parent, string name, uint16_t width,
-                       uint16_t height, uint8_t channels, uint32_t dev_id)
+                       uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId)
     : Thread(parent, name, 0), Camera(parent,name) {
 
   buf_size = width * height * channels+sizeof(Time);
   
-  ostringstream dev_name;
-  dev_name << "simu_cam_" << dev_id;
-  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId),
                         buf_size, SharedMem::Type::producerConsumer);
   shmemReadBuf=NULL;
@@ -69,4 +67,10 @@
   Join();
   if(shmemReadBuf!=NULL) delete shmemReadBuf;
+}
+
+string SimuCamera::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_cam_" << deviceId;
+  return dev_name.str().c_str();
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuCamera.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuCamera.h	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuCamera.h	(revision 158)
@@ -42,9 +42,10 @@
   * \param height height
   * \param channels number of channels
-  * \param dev_id device id
+  * \param modelId Model id
+  * \param deviceId Camera id of the Model
   * \param priority priority of the Thread
   */
   SimuCamera(std::string name,
-             uint16_t width, uint16_t height, uint8_t channels, uint32_t dev_id,
+             uint16_t width, uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId,
              uint8_t priority);
 
@@ -60,8 +61,9 @@
   * \param height height
   * \param channels number of channels
-  * \param dev_id device id
+  * \param modelId Model id
+  * \param deviceId Camera id of the Model
   */
   SimuCamera(const core::IODevice *parent, std::string name, uint16_t width,
-             uint16_t height, uint8_t channels, uint32_t dev_id);
+             uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId);
 
   /*!
@@ -95,4 +97,6 @@
   */
   void UpdateFrom(const core::io_data *data){};
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
 
   size_t buf_size;
Index: trunk/lib/FlairSensorActuator/src/SimuGps.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuGps.cpp	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuGps.cpp	(revision 158)
@@ -39,5 +39,5 @@
 
 SimuGps::SimuGps(string name,
-                 NmeaGps::NMEAFlags_t NMEAFlags, uint32_t deviceId,uint8_t priority)
+                 NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority)
     : NmeaGps(name, NMEAFlags),Thread(getFrameworkManager(), name, priority) {
 
@@ -49,7 +49,5 @@
   numberOfSatellites = new SpinBox(GetGroupBox()->NewRow(), "number of satellites", 1, 15, 1, 5);
 
-  ostringstream dev_name;
-  dev_name << "simu_gps_" << deviceId;
-  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
                         sizeof(gps_states_t));
                         
@@ -58,11 +56,9 @@
 
 
-SimuGps::SimuGps(const IODevice *parent, string name, uint32_t deviceId)
+SimuGps::SimuGps(const IODevice *parent, string name, uint32_t modelId,uint32_t deviceId)
     : NmeaGps(parent, name), Thread(parent, name, 0) {
   dataRate = NULL;
 
-  ostringstream dev_name;
-  dev_name << "simu_gps_" << deviceId;
-  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId),
                         sizeof(gps_states_t));
   
@@ -73,4 +69,10 @@
   SafeStop();
   Join();
+}
+
+string SimuGps::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_gps_" << deviceId;
+  return dev_name.str().c_str();
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuGps.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuGps.h	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuGps.h	(revision 158)
@@ -43,9 +43,10 @@
   * \param name name
   * \param NMEAFlags NMEA sentances to enable
-  * \param deviceId device id
+  * \param modelId Model id
+  * \param deviceId Gps id of the Model
   * \param priority priority of the Thread
   */
   SimuGps(std::string name,
-          NmeaGps::NMEAFlags_t NMEAFlags, uint32_t deviceId,uint8_t priority);
+          NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority);
 
   /*!
@@ -57,7 +58,8 @@
   * \param parent parent
   * \param name name
-  * \param deviceId device id
+  * \param modelId Model id
+  * \param deviceId Gps id of the Model
   */
-  SimuGps(const core::IODevice *parent, std::string name, uint32_t deviceId);
+  SimuGps(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId);
 
   /*!
@@ -92,4 +94,6 @@
     float vn;
   } gps_states_t;
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
 
   core::SharedMem *shmem;
Index: trunk/lib/FlairSensorActuator/src/SimuImu.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 158)
@@ -34,5 +34,5 @@
 namespace sensor {
 
-SimuImu::SimuImu(string name, uint32_t dev_id,
+SimuImu::SimuImu(string name, uint32_t modelId,uint32_t deviceId,
                  uint8_t priority)
     : Imu(name), Thread(getFrameworkManager(), name, priority) {
@@ -40,19 +40,15 @@
       new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 200);
   ahrsData = new AhrsData((Imu *)this);
-
-  ostringstream dev_name;
-  dev_name << "simu_imu_" << dev_id;
-  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+  
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
                         sizeof(imu_states_t));
   SetIsReady(true);
 }
 
-SimuImu::SimuImu(const IODevice *parent, string name, uint32_t dev_id)
+SimuImu::SimuImu(const IODevice *parent, string name, uint32_t modelId,uint32_t deviceId)
     : Imu(parent,name), Thread(parent, name, 0) {
   dataRate = NULL;
 
-  ostringstream dev_name;
-  dev_name << "simu_imu_" << dev_id;
-  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
                         sizeof(imu_states_t));
   SetIsReady(true);
@@ -62,4 +58,10 @@
   SafeStop();
   Join();
+}
+
+string SimuImu::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_imu_" << deviceId;
+  return dev_name.str().c_str();
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuImu.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuImu.h	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuImu.h	(revision 158)
@@ -42,9 +42,10 @@
   *
   * \param name name
-  * \param dev_id device id
+  * \param modelId Model id
+  * \param deviceId Imu id of the Model
   * \param priority priority of the Thread
   */
   SimuImu(std::string name,
-          uint32_t dev_id, uint8_t priority);
+          uint32_t modelId,uint32_t deviceId, uint8_t priority);
 
   /*!
@@ -56,7 +57,8 @@
   * \param parent parent
   * \param name name
-  * \param dev_id device id
+  * \param modelId Model id
+  * \param deviceId Imu id of the Model
   */
-  SimuImu(const core::IODevice *parent, std::string name, uint32_t dev_id);
+  SimuImu(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId);
 
   /*!
@@ -93,4 +95,6 @@
     float wz;
   } imu_states_t;
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
 
   gui::SpinBox *dataRate;
Index: trunk/lib/FlairSensorActuator/src/SimuLaser.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuLaser.cpp	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuLaser.cpp	(revision 158)
@@ -33,23 +33,19 @@
 
 SimuLaser::SimuLaser(string name,
-                     uint32_t dev_id, uint8_t priority)
+                     uint32_t modelId,uint32_t deviceId, uint8_t priority)
     : Thread(getFrameworkManager(), name, priority), LaserRangeFinder(name) {
   data_rate =
       new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
 
-  ostringstream dev_name;
-  dev_name << "simu_Laser_" << dev_id;
-  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
                         360 * sizeof(float));
   SetIsReady(true);
 }
 
-SimuLaser::SimuLaser(const IODevice *parent, string name, uint32_t dev_id)
+SimuLaser::SimuLaser(const IODevice *parent, string name, uint32_t modelId,uint32_t deviceId)
     : Thread(parent, name, 0), LaserRangeFinder(parent, name) {
   data_rate = NULL;
 
-  ostringstream dev_name;
-  dev_name << "simu_Laser_" << dev_id;
-  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
                         360 * sizeof(float));
   SetIsReady(true);
@@ -59,4 +55,10 @@
   SafeStop();
   Join();
+}
+
+string SimuLaser::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_laser_" << deviceId;
+  return dev_name.str().c_str();
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuLaser.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuLaser.h	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuLaser.h	(revision 158)
@@ -41,9 +41,10 @@
   *
   * \param name name
-  * \param dev_id device id
+  * \param modelId Model id
+  * \param deviceId LaserRangeFinder id of the Model
   * \param priority priority of the Thread
   */
   SimuLaser(std::string name,
-            uint32_t dev_id, uint8_t priority);
+            uint32_t modelId,uint32_t deviceId, uint8_t priority);
 
   /*!
@@ -55,7 +56,8 @@
   * \param parent parent
   * \param name name
-  * \param dev_id device id
+  * \param modelId Model id
+  * \param deviceId LaserRangeFinder id of the Model
   */
-  SimuLaser(const core::IODevice *parent, std::string name, uint32_t dev_id);
+  SimuLaser(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId);
 
   /*!
@@ -89,5 +91,6 @@
   */
   void Run(void);
-
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
   gui::SpinBox *data_rate;
 };
Index: trunk/lib/FlairSensorActuator/src/SimuUs.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuUs.cpp	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuUs.cpp	(revision 158)
@@ -32,5 +32,5 @@
 namespace sensor {
 
-SimuUs::SimuUs(string name, uint32_t dev_id,
+SimuUs::SimuUs(string name, uint32_t modelId,uint32_t deviceId,
                uint8_t priority)
     : Thread(getFrameworkManager(), name, priority), UsRangeFinder( name) {
@@ -38,18 +38,14 @@
       new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
 
-  ostringstream dev_name;
-  dev_name << "simu_us_" << dev_id;
-  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), sizeof(float));
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId), sizeof(float));
 
   SetIsReady(true);
 }
 
-SimuUs::SimuUs(const IODevice *parent, string name, uint32_t dev_id)
+SimuUs::SimuUs(const IODevice *parent, string name,uint32_t modelId,uint32_t deviceId)
     : Thread(parent, name, 0), UsRangeFinder(parent,name) {
   data_rate = NULL;
 
-  ostringstream dev_name;
-  dev_name << "simu_us_" << dev_id;
-  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), sizeof(float));
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId), sizeof(float));
   
   SetIsReady(true);
@@ -59,4 +55,10 @@
   SafeStop();
   Join();
+}
+
+string SimuUs::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_us_" << deviceId;
+  return dev_name.str().c_str();
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuUs.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuUs.h	(revision 157)
+++ trunk/lib/FlairSensorActuator/src/SimuUs.h	(revision 158)
@@ -41,9 +41,10 @@
   *
   * \param name name
-  * \param dev_id device id
+  * \param modelId Model id
+  * \param deviceId UsRangeFinder id of the Model
   * \param priority priority of the Thread
   */
   SimuUs(std::string name,
-         uint32_t dev_id, uint8_t priority);
+         uint32_t modelId,uint32_t deviceId, uint8_t priority);
 
   /*!
@@ -55,7 +56,8 @@
   * \param parent parent
   * \param name name
-  * \param dev_id device id
+  * \param modelId Model id
+  * \param deviceId UsRangeFinder id of the Model
   */
-  SimuUs(const core::IODevice *parent, std::string name, uint32_t dev_id);
+  SimuUs(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId);
 
   /*!
@@ -89,5 +91,6 @@
   */
   void Run(void);
-
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
   gui::SpinBox *data_rate;
 };
