Commit 231b0fa1 authored by Carla Guillen's avatar Carla Guillen
Browse files

Removing position from config file (done automatically)

parent d918fe50
......@@ -28,7 +28,7 @@
#include "SMUCNGPerfConfigurator.h"
SMUCNGPerfConfigurator::SMUCNGPerfConfigurator() : OperatorConfiguratorTemplate(){
SMUCNGPerfConfigurator::SMUCNGPerfConfigurator() : OperatorConfiguratorTemplate(), _vector_position(0) {
_operatorName = "supermucngperf";
_baseName = "sensor";
_metricMap["INSTRUCTIONS"]=SMUCSensorBase::INSTRUCTIONS;
......@@ -141,24 +141,20 @@ bool endsWith (std::string const &fullString, std::string const &ending) {
}
void SMUCNGPerfConfigurator::sensorBase(SMUCSensorBase& s, CFG_VAL config) {
BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config) {
if (boost::iequals(val.first, "position")) {
unsigned int position = std::stoul(val.second.data());
s.setPosition(position);
std::string name = s.getName();
for (auto & kv : _metricMap){
if(endsWith(name,kv.first)){
_metricToPosition[kv.second] = position;
s.setMetric(kv.second);
break;
}
std::string name = s.getName();
for (auto & kv : _metricMap) {
if(endsWith(name,kv.first)) {
_metricToPosition[kv.second] = _vector_position;
s.setMetric(kv.second);
break;
}
}
}
}
_vector_position++;
}
void SMUCNGPerfConfigurator::operatorAttributes(SMUCNGPerfOperator& op, CFG_VAL config){
op.setMetricToPosition(_metricToPosition);
_vector_position = 0;
BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config)
{
if (boost::iequals(val.first, "measuring_interval")){
......
......@@ -41,6 +41,7 @@ private:
bool unit(UnitTemplate<SMUCSensorBase>& u) override;
std::map<SMUCSensorBase::Metric_t, unsigned int> _metricToPosition;
std::map<std::string, SMUCSensorBase::Metric_t> _metricMap;
int _vector_position;
};
extern "C" OperatorConfiguratorInterface* create() {
......
Supports Markdown
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