Commit d3561152 authored by Carla Guillen Carias's avatar Carla Guillen Carias
Browse files

PerSystSqlOperator: implementing metadata query. PerSystSqlConfigurator: small bugfix.

parent bc6dc415
......@@ -135,9 +135,9 @@ void PerSystSqlConfigurator::operatorAttributes(PerSystSqlOperator& op, CFG_VAL
} else if (boost::iequals(val.first, "mariadb_every_x_days")){
every_x_days = std::stoi(val.second.data());
}
if(backend == PerSystSqlOperator::MARIADB) {
op.setMariaDBConnection(host, user, password, database_name, port, rotation, every_x_days);
}
}
if(backend == PerSystSqlOperator::MARIADB) {
op.setMariaDBConnection(host, user, password, database_name, port, rotation, every_x_days);
}
}
......
......@@ -127,7 +127,12 @@ void PerSystSqlOperator::compute(U_Ptr unit, qeJobData& jobData) {
for (const auto& subUnit : unit->getSubUnits()) {
// Since we do not clear the internal buffer, all sensor readings will be accumulated in the same vector
for (const auto& in : subUnit->getInputs()) {
_scaling_factor = in->getMetadata()->scale;
if( _scaling_factor == 1){
SensorMetadata buffer;
if(_queryEngine.queryMetadata(in->getName(), buffer)){
_scaling_factor = buffer.scale;
}
}
if (!_queryEngine.querySensor(in->getName(), my_timestamp, my_timestamp, _buffer, false)) {
LOG(debug)<< "PerSystSql Operator " << _name << " cannot read from sensor " << in->getName() << "!";
}
......
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