diff options
| author | tony mancill <tmancill@debian.org> | 2023-09-03 19:46:43 -0700 |
|---|---|---|
| committer | tony mancill <tmancill@debian.org> | 2023-09-03 19:46:43 -0700 |
| commit | 393a486ee1d7e308a49f8e0b8c3a4b2f43223248 (patch) | |
| tree | 6a6e8a56ace360795e1cf1a310d5652bb23f1386 /widgets/mainwindow.cpp | |
| parent | 6a285ab382ebff18c88e52bec75dc1773ac33b74 (diff) | |
New upstream version 2.7.0~rc2+repackupstream/2.7.0_rc2+repack
Diffstat (limited to 'widgets/mainwindow.cpp')
| -rwxr-xr-x | widgets/mainwindow.cpp | 619 |
1 files changed, 509 insertions, 110 deletions
diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index a466c4a6..a476bba7 100755 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -185,13 +185,18 @@ extern "C" { void save_dxbase_(char* dxbase, FCL len);
void indexx_(float arr[], int* n, int indx[]);
+
+ void get_q3list_(char* fname, bool* bDiskData, int* nlist, char* list, FCL len1, FCL len2);
+
+ void rm_q3list_(char* callsign, FCL len);
+
+ void jpl_setup_(char* fname, FCL len);
}
int volatile itone[MAX_NUM_SYMBOLS]; //Audio tones for all Tx symbols
int volatile itone0[MAX_NUM_SYMBOLS]; //Dummy array, data not actually used
int volatile icw[NUM_CW_SYMBOLS]; //Dits for CW ID
dec_data_t dec_data; // for sharing with Fortran
-
int outBufSize;
int rc;
qint32 g_iptt {0};
@@ -212,6 +217,17 @@ bool m_displayBand = false; bool no_a7_decodes = false;
bool keep_frequency = false;
+QSharedMemory mem_qmap("mem_qmap"); //Memory segment to be shared (optionally) with QMAP
+struct {
+ int ndecodes; //Number of QMAP decodes available (so far)
+ int ncand; //Number of QMAP candidates considered for decoding
+ int nQDecoderDone; //QMAP decoder is finished (0 or 1)
+ int nWDecoderBusy; //WSJT-X decoder is busy (0 or 1)
+ int nWTransmitting; //WSJT-X is transmitting (0 or 1)
+ char result[50][60]; //Decodes as character*60 arrays
+} qmapcom;
+int* ipc_qmap;
+
namespace
{
Radio::Frequency constexpr default_frequency {14074000};
@@ -453,6 +469,14 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_optimizingProgress.setAutoReset (false);
m_optimizingProgress.setMinimumDuration (15000); // only show after 15s delay
+ //Attach or create a memory segment to be shared with QMAP.
+ int memSize=4096;
+ if(!mem_qmap.attach()) mem_qmap.create(memSize);
+ ipc_qmap = (int*)mem_qmap.data();
+ mem_qmap.lock();
+ memset(ipc_qmap,0,memSize); //Zero all of QMAP shared memory
+ mem_qmap.unlock();
+
// Closedown.
connect (ui->actionExit, &QAction::triggered, this, &QMainWindow::close);
@@ -522,14 +546,15 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, connect (this, &MainWindow::finished, m_logDlg.data (), &LogQSO::close);
// hook up the log book
- connect (&m_logBook, &LogBook::finished_loading, [this] (int record_count, QString const& error) {
+ connect (&m_logBook, &LogBook::finished_loading, [this] (int record_count, QString cty_version, QString const& error) {
if (error.size ())
{
MessageBox::warning_message (this, tr ("Error Scanning ADIF Log"), error);
}
else
{
- showStatusMessage (tr ("Scanned ADIF log, %1 worked before records created").arg (record_count));
+ m_config.set_CTY_DAT_version(cty_version);
+ showStatusMessage (tr ("Scanned ADIF log, %1 worked-before records created. CTY: %2").arg (record_count).arg (cty_version));
}
});
@@ -646,6 +671,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, MessageBox::warning_message (this, tr ("Error Loading LotW Users Data"), reason);
}, Qt::QueuedConnection);
+
QButtonGroup* txMsgButtonGroup = new QButtonGroup {this};
txMsgButtonGroup->addButton(ui->txrb1,1);
txMsgButtonGroup->addButton(ui->txrb2,2);
@@ -880,6 +906,10 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->lh_decodes_headings_label->setText(t);
ui->rh_decodes_headings_label->setText(t);
readSettings(); //Restore user's setup parameters
+ if(m_mode=="Q65") {
+ m_score=0;
+ read_log();
+ }
m_audioThread.start (m_audioThreadPriority);
#ifdef WIN32
@@ -1049,6 +1079,11 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}");
ui->pbBestSP->setVisible(m_mode=="FT4");
+ update_foxLogWindow_rate(); // update the rate on the window
+
+ QString jpleph = m_config.data_dir().absoluteFilePath("JPLEPH");
+ jpl_setup_(const_cast<char *>(jpleph.toLocal8Bit().constData()),256);
+
// this must be the last statement of constructor
if (!m_valid) throw std::runtime_error {"Fatal initialization exception"};
}
@@ -1056,11 +1091,11 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, void MainWindow::not_GA_warning_message ()
{
MessageBox::critical_message (this,
- "This is a pre-release version of WSJT-X 2.6.0 made\n"
+ "This is a pre-release version of WSJT-X 2.7.0-rc2 made\n"
"available for testing purposes. By design it will\n"
- "be nonfunctional after Mar 31, 2023.");
+ "be nonfunctional after Jan 15, 2024.");
auto now = QDateTime::currentDateTimeUtc ();
- if (now >= QDateTime {{2023, 03, 31}, {23, 59, 59, 999}, Qt::UTC}) {
+ if (now >= QDateTime {{2024, 01, 15}, {23, 59, 59, 999}, Qt::UTC}) {
Q_EMIT finished ();
}
}
@@ -1107,6 +1142,7 @@ void MainWindow::on_the_minute () } else {
tx_watchdog (false);
}
+ update_foxLogWindow_rate(); // update the rate on the window
}
//--------------------------------------------------- MainWindow destructor
@@ -1118,6 +1154,7 @@ MainWindow::~MainWindow() m_audioThread.quit ();
m_audioThread.wait ();
remove_child_from_event_filter (this);
+ memset(ipc_qmap,0,4096); //Zero all of QMAP shared memory
}
//-------------------------------------------------------- writeSettings()
@@ -1376,10 +1413,7 @@ void MainWindow::readSettings() if(displayMsgAvg) on_actionMessage_averaging_triggered();
if (displayFoxLog) on_fox_log_action_triggered ();
if (displayContestLog) on_contest_log_action_triggered ();
- if(displayActiveStations) {
- on_actionActiveStations_triggered();
-// QFile f {m_config.writeable_data_dir ().absoluteFilePath ("activeCalls.txt")};
- }
+ if(displayActiveStations) on_actionActiveStations_triggered();
}
void MainWindow::checkMSK144ContestType()
@@ -2040,6 +2074,7 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog }
ui->labDXped->setVisible(SpecOp::NONE != m_specOp);
set_mode(m_mode);
+ configActiveStations();
}
}
@@ -2242,7 +2277,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) case Qt::Key_F11:
if((e->modifiers() & Qt::ControlModifier) and (e->modifiers() & Qt::ShiftModifier)) {
m_bandEdited = true;
- band_changed(m_freqNominal-2000);
+ band_changed(m_freqNominal-1000);
} else {
n=11;
if(e->modifiers() & Qt::ControlModifier) n+=100;
@@ -2258,7 +2293,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) case Qt::Key_F12:
if((e->modifiers() & Qt::ControlModifier) and (e->modifiers() & Qt::ShiftModifier)) {
m_bandEdited = true;
- band_changed(m_freqNominal+2000);
+ band_changed(m_freqNominal+1000);
} else {
n=12;
if(e->modifiers() & Qt::ControlModifier) n+=100;
@@ -2330,6 +2365,16 @@ void MainWindow::keyPressEvent (QKeyEvent * e) }
break;
case Qt::Key_R:
+ if(m_mode=="Q65" and e->modifiers() & Qt::ShiftModifier and
+ e->modifiers() & Qt::ControlModifier) {
+ if(m_specOp==SpecOp::Q65_PILEUP) {
+ refreshPileupList();
+ } else {
+ m_fetched=0;
+ readWidebandDecodes();
+ }
+ return;
+ }
if(e->modifiers() & Qt::AltModifier) {
if(!m_send_RR73) on_txrb4_doubleClicked();
return;
@@ -2422,6 +2467,7 @@ void MainWindow::displayDialFrequency () void MainWindow::statusChanged()
{
+ if (m_specOp==SpecOp::Q65_PILEUP && m_mode != "Q65") on_actionQ65_triggered();
statusUpdate ();
QFile f {m_config.temp_dir ().absoluteFilePath ("wsjtx_status.txt")};
if(f.open(QFile::WriteOnly | QIODevice::Text)) {
@@ -2445,6 +2491,17 @@ void MainWindow::statusChanged() .arg (f.fileName ()).arg (f.errorString ()));
}
on_dxGridEntry_textChanged(m_hisGrid);
+ if(m_specOp!=SpecOp::HOUND) {
+ ui->txb2->setEnabled(true);
+ ui->txrb2->setEnabled(true);
+ ui->txb4->setEnabled(true);
+ ui->txrb4->setEnabled(true);
+ ui->txb5->setEnabled(true);
+ ui->txrb5->setEnabled(true);
+ ui->txb6->setEnabled(true);
+ ui->txrb6->setEnabled(true);
+ ui->houndButton->setChecked(false);
+ }
}
bool MainWindow::eventFilter (QObject * object, QEvent * event)
@@ -2661,6 +2718,11 @@ void MainWindow::on_actionQSG_X250_M3_triggered() QDesktopServices::openUrl (QUrl {"https://wsjt.sourceforge.io/WSJTX_2.5.0_MAP65_3.0_Quick_Start.pdf"});
}
+void MainWindow::on_actionQuick_Start_Guide_to_WSJT_X_2_7_and_QMAP_triggered()
+{
+ QDesktopServices::openUrl (QUrl {"https://wsjt.sourceforge.io/Quick_Start_WSJT-X_2.7_QMAP.pdf"});
+}
+
void MainWindow::on_actionOnline_User_Guide_triggered() //Display manual
{
#if defined (CMAKE_BUILD)
@@ -2741,10 +2803,10 @@ void MainWindow::on_actionCopyright_Notice_triggered() "\"The algorithms, source code, look-and-feel of WSJT-X and related "
"programs, and protocol specifications for the modes FSK441, FST4, FT8, "
"JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) "
- "2001-2022 by one or more of the following authors: Joseph Taylor, "
+ "2001-2023 by one or more of the following authors: Joseph Taylor, "
"K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, "
"IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; "
- "Philip Karn, KA9Q; Chester Fennell, KG4IYS; Uwe Risse, DG2YCB; "
+ "Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; "
"and other members of the WSJT Development Group.\"");
MessageBox::warning_message(this, message);
}
@@ -2911,9 +2973,11 @@ void MainWindow::on_actionActiveStations_triggered() m_ActiveStationsWidget->showNormal();
m_ActiveStationsWidget->raise();
m_ActiveStationsWidget->activateWindow();
+ configActiveStations();
connect(m_ActiveStationsWidget.data(), SIGNAL(callSandP(int)),this,SLOT(callSandP2(int)));
connect(m_ActiveStationsWidget.data(), SIGNAL(activeStationsDisplay()),this,SLOT(ARRL_Digi_Display()));
m_ActiveStationsWidget->setScore(m_score);
+ if(m_mode=="Q65") m_ActiveStationsWidget->setRate(m_score);
}
void MainWindow::on_actionOpen_triggered() //Open File
@@ -3109,11 +3173,11 @@ void MainWindow::on_actionKeyboard_shortcuts_triggered() <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr>
<tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr>
<tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr>
- <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 2000 Hz</td></tr>
+ <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr>
<tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr>
<tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr>
<tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr>
- <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 2000 Hz</td></tr>
+ <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr>
<tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr>
<tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr>
<tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr>
@@ -3134,6 +3198,7 @@ void MainWindow::on_actionKeyboard_shortcuts_triggered() <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr>
<tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr>
<tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr>
+ <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr>
<tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr>
<tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr>
<tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr>
@@ -3231,6 +3296,7 @@ void MainWindow::msgAvgDecode2() void MainWindow::decode() //decode()
{
if(m_decoderBusy) return; //Don't start decoder if it's already busy.
+ m_fetched=0;
QDateTime now = QDateTime::currentDateTimeUtc ();
if( m_dateTimeLastTX.isValid () ) {
qint64 isecs_since_tx = m_dateTimeLastTX.secsTo(now);
@@ -3283,7 +3349,9 @@ void MainWindow::decode() //decode() dec_data.params.ndiskdat=0;
if(m_diskData) dec_data.params.ndiskdat=1;
dec_data.params.nfa=m_wideGraph->nStartFreq();
- dec_data.params.nfSplit=m_wideGraph->Fmin();
+ dec_data.params.nfSplit=m_wideGraph->Fmin(); // Not used any more?
+ if(dec_data.params.nfSplit==8) dec_data.params.nfSplit=1;
+
dec_data.params.nfb=m_wideGraph->Fmax();
if(m_mode=="FT8" and SpecOp::HOUND == m_specOp and !ui->cbRxAll->isChecked()) dec_data.params.nfb=1000;
if(m_mode=="FT8" and SpecOp::FOX == m_specOp ) dec_data.params.nfqso=200;
@@ -3339,7 +3407,10 @@ void MainWindow::decode() //decode() dec_data.params.emedelay=0.0;
if(m_config.decode_at_52s()) dec_data.params.emedelay=2.5;
dec_data.params.minSync=ui->syncSpinBox->isVisible () ? m_minSync : 0;
- dec_data.params.nexp_decode = static_cast<int> (m_specOp);
+ dec_data.params.nexp_decode=int(m_specOp);
+ if(dec_data.params.nexp_decode==5) dec_data.params.nexp_decode=1; //NA VHF, WW Digi, ARRL Digi contests
+ if(dec_data.params.nexp_decode==8) dec_data.params.nexp_decode=1; //and Q65 Pileup all use 4-character
+ if(dec_data.params.nexp_decode==9) dec_data.params.nexp_decode=1; //grid exchange
if(m_config.single_decode()) dec_data.params.nexp_decode += 32;
if(m_config.enable_VHF_features()) dec_data.params.nexp_decode += 64;
if(m_mode.startsWith("FST4")) dec_data.params.nexp_decode += 256*(ui->sbNB->value()+3);
@@ -3408,7 +3479,9 @@ void MainWindow::decode() //decode() }
}
if((m_mode=="FT4" or (m_mode=="FT8" and m_ihsym==41) or m_diskData) and
- m_ActiveStationsWidget != NULL) m_ActiveStationsWidget->erase();
+ m_ActiveStationsWidget != NULL) {
+ if(m_mode!="Q65") m_ActiveStationsWidget->erase(); //TEMP
+ }
}
void::MainWindow::fast_decode_done()
@@ -3521,10 +3594,69 @@ void MainWindow::decodeDone () ARRL_Digi_Display(); // Update the ARRL_DIGI display
}
if(m_mode!="FT8" or dec_data.params.nzhsym==50) m_nDecodes=0;
+
+ if(m_mode=="Q65" and (m_specOp==SpecOp::NA_VHF or m_specOp==SpecOp::ARRL_DIGI
+ or m_specOp==SpecOp::WW_DIGI or m_specOp==SpecOp::Q65_PILEUP)
+ and m_ActiveStationsWidget!=NULL) {
+ refreshPileupList();
+ }
+}
+
+void MainWindow::refreshPileupList()
+{
+ // Update the ActiveStations display for Q65 pileup situation...
+ int nlist=0;
+ char list[2000];
+ char line[36];
+ list[0]=0;
+ auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("tsil.3q"))};
+ get_q3list_(const_cast<char *> (fname.toLatin1().constData()), &m_diskData, &nlist,
+ &list[0], (FCL)fname.length(), (FCL)2000);
+ QString t="";
+ QString t0="";
+ for(int i=0; i<nlist; i++) {
+ memcpy(line,&list[36*i],36);
+ t0=QString::fromLatin1(line)+"\n";
+ m_callers[i]=t0;
+ t+=t0;
+ }
+ m_ActiveStationsWidget->setClickOK(false);
+ m_ActiveStationsWidget->displayRecentStations("Q65-pileup",t);
+ m_ActiveStationsWidget->setClickOK(true);
+}
+
+void MainWindow::read_log()
+{
+ static QFile f {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("wsjtx.log")};
+ f.open(QIODevice::ReadOnly);
+ if(f.isOpen()) {
+ QTextStream in(&f);
+ QString line,callsign;
+ for(int i=0; i<99999; i++) {
+ line=in.readLine();
+ if(line.length()<=0) break;
+ callsign=line.mid(40,6);
+ int n=callsign.indexOf(",");
+ if(n>0) callsign=callsign.left(n);
+ m_EMEworked[callsign]=true;
+ m_score++;
+ }
+ f.close();
+ }
+ if(m_ActiveStationsWidget!=NULL) {
+ m_ActiveStationsWidget->setScore(m_score);
+ if(m_mode=="Q65") m_ActiveStationsWidget->setRate(m_score);
+ }
}
void MainWindow::ARRL_Digi_Update(DecodedText dt)
{
+ if(m_mode=="Q65") {
+ m_fetched=0;
+ readWidebandDecodes();
+ return;
+ }
+
// Extract information relevant for the ARRL Digi contest
QString deCall;
QString deGrid;
@@ -3584,6 +3716,11 @@ void MainWindow::ARRL_Digi_Update(DecodedText dt) void MainWindow::ARRL_Digi_Display()
{
+ if(m_mode=="Q65") {
+ m_fetched=0;
+ readWidebandDecodes();
+ return;
+ }
QMutableMapIterator<QString,RecentCall> icall(m_recentCall);
QString deCall,deGrid;
int age=0;
@@ -3654,23 +3791,65 @@ void MainWindow::ARRL_Digi_Display() t += (t1 + list[k] + "\n");
if(i>=maxRecent) break;
}
- if(m_ActiveStationsWidget!=NULL) m_ActiveStationsWidget->displayRecentStations(t);
+ if(m_ActiveStationsWidget!=NULL) m_ActiveStationsWidget->displayRecentStations(m_mode,t);
m_ActiveStationsWidget->setClickOK(true);
}
void MainWindow::callSandP2(int n)
{
- if(m_ready2call[n]=="") return;
+ bool bCtrl = (n<0);
+ n=qAbs(n)-1;
+ if(m_mode!="Q65" and m_ready2call[n]=="") return;
QStringList w=m_ready2call[n].split(' ', SkipEmptyParts);
- m_deCall=w[0];
- m_deGrid=w[1];
+ if(m_mode=="Q65" and m_specOp==SpecOp::Q65_PILEUP and n < 40) {
+ // This code is for 6m EME DXpedition operator
+ w=m_callers[n].split(' ', SkipEmptyParts);
+ m_deCall=w[2];
+ if(bCtrl) {
+ // Remove this call from q3list.
+ rm_q3list_(const_cast<char *> (m_deCall.toLatin1().constData()), m_deCall.size());
+ refreshPileupList();
+ return;
+ }
+ m_deGrid=w[3];
+ m_bDoubleClicked=true; //### needed?
+ m_txFirst=true;
+ ui->dxCallEntry->setText(m_deCall);
+ ui->dxGridEntry->setText(m_deGrid);
+ ui->txFirstCheckBox->setChecked(m_txFirst);
+ genStdMsgs("-22");
+ setTxMsg(3);
+ if (!ui->autoButton->isChecked()) ui->autoButton->click(); // Enable Tx
+ if(m_transmitting) m_restart=true;
+ return;
+ }
+
+ if(m_mode=="Q65") {
+ if(!bCtrl) { //Do not reset m_freqNominal if CTRL was down
+ double kHz=w[1].toDouble();
+ int nMHz=m_freqNominal/1000000;
+ m_freqNominal=(nMHz*1000 + kHz)* 1000;
+ }
+ m_deCall=w[3];
+ m_deGrid=w[4];
+ m_txFirst=(w[5]=="0");
+// ui->TxFreqSpinBox->setValue(1500);
+ } else {
+ m_deCall=w[0];
+ m_deGrid=w[1];
+ ui->RxFreqSpinBox->setValue(w[4].toInt());
+ m_txFirst = (w[5]=="0");
+ }
m_bDoubleClicked=true; //### needed?
ui->dxCallEntry->setText(m_deCall);
ui->dxGridEntry->setText(m_deGrid);
- genStdMsgs(w[3]); //### real SNR would be better here?
- ui->RxFreqSpinBox->setValue(w[4].toInt());
+ if(m_mode=="Q65") {
+ ui->rptSpinBox->setValue(w[2].toInt());
+ genStdMsgs(w[2]);
+ } else {
+ genStdMsgs(w[3]);
+ }
setTxMsg(1);
- m_txFirst = (w[5]=="0");
ui->txFirstCheckBox->setChecked(m_txFirst);
if (!ui->autoButton->isChecked()) ui->autoButton->click(); // Enable Tx
if(m_transmitting) m_restart=true;
@@ -3732,6 +3911,8 @@ void MainWindow::readFromStdout() //readFromStdout bool bAvgMsg=false;
int navg=0;
+// qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
+// double fTR=float((ms%int(1000.0*m_TRperiod)))/int(1000.0*m_TRperiod);
if(line_read.indexOf("<DecodeFinished>") >= 0) {
m_bDecoded = line_read.mid(20).trimmed().toInt() > 0;
int n=line_read.trimmed().size();
@@ -3791,6 +3972,7 @@ void MainWindow::readFromStdout() //readFromStdout }
m_tBlankLine = line_read.left(ntime);
}
+// if(m_mode=="FT8" && fTR>0.6 && fTR<0.75) decodeDone(); // Clear a hung decoder status
}
if ("FST4W" == m_mode)
{
@@ -3972,6 +4154,7 @@ void MainWindow::readFromStdout() //readFromStdout if((abs(audioFreq - m_wideGraph->rxFreq()) <= 10) and
!m_config.enable_VHF_features()) bDisplayRight=true;
}
+ if(m_mode=="Q65" and !bAvgMsg) bDisplayRight=false;
if (bDisplayRight) {
// This msg is within 10 hertz of our tuned frequency, or a JT4 or JT65 avg,
@@ -4003,7 +4186,8 @@ void MainWindow::readFromStdout() //readFromStdout hound_reply ();
}
} else {
- QStringList w=decodedtext.string().mid(24).split(" ",SkipEmptyParts);
+ QString text = decodedtext.string().replace("<","").replace(">",""); // needed for MSHV multistream messages
+ QStringList w=text.mid(24).split(" ",SkipEmptyParts);
if(decodedtext.string().contains("/")) w.append(" +00"); //Add a dummy report
if(w.size()>=3) {
QString foxCall=w.at(1);
@@ -4019,6 +4203,8 @@ void MainWindow::readFromStdout() //readFromStdout m_rptSent=decodedtext.string().mid(7,3);
m_nFoxFreq=decodedtext.string().mid(16,4).toInt();
hound_reply ();
+ } else {
+ if (text.contains(m_config.my_callsign() + " " + m_hisCall) && !text.contains("73 ")) processMessage(decodedtext0); // needed for MSHV multistream messages
}
}
}
@@ -4109,7 +4295,7 @@ void MainWindow::auto_sequence (DecodedText const& message, unsigned start_toler || message_words.contains (ui->dxCallEntry->text ())
|| message_words.contains (Radio::base_callsign (ui->dxCallEntry->text ()))
|| message_words.contains ("DE")))
- || !message.isStandardMessage ()); // free text 73/RR73
+ || (!message.isStandardMessage () && m_mode != "MSK144")); // free text 73/RR73 except for MSK
auto const& w = msg_no_hash.split(" ",SkipEmptyParts);
QString w2;
@@ -4322,8 +4508,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<qint32> ft8Freq = {1840000,3573000,7074000,10136000,14074000,18100000,21074000,24915000,28074000,50313000,70154000};
+ for(int i=0; i<ft8Freq.length()-1; i++) {
int kHzdiff=m_freqNominal - ft8Freq[i];
if(qAbs(kHzdiff) < 3000 ) {
m_bTxTime=false;
@@ -4768,13 +4954,14 @@ void MainWindow::guiUpdate() }
}
- if(m_mode=="FT8" or m_mode=="MSK144" or m_mode=="FT4" || "Q65" == m_mode) {
+ if(m_mode=="FT8" or m_mode=="MSK144" or m_mode=="FT4" or m_mode=="Q65") {
if(ui->txrb1->isEnabled() and
(SpecOp::NA_VHF==m_specOp or
SpecOp::FIELD_DAY==m_specOp or
SpecOp::RTTY==m_specOp or
SpecOp::WW_DIGI==m_specOp or
- SpecOp::ARRL_DIGI==m_specOp) ) {
+ SpecOp::ARRL_DIGI==m_specOp or
+ SpecOp::Q65_PILEUP==m_specOp)) {
//We're in a contest-like mode other than EU_VHF: start QSO with Tx2.
ui->tx1->setEnabled(false);
ui->txb1->setEnabled(false);
@@ -4787,16 +4974,34 @@ void MainWindow::guiUpdate() }
if(m_mode=="Echo" and !m_monitoring and !m_auto and !m_diskData) m_echoRunning=false;
+ if(m_mode=="Q65") {
+ mem_qmap.lock();
+ int n=0;
+ if(m_decoderBusy) n=1;
+ ipc_qmap[3]=n;
+ n=0;
+ if(m_transmitting) n=1;
+ ipc_qmap[4]=n;
+ if(ipc_qmap[0] > 0) { //ndecodes
+ memcpy(&qmapcom, (char*)ipc_qmap, sizeof(qmapcom)); //Fetch the new decode(s)
+ readWidebandDecodes();
+ }
+ mem_qmap.unlock();
+ }
+
//Once per second (onesec)
if(nsec != m_sec0) {
-// qDebug() << "AAA" << nsec << m_bFastMode << m_bFast9;
+// qDebug() << "AAA" << nsec%60 << int(m_specOp);
if(m_mode=="FST4") chk_FST4_freq_range();
m_currentBand=m_config.bands()->find(m_freqNominal);
if( SpecOp::HOUND == m_specOp ) {
qint32 tHound=QDateTime::currentMSecsSinceEpoch()/1000 - m_tAutoOn;
//To keep calling Fox, Hound must reactivate Enable Tx at least once every 2 minutes
- if(tHound >= 120 and m_ntx==1) auto_tx_mode(false);
+ if(tHound >= 120 and m_ntx==1) {
+ auto_tx_mode(false);
+ statusUpdate ();
+ }
}
progressBar.setVisible(true);
@@ -5400,7 +5605,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie or bEU_VHF_w2 or (m_QSOProgress==CALLING))) {
if(message_words.at(4).contains(grid_regexp) and SpecOp::EU_VHF!=m_specOp) {
if((SpecOp::NA_VHF==m_specOp or SpecOp::WW_DIGI==m_specOp or
- SpecOp::ARRL_DIGI==m_specOp )
+ SpecOp::ARRL_DIGI==m_specOp or SpecOp::Q65_PILEUP==m_specOp)
and bContestOK) {
setTxMsg(3);
m_QSOProgress=ROGER_REPORT;
@@ -5764,7 +5969,7 @@ void MainWindow::genCQMsg () QString t=ui->tx6->text();
QStringList tlist=t.split(" ");
if((m_mode=="FT4" or m_mode=="FT8" or m_mode=="MSK144" || "Q65" == m_mode) and
- SpecOp::NONE != m_specOp and
+ SpecOp::NONE != m_specOp and SpecOp::HOUND != m_specOp and SpecOp::Q65_PILEUP != m_specOp and
( tlist.at(1)==my_callsign or
tlist.at(2)==my_callsign ) and
stdCall(my_callsign)) {
@@ -5888,6 +6093,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) if(SpecOp::NA_VHF==m_specOp) sent=my_grid;
if(SpecOp::WW_DIGI==m_specOp) sent=my_grid;
if(SpecOp::ARRL_DIGI==m_specOp) sent=my_grid;
+ if(SpecOp::Q65_PILEUP==m_specOp) sent=my_grid;
if(SpecOp::FIELD_DAY==m_specOp) sent=m_config.Field_Day_Exchange();
if(SpecOp::RTTY==m_specOp) {
sent=rst + m_config.RTTY_Exchange();
@@ -6312,9 +6518,25 @@ void MainWindow::on_RoundRobin_currentTextChanged(QString text) ui->sbTxPercent->setEnabled (text == tr ("Random"));
}
+void MainWindow::mousePressEvent(QMouseEvent *event)
+{
+ if(ui->q65Button->hasFocus() && (event->button() & Qt::RightButton)) {
+ m_specOp=m_config.special_op_id();
+ if (m_specOp==SpecOp::Q65_PILEUP) {
+ m_config.setSpecial_None();
+ ui->tx1->setEnabled(true);
+ ui->txb1->setEnabled(true);
+ } else {
+ m_config.setSpecial_Q65_Pileup();
+ }
+ m_specOp=m_config.special_op_id();
+ on_actionQ65_triggered();
+ }
+}
void MainWindow::on_dxCallEntry_textChanged (QString const& call)
{
+ set_dateTimeQSO (-1); // reset the QSO start time when DXCall changes
m_hisCall = call;
ui->dxGridEntry->clear();
statusChanged();
@@ -6479,16 +6701,26 @@ void MainWindow::acceptQSO (QDateTime const& QSO_date_off, QString const& call, }
if(m_ActiveStationsWidget!=NULL) {
- QString band=m_config.bands()->find(dial_freq);
- activeWorked(call,band);
- int points=m_activeCall[call].points;
- m_score += points;
- ARRL_logged al;
- al.time=QDateTime::currentDateTimeUtc();
- al.band=band;
- al.points=points;
- m_arrl_log.append(al);
- updateRate();
+ if(m_mode=="Q65") {
+ m_score++;
+ m_EMEworked[call]=true;
+ if(m_specOp==SpecOp::Q65_PILEUP) {
+ rm_q3list_(const_cast<char *> (m_deCall.toLatin1().constData()), m_deCall.size());
+ refreshPileupList();
+ }
+ m_ActiveStationsWidget->setRate(m_score);
+ } else {
+ QString band=m_config.bands()->find(dial_freq);
+ activeWorked(call,band);
+ int points=m_activeCall[call].points;
+ m_score += points;
+ ARRL_logged al;
+ al.time=QDateTime::currentDateTimeUtc();
+ al.band=band;
+ al.points=points;
+ m_arrl_log.append(al);
+ updateRate();
+ }
}
m_xSent.clear ();
@@ -6597,6 +6829,7 @@ void MainWindow::displayWidgets(qint64 n) b=m_mode.startsWith("FST4");
ui->sbNB->setVisible(b);
genStdMsgs (m_rpt, true);
+ configActiveStations();
}
void MainWindow::on_actionFST4_triggered()
@@ -6788,7 +7021,6 @@ void MainWindow::on_actionFT8_triggered() }
if(SpecOp::HOUND == m_specOp) {
ui->houndButton->setChecked(true);
- ui->houndButton->setStyleSheet("background-color: #ff0000;");
ui->txFirstCheckBox->setChecked(false);
ui->txFirstCheckBox->setEnabled(false);
ui->cbAutoSeq->setEnabled(false);
@@ -6809,10 +7041,8 @@ void MainWindow::on_actionFT8_triggered() } else {
if (!(keep_frequency)) switch_mode (Modes::FT8);
}
-
if(m_specOp != SpecOp::HOUND) {
ui->houndButton->setChecked(false);
- ui->houndButton->setStyleSheet("");
}
m_specOp=m_config.special_op_id();
@@ -6822,15 +7052,16 @@ void MainWindow::on_actionFT8_triggered() if(SpecOp::EU_VHF==m_specOp) t0="EU VHF";
if(SpecOp::FIELD_DAY==m_specOp) t0="Field Day";
if(SpecOp::RTTY==m_specOp) t0="FT RU";
- if(SpecOp::WW_DIGI==m_specOp) t0="WW_DIGI";
- if(SpecOp::ARRL_DIGI==m_specOp) t0="ARRL_DIGI";
+ if(SpecOp::WW_DIGI==m_specOp) t0="WW Digi";
+ if(SpecOp::ARRL_DIGI==m_specOp) t0="ARRL Digi";
+ if(SpecOp::Q65_PILEUP==m_specOp) t0="Q65 Pileup";
if(t0=="") {
ui->labDXped->setVisible(false);
} else {
ui->labDXped->setVisible(true);
ui->labDXped->setText(t0);
}
- on_contest_log_action_triggered();
+ if(m_specOp!=SpecOp::Q65_PILEUP) on_contest_log_action_triggered();
}
if((SpecOp::FOX==m_specOp or SpecOp::HOUND==m_specOp) and !m_config.split_mode() and !m_bWarnedSplit) {
@@ -6842,6 +7073,7 @@ void MainWindow::on_actionFT8_triggered() m_bWarnedSplit=true;
}
statusChanged();
+ configActiveStations();
}
void MainWindow::on_actionJT4_triggered()
@@ -7049,7 +7281,6 @@ void MainWindow::on_actionQ65_triggered() ui->rh_decodes_title_label->setText(tr ("Average Decodes"));
ui->lh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message"));
ui->rh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message"));
- statusChanged();
m_specOp=m_config.special_op_id();
if(m_specOp!=SpecOp::NONE and m_specOp!=SpecOp::FOX and m_specOp!=SpecOp::HOUND) {
@@ -7058,17 +7289,24 @@ void MainWindow::on_actionQ65_triggered() if(SpecOp::EU_VHF==m_specOp) t0="EU VHF";
if(SpecOp::FIELD_DAY==m_specOp) t0="Field Day";
if(SpecOp::RTTY==m_specOp) t0="FT RU";
- if(SpecOp::WW_DIGI==m_specOp) t0="WW_DIGI";
- if(SpecOp::ARRL_DIGI==m_specOp) t0="ARRL_DIGI";
+ if(SpecOp::WW_DIGI==m_specOp) t0="WW Digi";
+ if(SpecOp::ARRL_DIGI==m_specOp) t0="ARRL Digi";
+ if(SpecOp::Q65_PILEUP==m_specOp) t0="Q65 Pileup";
if(t0=="") {
ui->labDXped->setVisible(false);
} else {
ui->labDXped->setVisible(true);
ui->labDXped->setText(t0);
}
- on_contest_log_action_triggered();
+ if(m_specOp!=SpecOp::Q65_PILEUP) {
+ on_contest_log_action_triggered();
+ } else {
+ if(ui->txrb1->isChecked()) on_txb2_clicked();
+ ui->tx1->setEnabled(true);
+ ui->txb1->setEnabled(true);
+ }
}
-
+ statusChanged();
}
void MainWindow::on_actionMSK144_triggered()
@@ -7244,6 +7482,12 @@ void MainWindow::on_actionFreqCal_triggered() void MainWindow::switch_mode (Mode mode)
{
+ if (m_mode != "Q65" && m_specOp==SpecOp::Q65_PILEUP) {
+ m_config.setSpecial_None();
+ m_specOp=m_config.special_op_id();
+ ui->tx1->setEnabled(true);
+ ui->txb1->setEnabled(true);
+ }
m_fastGraph->setMode(m_mode);
m_config.frequencies ()->filter (m_config.region (), mode, true); // filter on current time
auto const& row = m_config.frequencies ()->best_working_frequency (m_freqNominal);
@@ -7436,6 +7680,17 @@ void MainWindow::on_actionErase_ALL_TXT_triggered() //Erase ALL.TXT }
}
+void MainWindow::on_actionErase_list_of_Q65_callers_triggered()
+{
+ int ret = MessageBox::query_message (this, tr ("Confirm Erase"),
+ tr ("Are you sure you want to erase the list of Q65 callers?"));
+ if(ret==MessageBox::Yes) {
+ QFile f {m_config.writeable_data_dir ().absoluteFilePath ("tsil.3q")};
+ f.remove();
+ }
+}
+
+
void MainWindow::on_reset_cabrillo_log_action_triggered ()
{
if (MessageBox::Yes == MessageBox::query_message (this, tr ("Confirm Reset"),
@@ -7447,8 +7702,12 @@ void MainWindow::on_reset_cabrillo_log_action_triggered () if(m_config.RTTY_Exchange()!="SCC") ui->sbSerialNumber->setValue(1);
m_logBook.contest_log ()->reset ();
m_activeCall.clear(); //Erase the QMap of active calls
+ m_EMECall.clear(); //ditto for EME calls
m_score=0;
- if (m_ActiveStationsWidget) m_ActiveStationsWidget->setScore(0);
+ if (m_ActiveStationsWidget) {
+ m_ActiveStationsWidget->setScore(0);
+ if(m_mode=="Q65") m_ActiveStationsWidget->setRate(0);
+ }
}
}
@@ -7527,6 +7786,8 @@ void MainWindow::on_bandComboBox_activated (int index) m_bandEdited = true;
band_changed (frequency);
m_wideGraph->setRxBand (m_config.bands ()->find (frequency));
+ m_specOp=m_config.special_op_id();
+ if (m_specOp==SpecOp::HOUND) auto_tx_mode(false);
}
void MainWindow::band_changed (Frequency f)
@@ -7572,6 +7833,8 @@ void MainWindow::band_changed (Frequency f) }
setRig (f);
setXIT (ui->TxFreqSpinBox->value ());
+ m_specOp=m_config.special_op_id();
+ if (m_specOp==SpecOp::FOX) FoxReset("BandChange"); // when changing bands, don't preserve the Fox queues
}
}
@@ -7819,7 +8082,7 @@ void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const& if(m_lastDialFreq != m_freqNominal and m_ActiveStationsWidget != NULL) {
m_recentCall.clear();
- m_ActiveStationsWidget->erase();
+ if(m_mode!="Q65") m_ActiveStationsWidget->erase();
}
m_lastDialFreq = m_freqNominal;
@@ -8455,6 +8718,7 @@ void MainWindow::locationChange (QString const& location) if (m_config.my_grid () != grid) {
m_config.set_location (grid);
genStdMsgs (m_rpt, false);
+ pskSetLocal ();
statusUpdate ();
}
} else {
@@ -9171,6 +9435,112 @@ void MainWindow::write_transmit_entry (QString const& file_name) }
}
+void MainWindow::readWidebandDecodes()
+{
+ if(m_ActiveStationsWidget==NULL) return;
+ int nhr=0;
+ int nmin=0;
+ int nsnr=0;
+ while(m_fetched < qmapcom.ndecodes) {
+ QString line=QString::fromLatin1(qmapcom.result[m_fetched]);
+ m_fetched++;
+ nhr=line.mid(0,2).toInt();
+ nmin=line.mid(2,2).toInt();
+ double frx=line.mid(4,9).toDouble();
+ double fsked=line.mid(13,7).toDouble();
+ QString msg=line.mid(34,-1);
+ int i1=msg.indexOf(" ");
+ int i2=i1 +1 + msg.mid(i1+1,-1).indexOf(" ");
+ QString dxcall=msg.mid(i1+1,i2-i1-1);
+ if(stdCall(dxcall)) {
+ QString w3=msg.mid(i2+1,-1);
+ nsnr=line.mid(29,3).toInt();
+ m_EMECall[dxcall].frx=frx;
+ m_EMECall[dxcall].fsked=fsked;
+ m_EMECall[dxcall].nsnr=nsnr;
+ m_EMECall[dxcall].t=60*nhr + nmin;
+ if(w3.contains(grid_regexp)) m_EMECall[dxcall].grid4=w3;
+ bool bCQ=line.contains(" CQ ");
+ m_EMECall[dxcall].ready2call=(bCQ or line.contains(" 73") or line.contains(" RR73"));
+ Frequency frequency = (m_freqNominal/1000000) * 1000000 + int(fsked*1000.0);
+ bool bFromDisk=qmapcom.nQDecoderDone==2;
+ if(!bFromDisk and (m_EMECall[dxcall].grid4.contains(grid_regexp) or bCQ)) {
+ qDebug() << "To PSKreporter:" << dxcall << m_EMECall[dxcall].grid4 << frequency << m_mode << nsnr;
+ if (!m_psk_Reporter.addRemoteStation (dxcall, m_EMECall[dxcall].grid4, frequency, m_mode, nsnr)) {
+ showStatusMessage (tr ("Spotting to PSK Reporter unavailable"));
+ }
+ }
+ }
+ }
+
+ if (m_config.spot_to_psk_reporter ()) {
+ m_psk_Reporter.sendReport(); // Upload any queued spots
+ }
+
+// Update "m_wEMECall" by reading qmap_decodes.txt
+ QMap<QString,EMECall>::iterator i;
+ QString t="";
+ QString t1;
+ QString dxcall;
+ QString dxgrid4;
+ QStringList list;
+ float f[100];
+ int indx[100];
+ int maxAge=m_ActiveStationsWidget->maxAge();
+
+ m_ActiveStationsWidget->setClickOK(false);
+ int k=0;
+
+ for(i=m_EMECall.begin(); i!=m_EMECall.end(); i++) {
+ bool bSkip=false;
+ if(m_ActiveStationsWidget->wantedOnly() and m_EMEworked[i.key()]) bSkip=true;
+ if(m_ActiveStationsWidget->readyOnly() and !i->ready2call) bSkip=true;
+ if(!bSkip) {
+ int snr=i->nsnr;
+ int odd=1 - (i->t)%2;
+ int age=60*nhr + nmin - (i->t);
+ char c2[3]={32,32,0};
+ if(age<0) age += 1440;
+ if(age<=maxAge) {
+ dxcall=(i.key()+" ").left(8);
+ dxgrid4=(i->grid4+"... ").left(4);
+ if(!m_EMEworked[dxcall.trimmed()]) c2[0]=35; //# for not in log
+ if(i->ready2call) c2[1]=42; //* for ready to call
+ t1=t1.asprintf("%7.3f %5.1f %+03d %8s %4s %3d %3d %2s\n",i->frx,i->fsked,snr,dxcall.toLatin1().constData(),
+ dxgrid4.toLatin1().constData(),odd,age,c2);
+ f[k]=i->fsked;
+ list.append(t1);
+ k++;
+ }
+ m_ActiveStationsWidget->setClickOK(true);
+ }
+ }
+
+ if(k>0) {
+ t1="";
+ int kz=k;
+ indexx_(f,&kz,indx);
+ for(int k=0; k<kz; k++) {
+ int j=indx[k]-1;
+ t1=t1.asprintf("%2d. ",k+1);
+ t1+=list[j];
+ m_ready2call[k]=list[j];
+ t+=t1;
+ }
+ }
+
+ if(m_ActiveStationsWidget != NULL) {
+ m_ActiveStationsWidget->erase();
+ m_ActiveStationsWidget->displayRecentStations(m_mode,t);
+ m_ActiveStationsWidget->setClickOK(true);
+ }
+ if(ipc_qmap[2]!=0) {
+ m_fetched=0;
+ ipc_qmap[0]=0;
+ ipc_qmap[2]=0;
+ }
+}
+
// -------------------------- Code for FT8 DXpedition Mode ---------------------------
void MainWindow::hound_reply ()
@@ -9207,6 +9577,21 @@ void MainWindow::on_sbMax_dB_valueChanged(int n) t = t.asprintf(" Max_dB %d",m_max_dB);
writeFoxQSO(t);
}
+void MainWindow::FoxReset(QString reason="")
+{
+ QFile f(m_config.temp_dir().absoluteFilePath("houndcallers.txt"));
+ f.remove();
+ ui->decodedTextBrowser->setText("");
+ ui->houndQueueTextBrowser->setText("");
+ ui->foxTxListTextBrowser->setText("");
+
+ m_houndQueue.clear();
+ m_foxQSO.clear();
+ m_foxQSOinProgress.clear();
+ m_discard_decoded_hounds_this_cycle = true; // discard decoded messages until the next cycle
+ if (reason != "") writeFoxQSO(" " + reason);
+ writeFoxQSO(" Reset");
+}
void MainWindow::on_pbFoxReset_clicked()
{
@@ -9214,16 +9599,7 @@ void MainWindow::on_pbFoxReset_clicked() auto button = MessageBox::query_message (this, tr ("Confirm Reset"),
tr ("Are you sure you want to clear the QSO queues?"));
if(button == MessageBox::Yes) {
- QFile f(m_config.temp_dir().absoluteFilePath("houndcallers.txt"));
- f.remove();
- ui->decodedTextBrowser->setText("");
- ui->houndQueueTextBrowser->setText("");
- ui->foxTxListTextBrowser->setText("");
-
- m_houndQueue.clear();
- m_foxQSO.clear();
- m_foxQSOinProgress.clear();
- writeFoxQSO(" Reset");
+ FoxReset();
}
}
@@ -9347,6 +9723,7 @@ void MainWindow::selectHound(QString line, bool bTopQueue) * <Enter> is equivalent to double-clicking on the top-most line.
*/
if(line.length()==0) return;
+ if(line.length() < 6) return;
QString houndCall=line.split(" ",SkipEmptyParts).at(0);
// Don't add a call already enqueued or in QSO
@@ -9391,6 +9768,15 @@ void MainWindow::houndCallers() * Distance, Age, and Continent) to a list, sort the list by specified criteria,
* and display the top N_Hounds entries in the left text window.
*/
+ // if frequency was changed in the middle of an interval, there's a flag set to ignore the decodes. Reset it here
+ //
+
+ if (m_discard_decoded_hounds_this_cycle)
+ {
+ m_discard_decoded_hounds_this_cycle = false; //
+ return; // don't use these decodes
+ }
+
QFile f(m_config.temp_dir().absoluteFilePath("houndcallers.txt"));
if(f.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream s(&f);
@@ -9606,26 +9992,33 @@ list2Done: }
if(hc1!="") {
- // Log this QSO!
- auto QSO_time = QDateTime::currentDateTimeUtc ();
- m_hisCall=hc1;
- m_hisGrid=m_foxQSO[hc1].grid;
- m_rptSent=m_foxQSO[hc1].sent;
- m_rptRcvd=m_foxQSO[hc1].rcvd;
- if (!m_foxLogWindow) on_fox_log_action_triggered ();
- if (m_logBook.fox_log ()->add_QSO (QSO_time, m_hisCall, m_hisGrid, m_rptSent, m_rptRcvd, m_lastBand))
+ auto already_logged = m_loggedByFox[hc1].contains(m_lastBand + " "); // already logged this call on this band?
+
+ if (!already_logged) { // Log this QSO!
+ auto QSO_time = QDateTime::currentDateTimeUtc ();
+ m_hisCall=hc1;
+ m_hisGrid=m_foxQSO[hc1].grid;
+ m_rptSent=m_foxQSO[hc1].sent;
+ m_rptRcvd=m_foxQSO[hc1].rcvd;
+ if (!m_foxLogWindow) on_fox_log_action_triggered ();
+ if (m_logBook.fox_log ()->add_QSO (QSO_time, m_hisCall, m_hisGrid, m_rptSent, m_rptRcvd, m_lastBand))
+ {
+ writeFoxQSO (QString {" Log: %1 %2 %3 %4 %5"}.arg (m_hisCall).arg (m_hisGrid)
+ .arg (m_rptSent).arg (m_rptRcvd).arg (m_lastBand));
+ on_logQSOButton_clicked ();
+ QTimer::singleShot (13000, [=] {
+ m_foxQSOinProgress.removeOne(hc1); //Remove from In Progress window
+ updateFoxQSOsInProgressDisplay(); //Update InProgress display after Tx is complete
+ });
+ }
+ m_loggedByFox[hc1] += (m_lastBand + " ");
+ }
+ else
{
- writeFoxQSO (QString {" Log: %1 %2 %3 %4 %5"}.arg (m_hisCall).arg (m_hisGrid)
- .arg (m_rptSent).arg (m_rptRcvd).arg (m_lastBand));
- on_logQSOButton_clicked ();
- m_foxRateQueue.enqueue (now); //Add present time in seconds
- //to Rate queue.
- QTimer::singleShot (13000, [=] {
- m_foxQSOinProgress.removeOne(hc1); //Remove from In Progress window
- updateFoxQSOsInProgressDisplay(); //Update InProgress display after Tx is complete
- });
+ // note that this is a duplicate
+ writeFoxQSO(QString{" Dup: %1 %2 %3 %4 %5"}.arg(m_hisCall).arg(m_hisGrid)
+ .arg(m_rptSent).arg(m_rptRcvd).arg(m_lastBand));
}
- m_loggedByFox[hc1] += (m_lastBand + " ");
}
if(i<n2 and fm=="") {
@@ -9675,19 +10068,21 @@ Transmit: }
}
- while(!m_foxRateQueue.isEmpty()) {
- qint64 age = now - m_foxRateQueue.head();
- if(age < 3600) break;
- m_foxRateQueue.dequeue();
- }
if (m_foxLogWindow)
{
- m_foxLogWindow->rate (m_foxRateQueue.size ());
+ 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;
@@ -9842,6 +10237,7 @@ void MainWindow::foxTest() return;
}
+
QTextStream s(&f);
QTextStream sdiag(&fdiag);
@@ -9901,14 +10297,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);
}
@@ -10021,15 +10417,16 @@ void MainWindow::chkFT4() if(SpecOp::EU_VHF==m_specOp) t0="EU VHF";
if(SpecOp::FIELD_DAY==m_specOp) t0="Field Day";
if(SpecOp::RTTY==m_specOp) t0="FT RU";
- if(SpecOp::WW_DIGI==m_specOp) t0="WW_DIGI";
- if(SpecOp::ARRL_DIGI==m_specOp) t0="ARRL_DIGI";
+ if(SpecOp::WW_DIGI==m_specOp) t0="WW Digi";
+ if(SpecOp::ARRL_DIGI==m_specOp) t0="ARRL Digi";
+ if(SpecOp::Q65_PILEUP==m_specOp) t0="Q65 Pileup";
if(t0=="") {
ui->labDXped->setVisible(false);
} else {
ui->labDXped->setVisible(true);
ui->labDXped->setText(t0);
}
- on_contest_log_action_triggered();
+ if(m_specOp!=SpecOp::Q65_PILEUP) on_contest_log_action_triggered();
}
if (SpecOp::HOUND == m_specOp or SpecOp::FOX == m_specOp) {
ui->labDXped->setVisible(false);
@@ -10061,6 +10458,17 @@ void MainWindow::set_mode (QString const& mode) else if ("Echo" == mode) on_actionEcho_triggered ();
}
+void MainWindow::configActiveStations()
+{
+ if(m_ActiveStationsWidget!=NULL and (m_mode=="Q65" or m_mode=="FT4" or m_mode=="FT8")) {
+ if(m_specOp==SpecOp::Q65_PILEUP) {
+ m_ActiveStationsWidget->displayRecentStations("Q65-pileup","");
+ } else {
+ m_ActiveStationsWidget->displayRecentStations(m_mode,"");
+ }
+ }
+}
+
void MainWindow::remote_configure (QString const& mode, quint32 frequency_tolerance
, QString const& submode, bool fast_mode, quint32 tr_period, quint32 rx_df
, QString const& dx_call, QString const& dx_grid, bool generate_messages)
@@ -10173,10 +10581,11 @@ QString MainWindow::WSPR_message() void MainWindow::on_houndButton_clicked (bool checked)
{
if (checked) {
- ui->houndButton->setStyleSheet("background-color: #ff0000;");
m_config.setSpecial_Hound();
+ ui->tx1->setVisible(true);
+ ui->tx1->setEnabled(true);
+ ui->txb1->setEnabled(true);
} else {
- ui->houndButton->setStyleSheet("");
m_config.setSpecial_None();
keep_frequency = true;
QTimer::singleShot (250, [=] {keep_frequency = false;});
@@ -10187,8 +10596,6 @@ void MainWindow::on_houndButton_clicked (bool checked) void MainWindow::on_ft8Button_clicked()
{
- ui->houndButton->setChecked(false);
- ui->houndButton->setStyleSheet("");
if(m_specOp==SpecOp::HOUND) {
m_config.setSpecial_None();
m_specOp=m_config.special_op_id();
@@ -10198,8 +10605,6 @@ void MainWindow::on_ft8Button_clicked() void MainWindow::on_ft4Button_clicked()
{
- ui->houndButton->setChecked(false);
- ui->houndButton->setStyleSheet("");
if(m_specOp==SpecOp::HOUND) {
m_config.setSpecial_None();
m_specOp=m_config.special_op_id();
@@ -10209,8 +10614,6 @@ void MainWindow::on_ft4Button_clicked() void MainWindow::on_msk144Button_clicked()
{
- ui->houndButton->setChecked(false);
- ui->houndButton->setStyleSheet("");
if(m_specOp==SpecOp::HOUND) {
m_config.setSpecial_None();
m_specOp=m_config.special_op_id();
@@ -10220,8 +10623,6 @@ void MainWindow::on_msk144Button_clicked() void MainWindow::on_q65Button_clicked()
{
- ui->houndButton->setChecked(false);
- ui->houndButton->setStyleSheet("");
if(m_specOp==SpecOp::HOUND) {
m_config.setSpecial_None();
m_specOp=m_config.special_op_id();
@@ -10231,8 +10632,6 @@ void MainWindow::on_q65Button_clicked() void MainWindow::on_jt65Button_clicked()
{
- ui->houndButton->setChecked(false);
- ui->houndButton->setStyleSheet("");
if(m_specOp==SpecOp::HOUND) {
m_config.setSpecial_None();
m_specOp=m_config.special_op_id();
|
