Skip to content

Commit

Permalink
Fix negative temperature readings
Browse files Browse the repository at this point in the history
We need to cast the reading first to integer, and then to double
or else temperature values are not interpreted as signed integers
  • Loading branch information
miikasda committed Nov 21, 2023
1 parent 306cb10 commit 5fe4337
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void worker::inputRawData() {
QVariantList itemList = item.toList();
int sensor = itemList[1].toInt();
int timestamp = itemList[3].toInt();
double value = itemList[4].toDouble() / 100.0;
double value = static_cast<double>(itemList[4].toInt()) / 100.0;

// Collect the data to sensor lists
switch (sensor) {
Expand Down

0 comments on commit 5fe4337

Please sign in to comment.