From 5fe433799512eb4a266609f804ad56fe91e046d1 Mon Sep 17 00:00:00 2001 From: Miikasda <47296738+miikasda@users.noreply.github.com> Date: Tue, 21 Nov 2023 23:44:26 +0200 Subject: [PATCH] Fix negative temperature readings We need to cast the reading first to integer, and then to double or else temperature values are not interpreted as signed integers --- src/worker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker.cpp b/src/worker.cpp index 5845a60..cadf138 100644 --- a/src/worker.cpp +++ b/src/worker.cpp @@ -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(itemList[4].toInt()) / 100.0; // Collect the data to sensor lists switch (sensor) {