Fix the logic about display of calls already worked on band. Update ActiveStations when cbReadyOnly is toggled.

This commit is contained in:
Joe Taylor 2022-03-26 10:42:01 -04:00
parent 02961a2ccc
commit 3c3c450839
4 changed files with 21 additions and 6 deletions

View File

@ -4,6 +4,7 @@
#include <QApplication>
#include <QTextCharFormat>
#include <QDateTime>
#include <QDebug>
#include "SettingsGroup.hpp"
#include "qt_helpers.hpp"
@ -23,6 +24,7 @@ ActiveStations::ActiveStations(QSettings * settings, QFont const& font, QWidget
read_settings ();
ui->header_label2->setText(" N Call Grid Az S/N Freq Tx Age Pts");
connect(ui->RecentStationsPlainTextEdit, SIGNAL(selectionChanged()), this, SLOT(select()));
connect(ui->cbReadyOnly, SIGNAL(toggled(bool)), this, SLOT(on_cbReadyOnly_toggled(bool)));
}
ActiveStations::~ActiveStations()
@ -95,3 +97,9 @@ bool ActiveStations::readyOnly()
{
return ui->cbReadyOnly->isChecked();
}
void ActiveStations::on_cbReadyOnly_toggled(bool b)
{
m_bReadyOnly=b;
emit activeStationsDisplay();
}

View File

@ -29,13 +29,16 @@ public:
Q_SLOT void select();
bool m_clickOK=false;
bool m_bReadyOnly;
signals:
void callSandP(int nline);
void activeStationsDisplay();
private:
void read_settings ();
void write_settings ();
Q_SLOT void on_cbReadyOnly_toggled(bool b);
qint64 m_msec0=0;
QSettings * settings_;

View File

@ -2768,7 +2768,8 @@ void MainWindow::on_actionActiveStations_triggered()
m_ActiveStationsWidget->showNormal();
m_ActiveStationsWidget->raise();
m_ActiveStationsWidget->activateWindow();
connect(m_ActiveStationsWidget.data (), SIGNAL(callSandP(int)),this,SLOT(callSandP2(int)));
connect(m_ActiveStationsWidget.data(), SIGNAL(callSandP(int)),this,SLOT(callSandP2(int)));
connect(m_ActiveStationsWidget.data(), SIGNAL(activeStationsDisplay()),this,SLOT(ARRL_Digi_Display()));
}
void MainWindow::on_actionOpen_triggered() //Open File
@ -3451,7 +3452,7 @@ void MainWindow::ARRL_Digi_Display()
QString bands=m_activeCall[deCall].bands;
bool bWorkedOnBand=false;
if(m_currentBand=="160m" and bands.mid(0,1)!=".") bWorkedOnBand=true;
if(m_currentBand=="90m" and bands.mid(1,1)!=".") bWorkedOnBand=true;
if(m_currentBand=="80m" and bands.mid(1,1)!=".") bWorkedOnBand=true;
if(m_currentBand=="40m" and bands.mid(2,1)!=".") bWorkedOnBand=true;
if(m_currentBand=="20m" and bands.mid(3,1)!=".") bWorkedOnBand=true;
if(m_currentBand=="15m" and bands.mid(4,1)!=".") bWorkedOnBand=true;
@ -3518,6 +3519,7 @@ void MainWindow::callSandP2(int n)
void MainWindow::activeWorked(QString call, QString band)
{
QString bands=m_activeCall[call].bands;
// qDebug() << "cc" << band << call << bands;
QByteArray ba=bands.toLatin1();
if(band=="160m") ba[0]='a';
if(band=="80m") ba[1]='b';
@ -3527,6 +3529,7 @@ void MainWindow::activeWorked(QString call, QString band)
if(band=="10m") ba[5]='f';
if(band=="6m") ba[6]='g';
m_activeCall[call].bands=QString::fromLatin1(ba);
// qDebug() << "dd" << band << call << m_activeCall[call].bands;
}
void MainWindow::readFromStdout() //readFromStdout
@ -3668,9 +3671,10 @@ void MainWindow::readFromStdout() //readFromStdout
if((m_mode=="FT4" or m_mode=="FT8") and bDisplayPoints and decodedtext1.isStandardMessage()) {
QString deCall,deGrid;
decodedtext.deCallAndGrid(/*out*/deCall,deGrid);
bool bWorkedOnBand=(ui->decodedTextBrowser->CQPriority()!="New Call on Band");
bool bWorkedOnBand=(ui->decodedTextBrowser->CQPriority()!="New Call on Band") and ui->decodedTextBrowser->CQPriority()!="";
if(bWorkedOnBand) activeWorked(deCall,m_currentBand);
// qDebug() << "aa" << m_currentBand << deCall << bWorkedOnBand << m_activeCall[deCall].bands;
// qDebug() << "aa" << m_currentBand << deCall << bWorkedOnBand << m_activeCall[deCall].bands
// << ui->decodedTextBrowser->CQPriority();
}
if (m_config.highlight_DXcall () && (m_hisCall!="") && ((decodedtext.string().contains(QRegularExpression {"(\\w+) " + m_hisCall}))
@ -7597,7 +7601,7 @@ void MainWindow::transmit (double snr)
}
if((m_mode=="FT4" or m_mode=="FT8") and m_maxPoints>0 and SpecOp::ARRL_DIGI==m_config.special_op_id()) {
qDebug() << "dd" << m_maxPoints << m_deCall << m_deGrid;
// qDebug() << "DD" << m_maxPoints << m_deCall << m_deGrid;
ui->dxCallEntry->setText(m_deCall);
ui->dxGridEntry->setText(m_deGrid);
genStdMsgs("-10");

View File

@ -816,7 +816,7 @@ private:
void to_jt9(qint32 n, qint32 istart, qint32 idone);
bool is77BitMode () const;
void cease_auto_Tx_after_QSO ();
void ARRL_Digi_Display();
Q_SLOT void ARRL_Digi_Display();
void ARRL_Digi_Update(DecodedText dt);
void activeWorked(QString call, QString band);
};