diff options
| author | Christoph Berg <myon@debian.org> | 2024-07-20 08:39:32 +0000 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2024-07-20 08:39:32 +0000 |
| commit | fbaeaa72f63f22bf0b53d634f6809cbdfbb46c9f (patch) | |
| tree | 34bf121b8a6f02b43542bd554d59ba6191cd1359 /widgets/mainwindow.cpp | |
| parent | 93f7198f9c2864ef9630cc0cc9e46d6cc1933aa9 (diff) | |
New upstream version 2.7.0~rc6+dfsgupstream/2.7.0_rc6+dfsg
Diffstat (limited to 'widgets/mainwindow.cpp')
| -rwxr-xr-x | widgets/mainwindow.cpp | 336 |
1 files changed, 258 insertions, 78 deletions
diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 543f4beb..f6054855 100755 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -176,7 +176,9 @@ extern "C" { void calibrate_(char const * data_dir, int* iz, double* a, double* b, double* rms,
double* sigmaa, double* sigmab, int* irc, fortran_charlen_t);
- void foxgen_();
+ void foxgen_(bool* bSuperFox, char const * fname, FCL len);
+
+ void sfox_wave_gfsk_(char const * fname, FCL len);
void plotsave_(float swide[], int* m_w , int* m_h1, int* irow);
@@ -213,10 +215,13 @@ QVector<QColor> g_ColorTbl; using SpecOp = Configuration::SpecialOperatingActivity;
+bool verified = false;
bool blocked = false;
bool m_displayBand = false;
bool no_a7_decodes = false;
bool keep_frequency = false;
+int m_Nslots0 {1};
+int m_TxFreqFox {300};
QSharedMemory mem_qmap("mem_qmap"); //Memory segment to be shared (optionally) with QMAP
struct {
@@ -1112,9 +1117,9 @@ void MainWindow::not_GA_warning_message () MessageBox::critical_message (this,
"This is a pre-release version of WSJT-X " + version (false) + " made\n"
"available for testing purposes. By design it will\n"
- "be nonfunctional after October 30, 2024.");
+ "be nonfunctional after December 31, 2024.");
auto now = QDateTime::currentDateTimeUtc ();
- if (now >= QDateTime {{2024, 10, 30}, {23, 59, 59, 999}, Qt::UTC}) {
+ if (now >= QDateTime {{2024, 12, 31}, {23, 59, 59, 999}, Qt::UTC}) {
Q_EMIT finished ();
}
}
@@ -1162,6 +1167,9 @@ void MainWindow::on_the_minute () tx_watchdog (false);
}
update_foxLogWindow_rate(); // update the rate on the window
+ if ((!verified && ui->labDXped->isVisible()) or ui->labDXped->text()!="Super Hound")
+ ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}");
+ verified = false;
}
//--------------------------------------------------- MainWindow destructor
@@ -1220,9 +1228,11 @@ void MainWindow::writeSettings() m_settings->setValue("RespondCQ",ui->respondComboBox->currentIndex());
m_settings->setValue("HoundSort",ui->comboBoxHoundSort->currentIndex());
m_settings->setValue("FoxNlist",ui->sbNlist->value());
- m_settings->setValue("FoxNslots",ui->sbNslots->value());
+ m_settings->setValue("FoxNslots",m_Nslots0);
m_settings->setValue("FoxMaxDB_v2",ui->sbMax_dB->value()); // original key abandoned
m_settings->setValue ("SerialNumber",ui->sbSerialNumber->value ());
+ m_settings->setValue("FoxTextMsg", m_freeTextMsg0);
+ m_settings->setValue("WorkDupes", ui->cbWorkDupes->isChecked());
m_settings->endGroup();
// do this in the General group because we save the parameters from various places
@@ -1242,7 +1252,8 @@ void MainWindow::writeSettings() m_settings->setValue("SaveAll",ui->actionSave_all->isChecked());
m_settings->setValue("NDepth",m_ndepth);
m_settings->setValue("RxFreq",ui->RxFreqSpinBox->value());
- m_settings->setValue("TxFreq",ui->TxFreqSpinBox->value());
+ if(m_specOp!=SpecOp::FOX) m_settings->setValue("TxFreq",ui->TxFreqSpinBox->value());
+ m_settings->setValue("TxFreqFox",m_TxFreqFox);
m_settings->setValue("WSPRfreq",ui->WSPRfreqSpinBox->value());
m_settings->setValue("FST4W_RxFreq",ui->sbFST4W_RxFreq->value());
m_settings->setValue("FST4W_FTol",ui->sbFST4W_FTol->value());
@@ -1330,10 +1341,14 @@ void MainWindow::readSettings() ui->respondComboBox->setCurrentIndex(m_settings->value("RespondCQ",0).toInt());
ui->comboBoxHoundSort->setCurrentIndex(m_settings->value("HoundSort",3).toInt());
ui->sbNlist->setValue(m_settings->value("FoxNlist",12).toInt());
- m_Nslots=m_settings->value("FoxNslots",5).toInt();
- ui->sbNslots->setValue(m_Nslots);
+ m_Nslots=m_settings->value("FoxNslots",3).toInt();
+ m_Nslots0=m_Nslots;
+ if(!m_config.superFox()) ui->sbNslots->setValue(m_Nslots);
ui->sbMax_dB->setValue(m_settings->value("FoxMaxDB_v2",70).toInt());
ui->sbSerialNumber->setValue (m_settings->value ("SerialNumber", 1).toInt ());
+ m_freeTextMsg0=m_settings->value("FoxTextMsg","").toString();
+ m_freeTextMsg=m_freeTextMsg0;
+ ui->cbWorkDupes->setChecked(m_settings->value("WorkDupes",false).toBool());
m_settings->endGroup();
m_settings->beginGroup("Common");
@@ -1414,7 +1429,9 @@ void MainWindow::readSettings() ui->WSPRfreqSpinBox->setValue(0); // ensure a change is signaled
ui->WSPRfreqSpinBox->setValue(m_settings->value("WSPRfreq",1500).toInt());
ui->TxFreqSpinBox->setValue(0); // ensure a change is signaled
- ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq",1500).toInt());
+ if(m_specOp!=SpecOp::FOX) ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq",1500).toInt());
+ m_TxFreqFox=m_settings->value("TxFreqFox",300).toInt();
+ if(m_specOp==SpecOp::FOX && !m_config.superFox()) ui->TxFreqSpinBox->setValue(m_TxFreqFox);
m_ndepth=m_settings->value("NDepth",3).toInt();
ui->sbTxPercent->setValue (m_settings->value ("PctTx", 20).toInt ());
on_sbTxPercent_valueChanged (ui->sbTxPercent->value ());
@@ -1437,7 +1454,12 @@ void MainWindow::readSettings() ui->sbCQTxFreq->setValue (m_settings->value ("CQTxFreq", 260).toInt());
m_noSuffix=m_settings->value("NoSuffix",false).toBool();
int n=m_settings->value("GUItab",0).toInt();
- ui->tabWidget->setCurrentIndex(n);
+ if (SpecOp::FOX==m_specOp) {
+ ui->tabWidget->setCurrentIndex(n);
+ } else {
+ ui->tabWidget->setCurrentIndex(1); // needed for GUI initialisation when SuperFox controls are invisible
+ ui->tabWidget->setCurrentIndex(n);
+ }
outBufSize=m_settings->value("OutBufSize",4096).toInt();
ui->cbHoldTxFreq->setChecked (m_settings->value ("HoldTxFreq", false).toBool ());
m_pwrBandTxMemory=m_settings->value("pwrBandTxMemory").toHash();
@@ -2131,6 +2153,8 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog "Fox-and-Hound operation is available only in FT8 mode.\nGo back and change your selection.");
}
ui->labDXped->setVisible(SpecOp::NONE != m_specOp);
+ if ((!verified && ui->labDXped->isVisible()) or ui->labDXped->text()!="Super Hound")
+ ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}");
set_mode(m_mode);
configActiveStations();
}
@@ -2224,28 +2248,26 @@ void MainWindow::keyPressEvent (QKeyEvent * e) case Qt::Key_Backspace:
qDebug() << "Key Backspace";
return;
-#ifdef DEBUG_FOX
case Qt::Key_X:
if(e->modifiers() & Qt::AltModifier) {
foxTest();
return;
}
-#endif
- }
- QMainWindow::keyPressEvent (e);
- }
-
- if(SpecOp::HOUND == m_specOp) {
- switch (e->key()) {
- case Qt::Key_Return:
- auto_tx_mode(true);
- return;
- case Qt::Key_Enter:
- auto_tx_mode(true);
- return;
}
QMainWindow::keyPressEvent (e);
}
+ // Why shall RETURN switch Tx on when in Hound mode? Makes little sense and confuses many OMs!
+// if(SpecOp::HOUND == m_specOp) {
+// switch (e->key()) {
+// case Qt::Key_Return:
+// auto_tx_mode(true);
+// return;
+// case Qt::Key_Enter:
+// auto_tx_mode(true);
+// return;
+// }
+// QMainWindow::keyPressEvent (e);
+// }
int n;
bool bAltF1F6=m_config.alternate_bindings();
@@ -2451,8 +2473,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) break;
case Qt::Key_X:
if(e->modifiers() & Qt::AltModifier) {
-// qDebug() << "Alt-X" << m_mode << m_TRperiod << m_nsps << m_bFast9
-// << tx_duration(m_mode,m_TRperiod,m_nsps,m_bFast9);
+ foxTest();
return;
}
}
@@ -2588,6 +2609,22 @@ void MainWindow::statusChanged() }
}
}
+ if (SpecOp::FOX==m_specOp && m_config.superFox()) {
+ ui->sbNslots->setVisible(false);
+ ui->pbFreeText->setVisible(true);
+ ui->cbSendMsg->setVisible(true);
+ if(ui->cbSendMsg->isChecked()) {
+ ui->sbNslots->setValue(2);
+ } else {
+ ui->sbNslots->setValue(5);
+ }
+ } else {
+ ui->sbNslots->setVisible(true);
+ ui->pbFreeText->setVisible(false);
+ ui->cbSendMsg->setVisible(false);
+ ui->sbNslots->setValue(m_Nslots0);
+ }
+ if (SpecOp::HOUND==m_specOp) ui->cbRxAll->setVisible(!m_config.superFox());
}
bool MainWindow::eventFilter (QObject * object, QEvent * event)
@@ -2789,6 +2826,11 @@ void MainWindow::on_actionFT8_DXpedition_Mode_User_Guide_triggered() QDesktopServices::openUrl (QUrl {"https://wsjt.sourceforge.io/FT8_DXpedition_Mode.pdf"});
}
+void MainWindow::on_actionSuperFox_User_Guide_triggered()
+{
+ QDesktopServices::openUrl (QUrl {"https://wsjt.sourceforge.io/SuperFox_User_Guide.pdf"});
+}
+
void MainWindow::on_actionQSG_FST4_triggered()
{
QDesktopServices::openUrl (QUrl {"https://wsjt.sourceforge.io/FST4_Quick_Start.pdf"});
@@ -3130,14 +3172,7 @@ void MainWindow::read_wav_file (QString const& fname) dec_data.params.newdat = 0;
}
- if(basename.mid(0,10)=="000000_000" && m_mode == "FT8") {
- int isec=15*basename.mid(10,3).toInt();
- int ih=isec/3600;
- int im=(isec-3600*ih)/60;
- isec=isec%60;
- dec_data.params.nutc=3600*ih+60*im+isec;
- }
-
+ dec_data.params.yymmdd=basename.left(6).toInt();
}));
}
@@ -3404,8 +3439,10 @@ void MainWindow::decode() //decode() m_dateTimeLastTX = now.addSecs(-900);
dec_data.params.lapcqonly=true;
}
- if( m_diskData ) {
+ if(m_diskData) {
dec_data.params.lapcqonly=false;
+ } else {
+ dec_data.params.yymmdd=-1;
}
if(!m_dataAvailable or m_TRperiod==0.0) return;
ui->DecodeButton->setChecked (true);
@@ -3452,8 +3489,13 @@ void MainWindow::decode() //decode() 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::HOUND==m_specOp and !ui->cbRxAll->isChecked() and
+ !m_config.superFox()) dec_data.params.nfb=1000;
if(m_mode=="FT8" and SpecOp::FOX == m_specOp ) dec_data.params.nfqso=200;
+ dec_data.params.b_even_seq=(dec_data.params.nutc%10)==0;
+ dec_data.params.b_superfox=(m_config.superFox() and (SpecOp::FOX == m_specOp or SpecOp::HOUND == m_specOp));
+ if(dec_data.params.b_superfox and dec_data.params.b_even_seq and m_ihsym<50) return;
+
dec_data.params.ntol=ui->sbFtol->value ();
if(!m_config.enable_VHF_features()) {
dec_data.params.ntol=20;
@@ -3513,7 +3555,7 @@ void MainWindow::decode() //decode() 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);
- dec_data.params.max_drift=ui->sbMaxDrift->value();
+ dec_data.params.max_drift=ui->sbMaxDrift->value();
::memcpy(dec_data.params.datetime, m_dateTime.toLatin1()+" ", sizeof dec_data.params.datetime);
::memcpy(dec_data.params.mycall, (m_config.my_callsign()+" ").toLatin1(), sizeof dec_data.params.mycall);
@@ -3674,7 +3716,10 @@ void MainWindow::decodeDone () ui->DecodeButton->setChecked (false);
decodeBusy(false);
m_RxLog=0;
- if(SpecOp::FOX == m_specOp) houndCallers();
+ if(SpecOp::FOX == m_specOp) {
+ houndCallers();
+ if(ui->cbWorkDupes->isChecked()) QTimer::singleShot (5000, [=] {band_activity_cleared();});
+ }
to_jt9(m_ihsym,-1,1); //Tell jt9 we know it has finished
m_startAnother=m_loopall;
@@ -4077,7 +4122,7 @@ void MainWindow::readFromStdout() //readFromStdout write_all("Rx",line_read.trimmed());
int ntime=6;
if(m_TRperiod>=60) ntime=4;
- if (line_read.left(ntime) != m_tBlankLine) {
+ if (line_read.left(ntime) != m_tBlankLine && QString::fromUtf8(line_read.constData()).left(4).contains(QRegularExpression {"\\d\\d\\d\\d"})) {
ui->decodedTextBrowser->new_period ();
if (m_config.insert_blank ()
&& SpecOp::FOX != m_specOp) {
@@ -4128,6 +4173,14 @@ void MainWindow::readFromStdout() //readFromStdout if((m_mode=="FT4" or m_mode=="FT8") and bDisplayPoints and decodedtext1.isStandardMessage()) {
ARRL_Digi_Update(decodedtext1);
}
+ if (ui->labDXped->text()=="Super Hound" && decodedtext0.mid(3,18).contains(" verified")) {
+ verified = true;
+ ui->labDXped->setStyleSheet("QLabel {background-color: #00ff00; color: black;}");
+ } else {
+ if (decodedtext0.mid(4,2).contains("00") or decodedtext0.mid(4,2).contains("30")) verified = false;
+ }
+ if ((!verified && ui->labDXped->isVisible()) or ui->labDXped->text()!="Super Hound")
+ ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}");
ui->decodedTextBrowser->displayDecodedText (decodedtext1, m_config.my_callsign (), m_mode, m_config.DXCC (),
m_logBook, m_currentBandPeriod, m_config.ppfx (),
ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(),
@@ -4267,6 +4320,7 @@ void MainWindow::readFromStdout() //readFromStdout if(SpecOp::FOX==m_specOp and decodedtext.string().contains(" DE ")) for_us=true; //Hound with compound callsign
if(SpecOp::FOX==m_specOp and for_us and decodedtext.string().contains(QRegularExpression{" R\\W\\d"})) bDisplayRight=true;
if(SpecOp::FOX!=m_specOp and (for_us or (abs(audioFreq - m_wideGraph->rxFreq()) <= 10))) bDisplayRight=true;
+ if(SpecOp::HOUND==m_specOp and !for_us) bDisplayRight=false;
}
} else {
if((abs(audioFreq - m_wideGraph->rxFreq()) <= 10) and
@@ -4274,7 +4328,7 @@ void MainWindow::readFromStdout() //readFromStdout }
if(m_mode=="Q65" and !bAvgMsg and !decodedtext.string().contains(m_baseCall)) bDisplayRight=false;
if((m_mode=="JT4" or m_mode=="Q65" or m_mode=="JT65") and decodedtext.string().contains(m_baseCall) && ui->actionInclude_averaging->isVisible() && !ui->actionInclude_averaging->isChecked()) bDisplayRight=true;
- if(m_mode=="FT8" and SpecOp::HOUND==m_specOp && decodedtext0.string().replace("<","").replace(">","").contains(" " + m_baseCall + " ")) bDisplayRight=true;
+ if((m_mode=="FT8" or m_mode=="FT4") and SpecOp::FOX!=m_specOp && decodedtext0.string().replace("<","").replace(">","").contains(m_baseCall + " " + m_hisCall)) bDisplayRight=true; // really all messages for us
if (bDisplayRight) {
// This msg is within 10 hertz of our tuned frequency, or a JT4 or JT65 avg,
@@ -4324,7 +4378,7 @@ void MainWindow::readFromStdout() //readFromStdout 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
+ if (text.contains(" " + m_config.my_callsign() + " " + m_hisCall) && !text.contains("73 ")) processMessage(decodedtext0); // needed for MSHV multistream messages
}
}
}
@@ -4333,7 +4387,7 @@ void MainWindow::readFromStdout() //readFromStdout }
//### I think this is where we are preventing Hounds from spotting Fox ###
- if(m_mode!="FT8" or (SpecOp::HOUND != m_specOp)) {
+ if(m_mode!="FT8" or (SpecOp::HOUND != m_specOp) or (SpecOp::HOUND == m_specOp and m_config.superFox())) {
if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="Q65"
or m_mode=="JT4" or m_mode=="JT65" or m_mode=="JT9" or m_mode=="FST4") {
auto_sequence (decodedtext, 25, 50);
@@ -4549,6 +4603,8 @@ void MainWindow::guiUpdate() if(m_TRperiod==0) m_TRperiod=60.0;
txDuration=tx_duration(m_mode,m_TRperiod,m_nsps,m_bFast9);
+ if(m_mode=="FT8" and m_specOp==SpecOp::FOX and m_config.superFox()) txDuration=1.0+151*1024.0/12000.0;
+ // qDebug () << "DEBUG SF " << m_mode << m_TRperiod << m_nsps << (SpecOp::FOX==m_specOp) << m_config.superFox() << txDuration;
double tx1=0.0;
double tx2=txDuration;
if(m_mode=="FT8" or m_mode=="FT4") icw[0]=0; //No CW ID in FT4 or FT8 mode
@@ -4671,11 +4727,15 @@ void MainWindow::guiUpdate() setRig ();
if(m_mode=="FT8") {
if (SpecOp::FOX == m_specOp) {
- if (ui->TxFreqSpinBox->value() > 900) {
- ui->TxFreqSpinBox->setValue(300);
+ if(m_config.superFox()) {
+ ui->TxFreqSpinBox->setValue(750); //SuperFox transmits at 750 Hz
+ } else {
+ if (ui->TxFreqSpinBox->value() > 900) {
+ ui->TxFreqSpinBox->setValue(300);
+ }
}
}
- else if (SpecOp::HOUND == m_specOp) {
+ else if (SpecOp::HOUND == m_specOp && !m_config.superFox()) {
if(m_auto && !m_tune) {
if (ui->TxFreqSpinBox->value() < 999 && m_ntx != 3) {
// Hound randomized range: 1000-3000 Hz
@@ -4823,7 +4883,13 @@ void MainWindow::guiUpdate() if(m_config.split_mode()) foxcom_.nfreq = foxcom_.nfreq - m_XIT; //Fox Tx freq
QString foxCall=m_config.my_callsign() + " ";
::memcpy(foxcom_.mycall, foxCall.toLatin1(), sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_
- foxgen_();
+ bool bSuperFox=m_config.superFox();
+ auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()};
+ foxcom_.bMoreCQs=ui->cbMoreCQs->isChecked();
+ foxcom_.bSendMsg=ui->cbSendMsg->isChecked();
+ memcpy(foxcom_.textMsg, m_freeTextMsg.leftJustified(26,' ').toLatin1(),26);
+ foxgen_(&bSuperFox, fname.constData(), (FCL)fname.size());
+ if(bSuperFox) sfox_tx();
}
}
}
@@ -4933,7 +4999,7 @@ void MainWindow::guiUpdate() write_all("Tx",m_currentMessage);
if (m_config.TX_messages () and m_mode!="Echo") {
ui->decodedTextBrowser2->displayTransmittedText(m_currentMessage.trimmed(),m_mode,
- ui->TxFreqSpinBox->value(),m_bFastMode,m_TRperiod);
+ ui->TxFreqSpinBox->value(),m_bFastMode,m_TRperiod,m_config.superFox());
}
}
@@ -5036,7 +5102,7 @@ void MainWindow::guiUpdate() if (m_config.TX_messages () && !m_tune && SpecOp::FOX!=m_specOp)
{
ui->decodedTextBrowser2->displayTransmittedText(current_message.trimmed(),
- m_mode,ui->TxFreqSpinBox->value(),m_bFastMode,m_TRperiod);
+ m_mode,ui->TxFreqSpinBox->value(),m_bFastMode,m_TRperiod,m_config.superFox());
}
}
@@ -5107,17 +5173,20 @@ void MainWindow::guiUpdate() readWidebandDecodes();
}
if(ipc_qmap[5]>0) {
-// qDebug() << "aa" << m_freqNominal << ipc_qmap[5];
setRig((m_freqNominal/1000000)*1000000 + 1000*ipc_qmap[5]);
ipc_qmap[5]=0;
-// qDebug() << "bb" << m_freqNominal << ipc_qmap[5];
}
mem_qmap.unlock();
}
//Once per second (onesec)
if(nsec != m_sec0) {
-// qDebug() << "AAA" << nsec%60 << ipc_qmap[5];
+// qDebug() << "AAA" << nsec%60 << ui->cbWorkDupes->isChecked();
+
+// qint64 n64 = QDateTime::currentSecsSinceEpoch();
+// n64=n64/30;
+// n64=n64*30;
+// qDebug() << "bb" << m_config.FoxKey() << nsec%60 << dec_data.params.nutc << n64 << n64%60;
if(m_mode=="FST4") chk_FST4_freq_range();
m_currentBand=m_config.bands()->find(m_freqNominal);
if( SpecOp::HOUND == m_specOp ) {
@@ -6434,7 +6503,7 @@ void MainWindow::lookup() {
QString hisCall {ui->dxCallEntry->text()};
QString hisgrid0 {ui->dxGridEntry->text()};
- if (!hisCall.size () or (!(m_specOp==SpecOp::NONE or m_specOp==SpecOp::HOUND or m_specOp==SpecOp::Q65_PILEUP))) return;
+ if (!hisCall.size ()) return;
QFile f {m_config.writeable_data_dir ().absoluteFilePath ("CALL3.TXT")};
if (f.open (QIODevice::ReadOnly | QIODevice::Text))
{
@@ -6668,9 +6737,19 @@ void MainWindow::mousePressEvent(QMouseEvent *event) m_config.setSpecial_Q65_Pileup();
m_specOp=m_config.special_op_id();
on_actionQ65_triggered();
+ ui->q65Button->clearFocus();
}
if(ui->jt65Button->hasFocus() && (event->button() & Qt::RightButton)) { // switch to JT9 mode
on_actionJT9_triggered();
+ ui->jt65Button->clearFocus();
+ }
+ if(ui->ft8Button->hasFocus() && (event->button() & Qt::RightButton)) { // toggle SuperFox mode
+ keep_frequency = true;
+ m_config.toggle_SF();
+ QTimer::singleShot (250, [=] {keep_frequency = false;});
+ on_actionFT8_triggered();
+ ui->ft8Button->clearFocus();
+ ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}");
}
}
@@ -6766,7 +6845,7 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button {
case SpecOp::NA_VHF:
m_xSent=m_config.my_grid().left(4);
- m_xRcvd=m_hisGrid;
+ m_xRcvd=m_hisGrid.left(4);
break;
case SpecOp::EU_VHF:
m_rptSent=m_xSent.split(" ").at(0).left(2);
@@ -6785,11 +6864,11 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button break;
case SpecOp::WW_DIGI:
m_xSent=m_config.my_grid().left(4);
- m_xRcvd=m_hisGrid;
+ m_xRcvd=m_hisGrid.left(4);
break;
case SpecOp::ARRL_DIGI:
m_xSent=m_config.my_grid().left(4);
- m_xRcvd=m_hisGrid;
+ m_xRcvd=m_hisGrid.left(4);
break;
case SpecOp::Q65_PILEUP:
m_xSent=m_config.my_grid().left(4);
@@ -7117,7 +7196,8 @@ void MainWindow::on_actionFT4_triggered() void MainWindow::on_actionFT8_triggered()
{
QTimer::singleShot (50, [=] {
- ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq_old",1500).toInt());
+ if(m_specOp!=SpecOp::FOX) ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq_old",1500).toInt());
+ if(m_specOp==SpecOp::FOX && !m_config.superFox()) ui->TxFreqSpinBox->setValue(m_TxFreqFox);
ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq_old",1500).toInt());
on_sbSubmode_valueChanged(ui->sbSubmode->value());
});
@@ -7169,10 +7249,18 @@ void MainWindow::on_actionFT8_triggered() ui->cbHoldTxFreq->setChecked(true);
ui->cbAutoSeq->setEnabled(false);
ui->tabWidget->setCurrentIndex(1);
- ui->TxFreqSpinBox->setValue(300);
+ if(m_config.superFox()) {
+ ui->TxFreqSpinBox->setValue(750); //SuperFox transmits at 750 Hz
+ } else {
+ ui->TxFreqSpinBox->setValue(300);
+ }
// 01234567890123456789012345678901234567
displayWidgets(nWidgets("11101000010011100001000000000010000000"));
- ui->labDXped->setText(tr ("Fox"));
+ if(m_config.superFox()) {
+ ui->labDXped->setText(tr ("Super Fox"));
+ } else {
+ ui->labDXped->setText(tr ("Fox"));
+ }
on_fox_log_action_triggered();
}
if(SpecOp::HOUND == m_specOp) {
@@ -7184,7 +7272,13 @@ void MainWindow::on_actionFT8_triggered() ui->cbHoldTxFreq->setChecked(true);
// 01234567890123456789012345678901234567
displayWidgets(nWidgets("11101000010011000001000000000011000000"));
- ui->labDXped->setText(tr ("Hound"));
+ if(m_config.superFox()) {
+ ui->labDXped->setText(tr ("Super Hound"));
+ ui->cbRxAll->setEnabled(false);
+ } else {
+ ui->labDXped->setText(tr ("Hound"));
+ ui->cbRxAll->setEnabled(true);
+ }
ui->txrb1->setChecked(true);
ui->txrb2->setEnabled(false);
ui->txrb4->setEnabled(false);
@@ -7195,7 +7289,7 @@ void MainWindow::on_actionFT8_triggered() ui->txb5->setEnabled(false);
ui->txb6->setEnabled(false);
} else {
- if (!(keep_frequency)) switch_mode (Modes::FT8);
+ switch_mode (Modes::FT8);
}
if(m_specOp != SpecOp::HOUND) {
ui->houndButton->setChecked(false);
@@ -7220,7 +7314,7 @@ void MainWindow::on_actionFT8_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) {
+ if((SpecOp::FOX==m_specOp or SpecOp::HOUND==m_specOp) and !m_config.superFox() and !m_config.split_mode() and !m_bWarnedSplit) {
QString errorMsg;
MessageBox::critical_message (this,
"Operation in FT8 DXpedition mode normally requires\n"
@@ -7228,6 +7322,7 @@ void MainWindow::on_actionFT8_triggered() "the *Settings | Radio* tab.)", errorMsg);
m_bWarnedSplit=true;
}
+ if (ui->labDXped->isVisible()) ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}");
statusChanged();
configActiveStations();
}
@@ -7697,9 +7792,11 @@ void MainWindow::switch_mode (Mode mode) 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);
- ui->bandComboBox->setCurrentIndex (row);
- if (row >= 0) {
- on_bandComboBox_activated (row);
+ if (!keep_frequency) {
+ ui->bandComboBox->setCurrentIndex (row);
+ if (row >= 0 ) {
+ on_bandComboBox_activated (row);
+ }
}
ui->rptSpinBox->setSingleStep(1);
ui->rptSpinBox->setMinimum(-50);
@@ -7787,9 +7884,11 @@ void MainWindow::on_TxFreqSpinBox_valueChanged(int n) ui->TxFreqSpinBox->setStyleSheet("");
}
}
- if (m_mode != "MSK144" && m_mode != "FST4W" && m_mode != "WSPR" && m_mode != "Echo" && m_mode != "FreqCal") {
+ if (m_mode != "MSK144" && m_mode != "FST4W" && m_mode != "WSPR" && m_mode != "Echo" && m_mode != "FreqCal"
+ && m_specOp!=SpecOp::FOX) {
QTimer::singleShot (200, [=] {m_settings->setValue("TxFreq_old",ui->TxFreqSpinBox->value());});
}
+ if(m_specOp==SpecOp::FOX && !m_config.superFox()) QTimer::singleShot (50, [=] {m_TxFreqFox=n;});
statusUpdate ();
}
@@ -7993,8 +8092,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);
+// m_specOp=m_config.special_op_id();
+// if (m_specOp==SpecOp::HOUND) auto_tx_mode(false);
}
void MainWindow::band_changed (Frequency f)
@@ -8190,7 +8289,7 @@ void MainWindow::setXIT(int n, Frequency base) }
if (!base) base = m_freqNominal;
m_XIT = 0;
- if (!m_bSimplex) {
+ if (!(m_bSimplex || (SpecOp::FOX==m_specOp && m_config.superFox()))) {
// m_bSimplex is false, so we can use split mode if requested
if (m_config.split_mode () && (!m_config.enable_VHF_features () ||
m_mode=="FT4" || m_mode == "FT8" || m_mode=="FST4")) {
@@ -8396,10 +8495,17 @@ void MainWindow::transmit (double snr) if(m_config.x2ToneSpacing()) toneSpacing=2*12000.0/1920.0;
if(m_config.x4ToneSpacing()) toneSpacing=4*12000.0/1920.0;
if(SpecOp::FOX==m_specOp and !m_tune) toneSpacing=-1;
- Q_EMIT sendMessage (m_mode, NUM_FT8_SYMBOLS,
+ if(SpecOp::FOX==m_specOp and m_config.superFox()) {
+ Q_EMIT sendMessage (m_mode, NUM_SUPERFOX_SYMBOLS,
+ 1024.0, ui->TxFreqSpinBox->value () - m_XIT,
+ toneSpacing, m_soundOutput, m_config.audio_output_channel (),
+ true, false, snr, m_TRperiod);
+ } else {
+ Q_EMIT sendMessage (m_mode, NUM_FT8_SYMBOLS,
1920.0, ui->TxFreqSpinBox->value () - m_XIT,
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
true, false, snr, m_TRperiod);
+ }
}
if (m_mode == "FT4") {
@@ -8832,6 +8938,14 @@ void MainWindow::on_cbFast9_clicked(bool b) statusChanged ();
}
+void MainWindow::on_cbSendMsg_toggled(bool b)
+{
+ if(b) {
+ ui->sbNslots->setValue(2);
+ } else {
+ ui->sbNslots->setValue(5);
+ }
+}
void MainWindow::on_cbShMsgs_toggled(bool b)
{
@@ -9425,7 +9539,7 @@ void MainWindow::setRig (Frequency f) if(m_transmitting && !m_config.tx_QSY_allowed ()) return;
if ((m_monitoring || m_transmitting) && m_config.transceiver_online ())
{
- if (m_transmitting && m_config.split_mode ())
+ if (m_transmitting && m_config.split_mode () && !(m_config.superFox() && m_specOp==SpecOp::FOX))
{
m_config.transceiver_tx_frequency (m_freqTxNominal + m_astroCorrection.tx);
}
@@ -9800,7 +9914,7 @@ void MainWindow::hound_reply () m_nSentFoxRrpt = 1;
ui->rptSpinBox->setValue(m_rptSent.toInt());
if (!m_auto) auto_tx_mode(true);
- ui->TxFreqSpinBox->setValue (m_nFoxFreq);
+ if (!m_config.superFox()) ui->TxFreqSpinBox->setValue (m_nFoxFreq);
}
}
@@ -9816,6 +9930,7 @@ void MainWindow::on_sbNslots_valueChanged(int n) QString t;
t = t.asprintf(" NSlots %d",m_Nslots);
writeFoxQSO(t);
+ if(!m_config.superFox()) m_Nslots0=n;
}
void MainWindow::on_sbMax_dB_valueChanged(int n)
@@ -9852,6 +9967,17 @@ void MainWindow::on_pbFoxReset_clicked() }
}
+void MainWindow::on_pbFreeText_clicked()
+{
+ bool ok;
+ m_freeTextMsg = QInputDialog::getText (this, tr("Free Text Message"),
+ tr("Message:"), QLineEdit::Normal, m_freeTextMsg0, &ok).left(26);
+ if(ok) {
+ m_freeTextMsg=m_freeTextMsg.toUpper();
+ m_freeTextMsg0=m_freeTextMsg;
+ }
+}
+
void MainWindow::on_comboBoxHoundSort_activated(int index)
{
if(index!=-99) houndCallers(); //Silence compiler warning
@@ -10026,6 +10152,18 @@ void MainWindow::houndCallers() return; // don't use these decodes
}
+// Read decodes of the current period
+ QFile d(m_config.temp_dir().absoluteFilePath("decoded.txt"));
+ QTextStream ds(&d);
+ QString decoded="";
+ if(d.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ while (!ds.atEnd()) {
+ decoded = ds.readAll();
+ }
+ ds.flush();
+ d.close();
+ }
+
QFile f(m_config.temp_dir().absoluteFilePath("houndcallers.txt"));
if(f.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream s(&f);
@@ -10043,12 +10181,17 @@ void MainWindow::houndCallers() paddedHoundCall=houndCall + " ";
//Don't list a hound already in the queue
if(!ui->houndQueueTextBrowser->toPlainText().contains(paddedHoundCall)) {
- if(m_loggedByFox[houndCall].contains(m_lastBand)) continue; //already logged on this band
- if(m_foxQSO.contains(houndCall)) continue; //still in the QSO map
+ if(ui->cbWorkDupes->isChecked()) {
+ if(m_loggedByFox[houndCall].contains(m_lastBand)
+ and !decoded.contains(paddedHoundCall)) continue; // don't display old messages again of stations already logged
+ } else {
+ if(m_loggedByFox[houndCall].contains(m_lastBand)) continue; // already logged on this band
+ }
+ if(m_foxQSO.contains(houndCall)) continue; // still in the QSO map
auto const& entity = m_logBook.countries ()->lookup (houndCall);
auto const& continent = AD1CCty::continent (entity.continent);
-//If we are using a directed CQ, ignore Hound calls that do not comply.
+// If we are using a directed CQ, ignore Hound calls that do not comply.
QString CQtext=ui->comboBoxCQ->currentText();
if(CQtext.length()==5 and (continent!=CQtext.mid(3,2))) continue;
int nCallArea=-1;
@@ -10060,7 +10203,7 @@ void MainWindow::houndCallers() }
if(nCallArea!=CQtext.mid(3,1).toInt()) continue;
}
-//This houndCall passes all tests, add it to the list.
+// This houndCall passes all tests, add it to the list.
t = t + line + " " + continent + "\n";
m_nHoundsCalling++; // Number of accepted Hounds to be sorted
}
@@ -10297,7 +10440,15 @@ Transmit: if(m_config.split_mode()) foxcom_.nfreq = foxcom_.nfreq - m_XIT; //Fox Tx freq
QString foxCall=m_config.my_callsign() + " ";
::memcpy(foxcom_.mycall, foxCall.toLatin1(),sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_
- foxgen_();
+ bool bSuperFox=m_config.superFox();
+ foxcom_.bMoreCQs=ui->cbMoreCQs->isChecked();
+ foxcom_.bSendMsg=ui->cbSendMsg->isChecked();
+// qDebug() << "cc" << foxcom_.bMoreCQs << foxcom_.bSendMsg << foxcom_.nslots
+// << m_Nslots << m_freeTextMsg0;
+ ::memcpy(foxcom_.textMsg, m_freeTextMsg0.leftJustified(26,' ').toLatin1(),26);
+ auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()};
+ foxgen_(&bSuperFox, fname.constData(), (FCL)fname.size());
+ if(bSuperFox) sfox_tx();
m_tFoxTxSinceCQ++;
for(QString hc: m_foxQSO.keys()) { //Check for strikeout or timeout
@@ -10429,8 +10580,13 @@ void MainWindow::foxGenWaveform(int i,QString fm) QString txModeArg;
txModeArg = txModeArg.asprintf("FT8fox %d",i+1);
+ int nfreq=ui->TxFreqSpinBox->value()+60*i;
+ if(m_config.superFox()) nfreq=750;
ui->decodedTextBrowser2->displayTransmittedText(fm.trimmed(), txModeArg,
- ui->TxFreqSpinBox->value()+60*i,m_bFastMode,m_TRperiod);
+ nfreq,m_bFastMode,m_TRperiod,m_config.superFox());
+ if (SpecOp::FOX==m_specOp && m_config.superFox() && ui->cbSendMsg->isChecked())
+ ui->decodedTextBrowser2->displayTransmittedText(m_freeTextMsg0, txModeArg,
+ nfreq,m_bFastMode,m_TRperiod,m_config.superFox());
foxcom_.i3bit[i]=0;
if(fm.indexOf("<")>0) foxcom_.i3bit[i]=1;
strncpy(&foxcom_.cmsg[i][0],fm.toLatin1(),40); //Copy this message into cmsg[i]
@@ -10483,7 +10639,6 @@ void MainWindow::foxTest() return;
}
-
QTextStream s(&f);
QTextStream sdiag(&fdiag);
@@ -10579,6 +10734,7 @@ void MainWindow::write_all(QString txRx, QString message) QString msg;
QString mode_string;
QString file_name="ALL.TXT";
+ QRegularExpression verified_call_regex {"[A-Z0-9/]+\\sverified\\s*"};
if(m_mode!="Echo") {
if (message.size () > 5 && message[4]==' ') {
@@ -10597,7 +10753,17 @@ void MainWindow::write_all(QString txRx, QString message) mode_string=m_mode.leftJustified(6,' ');
}
- msg=msg.mid(0,15) + msg.mid(18,-1);
+ if(mode_string=="FT8 " and txRx=="Tx" and m_config.superFox() and
+ m_specOp==SpecOp::FOX) mode_string="FT8_SF";
+
+ if(mode_string=="FT8 " and m_config.superFox() and
+ m_specOp==SpecOp::HOUND) mode_string="FT8_SH";
+
+ if (mode_string == "FT8_SH" && verified_call_regex.match(message).hasMatch()) {
+ msg = " "+message;
+ } else {
+ msg = msg.mid(0, 15) + msg.mid(18, -1);
+ }
t = t.asprintf("%5d",ui->TxFreqSpinBox->value());
if (txRx=="Tx") msg=" 0 0.0" + t + " " + message;
@@ -10872,3 +11038,17 @@ void MainWindow::on_jt65Button_clicked() {
on_actionJT65_triggered();
}
+
+void MainWindow::sfox_tx()
+{
+ auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()};
+ QStringList args{fname};
+ args.append(m_config.my_callsign());
+ args.append(m_config.FoxKey());
+// qDebug() << "aa" << QDir::toNativeSeparators(m_appDir)+QDir::separator()+"sftx";
+// qDebug() << "bb" << args;
+ p2.start(QDir::toNativeSeparators(m_appDir)+QDir::separator()+"sftx", args);
+ p2.waitForFinished();
+ auto fname2 {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_2.dat")).toLocal8Bit()};
+ sfox_wave_gfsk_(fname2.constData(), (FCL)fname2.size());
+}
|
