The "Best S+P" button is now functional. Needs testing!

This commit is contained in:
Joe Taylor 2019-04-08 12:36:05 -04:00
parent ec97d0410e
commit b6032277d0
6 changed files with 48 additions and 10 deletions

View File

@ -5,7 +5,8 @@ SOURCES += \
models/Modes.cpp \ models/Modes.cpp \
models/IARURegions.cpp \ models/IARURegions.cpp \
models/FoxLog.cpp \ models/FoxLog.cpp \
models/CabrilloLog.cpp models/CabrilloLog.cpp \
models/DecodeHighlightingModel.cpp
HEADERS += \ HEADERS += \
models/Bands.hpp \ models/Bands.hpp \
@ -15,4 +16,5 @@ HEADERS += \
models/IARURegions.hpp \ models/IARURegions.hpp \
models/FoxLog.hpp \ models/FoxLog.hpp \
models/CabrilloLog.hpp \ models/CabrilloLog.hpp \
models/FontOverrideModel.hpp models/FontOverrideModel.hpp \
models/DecodeHighlightingModel.hpp

View File

@ -374,6 +374,7 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons
appendage += countryName; appendage += countryName;
} }
} }
m_CQPriority=DecodeHighlightingModel::highlight_name(top_highlight);
// use a nbsp to save the start of appended text so we can find // use a nbsp to save the start of appended text so we can find
// it again later, align appended data at a fixed column if // it again later, align appended data at a fixed column if
@ -423,6 +424,7 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"};
if(!dxGrid.contains(grid_regexp)) dxGrid=""; if(!dxGrid.contains(grid_regexp)) dxGrid="";
message = message.left (message.indexOf (QChar::Nbsp)); // strip appended info message = message.left (message.indexOf (QChar::Nbsp)); // strip appended info
m_CQPriority="";
if (CQcall) if (CQcall)
{ {
if (displayDXCCEntity) if (displayDXCCEntity)
@ -447,6 +449,7 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
set_colours (m_config, &bg, &fg, types); set_colours (m_config, &bg, &fg, types);
} }
} }
appendText (message.trimmed (), bg, fg, decodedText.call (), dxCall); appendText (message.trimmed (), bg, fg, decodedText.call (), dxCall);
} }

View File

