remove old fox rate queue mechanism. Update rates periodically

This commit is contained in:
Brian Moran 2023-04-26 08:25:02 -07:00
parent d307193e0a
commit db54472a5a
3 changed files with 16 additions and 14 deletions

View File

@ -161,7 +161,7 @@ FoxLog::impl::impl (Configuration const * configuration)
QString FoxLog::rate() 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_last_n(100),'f',0),
QString::number(this->rate_60m())); QString::number(this->rate_60m()));
} }

View File

@ -1147,6 +1147,7 @@ void MainWindow::on_the_minute ()
} else { } else {
tx_watchdog (false); tx_watchdog (false);
} }
MainWindow::update_foxLogWindow_rate(); // update the rate on the window
} }
//--------------------------------------------------- MainWindow destructor //--------------------------------------------------- MainWindow destructor
@ -4512,8 +4513,8 @@ void MainWindow::guiUpdate()
if(m_mode=="FT8" and SpecOp::FOX==m_specOp) { if(m_mode=="FT8" and SpecOp::FOX==m_specOp) {
// Don't allow Fox mode in any of the default FT8 sub-bands. // 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}; QVector<qint32> ft8Freq = {1840000,3573000,7074000,10136000,14074000,18100000,21074000,24915000,28074000,50313000,70154000};
for(int i=0; i<11; i++) { for(int i=0; i<ft8Freq.length()-1; i++) {
int kHzdiff=m_freqNominal - ft8Freq[i]; int kHzdiff=m_freqNominal - ft8Freq[i];
if(qAbs(kHzdiff) < 3000 ) { if(qAbs(kHzdiff) < 3000 ) {
m_bTxTime=false; m_bTxTime=false;
@ -10009,8 +10010,6 @@ list2Done:
writeFoxQSO (QString {" Log: %1 %2 %3 %4 %5"}.arg (m_hisCall).arg (m_hisGrid) writeFoxQSO (QString {" Log: %1 %2 %3 %4 %5"}.arg (m_hisCall).arg (m_hisGrid)
.arg (m_rptSent).arg (m_rptRcvd).arg (m_lastBand)); .arg (m_rptSent).arg (m_rptRcvd).arg (m_lastBand));
on_logQSOButton_clicked (); on_logQSOButton_clicked ();
m_foxRateQueue.enqueue (now); //Add present time in seconds
//to Rate queue.
QTimer::singleShot (13000, [=] { QTimer::singleShot (13000, [=] {
m_foxQSOinProgress.removeOne(hc1); //Remove from In Progress window m_foxQSOinProgress.removeOne(hc1); //Remove from In Progress window
updateFoxQSOsInProgressDisplay(); //Update InProgress display after Tx is complete updateFoxQSOsInProgressDisplay(); //Update InProgress display after Tx is complete
@ -10073,19 +10072,21 @@ Transmit:
} }
} }
while(!m_foxRateQueue.isEmpty()) {
qint64 age = now - m_foxRateQueue.head();
if(age < 3600) break;
m_foxRateQueue.dequeue();
}
if (m_foxLogWindow) if (m_foxLogWindow)
{ {
m_foxLogWindow->rate (m_foxRateQueue.size ()); MainWindow::update_foxLogWindow_rate();
m_foxLogWindow->queued (m_foxQSOinProgress.count ()); m_foxLogWindow->queued (m_foxQSOinProgress.count ());
} }
updateFoxQSOsInProgressDisplay(); updateFoxQSOsInProgressDisplay();
} }
void MainWindow::update_foxLogWindow_rate()
{
if (m_foxLogWindow) {
m_foxLogWindow->rate(m_logBook.fox_log()->rate());
}
}
void MainWindow::rm_tb4(QString houndCall) void MainWindow::rm_tb4(QString houndCall)
{ {
if(houndCall=="") return; if(houndCall=="") return;
@ -10240,6 +10241,7 @@ void MainWindow::foxTest()
return; return;
} }
QTextStream s(&f); QTextStream s(&f);
QTextStream sdiag(&fdiag); QTextStream sdiag(&fdiag);
@ -10299,14 +10301,14 @@ void MainWindow::foxTest()
m_houndQueue.swap(tmpQueue); m_houndQueue.swap(tmpQueue);
} }
if(line.contains("Rx:")) { if(line.contains("Rx:")) {
msg=line.mid(43); msg=line.mid(37+6);
t=msg.mid(24); t=msg.mid(24);
int i0=t.indexOf(" "); int i0=t.indexOf(" ");
hc1=t.mid(i0+1); hc1=t.mid(i0+1);
int i1=hc1.indexOf(" "); int i1=hc1.indexOf(" ");
hc1=hc1.mid(0,i1); hc1=hc1.mid(0,i1);
int i2=qMax(msg.indexOf("R+"),msg.indexOf("R-")); int i2=qMax(msg.indexOf("R+"),msg.indexOf("R-"));
if(i2>20) { if(i2>10) {
rptRcvd=msg.mid(i2,4); rptRcvd=msg.mid(i2,4);
foxRxSequencer(msg,hc1,rptRcvd); foxRxSequencer(msg,hc1,rptRcvd);
} }

View File

@ -745,7 +745,6 @@ private:
QQueue<QString> m_houndQueue; //Selected Hounds available for starting a QSO QQueue<QString> m_houndQueue; //Selected Hounds available for starting a QSO
QQueue<QString> m_foxQSOinProgress; //QSOs in progress: Fox has sent a report QQueue<QString> m_foxQSOinProgress; //QSOs in progress: Fox has sent a report
QQueue<qint64> m_foxRateQueue;
QDateTime m_dateTimeQSOOn; QDateTime m_dateTimeQSOOn;
QDateTime m_dateTimeLastTX; QDateTime m_dateTimeLastTX;
@ -865,6 +864,7 @@ private:
void foxTxSequencer(); void foxTxSequencer();
void foxGenWaveform(int i,QString fm); void foxGenWaveform(int i,QString fm);
void writeFoxQSO (QString const& msg); void writeFoxQSO (QString const& msg);
void update_foxLogWindow_rate();
void to_jt9(qint32 n, qint32 istart, qint32 idone); void to_jt9(qint32 n, qint32 istart, qint32 idone);
bool is77BitMode () const; bool is77BitMode () const;
void cease_auto_Tx_after_QSO (); void cease_auto_Tx_after_QSO ();