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

    r157 r158  
    3939
    4040SimuGps::SimuGps(string name,
    41                  NmeaGps::NMEAFlags_t NMEAFlags, uint32_t deviceId,uint8_t priority)
     41                 NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority)
    4242    : NmeaGps(name, NMEAFlags),Thread(getFrameworkManager(), name, priority) {
    4343
     
    4949  numberOfSatellites = new SpinBox(GetGroupBox()->NewRow(), "number of satellites", 1, 15, 1, 5);
    5050
    51   ostringstream dev_name;
    52   dev_name << "simu_gps_" << deviceId;
    53   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
     51  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
    5452                        sizeof(gps_states_t));
    5553                       
     
    5856
    5957
    60 SimuGps::SimuGps(const IODevice *parent, string name, uint32_t deviceId)
     58SimuGps::SimuGps(const IODevice *parent, string name, uint32_t modelId,uint32_t deviceId)
    6159    : NmeaGps(parent, name), Thread(parent, name, 0) {
    6260  dataRate = NULL;
    6361
    64   ostringstream dev_name;
    65   dev_name << "simu_gps_" << deviceId;
    66   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
     62  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId),
    6763                        sizeof(gps_states_t));
    6864 
     
    7369  SafeStop();
    7470  Join();
     71}
     72
     73string SimuGps::ShMemName(uint32_t modelId,uint32_t deviceId) {
     74  ostringstream dev_name;
     75  dev_name << "simu" <<  modelId << "_gps_" << deviceId;
     76  return dev_name.str().c_str();
    7577}
    7678
Note: See TracChangeset for help on using the changeset viewer.