Commit 883e9361 authored by Michael Ott's avatar Michael Ott
Browse files

Use the new scaling factor feature in DCDB::Sensor for actual scaling

parent b7853cbc
......@@ -95,16 +95,6 @@ void DCDBQuery::genOutput(DCDB::SensorDataStoreReading& reading)
}
}
/* Scale the value if requested */
if (scale) {
if (useFloatOutput) {
fvalue *= scalingFactor;
}
else {
ivalue *= scalingFactor;
}
}
/* Print the sensor's public name */
std::cout << sensorName << ",";
......@@ -179,6 +169,9 @@ void DCDBQuery::doQuery(const char* hostname, std::list<std::string> sensors, DC
std::list<DCDB::SensorDataStoreReading> results;
sensorName = *it;
DCDB::Sensor sensor(connection, sensorName);
if (scale) {
sensor.setScalingFactor(scalingFactor);
}
sensor.query(results, start, end);
for (std::list<DCDB::SensorDataStoreReading>::iterator reading = results.begin(); reading != results.end(); reading++) {
genOutput(*reading);
......
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