10.12., 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 14cb641a authored by Micha Müller's avatar Micha Müller

Pusher: ConfiguratorTemplateEntity: remove code to read in SensorGroups without associated Entity

parent 5c7ca5ab
......@@ -102,7 +102,7 @@ class ConfiguratorTemplateEntity : public ConfiguratorTemplate<SBase, SGroup> {
//read global variables (if present overwrite those from global.conf)
readGlobal(cfg);
//read groups and templates for groups. If present also entity/-template stuff
//read entities and template stuff
BOOST_FOREACH (boost::property_tree::iptree::value_type &val, cfg) {
//template entity
if (boost::iequals(val.first, "template_" + _entityName)) {
......@@ -199,51 +199,6 @@ class ConfiguratorTemplateEntity : public ConfiguratorTemplate<SBase, SGroup> {
delete entity;
}
}
//group
} else if (boost::iequals(val.first, _groupName)) {
LOG(debug) << _groupName << " \"" << val.second.data() << "\"";
if (!val.second.empty()) {
SG_Ptr group = std::make_shared<SGroup>(val.second.data());
if (readSensorGroup(*group, val.second)) {
storeSensorGroup(group);
} else {
LOG(warning) << _groupName << " \""
<< val.second.data() << "\" has bad values! Ignoring...";
}
}
//single sensor
} else if (boost::iequals(val.first, "single_" + _baseName)) {
LOG(debug) << "Single " << _baseName << " \"" << val.second.data() << "\"";
if (!val.second.empty()) {
SG_Ptr group = std::make_shared<SGroup>(val.second.data());
if (readSensorGroup(*group, val.second)) {
//group which consists of only one sensor
SB_Ptr sensor;
//perhaps one sensor is already present because it was copied from the template group
if (group->getDerivedSensors().size() != 0) {
sensor = group->getDerivedSensors()[0];
sensor->setName(val.second.data());
if (readSensorBase(*sensor, val.second)) {
storeSensorGroup(group);
} else {
LOG(warning) << "Single " << _baseName << " "
<< val.second.data() << " could not be read! Omitting";
}
} else {
sensor = std::make_shared<SBase>(val.second.data());
if (readSensorBase(*sensor, val.second)) {
group->pushBackSensor(sensor);
storeSensorGroup(group);
} else {
LOG(warning) << "Single " << _baseName << " "
<< val.second.data() << " could not be read! Omitting";
}
}
} else {
LOG(warning) << "Single " << _baseName << " \""
<< val.second.data() << "\" has bad values! Ignoring...";
}
}
} else if (!boost::iequals(val.first, "global")) {
LOG(error) << "\"" << val.first << "\": unknown construct!";
return false;
......
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