diff --git a/widgets/activeStations.cpp b/widgets/activeStations.cpp index ddbc40389..a825d11f8 100644 --- a/widgets/activeStations.cpp +++ b/widgets/activeStations.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "SettingsGroup.hpp" #include "qt_helpers.hpp" @@ -20,7 +21,7 @@ ActiveStations::ActiveStations(QSettings * settings, QFont const& font, QWidget ui->RecentStationsPlainTextEdit->setReadOnly (true); changeFont (font); read_settings (); - ui->header_label2->setText(" Call Grid Age Points"); + ui->header_label2->setText(" N Call Grid Tx Age Points"); connect(ui->RecentStationsPlainTextEdit, &QPlainTextEdit::selectionChanged, this, select); } @@ -69,6 +70,9 @@ int ActiveStations::maxAge() void ActiveStations::select() { + qint64 msec=QDateTime::currentMSecsSinceEpoch(); + if((msec-m_msec0)<500) return; + m_msec0=msec; int nline=ui->RecentStationsPlainTextEdit->textCursor().blockNumber(); emit callSandP(nline); } diff --git a/widgets/activeStations.h b/widgets/activeStations.h index 48144880c..b6ccf9058 100644 --- a/widgets/activeStations.h +++ b/widgets/activeStations.h @@ -31,7 +31,8 @@ signals: private: void read_settings (); void write_settings (); -// void setContentFont (QFont const&); + + qint64 m_msec0=0; QSettings * settings_; QScopedPointer ui; diff --git a/widgets/activeStations.ui b/widgets/activeStations.ui index 64d0db2de..563a3898f 100644 --- a/widgets/activeStations.ui +++ b/widgets/activeStations.ui @@ -36,7 +36,7 @@ Max Age - 4 + 0 10 @@ -64,7 +64,7 @@ Max Recent - 20 + 50 10 diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index a1147ca3a..9ca3ae7f6 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3402,6 +3402,7 @@ void MainWindow::ARRL_Digi_Update(DecodedText dt) rc.audioFreq=dt.frequencyOffset(); rc.snr=dt.snr(); m_latestDecodeTime=dt.timeInSeconds(); + rc.txEven = (m_latestDecodeTime % int(2*m_TRperiod)) > 0; rc.ready2call=false; bool bCQ=dt.messageWords()[0].left(3)=="CQ "; if(bCQ or deGrid=="RR73" or deGrid=="73") rc.ready2call=true; @@ -3427,8 +3428,10 @@ void MainWindow::ARRL_Digi_Display() icall.next(); deCall=icall.key(); age=int((m_latestDecodeTime - icall.value().decodeTime)/m_TRperiod + 0.5); + int itx=1; + if(icall.value().txEven) itx=0; if(age>maxAge) { -// qDebug() << "bb" << i << deCall << "removed"; + qDebug() << "bb" << i << deCall << "removed"; icall.remove(); } else { i++; @@ -3436,7 +3439,7 @@ void MainWindow::ARRL_Digi_Display() if(points>maxPoints) maxPoints=points; pts[i-1]=points - float(age)/(maxAge+1); QString t1; - t1 = t1.asprintf(" %2d %5d",age,points); + t1 = t1.asprintf(" %2d %2d %5d",itx,age,points); t1 = (deCall + " ").left(6) + " " + m_activeCall[deCall].grid4 + t1; list.append(t1); } @@ -3449,15 +3452,17 @@ void MainWindow::ARRL_Digi_Display() int k=indx[j]-1; m_ready2call[i]=list[k]; i++; - t += (list[k] + "\n"); + QString t1=QString::number(i) + ". "; + if(i<10) t1=" " + t1; + t += (t1 + list[k] + "\n"); } if(m_ActiveStationsWidget!=NULL) m_ActiveStationsWidget->displayRecentStations(t); } void MainWindow::callSandP2(int n) { + if(m_ready2call[n]=="") return; QStringList w=m_ready2call[n].split(' ', SkipEmptyParts); - m_deCall=w[0]; //### needed? m_deGrid=w[1]; //### needed? m_bDoubleClicked=true; //### needed? @@ -3465,8 +3470,10 @@ void MainWindow::callSandP2(int n) ui->dxGridEntry->setText(m_deGrid); genStdMsgs("-10"); //### real SNR would be better here? setTxMsg(3); - + m_txFirst = (w[2]=="0"); + ui->txFirstCheckBox->setChecked(m_txFirst); if (!ui->autoButton->isChecked()) ui->autoButton->click(); // Enable Tx + if(m_transmitting) m_restart=true; } void MainWindow::readFromStdout() //readFromStdout diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h index 508a508b1..47a4f13fc 100644 --- a/widgets/mainwindow.h +++ b/widgets/mainwindow.h @@ -648,7 +648,7 @@ private: QString m_BestCQpriority; QString m_deCall; QString m_deGrid; - QString m_ready2call[20]; + QString m_ready2call[50]; QSet m_pfx; QSet m_sfx; @@ -690,6 +690,7 @@ private: qint32 audioFreq; qint32 snr; qint32 decodeTime; + bool txEven; bool ready2call; }; QMap m_recentCall; //Key = callsign, value = snr, dialFreq, audioFreq, decodeTime