Ignore:
Timestamp:
Mar 5, 2017, 10:50:56 AM (8 years ago)
Author:
Sanahuja Guillaume
Message:

corrected simu/device id for sensors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSensorActuator/src/SimuCamera.cpp

    r157 r158  
    3333SimuCamera::SimuCamera(string name,
    3434                       uint16_t width, uint16_t height, uint8_t channels,
    35                        uint32_t dev_id, uint8_t priority)
     35                       uint32_t modelId,uint32_t deviceId, uint8_t priority)
    3636    : Thread(getFrameworkManager(), name, priority),
    3737      Camera(name, width, height, cvimage::Type::Format::BGR) {
     
    4343
    4444  ostringstream dev_name;
    45   dev_name << "simu_cam_" << dev_id;
    46   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), buf_size, SharedMem::Type::producerConsumer);
     45  dev_name << "simu" <<  modelId << "_cam_" << deviceId;
     46  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId), buf_size, SharedMem::Type::producerConsumer);
    4747 
    4848  SetIsReady(true);
     
    5151//simulation part
    5252SimuCamera::SimuCamera(const IODevice *parent, string name, uint16_t width,
    53                        uint16_t height, uint8_t channels, uint32_t dev_id)
     53                       uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId)
    5454    : Thread(parent, name, 0), Camera(parent,name) {
    5555
    5656  buf_size = width * height * channels+sizeof(Time);
    5757 
    58   ostringstream dev_name;
    59   dev_name << "simu_cam_" << dev_id;
    60   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
     58  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId),
    6159                        buf_size, SharedMem::Type::producerConsumer);
    6260  shmemReadBuf=NULL;
     
    6967  Join();
    7068  if(shmemReadBuf!=NULL) delete shmemReadBuf;
     69}
     70
     71string SimuCamera::ShMemName(uint32_t modelId,uint32_t deviceId) {
     72  ostringstream dev_name;
     73  dev_name << "simu" <<  modelId << "_cam_" << deviceId;
     74  return dev_name.str().c_str();
    7175}
    7276
Note: See TracChangeset for help on using the changeset viewer.