From e7e7b49a5dd19ab61a968b7ce006f76fd8ece717 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Sun, 20 Oct 2019 09:53:24 -0400 Subject: [PATCH] Fixed time drifting sync for fast and turbo modes --- mainwindow.cpp | 8 ++++---- mainwindow.ui | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index e608315..9efb846 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -8616,8 +8616,8 @@ void MainWindow::on_driftSyncButton_clicked(){ auto now = QDateTime::currentDateTimeUtc(); int n = 0; - int nPos = 15 - now.time().second() % m_TRperiod; - int nNeg = now.time().second() % m_TRperiod - 15; + int nPos = m_TRperiod - (now.time().second() % m_TRperiod); + int nNeg = (now.time().second() % m_TRperiod) - m_TRperiod; if(abs(nNeg) < nPos){ n = nNeg; @@ -8632,8 +8632,8 @@ void MainWindow::on_driftSyncEndButton_clicked(){ auto now = QDateTime::currentDateTimeUtc(); int n = 0; - int nPos = 15 - now.time().second() % m_TRperiod; - int nNeg = now.time().second() % m_TRperiod - 15; + int nPos = m_TRperiod - (now.time().second() % m_TRperiod); + int nNeg = (now.time().second() % m_TRperiod) - m_TRperiod; if(abs(nNeg) < nPos){ n = nNeg + 2; diff --git a/mainwindow.ui b/mainwindow.ui index c50f385..0e4c316 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -2037,10 +2037,10 @@ background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #2ecc71, stop:1 #00FF Time Drift - -15000 + -30000 - 15000 + 30000 100