Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
883e9361
Commit
883e9361
authored
Apr 28, 2017
by
Michael Ott
Browse files
Use the new scaling factor feature in DCDB::Sensor for actual scaling
parent
b7853cbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/dcdbquery/query.cpp
View file @
883e9361
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment