From 6773768586f9ceb453caa057ccd7af832ecb47ac Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Thu, 5 Mar 2020 11:25:49 -0600 Subject: [PATCH] Clean up the timestamp adjustment logic, and make the threshold 0.5*TRperiod. --- widgets/mainwindow.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index be133016c..e0795d301 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -8746,11 +8746,13 @@ void MainWindow::write_all(QString txRx, QString message) t.sprintf("%5d",ui->TxFreqSpinBox->value()); if (txRx=="Tx") msg=" 0 0.0" + t + " " + message; auto time = QDateTime::currentDateTimeUtc (); - double tdec = fmod(double(time.time().second()),m_TRperiod); - if( txRx=="Rx" && tdec < 0.4*m_TRperiod ) { - tdec+=m_TRperiod; - } - if( txRx=="Rx" ) time = time.addSecs(-tdec); + if( txRx=="Rx" ) { + double tdec = fmod(double(time.time().second()),m_TRperiod); + if( tdec < 0.5*m_TRperiod ) { + tdec+=m_TRperiod; + } + time = time.addSecs(-tdec); + } t.sprintf("%10.3f ",m_freqNominal/1.e6); if (m_diskData) { if (m_fileDateTime.size()==11) {