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

    r157 r158  
    3333
    3434SimuBldc::SimuBldc(const IODevice *parent, Layout *layout, string name,
    35                    uint8_t motors_count, uint32_t dev_id)
     35                   uint8_t motors_count, uint32_t modelId,uint32_t deviceId)
    3636    : Bldc(parent, layout, name, motors_count) {
    37   ostringstream dev_name;
    38   dev_name << "simu_bldc_" << dev_id;
    3937  shmem =
    40       new SharedMem(this, dev_name.str().c_str(), motors_count * sizeof(float));
     38      new SharedMem(this, ShMemName(modelId, deviceId), motors_count * sizeof(float));
    4139
    4240  GroupBox *groupbox = new GroupBox(layout->NewRow(), "simubldc");
     
    4745
    4846SimuBldc::SimuBldc(const Object *parent, string name, uint8_t motors_count,
    49                    uint32_t dev_id)
     47                   uint32_t modelId,uint32_t deviceId)
    5048    : Bldc(parent, name, motors_count) {
    51   ostringstream dev_name;
    52   dev_name << "simu_bldc_" << dev_id;
    5349  shmem =
    54       new SharedMem(this, dev_name.str().c_str(), motors_count * sizeof(float));
     50      new SharedMem(this, ShMemName(modelId, deviceId), motors_count * sizeof(float));
    5551
    5652  // reset values
     
    6561
    6662SimuBldc::~SimuBldc() {}
     63
     64string SimuBldc::ShMemName(uint32_t modelId,uint32_t deviceId) {
     65  ostringstream dev_name;
     66  dev_name << "simu" <<  modelId << "_bldc_" << deviceId;
     67  return dev_name.str().c_str();
     68}
    6769
    6870void SimuBldc::SetMotors(float *value) {
Note: See TracChangeset for help on using the changeset viewer.