From 4d9c9e08e2e101cae5ae0fc78b5d685cd08d0e35 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 11 Mar 2020 16:03:51 -0400 Subject: [PATCH] If 47-buffer call takes too long, start the 50-buffer call late. --- widgets/mainwindow.cpp | 27 +++++++++++++++++++++++++-- widgets/mainwindow.h | 1 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 937402332..7119ff17a 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -1415,8 +1415,27 @@ void MainWindow::dataSink(qint64 frames) to_jt9(m_ihsym); //Allow jt9 to bail out early, if necessary } + /* if(m_ihsym==m_hsymStop or (m_mode=="FT8" and m_ihsym==m_earlyDecode and !m_diskData) or (m_mode=="FT8" and m_ihsym==m_earlyDecode2 and !m_diskData)) { + */ + + bool bCallDecoder=false; + if(m_ihsym==m_hsymStop) bCallDecoder=true; + if(m_mode=="FT8" and !m_diskData) { + if(m_ihsym==m_earlyDecode) bCallDecoder=true; + if(m_ihsym==m_earlyDecode2) bCallDecoder=true; + if(m_ihsym>m_hsymStop and !m_bStart3) { + auto now = QDateTime::currentDateTimeUtc(); + double tseq = fmod(double(now.toMSecsSinceEpoch() ),1000.0*m_TRperiod)/1000.0; + if(tseq < 0.5*m_TRperiod) tseq+= m_TRperiod; + if(m_ihsym==m_earlyDecode) qDebug() << ""; + qDebug() << "cc" << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz") + << tseq << m_ihsym << m_ndepth << from_jt9(); + bCallDecoder=true; + } + } + if(bCallDecoder) { if(m_mode=="Echo") { float snr=0; int nfrit=0; @@ -2997,13 +3016,16 @@ void MainWindow::decode() //decode() dec_data.params.mycall,dec_data.params.hiscall,8000,12,12))); } else { memcpy(to, from, qMin(mem_jt9->size(), size)); - if(m_mode=="FT8") to_jt9(m_ihsym); //Send m_ihsym to jt9[.exe] + if(m_mode=="FT8") { + to_jt9(m_ihsym); //Send m_ihsym to jt9[.exe] + if(m_ihsym>=m_hsymStop) m_bStart3=true; + } QFile {m_config.temp_dir ().absoluteFilePath (".lock")}.remove (); // Allow jt9 to start auto now = QDateTime::currentDateTimeUtc(); double tseq = fmod(double(now.toMSecsSinceEpoch() ),1000.0*m_TRperiod)/1000.0; if(tseq < 0.5*m_TRperiod) tseq+= m_TRperiod; - if(m_ihsym==41) qDebug() << ""; + if(m_ihsym==m_earlyDecode) qDebug() << ""; qDebug() << "aa" << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz") << tseq << m_ihsym << m_ndepth << from_jt9(); decodeBusy(true); @@ -3078,6 +3100,7 @@ void MainWindow::decodeDone () m_blankLine=true; if(m_mode=="FT8" and dec_data.params.nzhsym==m_earlyDecode) m_blankLine=false; if(m_mode=="FT8" and dec_data.params.nzhsym==m_earlyDecode2) m_blankLine=false; + if(m_mode=="FT8" and m_bStart3) m_bStart3=false; if(SpecOp::FOX == m_config.special_op_id()) houndCallers(); auto now = QDateTime::currentDateTimeUtc(); diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h index 2a257a448..d0e35e72e 100644 --- a/widgets/mainwindow.h +++ b/widgets/mainwindow.h @@ -675,6 +675,7 @@ private: bool m_PwrBandSetOK; bool m_bVHFwarned; bool m_bDisplayedOnce; + bool m_bStart3=false; Frequency m_lastMonitoredFrequency; double m_toneSpacing; int m_firstDecode;