@ -35,6 +35,7 @@ public:
void displayQSY(QString text); void displayQSY(QString text);
void displayFoxToBeCalled(QString t, QColor bg = QColor {}, QColor fg = QColor {}); void displayFoxToBeCalled(QString t, QColor bg = QColor {}, QColor fg = QColor {});
void new_period (); void new_period ();
QString CQPriority(){return m_CQPriority;};
Q_SIGNAL void selectCallsign (Qt::KeyboardModifiers); Q_SIGNAL void selectCallsign (Qt::KeyboardModifiers);
Q_SIGNAL void erased (); Q_SIGNAL void erased ();
@ -51,6 +52,7 @@ private:
Configuration const * m_config; Configuration const * m_config;
bool m_bPrincipalPrefix; bool m_bPrincipalPrefix;
QString m_CQPriority;
QString appendWorkedB4(QString message, QString callsign QString appendWorkedB4(QString message, QString callsign
, QString const& grid, QColor * bg, QColor * fg , QString const& grid, QColor * bg, QColor * fg
, LogBook const& logBook, QString const& currentBand , LogBook const& logBook, QString const& currentBand

View File

@ -979,7 +979,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
QTimer::singleShot (0, this, SLOT (not_GA_warning_message ())); QTimer::singleShot (0, this, SLOT (not_GA_warning_message ()));
} }
ui->pbCallBest->setVisible(m_mode=="FT4"); ui->pbBestSP->setVisible(m_mode=="FT4");
if(!ui->cbMenus->isChecked()) { if(!ui->cbMenus->isChecked()) {
ui->cbMenus->setChecked(true); ui->cbMenus->setChecked(true);
ui->cbMenus->setChecked(false); ui->cbMenus->setChecked(false);
@ -2885,7 +2885,10 @@ void MainWindow::decode() //decode()
if(m_mode=="FT8") dec_data.params.lft8apon = ui->actionEnable_AP_FT8->isVisible () && if(m_mode=="FT8") dec_data.params.lft8apon = ui->actionEnable_AP_FT8->isVisible () &&
ui->actionEnable_AP_FT8->isChecked (); ui->actionEnable_AP_FT8->isChecked ();
if(m_mode=="FT8") dec_data.params.napwid=50; if(m_mode=="FT8") dec_data.params.napwid=50;
if(m_mode=="FT4") dec_data.params.nmode=5; if(m_mode=="FT4") {
dec_data.params.nmode=5;
m_BestCQpriority="";
}
dec_data.params.ntrperiod=m_TRperiod; dec_data.params.ntrperiod=m_TRperiod;
dec_data.params.nsubmode=m_nSubMode; dec_data.params.nsubmode=m_nSubMode;
if(m_mode=="QRA64") dec_data.params.nsubmode=100 + m_nSubMode; if(m_mode=="QRA64") dec_data.params.nsubmode=100 + m_nSubMode;
@ -3104,6 +3107,17 @@ void MainWindow::readFromStdout() //readFromStdout
ui->decodedTextBrowser->displayDecodedText(decodedtext0,m_baseCall,m_mode,m_config.DXCC(), ui->decodedTextBrowser->displayDecodedText(decodedtext0,m_baseCall,m_mode,m_config.DXCC(),
m_logBook,m_currentBand,m_config.ppfx(), m_logBook,m_currentBand,m_config.ppfx(),
(ui->cbCQonly->isVisible() and ui->cbCQonly->isChecked())); (ui->cbCQonly->isVisible() and ui->cbCQonly->isChecked()));
if(m_bBestSPArmed and m_mode=="FT4") {
QString messagePriority=ui->decodedTextBrowser->CQPriority();
if(messagePriority!="") {
if(messagePriority=="New Call on Band"
and m_BestCQpriority!="New Call on Band"
and m_BestCQpriority!="New Multiplier") {
m_BestCQpriority="New Call on Band";
processMessage(decodedtext0);
}
}
}
} }
} }
@ -3135,9 +3149,10 @@ void MainWindow::readFromStdout() //readFromStdout
if (bDisplayRight) { if (bDisplayRight) {
// This msg is within 10 hertz of our tuned frequency, or a JT4 or JT65 avg, // This msg is within 10 hertz of our tuned frequency, or a JT4 or JT65 avg,
// or contains MyCall // or contains MyCall
ui->decodedTextBrowser2->displayDecodedText(decodedtext0,m_baseCall,m_mode,m_config.DXCC(), if(!m_bBestSPArmed or m_mode!="FT4") {
m_logBook,m_currentBand,m_config.ppfx()); ui->decodedTextBrowser2->displayDecodedText(decodedtext0,m_baseCall,m_mode,m_config.DXCC(),
m_logBook,m_currentBand,m_config.ppfx());
}
if(m_mode!="JT4") { if(m_mode!="JT4") {
bool b65=decodedtext.isJT65(); bool b65=decodedtext.isJT65();
if(b65 and m_modeTx!="JT65") on_pbTxMode_clicked(); if(b65 and m_modeTx!="JT65") on_pbTxMode_clicked();
@ -3614,6 +3629,13 @@ void MainWindow::guiUpdate()
m_ntx=1; m_ntx=1;
ui->txrb1->setChecked(true); ui->txrb1->setChecked(true);
} }
if(m_mode=="FT4" and m_bBestSPArmed) {
m_BestCQpriority="";
m_bBestSPArmed=false;
ui->pbBestSP->setStyleSheet ("");
}
if(m_ntx == 1) ba=ui->tx1->text().toLocal8Bit(); if(m_ntx == 1) ba=ui->tx1->text().toLocal8Bit();
if(m_ntx == 2) ba=ui->tx2->text().toLocal8Bit(); if(m_ntx == 2) ba=ui->tx2->text().toLocal8Bit();
if(m_ntx == 3) ba=ui->tx3->text().toLocal8Bit(); if(m_ntx == 3) ba=ui->tx3->text().toLocal8Bit();
@ -5575,7 +5597,7 @@ void MainWindow::displayWidgets(qint64 n)
if(i==32) ui->cbCQonly->setVisible(b); if(i==32) ui->cbCQonly->setVisible(b);
j=j>>1; j=j>>1;
} }
ui->pbCallBest->setVisible(m_mode=="FT4"); ui->pbBestSP->setVisible(m_mode=="FT4");
b=SpecOp::EU_VHF==m_config.special_op_id() or (SpecOp::RTTY==m_config.special_op_id() and b=SpecOp::EU_VHF==m_config.special_op_id() or (SpecOp::RTTY==m_config.special_op_id() and
(m_config.RTTY_Exchange()=="DX" or m_config.RTTY_Exchange()=="SCC")); (m_config.RTTY_Exchange()=="DX" or m_config.RTTY_Exchange()=="SCC"));
ui->sbSerialNumber->setVisible(b); ui->sbSerialNumber->setVisible(b);
@ -8671,3 +8693,9 @@ void MainWindow::chkFT4()
on_contest_log_action_triggered(); on_contest_log_action_triggered();
} }
} }
void MainWindow::on_pbBestSP_clicked()
{
ui->pbBestSP->setStyleSheet ("QPushButton{color:red}");
m_bBestSPArmed=true;
}

View File

@ -312,6 +312,7 @@ private slots:
void on_comboBoxHoundSort_activated (int index); void on_comboBoxHoundSort_activated (int index);
void not_GA_warning_message (); void not_GA_warning_message ();
void checkMSK144ContestType(); void checkMSK144ContestType();
void on_pbBestSP_clicked();
int setTxMsg(int n); int setTxMsg(int n);
bool stdCall(QString const& w); bool stdCall(QString const& w);
@ -520,6 +521,7 @@ private:
bool m_bCheckedContest; bool m_bCheckedContest;
bool m_bWarnedSplit=false; bool m_bWarnedSplit=false;
bool m_bTUmsg; bool m_bTUmsg;
bool m_bBestSPArmed=false;
enum enum
{ {
@ -615,6 +617,7 @@ private:
QString m_nextGrid; QString m_nextGrid;
QString m_fileDateTime; QString m_fileDateTime;
QString m_inQSOwith; QString m_inQSOwith;
QString m_BestCQpriority;
QSet<QString> m_pfx; QSet<QString> m_pfx;
QSet<QString> m_sfx; QSet<QString> m_sfx;

View File

@ -1339,9 +1339,9 @@ QPushButton[state=&quot;ok&quot;] {
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pbCallBest"> <widget class="QPushButton" name="pbBestSP">
<property name="text"> <property name="text">
<string>Call Best</string> <string>Best S+P</string>
</property> </property>
</widget> </widget>
</item> </item>