Commit 13351bfc authored by Alessio Netti's avatar Alessio Netti
Browse files

Temporarily reverting commit 1a5e05a7

- Sensor/Group overwriting broke CPU sensor instantiation
- Looking for a more robust solution
parent a437efd2
...@@ -426,13 +426,13 @@ class ConfiguratorTemplate : public ConfiguratorInterface { ...@@ -426,13 +426,13 @@ class ConfiguratorTemplate : public ConfiguratorInterface {
* @param sGroup Group to store. * @param sGroup Group to store.
*/ */
void storeSensorGroup(SG_Ptr sGroup) { void storeSensorGroup(SG_Ptr sGroup) {
for (size_t i = 0; i < _sensorGroups.size(); ++i) { //for (size_t i = 0; i < _sensorGroups.size(); ++i) {
if (sGroup->getGroupName() == _sensorGroups[i]->getGroupName()) { // if (sGroup->getGroupName() == _sensorGroups[i]->getGroupName()) {
_sensorGroups[i] = sGroup; // _sensorGroups[i] = sGroup;
_sensorGroupInterfaces[i] = sGroup; // _sensorGroupInterfaces[i] = sGroup;
return; // return;
} // }
} //}
_sensorGroups.push_back(sGroup); _sensorGroups.push_back(sGroup);
_sensorGroupInterfaces.push_back(sGroup); _sensorGroupInterfaces.push_back(sGroup);
......
...@@ -191,13 +191,13 @@ class SensorGroupTemplate : public SensorGroupInterface { ...@@ -191,13 +191,13 @@ class SensorGroupTemplate : public SensorGroupInterface {
virtual void pushBackSensor(SBasePtr s) final override { virtual void pushBackSensor(SBasePtr s) final override {
//check if dynamic cast returns nullptr //check if dynamic cast returns nullptr
if (S_Ptr dSensor = std::dynamic_pointer_cast<S>(s)) { if (S_Ptr dSensor = std::dynamic_pointer_cast<S>(s)) {
for (size_t i = 0; i < _sensors.size(); ++i) { //for (size_t i = 0; i < _sensors.size(); ++i) {
if (dSensor->getName() == _sensors[i]->getName()) { // if (dSensor->getName() == _sensors[i]->getName()) {
_sensors[i] = dSensor; // _sensors[i] = dSensor;
_baseSensors[i] = s; // _baseSensors[i] = s;
return; // return;
} // }
} //}
_sensors.push_back(dSensor); _sensors.push_back(dSensor);
_baseSensors.push_back(s); _baseSensors.push_back(s);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment