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/SimuUs.cpp

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