From db54472a5aa6375f51bceff1a4f88a0b8001026b Mon Sep 17 00:00:00 2001 From: Brian Moran Date: Wed, 26 Apr 2023 08:25:02 -0700 Subject: [PATCH] remove old fox rate queue mechanism. Update rates periodically --- models/FoxLog.cpp | 2 +- widgets/mainwindow.cpp | 26 ++++++++++++++------------ widgets/mainwindow.h | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/models/FoxLog.cpp b/models/FoxLog.cpp index b78a7f38d..d0754e61f 100644 --- a/models/FoxLog.cpp +++ b/models/FoxLog.cpp @@ -161,7 +161,7 @@ FoxLog::impl::impl (Configuration const * configuration) QString FoxLog::rate() { - return QString("Last_10: %1, Last_100: %2, Last_60m:%3").arg(QString::number(this->rate_last_n(10),'f',0), + return QString("Last_10: %1, Last_100: %2, Last_60m: %3").arg(QString::number(this->rate_last_n(10),'f',0), QString::number(this->rate_last_n(100),'f',0), QString::number(this->rate_60m())); } diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index beeb4b914..de7fbb822 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -1147,6 +1147,7 @@ void MainWindow::on_the_minute () } else { tx_watchdog (false); } + MainWindow::update_foxLogWindow_rate(); // update the rate on the window } //--------------------------------------------------- MainWindow destructor @@ -4512,8 +4513,8 @@ void MainWindow::guiUpdate() if(m_mode=="FT8" and SpecOp::FOX==m_specOp) { // Don't allow Fox mode in any of the default FT8 sub-bands. - qint32 ft8Freq[]={1840000,3573000,7074000,10136000,14074000,18100000,21074000,24915000,28074000,50313000,70154000}; - for(int i=0; i<11; i++) { + QVector ft8Freq = {1840000,3573000,7074000,10136000,14074000,18100000,21074000,24915000,28074000,50313000,70154000}; + for(int i=0; irate (m_foxRateQueue.size ()); + MainWindow::update_foxLogWindow_rate(); m_foxLogWindow->queued (m_foxQSOinProgress.count ()); } updateFoxQSOsInProgressDisplay(); } +void MainWindow::update_foxLogWindow_rate() +{ + if (m_foxLogWindow) { + m_foxLogWindow->rate(m_logBook.fox_log()->rate()); + } +} + void MainWindow::rm_tb4(QString houndCall) { if(houndCall=="") return; @@ -10240,6 +10241,7 @@ void MainWindow::foxTest() return; } + QTextStream s(&f); QTextStream sdiag(&fdiag); @@ -10299,14 +10301,14 @@ void MainWindow::foxTest() m_houndQueue.swap(tmpQueue); } if(line.contains("Rx:")) { - msg=line.mid(43); + msg=line.mid(37+6); t=msg.mid(24); int i0=t.indexOf(" "); hc1=t.mid(i0+1); int i1=hc1.indexOf(" "); hc1=hc1.mid(0,i1); int i2=qMax(msg.indexOf("R+"),msg.indexOf("R-")); - if(i2>20) { + if(i2>10) { rptRcvd=msg.mid(i2,4); foxRxSequencer(msg,hc1,rptRcvd); } diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h index 30f4b923b..6259d2d12 100644 --- a/widgets/mainwindow.h +++ b/widgets/mainwindow.h @@ -745,7 +745,6 @@ private: QQueue m_houndQueue; //Selected Hounds available for starting a QSO QQueue m_foxQSOinProgress; //QSOs in progress: Fox has sent a report - QQueue m_foxRateQueue; QDateTime m_dateTimeQSOOn; QDateTime m_dateTimeLastTX; @@ -865,6 +864,7 @@ private: void foxTxSequencer(); void foxGenWaveform(int i,QString fm); void writeFoxQSO (QString const& msg); + void update_foxLogWindow_rate(); void to_jt9(qint32 n, qint32 istart, qint32 idone); bool is77BitMode () const; void cease_auto_Tx_after_QSO ();