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

corrected simu/device id for sensors

File:
1 edited

Legend:

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

    r157 r158  
    3333
    3434SimuLaser::SimuLaser(string name,
    35                      uint32_t dev_id, uint8_t priority)
     35                     uint32_t modelId,uint32_t deviceId, uint8_t priority)
    3636    : Thread(getFrameworkManager(), name, priority), LaserRangeFinder(name) {
    3737  data_rate =
    3838      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
    3939
    40   ostringstream dev_name;
    41   dev_name << "simu_Laser_" << dev_id;
    42   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
     40  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
    4341                        360 * sizeof(float));
    4442  SetIsReady(true);
    4543}
    4644
    47 SimuLaser::SimuLaser(const IODevice *parent, string name, uint32_t dev_id)
     45SimuLaser::SimuLaser(const IODevice *parent, string name, uint32_t modelId,uint32_t deviceId)
    4846    : Thread(parent, name, 0), LaserRangeFinder(parent, name) {
    4947  data_rate = NULL;
    5048
    51   ostringstream dev_name;
    52   dev_name << "simu_Laser_" << dev_id;
    53   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
     49  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
    5450                        360 * sizeof(float));
    5551  SetIsReady(true);
     
    5955  SafeStop();
    6056  Join();
     57}
     58
     59string SimuLaser::ShMemName(uint32_t modelId,uint32_t deviceId) {
     60  ostringstream dev_name;
     61  dev_name << "simu" <<  modelId << "_laser_" << deviceId;
     62  return dev_name.str().c_str();
    6163}
    6264
Note: See TracChangeset for help on using the changeset viewer.