From 34441618f864b83e135ed10e4eff8a076b5d1fc6 Mon Sep 17 00:00:00 2001 From: Jim Taylor Date: Sat, 27 Aug 2016 12:35:51 -0400 Subject: [PATCH] =?UTF-8?q?Skip=20first=20record=20when=20calculating=20re?= =?UTF-8?q?play=20speed=20and=20set=20minimum=20repla=E2=80=A6=20(#3715)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Skip first record when calculating replay speed and set minimum replay speed to 100 ms. Fixes issue 3708 * Cosmetics --- companion/src/simulation/telemetrysimu.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/companion/src/simulation/telemetrysimu.cpp b/companion/src/simulation/telemetrysimu.cpp index aff8fee51..f36e95ab3 100644 --- a/companion/src/simulation/telemetrysimu.cpp +++ b/companion/src/simulation/telemetrysimu.cpp @@ -651,14 +651,15 @@ QDateTime TelemetrySimulator::LogPlaybackController::parseTransmittterTimestamp( void TelemetrySimulator::LogPlaybackController::calcLogFrequency() { // examine up to 20 rows to determine log frequency in seconds + // Skip the first entry which contains the file open time logFrequency = 25.5; // default value QDateTime lastTime; - for (int i = 1; (i < 20) && (i < csvRecords.count()); i++) + for (int i = 2; (i < 21) && (i < csvRecords.count()); i++) { QDateTime logTime = parseTransmittterTimestamp(csvRecords[i]); // ugh - no timespan in this Qt version double timeDiff = (logTime.toMSecsSinceEpoch() - lastTime.toMSecsSinceEpoch()) / 1000.0; - if ((timeDiff > 0) && (timeDiff < logFrequency)) { + if ((timeDiff > 0.1) && (timeDiff < logFrequency)) { logFrequency = timeDiff; } lastTime = logTime;