Fixed time drifting sync for fast and turbo modes

This commit is contained in:
Jordan Sherer 2019-10-20 09:53:24 -04:00
parent e4d4487d23
commit e7e7b49a5d
2 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -2037,10 +2037,10 @@ background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #2ecc71, stop:1 #00FF
<string>Time Drift </string>
</property>
<property name="minimum">
<number>-15000</number>
<number>-30000</number>
</property>
<property name="maximum">
<number>15000</number>
<number>30000</number>
</property>
<property name="singleStep">
<number>100</number>