Changeset 158 in flair-src for trunk/lib/FlairSensorActuator/src/SimuUs.cpp
- Timestamp:
- Mar 5, 2017, 10:50:56 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSensorActuator/src/SimuUs.cpp
r157 r158 32 32 namespace sensor { 33 33 34 SimuUs::SimuUs(string name, uint32_t dev_id,34 SimuUs::SimuUs(string name, uint32_t modelId,uint32_t deviceId, 35 35 uint8_t priority) 36 36 : Thread(getFrameworkManager(), name, priority), UsRangeFinder( name) { … … 38 38 new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50); 39 39 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)); 43 41 44 42 SetIsReady(true); 45 43 } 46 44 47 SimuUs::SimuUs(const IODevice *parent, string name, uint32_t dev_id)45 SimuUs::SimuUs(const IODevice *parent, string name,uint32_t modelId,uint32_t deviceId) 48 46 : Thread(parent, name, 0), UsRangeFinder(parent,name) { 49 47 data_rate = NULL; 50 48 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)); 54 50 55 51 SetIsReady(true); … … 59 55 SafeStop(); 60 56 Join(); 57 } 58 59 string 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(); 61 63 } 62 64
Note:
See TracChangeset
for help on using the changeset viewer.