From e84b426b79a709549ad24ba9a3525976fa8a4e56 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 6 Mar 2024 00:09:46 +0100 Subject: [PATCH] fix(cpn): initialisation of log viewer x-axis should use log time, not system time (#4691) --- companion/src/logsdialog.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/companion/src/logsdialog.cpp b/companion/src/logsdialog.cpp index 22cf51982..ebc5b1893 100644 --- a/companion/src/logsdialog.cpp +++ b/companion/src/logsdialog.cpp @@ -848,7 +848,7 @@ void LogsDialog::plotLogs() rowCount = ui->logTable->rowCount(); } - plots.min_x = QDateTime::currentDateTime().toTime_t(); + plots.min_x = INVALID_MIN; plots.max_x = 0; foreach (QTableWidgetItem *plot, ui->FieldsTW->selectedItems()) { @@ -891,8 +891,12 @@ void LogsDialog::plotLogs() .toTime_t(); } plotCoords.x.push_back(time); + + if(plots.min_x == INVALID_MIN) + plots.min_x = time; + else + if (plots.min_x > time) plots.min_x = time; - if (plots.min_x > time) plots.min_x = time; if (plots.max_x < time) plots.max_x = time; }