summaryrefslogtreecommitdiff
path: root/widgets/mainwindow.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2020-09-28 23:28:13 +0200
committerChristoph Berg <myon@debian.org>2020-09-28 23:28:13 +0200
commit7aa3c56b01768ba7d38fccedc17b30a4046b3fbb (patch)
treeda509a2cf3667b6f9855ea811f4a1f95d9e6f5ef /widgets/mainwindow.cpp
parent28f34ff4908a90b1a7323b2988c33cdb1779fa06 (diff)
New upstream version 2.3.0~rc1+repackupstream/2.3.0_rc1+repack
Diffstat (limited to 'widgets/mainwindow.cpp')
-rw-r--r--widgets/mainwindow.cpp1849
1 files changed, 1031 insertions, 818 deletions
diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp
index 0ed391fa..682fb9ad 100644
--- a/widgets/mainwindow.cpp
+++ b/widgets/mainwindow.cpp
@@ -89,9 +89,9 @@
extern "C" {
//----------------------------------------------------- C and Fortran routines
- void symspec_(struct dec_data *, int* k, int* ntrperiod, int* nsps, int* ingain,
+ void symspec_(struct dec_data *, int* k, double* trperiod, int* nsps, int* ingain,
bool* bLowSidelobes, int* minw, float* px, float s[], float* df3,
- int* nhsym, int* npts8, float *m_pxmax);
+ int* nhsym, int* npts8, float *m_pxmax, int* npct);
void hspec_(short int d2[], int* k, int* nutc0, int* ntrperiod, int* nrxfreq, int* ntol,
bool* bmsk144, bool* btrain, double const pcoeffs[], int* ingain,
@@ -105,12 +105,18 @@ extern "C" {
void genft4_(char* msg, int* ichk, char* msgsent, char ft4msgbits[], int itone[],
fortran_charlen_t, fortran_charlen_t);
+ void genfst4_(char* msg, int* ichk, char* msgsent, char fst4msgbits[],
+ int itone[], int* iwspr, fortran_charlen_t, fortran_charlen_t);
+
void gen_ft8wave_(int itone[], int* nsym, int* nsps, float* bt, float* fsample, float* f0,
float xjunk[], float wave[], int* icmplx, int* nwave);
void gen_ft4wave_(int itone[], int* nsym, int* nsps, float* fsample, float* f0,
float xjunk[], float wave[], int* icmplx, int* nwave);
+ void gen_fst4wave_(int itone[], int* nsym, int* nsps, int* nwave, float* fsample,
+ int* hmod, float* f0, int* icmplx, float xjunk[], float wave[]);
+
void gen4_(char* msg, int* ichk, char* msgsent, int itone[],
int* itext, fortran_charlen_t, fortran_charlen_t);
@@ -128,8 +134,6 @@ extern "C" {
void genwspr_(char* msg, char* msgsent, int itone[], fortran_charlen_t, fortran_charlen_t);
-// void genwspr_fsk8_(char* msg, char* msgsent, int itone[], fortran_charlen_t, fortran_charlen_t);
-
void geniscat_(char* msg, char* msgsent, int itone[], fortran_charlen_t, fortran_charlen_t);
void azdist_(char* MyGrid, char* HisGrid, double* utch, int* nAz, int* nEl,
@@ -204,6 +208,9 @@ namespace
// grid exact match excluding RR73
QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"};
auto quint32_max = std::numeric_limits<quint32>::max ();
+ constexpr int N_WIDGETS {36};
+ constexpr int rx_chunk_size {3456}; // audio samples at 12000 Hz
+ constexpr int tx_audio_buffer_size {48000 / 5}; // audio frames at 48000 Hz
bool message_is_73 (int type, QStringList const& msg_parts)
{
@@ -278,7 +285,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_idleMinutes {0},
m_nSubMode {0},
m_nclearave {1},
- m_pctx {0},
m_nseq {0},
m_nWSPRdecodes {0},
m_k0 {9999999},
@@ -304,11 +310,10 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_bShMsgs {false},
m_bSWL {false},
m_uploading {false},
- m_txNext {false},
m_grid6 {false},
m_tuneup {false},
m_bTxTime {false},
- m_rxDone {false},
+ m_rxDone {true},
m_bSimplex {false},
m_bEchoTxOK {false},
m_bTransmittedEcho {false},
@@ -389,8 +394,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
},
m_sfx {"P", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A"},
mem_jt9 {shdmem},
- m_msAudioOutputBuffered (0u),
- m_framesAudioInputBuffered (RX_SAMPLE_RATE / 10),
m_downSampleFactor (downSampleFactor),
m_audioThreadPriority (QThread::HighPriority),
m_bandEdited {false},
@@ -412,7 +415,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
version (), revision (),
m_config.udp_server_name (), m_config.udp_server_port (),
this}},
- psk_Reporter {new PSK_Reporter {m_messageClient, this}},
+ m_psk_Reporter {&m_config, QString {"WSJT-X v" + version () + " " + m_revision}.simplified ()},
m_manual {&m_network_manager},
m_block_udp_status_updates {false}
{
@@ -422,7 +425,8 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
add_child_to_event_filter (this);
ui->dxGridEntry->setValidator (new MaidenheadLocatorValidator {this});
ui->dxCallEntry->setValidator (new CallsignValidator {this});
- ui->sbTR->values ({5, 10, 15, 30});
+ ui->sbTR->values ({5, 10, 15, 30, 60, 120, 300, 900, 1800});
+ ui->sbTR_FST4W->values ({120, 300, 900, 1800});
ui->decodedTextBrowser->set_configuration (&m_config, true);
ui->decodedTextBrowser2->set_configuration (&m_config);
@@ -450,6 +454,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
// hook up sound output stream slots & signals and disposal
connect (this, &MainWindow::initializeAudioOutputStream, m_soundOutput, &SoundOutput::setFormat);
connect (m_soundOutput, &SoundOutput::error, this, &MainWindow::showSoundOutError);
+ connect (m_soundOutput, &SoundOutput::error, &m_config, &Configuration::invalidate_audio_output_device);
// connect (m_soundOutput, &SoundOutput::status, this, &MainWindow::showStatusMessage);
connect (this, &MainWindow::outAttenuationChanged, m_soundOutput, &SoundOutput::setAttenuation);
connect (&m_audioThread, &QThread::finished, m_soundOutput, &QObject::deleteLater);
@@ -465,9 +470,28 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
connect (this, &MainWindow::startAudioInputStream, m_soundInput, &SoundInput::start);
connect (this, &MainWindow::suspendAudioInputStream, m_soundInput, &SoundInput::suspend);
connect (this, &MainWindow::resumeAudioInputStream, m_soundInput, &SoundInput::resume);
+ connect (this, &MainWindow::reset_audio_input_stream, m_soundInput, &SoundInput::reset);
connect (this, &MainWindow::finished, m_soundInput, &SoundInput::stop);
connect(m_soundInput, &SoundInput::error, this, &MainWindow::showSoundInError);
+ connect(m_soundInput, &SoundInput::error, &m_config, &Configuration::invalidate_audio_input_device);
// connect(m_soundInput, &SoundInput::status, this, &MainWindow::showStatusMessage);
+ connect (m_soundInput, &SoundInput::dropped_frames, this, [this] (qint32 dropped_frames, qint64 usec) {
+ if (dropped_frames > 48000 / 5) // 1/5 second
+ {
+ showStatusMessage (tr ("%1 (%2 sec) audio frames dropped").arg (dropped_frames).arg (usec / 1.e6, 5, 'f', 3));
+ }
+ if (dropped_frames > 5 * 48000) // seconds
+ {
+ auto period = qt_truncate_date_time_to (QDateTime::currentDateTimeUtc ().addMSecs (-m_TRperiod / 2.), m_TRperiod * 1e3);
+ MessageBox::warning_message (this
+ , tr ("Audio Source")
+ , tr ("Reduce system load")
+ , tr ("Excessive dropped samples - %1 (%2 sec) audio frames dropped in period starting %3")
+ .arg (dropped_frames)
+ .arg (usec / 1.e6, 5, 'f', 3)
+ .arg (period.toString ("hh:mm:ss")));
+ }
+ });
connect (&m_audioThread, &QThread::finished, m_soundInput, &QObject::deleteLater);
connect (this, &MainWindow::finished, this, &MainWindow::close);
@@ -547,15 +571,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
} else if (text.isEmpty ()) {
ui->tx5->setCurrentText (text);
}
- } else if (1 == ui->tabWidget->currentIndex ()) {
- if (!text.isEmpty ()) {
- ui->freeTextMsg->setCurrentText (text);
- }
- if (send) {
- ui->rbFreeText->click ();
- } else if (text.isEmpty ()) {
- ui->freeTextMsg->setCurrentText (text);
- }
}
QApplication::alert (this);
});
@@ -573,6 +588,8 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
on_EraseButton_clicked ();
QActionGroup* modeGroup = new QActionGroup(this);
+ ui->actionFST4->setActionGroup(modeGroup);
+ ui->actionFST4W->setActionGroup(modeGroup);
ui->actionFT4->setActionGroup(modeGroup);
ui->actionFT8->setActionGroup(modeGroup);
ui->actionJT9->setActionGroup(modeGroup);
@@ -580,7 +597,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
ui->actionJT9_JT65->setActionGroup(modeGroup);
ui->actionJT4->setActionGroup(modeGroup);
ui->actionWSPR->setActionGroup(modeGroup);
- ui->actionWSPR_LF->setActionGroup(modeGroup);
ui->actionEcho->setActionGroup(modeGroup);
ui->actionISCAT->setActionGroup(modeGroup);
ui->actionMSK144->setActionGroup(modeGroup);
@@ -662,10 +678,15 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
#endif
connect(&proc_jt9, static_cast<void (QProcess::*) (int, QProcess::ExitStatus)> (&QProcess::finished),
[this] (int exitCode, QProcess::ExitStatus status) {
- subProcessFailed (&proc_jt9, exitCode, status);
+ if (subProcessFailed (&proc_jt9, exitCode, status))
+ {
+ m_valid = false; // ensures exit if still
+ // constructing
+ QTimer::singleShot (0, this, SLOT (close ()));
+ }
});
connect(&p1, &QProcess::started, [this] () {
- showStatusMessage (QString {"Started: %1 \"%2\""}.arg (p1.program ()).arg (p1.arguments ().join (QLatin1String {"\" \""})));
+ showStatusMessage (QString {"Started: %1 \"%2\""}.arg (p1.program ()).arg (p1.arguments ().join ("\" \"")));
});
connect(&p1, &QProcess::readyReadStandardOutput, this, &MainWindow::p1ReadFromStdout);
#if QT_VERSION < QT_VERSION_CHECK (5, 6, 0)
@@ -680,25 +701,50 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
#endif
connect(&p1, static_cast<void (QProcess::*) (int, QProcess::ExitStatus)> (&QProcess::finished),
[this] (int exitCode, QProcess::ExitStatus status) {
- subProcessFailed (&p1, exitCode, status);
+ if (subProcessFailed (&p1, exitCode, status))
+ {
+ m_valid = false; // ensures exit if still
+ // constructing
+ QTimer::singleShot (0, this, SLOT (close ()));
+ }
});
#if QT_VERSION < QT_VERSION_CHECK (5, 6, 0)
connect(&p3, static_cast<void (QProcess::*) (QProcess::ProcessError)> (&QProcess::error),
[this] (QProcess::ProcessError error) {
- subProcessError (&p3, error);
- });
#else
connect(&p3, &QProcess::errorOccurred, [this] (QProcess::ProcessError error) {
- subProcessError (&p3, error);
- });
#endif
+#if !defined(Q_OS_WIN)
+ if (QProcess::FailedToStart != error)
+#else
+ if (QProcess::Crashed != error)
+#endif
+ {
+ subProcessError (&p3, error);
+ }
+ });
connect(&p3, &QProcess::started, [this] () {
- showStatusMessage (QString {"Started: %1 \"%2\""}.arg (p3.program ()).arg (p3.arguments ().join (QLatin1String {"\" \""})));
+ showStatusMessage (QString {"Started: %1 \"%2\""}.arg (p3.program ()).arg (p3.arguments ().join ("\" \"")));
});
connect(&p3, static_cast<void (QProcess::*) (int, QProcess::ExitStatus)> (&QProcess::finished),
[this] (int exitCode, QProcess::ExitStatus status) {
- subProcessFailed (&p3, exitCode, status);
+#if defined(Q_OS_WIN)
+ // We forgo detecting user_hardware failures with exit
+ // code 1 on Windows. This is because we use CMD.EXE to
+ // run the executable. CMD.EXE returns exit code 1 when it
+ // can't find the target executable.
+ if (exitCode != 1) // CMD.EXE couldn't find file to execute
+#else
+ // We forgo detecting user_hardware failures with exit
+ // code 127 non-Windows. This is because we use /bin/sh to
+ // run the executable. /bin/sh returns exit code 127 when it
+ // can't find the target executable.
+ if (exitCode != 127) // /bin/sh couldn't find file to execute
+#endif
+ {
+ subProcessFailed (&p3, exitCode, status);
+ }
});
// hook up save WAV file exit handling
@@ -737,6 +783,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
connect (&m_config, &Configuration::udp_server_changed, m_messageClient, &MessageClient::set_server);
connect (&m_config, &Configuration::udp_server_port_changed, m_messageClient, &MessageClient::set_server_port);
connect (&m_config, &Configuration::accept_udp_requests_changed, m_messageClient, &MessageClient::enable);
+ connect (&m_config, &Configuration::enumerating_audio_devices, [this] () {
+ showStatusMessage (tr ("Enumerating audio devices"));
+ });
// set up configurations menu
connect (m_multi_settings, &MultiSettings::configurationNameChanged, [this] (QString const& name) {
@@ -760,17 +809,11 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
ui->tx4->setValidator (new QRegExpValidator {message_alphabet, this});
ui->tx5->setValidator (new QRegExpValidator {message_alphabet, this});
ui->tx6->setValidator (new QRegExpValidator {message_alphabet, this});
- ui->freeTextMsg->setValidator (new QRegExpValidator {message_alphabet, this});
// Free text macros model to widget hook up.
ui->tx5->setModel (m_config.macros ());
connect (ui->tx5->lineEdit(), &QLineEdit::editingFinished,
[this] () {on_tx5_currentTextChanged (ui->tx5->lineEdit()->text());});
- ui->freeTextMsg->setModel (m_config.macros ());
- connect (ui->freeTextMsg->lineEdit ()
- , &QLineEdit::editingFinished
- , [this] () {on_freeTextMsg_currentTextChanged (ui->freeTextMsg->lineEdit ()->text ());});
-
connect(&m_guiTimer, &QTimer::timeout, this, &MainWindow::guiUpdate);
m_guiTimer.start(100); //### Don't change the 100 ms! ###
@@ -796,7 +839,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
connect(&killFileTimer, &QTimer::timeout, this, &MainWindow::killFile);
uploadTimer.setSingleShot(true);
- connect(&uploadTimer, SIGNAL(timeout()), this, SLOT(uploadSpots()));
+ connect(&uploadTimer, &QTimer::timeout, [this] () {uploadWSPRSpots ();});
TxAgainTimer.setSingleShot(true);
connect(&TxAgainTimer, SIGNAL(timeout()), this, SLOT(TxAgain()));
@@ -900,15 +943,22 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
connect (&m_wav_future_watcher, &QFutureWatcher<void>::finished, this, &MainWindow::diskDat);
connect(&watcher3, SIGNAL(finished()),this,SLOT(fast_decode_done()));
- Q_EMIT startAudioInputStream (m_config.audio_input_device (), m_framesAudioInputBuffered, m_detector, m_downSampleFactor, m_config.audio_input_channel ());
- Q_EMIT initializeAudioOutputStream (m_config.audio_output_device (), AudioDevice::Mono == m_config.audio_output_channel () ? 1 : 2, m_msAudioOutputBuffered);
+ if (!m_config.audio_input_device ().isNull ())
+ {
+ Q_EMIT startAudioInputStream (m_config.audio_input_device ()
+ , rx_chunk_size * m_downSampleFactor
+ , m_detector, m_downSampleFactor, m_config.audio_input_channel ());
+ }
+ if (!m_config.audio_output_device ().isNull ())
+ {
+ Q_EMIT initializeAudioOutputStream (m_config.audio_output_device ()
+ , AudioDevice::Mono == m_config.audio_output_channel () ? 1 : 2
+ , tx_audio_buffer_size);
+ }
Q_EMIT transmitFrequency (ui->TxFreqSpinBox->value () - m_XIT);
enable_DXCC_entity (m_config.DXCC ()); // sets text window proportions and (re)inits the logbook
- ui->label_9->setStyleSheet("QLabel{background-color: #aabec8}");
- ui->label_10->setStyleSheet("QLabel{background-color: #aabec8}");
-
// this must be done before initializing the mode as some modes need
// to turn off split on the rig e.g. WSPR
m_config.transceiver_online ();
@@ -935,9 +985,8 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
}
m_saveDecoded=ui->actionSave_decoded->isChecked();
m_saveAll=ui->actionSave_all->isChecked();
- ui->sbTxPercent->setValue(m_pctx);
ui->TxPowerComboBox->setCurrentIndex(int(.3 * m_dBm + .2));
- ui->cbUploadWSPR_Spots->setChecked(m_uploadSpots);
+ ui->cbUploadWSPR_Spots->setChecked(m_uploadWSPRSpots);
if((m_ndepth&7)==1) ui->actionQuickDecode->setChecked(true);
if((m_ndepth&7)==2) ui->actionMediumDecode->setChecked(true);
if((m_ndepth&7)==3) ui->actionDeepestDecode->setChecked(true);
@@ -950,7 +999,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_bFastDone=false;
m_bAltV=false;
m_bNoMoreFiles=false;
- m_bVHFwarned=false;
m_bDoubleClicked=false;
m_bCallingCQ=false;
m_bCheckedContest=false;
@@ -959,12 +1007,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_isort=-3;
m_max_dB=70;
m_CQtype="CQ";
-
- if(m_mode.startsWith ("WSPR") and m_pctx>0) {
- QPalette palette {ui->sbTxPercent->palette ()};
- palette.setColor(QPalette::Base,Qt::yellow);
- ui->sbTxPercent->setPalette(palette);
- }
fixStop();
VHF_features_enabled(m_config.enable_VHF_features());
m_wideGraph->setVHF(m_config.enable_VHF_features());
@@ -1001,14 +1043,14 @@ 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.2.0 made\n"
- // "available for testing purposes. By design it will\n"
- // "be nonfunctional after 0000 UTC on June 10, 2020.");
- // auto now = QDateTime::currentDateTimeUtc ();
- // if (now >= QDateTime {{2020, 6, 10}, {0, 0}, Qt::UTC}) {
- // Q_EMIT finished ();
- // }
+ MessageBox::critical_message (this,
+ "This is a pre-release version of WSJT-X 2.3.0 made\n"
+ "available for testing purposes. By design it will\n"
+ "be nonfunctional after 0000 UTC on Nov 17, 2020.");
+ auto now = QDateTime::currentDateTimeUtc ();
+ if (now >= QDateTime {{2020, 11, 17}, {0, 0}, Qt::UTC}) {
+ Q_EMIT finished ();
+ }
}
void MainWindow::initialize_fonts ()
@@ -1039,15 +1081,12 @@ void MainWindow::on_the_minute ()
}
}
- if (m_config.watchdog () && !m_mode.startsWith ("WSPR"))
- {
- if (m_idleMinutes < m_config.watchdog ()) ++m_idleMinutes;
- update_watchdog_label ();
- }
- else
- {
- tx_watchdog (false);
- }
+ if (m_config.watchdog () && m_mode!="WSPR" && m_mode!="FST4W") {
+ if (m_idleMinutes < m_config.watchdog ()) ++m_idleMinutes;
+ update_watchdog_label ();
+ } else {
+ tx_watchdog (false);
+ }
}
//--------------------------------------------------- MainWindow destructor
@@ -1077,7 +1116,6 @@ void MainWindow::writeSettings()
m_settings->setValue ("MsgAvgDisplayed", m_msgAvgWidget && m_msgAvgWidget->isVisible ());
m_settings->setValue ("FoxLogDisplayed", m_foxLogWindow && m_foxLogWindow->isVisible ());
m_settings->setValue ("ContestLogDisplayed", m_contestLogWindow && m_contestLogWindow->isVisible ());
- m_settings->setValue ("FreeText", ui->freeTextMsg->currentText ());
m_settings->setValue("ShowMenus",ui->cbMenus->isChecked());
m_settings->setValue("CallFirst",ui->cbFirst->isChecked());
m_settings->setValue("HoundSort",ui->comboBoxHoundSort->currentIndex());
@@ -1097,6 +1135,10 @@ void MainWindow::writeSettings()
m_settings->setValue("RxFreq",ui->RxFreqSpinBox->value());
m_settings->setValue("TxFreq",ui->TxFreqSpinBox->value());
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());
+ m_settings->setValue("FST4_FLow",ui->sbF_Low->value());
+ m_settings->setValue("FST4_FHigh",ui->sbF_High->value());
m_settings->setValue("SubMode",ui->sbSubmode->value());
m_settings->setValue("DTtol",m_DTtol);
m_settings->setValue("Ftol", ui->sbFtol->value ());
@@ -1111,14 +1153,16 @@ void MainWindow::writeSettings()
m_settings->setValue("GUItab",ui->tabWidget->currentIndex());
m_settings->setValue("OutBufSize",outBufSize);
m_settings->setValue ("HoldTxFreq", ui->cbHoldTxFreq->isChecked ());
- m_settings->setValue("PctTx",m_pctx);
+ m_settings->setValue("PctTx", ui->sbTxPercent->value ());
+ m_settings->setValue("RoundRobin",ui->RoundRobin->currentText());
m_settings->setValue("dBm",m_dBm);
m_settings->setValue("RR73",m_send_RR73);
m_settings->setValue ("WSPRPreferType1", ui->WSPR_prefer_type_1_check_box->isChecked ());
- m_settings->setValue("UploadSpots",m_uploadSpots);
+ m_settings->setValue("UploadSpots",m_uploadWSPRSpots);
m_settings->setValue("NoOwnCall",ui->cbNoOwnCall->isChecked());
m_settings->setValue ("BandHopping", ui->band_hopping_group_box->isChecked ());
m_settings->setValue ("TRPeriod", ui->sbTR->value ());
+ m_settings->setValue ("TRPeriod_FST4W", ui->sbTR_FST4W->value ());
m_settings->setValue("FastMode",m_bFastMode);
m_settings->setValue("Fast9",m_bFast9);
m_settings->setValue ("CQTxfreq", ui->sbCQTxFreq->value ());
@@ -1127,6 +1171,8 @@ void MainWindow::writeSettings()
m_settings->setValue ("FT8AP", ui->actionEnable_AP_FT8->isChecked ());
m_settings->setValue ("JT65AP", ui->actionEnable_AP_JT65->isChecked ());
m_settings->setValue("SplitterState",ui->splitter->saveState());
+ m_settings->setValue("Blanker",ui->sbNB->value());
+
{
QList<QVariant> coeffs; // suitable for QSettings
for (auto const& coeff : m_phaseEqCoefficients)
@@ -1155,8 +1201,6 @@ void MainWindow::readSettings()
auto displayMsgAvg = m_settings->value ("MsgAvgDisplayed", false).toBool ();
auto displayFoxLog = m_settings->value ("FoxLogDisplayed", false).toBool ();
auto displayContestLog = m_settings->value ("ContestLogDisplayed", false).toBool ();
- if (m_settings->contains ("FreeText")) ui->freeTextMsg->setCurrentText (
- m_settings->value ("FreeText").toString ());
ui->cbMenus->setChecked(m_settings->value("ShowMenus",true).toBool());
ui->cbFirst->setChecked(m_settings->value("CallFirst",true).toBool());
ui->comboBoxHoundSort->setCurrentIndex(m_settings->value("HoundSort",3).toInt());
@@ -1180,8 +1224,13 @@ void MainWindow::readSettings()
ui->actionSave_all->setChecked(m_settings->value("SaveAll",false).toBool());
ui->RxFreqSpinBox->setValue(0); // ensure a change is signaled
ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq",1500).toInt());
+ ui->sbFST4W_RxFreq->setValue(0);
+ ui->sbFST4W_RxFreq->setValue(m_settings->value("FST4W_RxFreq",1500).toInt());
+ ui->sbF_Low->setValue(m_settings->value("FST4_FLow",600).toInt());
+ ui->sbF_High->setValue(m_settings->value("FST4_FHigh",1400).toInt());
m_nSubMode=m_settings->value("SubMode",0).toInt();
ui->sbFtol->setValue (m_settings->value("Ftol", 50).toInt());
+ ui->sbFST4W_FTol->setValue(m_settings->value("FST4W_FTol",100).toInt());
m_minSync=m_settings->value("MinSync",0).toInt();
ui->syncSpinBox->setValue(m_minSync);
ui->cbAutoSeq->setChecked (m_settings->value ("AutoSeq", false).toBool());
@@ -1191,6 +1240,7 @@ void MainWindow::readSettings()
m_bFast9=m_settings->value("Fast9",false).toBool();
m_bFastMode=m_settings->value("FastMode",false).toBool();
ui->sbTR->setValue (m_settings->value ("TRPeriod", 15).toInt());
+ ui->sbTR_FST4W->setValue (m_settings->value ("TRPeriod_FST4W", 15).toInt());
m_lastMonitoredFrequency = m_settings->value ("DialFreq",
QVariant::fromValue<Frequency> (default_frequency)).value<Frequency> ();
ui->WSPRfreqSpinBox->setValue(0); // ensure a change is signaled
@@ -1198,7 +1248,9 @@ void MainWindow::readSettings()
ui->TxFreqSpinBox->setValue(0); // ensure a change is signaled
ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq",1500).toInt());
m_ndepth=m_settings->value("NDepth",3).toInt();
- m_pctx=m_settings->value("PctTx",20).toInt();
+ ui->sbTxPercent->setValue (m_settings->value ("PctTx", 20).toInt ());
+ on_sbTxPercent_valueChanged (ui->sbTxPercent->value ());
+ ui->RoundRobin->setCurrentText(m_settings->value("RoundRobin",tr("Random")).toString());
m_dBm=m_settings->value("dBm",37).toInt();
m_send_RR73=m_settings->value("RR73",false).toBool();
if(m_send_RR73) {
@@ -1206,8 +1258,7 @@ void MainWindow::readSettings()
on_txrb4_doubleClicked();
}
ui->WSPR_prefer_type_1_check_box->setChecked (m_settings->value ("WSPRPreferType1", true).toBool ());
- m_uploadSpots=m_settings->value("UploadSpots",false).toBool();
- if(!m_uploadSpots) ui->cbUploadWSPR_Spots->setStyleSheet("QCheckBox{background-color: yellow}");
+ m_uploadWSPRSpots=m_settings->value("UploadSpots",false).toBool();
ui->cbNoOwnCall->setChecked(m_settings->value("NoOwnCall",false).toBool());
ui->band_hopping_group_box->setChecked (m_settings->value ("BandHopping", false).toBool());
// setup initial value of tx attenuator
@@ -1225,6 +1276,7 @@ void MainWindow::readSettings()
ui->actionEnable_AP_FT8->setChecked (m_settings->value ("FT8AP", false).toBool());
ui->actionEnable_AP_JT65->setChecked (m_settings->value ("JT65AP", false).toBool());
ui->splitter->restoreState(m_settings->value("SplitterState").toByteArray());
+ ui->sbNB->setValue(m_settings->value("Blanker",0).toInt());
{
auto const& coeffs = m_settings->value ("PhaseEqualizationCoefficients"
, QList<QVariant> {0., 0., 0., 0., 0.}).toList ();
@@ -1239,8 +1291,6 @@ void MainWindow::readSettings()
// use these initialisation settings to tune the audio o/p buffer
// size and audio thread priority
m_settings->beginGroup ("Tune");
- m_msAudioOutputBuffered = m_settings->value ("Audio/OutputBufferMs").toInt ();
- m_framesAudioInputBuffered = m_settings->value ("Audio/InputBufferFrames", RX_SAMPLE_RATE / 10).toInt ();
m_audioThreadPriority = static_cast<QThread::Priority> (m_settings->value ("Audio/ThreadPriority", QThread::HighPriority).toInt () % 8);
m_settings->endGroup ();
@@ -1313,8 +1363,6 @@ void MainWindow::fixStop()
m_hsymStop=179;
if(m_mode=="WSPR") {
m_hsymStop=396;
- } else if(m_mode=="WSPR-LF") {
- m_hsymStop=813;
} else if(m_mode=="Echo") {
m_hsymStop=9;
} else if (m_mode=="JT4"){
@@ -1335,7 +1383,22 @@ void MainWindow::fixStop()
m_hsymStop=50;
} else if (m_mode=="FT4") {
m_hsymStop=21;
-}
+ } else if(m_mode=="FST4" or m_mode=="FST4W") {
+ int stop[] = {39,85,187,387,1003,3107,6232};
+ int stop_EME[] = {48,95,197,396,1012,3107,6232};
+ int i=0;
+ if(m_TRperiod==30) i=1;
+ if(m_TRperiod==60) i=2;
+ if(m_TRperiod==120) i=3;
+ if(m_TRperiod==300) i=4;
+ if(m_TRperiod==900) i=5;
+ if(m_TRperiod==1800) i=6;
+ if(m_config.decode_at_52s()) {
+ m_hsymStop=stop_EME[i];
+ } else {
+ m_hsymStop=stop[i];
+ }
+ }
}
//-------------------------------------------------------------- dataSink()
@@ -1356,8 +1419,10 @@ void MainWindow::dataSink(qint64 frames)
}
m_bUseRef=m_wideGraph->useRef();
- refspectrum_(&dec_data.d2[k-m_nsps/2],&m_bClearRefSpec,&m_bRefSpec,
- &m_bUseRef,c_fname,len);
+ if(!m_diskData) {
+ refspectrum_(&dec_data.d2[k-m_nsps/2],&m_bClearRefSpec,&m_bRefSpec,
+ &m_bUseRef,c_fname,len);
+ }
m_bClearRefSpec=false;
if(m_mode=="ISCAT" or m_mode=="MSK144" or m_bFast9) {
@@ -1366,24 +1431,26 @@ void MainWindow::dataSink(qint64 frames)
}
// Get power, spectrum, and ihsym
- int trmin=m_TRperiod/60.0;
-// int k (frames - 1);
dec_data.params.nfa=m_wideGraph->nStartFreq();
dec_data.params.nfb=m_wideGraph->Fmax();
+ if(m_mode=="FST4") {
+ dec_data.params.nfa=ui->sbF_Low->value();
+ dec_data.params.nfb=ui->sbF_High->value();
+ }
int nsps=m_nsps;
if(m_bFastMode) nsps=6912;
int nsmo=m_wideGraph->smoothYellow()-1;
bool bLowSidelobes=m_config.lowSidelobes();
- symspec_(&dec_data,&k,&trmin,&nsps,&m_inGain,&bLowSidelobes,&nsmo,&m_px,s,
- &m_df3,&m_ihsym,&m_npts8,&m_pxmax);
- if(m_mode=="WSPR") wspr_downsample_(dec_data.d2,&k);
+ int npct=0;
+ if(m_mode.startsWith("FST4")) npct=ui->sbNB->value();
+ symspec_(&dec_data,&k,&m_TRperiod,&nsps,&m_inGain,&bLowSidelobes,&nsmo,&m_px,s,
+ &m_df3,&m_ihsym,&m_npts8,&m_pxmax,&npct);
+ if(m_mode=="WSPR" or m_mode=="FST4W") wspr_downsample_(dec_data.d2,&k);
if(m_ihsym <=0) return;
if(ui) ui->signal_meter_widget->setValue(m_px,m_pxmax); // Update thermometer
if(m_monitoring || m_diskData) {
m_wideGraph->dataSink2(s,m_df3,m_ihsym,m_diskData);
}
-// if(m_mode=="FT4") ft4_rx(k);
-// if(m_mode=="MSK144" or m_mode=="FT4") return;
if(m_mode=="MSK144") return;
fixStop();
@@ -1482,11 +1549,16 @@ void MainWindow::dataSink(qint64 frames)
if(m_mode=="FT8" and m_ihsym==m_earlyDecode2 and !m_diskData) dec_data.params.nzhsym=m_earlyDecode2;
QDateTime now {QDateTime::currentDateTimeUtc ()};
m_dateTime = now.toString ("yyyy-MMM-dd hh:mm");
- if(!m_mode.startsWith ("WSPR")) decode(); //Start decoder
- if(m_mode=="FT8" and !m_diskData and (m_ihsym==m_earlyDecode or m_ihsym==m_earlyDecode2)) return;
+ if(m_mode!="WSPR") decode(); //Start decoder
- if(!m_diskData and (m_saveAll or m_saveDecoded or m_mode=="WSPR")) { //Always save unless "Save None"; may delete later
- if(m_mode=="FT8" or m_mode=="FT4") {
+ if(m_mode=="FT8" and !m_diskData and (m_ihsym==m_earlyDecode or m_ihsym==m_earlyDecode2)) return;
+ if (!m_diskData)
+ {
+ Q_EMIT reset_audio_input_stream (true); // signals dropped samples
+ }
+ if(!m_diskData and (m_saveAll or m_saveDecoded or m_mode=="WSPR" or m_mode=="FST4W")) {
+ //Always save unless "Save None"; may delete later
+ if(m_TRperiod < 60) {
int n=fmod(double(now.time().second()),m_TRperiod);
if(n<(m_TRperiod/2)) n=n+m_TRperiod;
auto const& period_start=now.addSecs(-n);
@@ -1503,7 +1575,7 @@ void MainWindow::dataSink(qint64 frames)
m_saveWAVWatcher.setFuture (QtConcurrent::run (std::bind (&MainWindow::save_wave_file,
this, m_fnameWE, &dec_data.d2[0], samples, m_config.my_callsign(),
m_config.my_grid(), m_mode, m_nSubMode, m_freqNominal, m_hisCall, m_hisGrid)));
- if (m_mode=="WSPR") {
+ if (m_mode=="WSPR" or m_mode=="FST4W") {
QString c2name_string {m_fnameWE + ".c2"};
int len1=c2name_string.length();
char c2name[80];
@@ -1515,11 +1587,10 @@ void MainWindow::dataSink(qint64 frames)
if (err!=0) MessageBox::warning_message (this, tr ("Error saving c2 file"), c2name);
}
}
-
- if(m_mode.startsWith ("WSPR")) {
+ if(m_mode=="WSPR") {
QStringList t2;
QStringList depth_args;
- t2 << "-f" << QString {"%1"}.arg (m_dialFreqRxWSPR / 1000000.0, 0, 'f', 6);
+ t2 << "-f" << QString {"%1"}.arg (m_dialFreqRxWSPR / 1e6, 0, 'f', 6);
if((m_ndepth&7)==1) depth_args << "-qB"; //2 pass w subtract, no Block detection, no shift jittering
if((m_ndepth&7)==2) depth_args << "-C" << "500" << "-o" << "4"; //3 pass, subtract, Block detection, OSD
if((m_ndepth&7)==3) depth_args << "-C" << "500" << "-o" << "4" << "-d"; //3 pass, subtract, Block detect, OSD, more candidates
@@ -1530,26 +1601,11 @@ void MainWindow::dataSink(qint64 frames)
m_cmndP1 << depth_args << "-a"
<< QDir::toNativeSeparators (m_config.writeable_data_dir ().absolutePath()) << m_path;
} else {
- // if(m_mode=="WSPR-LF")
- // {
- // m_cmndP1 << degrade << t2 << "-a"
- // << QDir::toNativeSeparators (m_config.writeable_data_dir ().absolutePath())
- // << m_fnameWE + ".wav";
- // }
- // else
- {
- m_cmndP1 << depth_args << "-a"
- << QDir::toNativeSeparators (m_config.writeable_data_dir ().absolutePath())
- << t2 << m_fnameWE + ".wav";
- }
+ m_cmndP1 << depth_args << "-a"
+ << QDir::toNativeSeparators (m_config.writeable_data_dir ().absolutePath())
+ << t2 << m_fnameWE + ".wav";
}
- // QString t3=cmnd;
- // int i1=cmnd.indexOf("/wsprd ");
- // cmnd=t3.mid(0,i1+7) + t3.mid(i1+7);
-
-// if(m_mode=="WSPR-LF") cmnd=cmnd.replace("/wsprd ","/wspr_fsk8d "+degrade+t2);
if (ui) ui->DecodeButton->setChecked (true);
- // m_cmndP1=QDir::toNativeSeparators(cmnd);
p1Timer.start(1000);
m_decoderBusy = true;
statusUpdate ();
@@ -1560,14 +1616,7 @@ void MainWindow::dataSink(qint64 frames)
void MainWindow::startP1()
{
- // if (m_mode=="WSPR-LF")
- // {
- // p1.start (QDir::toNativeSeparators (QDir {QApplication::applicationDirPath ()}.absoluteFilePath ("wspr_fsk8d")), m_cmndP1);
- // }
- // else
- {
- p1.start (QDir::toNativeSeparators (QDir {QApplication::applicationDirPath ()}.absoluteFilePath ("wsprd")), m_cmndP1);
- }
+ p1.start (QDir::toNativeSeparators (QDir {QApplication::applicationDirPath ()}.absoluteFilePath ("wsprd")), m_cmndP1);
}
QString MainWindow::save_wave_file (QString const& name, short const * data, int samples,
@@ -1585,14 +1634,15 @@ QString MainWindow::save_wave_file (QString const& name, short const * data, int
format.setChannelCount (1);
format.setSampleSize (16);
format.setSampleType (QAudioFormat::SignedInt);
- auto source = QString {"%1, %2"}.arg (my_callsign).arg (my_grid);
- auto comment = QString {"Mode=%1%2, Freq=%3%4"}
- .arg (mode)
- .arg (QString {mode.contains ('J') && !mode.contains ('+')
- ? QString {", Sub Mode="} + QChar {'A' + sub_mode}
- : QString {}})
- .arg (Radio::frequency_MHz_string (frequency))
- .arg (QString {!mode.startsWith ("WSPR") ? QString {", DXCall=%1, DXGrid=%2"}
+ auto source = QString {"%1; %2"}.arg (my_callsign).arg (my_grid);
+ auto comment = QString {"Mode=%1%2; Freq=%3%4"}
+ .arg (mode)
+ .arg (QString {(mode.contains ('J') && !mode.contains ('+'))
+ || mode.startsWith ("FST4") || mode.startsWith ("QRA")
+ ? QString {"; Sub Mode="} + QString::number (int (samples / 12000)) + QChar {'A' + sub_mode}
+ : QString {}})
+ .arg (Radio::frequency_MHz_string (frequency))
+ .arg (QString {mode!="WSPR" ? QString {"; DXCall=%1; DXGrid=%2"}
.arg (his_call)
.arg (his_grid).toLocal8Bit () : ""});
BWFFile::InfoDictionary list_info {
@@ -1754,6 +1804,7 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog
auto callsign = m_config.my_callsign ();
auto my_grid = m_config.my_grid ();
SpecOp nContest0=m_config.special_op_id();
+ auto psk_on = m_config.spot_to_psk_reporter ();
if (QDialog::Accepted == m_config.exec ()) {
checkMSK144ContestType();
if (m_config.my_callsign () != callsign) {
@@ -1767,18 +1818,25 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog
on_dxGridEntry_textChanged (m_hisGrid); // recalculate distances in case of units change
enable_DXCC_entity (m_config.DXCC ()); // sets text window proportions and (re)inits the logbook
- if(m_config.spot_to_psk_reporter ()) pskSetLocal ();
+ pskSetLocal ();
+ // this will close the connection to PSKReporter if it has been
+ // disabled
+ if (psk_on && !m_config.spot_to_psk_reporter ())
+ {
+ m_psk_Reporter.sendReport (true);
+ }
- if(m_config.restart_audio_input ()) {
- Q_EMIT startAudioInputStream (m_config.audio_input_device (),
- m_framesAudioInputBuffered, m_detector, m_downSampleFactor,
- m_config.audio_input_channel ());
+ if(m_config.restart_audio_input () && !m_config.audio_input_device ().isNull ()) {
+ Q_EMIT startAudioInputStream (m_config.audio_input_device ()
+ , rx_chunk_size * m_downSampleFactor
+ , m_detector, m_downSampleFactor
+ , m_config.audio_input_channel ());
}
- if(m_config.restart_audio_output ()) {
- Q_EMIT initializeAudioOutputStream (m_config.audio_output_device (),
- AudioDevice::Mono == m_config.audio_output_channel () ? 1 : 2,
- m_msAudioOutputBuffered);
+ if(m_config.restart_audio_output () && !m_config.audio_output_device ().isNull ()) {
+ Q_EMIT initializeAudioOutputStream (m_config.audio_output_device ()
+ , AudioDevice::Mono == m_config.audio_output_channel () ? 1 : 2
+ , tx_audio_buffer_size);
}
displayDialFrequency ();
@@ -1795,7 +1853,7 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog
m_config.transceiver_online ();
if(!m_bFastMode) setXIT (ui->TxFreqSpinBox->value ());
- if(m_config.single_decode() or m_mode=="JT4") {
+ if ((m_config.single_decode () && !m_mode.startsWith ("FST4")) || m_mode=="JT4") {
ui->label_6->setText(tr ("Single-Period Decodes"));
ui->label_7->setText(tr ("Average Decodes"));
}
@@ -1835,10 +1893,14 @@ void MainWindow::on_monitorButton_clicked (bool checked)
setXIT (ui->TxFreqSpinBox->value ());
}
// ensure FreqCal triggers
- on_RxFreqSpinBox_valueChanged (ui->RxFreqSpinBox->value ());
+ if(m_mode=="FST4W") {
+ on_sbFST4W_RxFreq_valueChanged(ui->sbFST4W_RxFreq->value());
+ } else {
+ on_RxFreqSpinBox_valueChanged (ui->RxFreqSpinBox->value ());
+ }
}
//Get Configuration in/out of strict split and mode checking
- Q_EMIT m_config.sync_transceiver (true, checked);
+ m_config.sync_transceiver (true, checked);
} else {
ui->monitorButton->setChecked (false); // disallow
}
@@ -1880,18 +1942,14 @@ void MainWindow::on_autoButton_clicked (bool checked)
m_nclearave=1;
echocom_.nsum=0;
}
- if(m_mode.startsWith ("WSPR")) {
- QPalette palette {ui->sbTxPercent->palette ()};
- if(m_auto or m_pctx==0) {
- palette.setColor(QPalette::Base,Qt::white);
- } else {
- palette.setColor(QPalette::Base,Qt::yellow);
- }
- ui->sbTxPercent->setPalette(palette);
- }
m_tAutoOn=QDateTime::currentMSecsSinceEpoch()/1000;
}
+void MainWindow::on_sbTxPercent_valueChanged (int n)
+{
+ update_dynamic_property (ui->sbTxPercent, "notx", !n);
+}
+
void MainWindow::auto_tx_mode (bool state)
{
ui->autoButton->setChecked (state);
@@ -2065,9 +2123,6 @@ void MainWindow::keyPressEvent (QKeyEvent * e)
if(ui->tabWidget->currentIndex()==0) {
ui->tx5->clearEditText();
ui->tx5->setFocus();
- } else {
- ui->freeTextMsg->clearEditText();
- ui->freeTextMsg->setFocus();
}
return;
}
@@ -2143,7 +2198,7 @@ void MainWindow::bumpFqso(int n) //bumpFqso()
if (ui->RxFreqSpinBox->isEnabled ()) {
ui->RxFreqSpinBox->setValue (i);
}
- if(ctrl and m_mode.startsWith ("WSPR")) {
+ if(ctrl and m_mode=="WSPR") {
ui->WSPRfreqSpinBox->setValue(i);
} else {
if(ctrl and bTrackTx) {
@@ -2163,7 +2218,7 @@ void MainWindow::displayDialFrequency ()
{
// only change this when necessary as we get called a lot and it
// would trash any user input to the band combo box line edit
- ui->bandComboBox->setCurrentText (band_name);
+ ui->bandComboBox->setCurrentText (band_name.size () ? band_name : m_config.bands ()->oob ());
m_wideGraph->setRxBand (band_name);
m_lastBand = band_name;
band_changed(dial_frequency);
@@ -2250,8 +2305,8 @@ bool MainWindow::eventFilter (QObject * object, QEvent * event)
void MainWindow::createStatusBar() //createStatusBar
{
tx_status_label.setAlignment (Qt::AlignHCenter);
- tx_status_label.setMinimumSize (QSize {150, 18});
- tx_status_label.setStyleSheet ("QLabel{background-color: #00ff00}");
+ tx_status_label.setMinimumSize (QSize {100, 18});
+ tx_status_label.setStyleSheet ("QLabel{color: #000000; background-color: #00ff00}");
tx_status_label.setFrameStyle (QFrame::Panel | QFrame::Sunken);
statusBar()->addWidget (&tx_status_label);
@@ -2299,33 +2354,37 @@ void MainWindow::setup_status_bar (bool vhf)
mode_label.setText (m_mode);
}
if ("ISCAT" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #ff9933}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff9933}");
} else if ("JT9" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #ff6ec7}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff6ec7}");
} else if ("JT4" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #cc99ff}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #cc99ff}");
} else if ("Echo" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #66ffff}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #66ffff}");
} else if ("JT9+JT65" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #ffff66}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ffff66}");
} else if ("JT65" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #66ff66}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #66ff66}");
} else if ("QRA64" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #99ff33}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #99ff33}");
} else if ("MSK144" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #ff6666}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff6666}");
} else if ("FT4" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #ff0099}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff0099}");
} else if ("FT8" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #6699ff}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff6699}");
+ } else if ("FST4" == m_mode) {
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #99ff66}");
+ } else if ("FST4W" == m_mode) {
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #6699ff}");
} else if ("FreqCal" == m_mode) {
- mode_label.setStyleSheet ("QLabel{background-color: #ff9933}");
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff9933}");
}
last_tx_label.setText (QString {});
if (m_mode.contains (QRegularExpression {R"(^(Echo|ISCAT))"})) {
if (band_hopping_label.isVisible ()) statusBar ()->removeWidget (&band_hopping_label);
- } else if (m_mode.startsWith ("WSPR")) {
- mode_label.setStyleSheet ("QLabel{background-color: #ff66ff}");
+ } else if (m_mode=="WSPR") {
+ mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff66ff}");
if (!band_hopping_label.isVisible ()) {
statusBar ()->addWidget (&band_hopping_label);
band_hopping_label.show ();
@@ -2335,7 +2394,7 @@ void MainWindow::setup_status_bar (bool vhf)
}
}
-void MainWindow::subProcessFailed (QProcess * process, int exit_code, QProcess::ExitStatus status)
+bool MainWindow::subProcessFailed (QProcess * process, int exit_code, QProcess::ExitStatus status)
{
if (m_valid && (exit_code || QProcess::NormalExit != status))
{
@@ -2352,9 +2411,9 @@ void MainWindow::subProcessFailed (QProcess * process, int exit_code, QProcess::
, tr ("Running: %1\n%2")
.arg (process->program () + ' ' + arguments.join (' '))
.arg (QString {process->readAllStandardError()}));
- QTimer::singleShot (0, this, SLOT (close ()));
- m_valid = false; // ensures exit if still constructing
+ return true;
}
+ return false;
}
void MainWindow::subProcessError (QProcess * process, QProcess::ProcessError)
@@ -2372,8 +2431,8 @@ void MainWindow::subProcessError (QProcess * process, QProcess::ProcessError)
, tr ("Running: %1\n%2")
.arg (process->program () + ' ' + arguments.join (' '))
.arg (process->errorString ()));
- QTimer::singleShot (0, this, SLOT (close ()));
m_valid = false; // ensures exit if still constructing
+ QTimer::singleShot (0, this, SLOT (close ()));
}
}
@@ -2421,9 +2480,9 @@ void MainWindow::on_actionFT8_DXpedition_Mode_User_Guide_triggered()
QDesktopServices::openUrl (QUrl {"http://physics.princeton.edu/pulsar/k1jt/FT8_DXpedition_Mode.pdf"});
}
-void MainWindow::on_actionQuick_Start_Guide_v2_triggered()
+void MainWindow::on_actionQuick_Start_Guide_triggered()
{
- QDesktopServices::openUrl (QUrl {"https://physics.princeton.edu/pulsar/k1jt/Quick_Start_WSJT-X_2.0.pdf"});
+ QDesktopServices::openUrl (QUrl {"https://physics.princeton.edu/pulsar/k1jt/FST4_Quick_Start.pdf"});
}
void MainWindow::on_actionOnline_User_Guide_triggered() //Display manual
@@ -2534,16 +2593,14 @@ void MainWindow::hideMenus(bool checked)
minimumSize().setWidth(770);
}
ui->menuBar->setVisible(!checked);
- if(m_mode!="FreqCal" and m_mode!="WSPR") {
+ if(m_mode!="FreqCal" and m_mode!="WSPR" and m_mode!="Fst4W") {
ui->label_6->setVisible(!checked);
ui->label_7->setVisible(!checked);
ui->decodedTextLabel2->setVisible(!checked);
}
ui->decodedTextLabel->setVisible(!checked);
ui->gridLayout_5->layout()->setSpacing(spacing);
- ui->horizontalLayout->layout()->setSpacing(spacing);
ui->horizontalLayout_2->layout()->setSpacing(spacing);
- ui->horizontalLayout_3->layout()->setSpacing(spacing);
ui->horizontalLayout_5->layout()->setSpacing(spacing);
ui->horizontalLayout_6->layout()->setSpacing(spacing);
ui->horizontalLayout_7->layout()->setSpacing(spacing);
@@ -2557,7 +2614,6 @@ void MainWindow::hideMenus(bool checked)
ui->verticalLayout->layout()->setSpacing(spacing);
ui->verticalLayout_2->layout()->setSpacing(spacing);
ui->verticalLayout_3->layout()->setSpacing(spacing);
- ui->verticalLayout_4->layout()->setSpacing(spacing);
ui->verticalLayout_5->layout()->setSpacing(spacing);
ui->verticalLayout_7->layout()->setSpacing(spacing);
ui->verticalLayout_8->layout()->setSpacing(spacing);
@@ -2656,7 +2712,7 @@ void MainWindow::on_actionOpen_triggered() //Open File
m_path=fname;
int i1=fname.lastIndexOf("/");
QString baseName=fname.mid(i1+1);
- tx_status_label.setStyleSheet("QLabel{background-color: #99ffff}");
+ tx_status_label.setStyleSheet("QLabel{color: #000000; background-color: #99ffff}");
tx_status_label.setText(" " + baseName + " ");
on_stopButton_clicked();
m_diskData=true;
@@ -2736,7 +2792,7 @@ void MainWindow::on_actionOpen_next_in_directory_triggered() //Open Next
m_path=fname;
int i1=fname.lastIndexOf("/");
QString baseName=fname.mid(i1+1);
- tx_status_label.setStyleSheet("QLabel{background-color: #99ffff}");
+ tx_status_label.setStyleSheet("QLabel{color: #000000; background-color: #99ffff}");
tx_status_label.setText(" " + baseName + " ");
m_diskData=true;
read_wav_file (fname);
@@ -2819,8 +2875,53 @@ void MainWindow::on_actionKeyboard_shortcuts_triggered()
{
QFont font;
font.setPointSize (10);
- m_shortcuts.reset (new HelpTextWindow {tr ("Keyboard Shortcuts")
- , ":/shortcuts.txt", font});
+ m_shortcuts.reset (new HelpTextWindow {tr ("Keyboard Shortcuts"),
+ //: Keyboard shortcuts help window contents
+ tr (R"(<table cellspacing=1>
+ <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr>
+ <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr>
+ <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr>
+ <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr>
+ <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr>
+ <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr>
+ <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr>
+ <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr>
+ <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr>
+ <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr>
+ <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr>
+ <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr>
+ <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>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>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>
+ <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr>
+ <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr>
+ <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr>
+ <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr>
+ <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr>
+ <tr><td><b>Alt+E </b></td><td>Erase</td></tr>
+ <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr>
+ <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr>
+ <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr>
+ <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr>
+ <tr><td><b>Alt+M </b></td><td>Monitor</td></tr>
+ <tr><td><b>Alt+N </b></td><td>Enable Tx</td></tr>
+ <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr>
+ <tr><td><b>Alt+O </b></td><td>Change operator</td></tr>
+ <tr><td><b>Alt+Q </b></td><td>Log QSO</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>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>
+</table>)"), font});
}
m_shortcuts->showNormal ();
m_shortcuts->raise ();
@@ -2832,8 +2933,39 @@ void MainWindow::on_actionSpecial_mouse_commands_triggered()
{
QFont font;
font.setPointSize (10);
- m_mouseCmnds.reset (new HelpTextWindow {tr ("Special Mouse Commands")
- , ":/mouse_commands.txt", font});
+ m_mouseCmnds.reset (new HelpTextWindow {tr ("Special Mouse Commands"),
+ //: Mouse commands help window contents
+ tr (R"(<table cellpadding=5>
+ <tr>
+ <th align="right">Click on</th>
+ <th align="left">Action</th>
+ </tr>
+ <tr>
+ <td align="right">Waterfall:</td>
+ <td><b>Click</b> to set Rx frequency.<br/>
+ <b>Shift-click</b> to set Tx frequency.<br/>
+ <b>Ctrl-click</b> or <b>Right-click</b> to set Rx and Tx frequencies.<br/>
+ <b>Double-click</b> to also decode at Rx frequency.<br/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Decoded text:</td>
+ <td><b>Double-click</b> to copy second callsign to Dx Call,<br/>
+ locator to Dx Grid, change Rx and Tx frequency to<br/>
+ decoded signal's frequency, and generate standard<br/>
+ messages.<br/>
+ If <b>Hold Tx Freq</b> is checked or first callsign in message<br/>
+ is your own call, Tx frequency is not changed unless <br/>
+ <b>Ctrl</b> is held down.<br/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Erase button:</td>
+ <td><b>Click</b> to erase QSO window.<br/>
+ <b>Double-click</b> to erase QSO and Band Activity windows.
+ </td>
+ </tr>
+</table>)"), font});
}
m_mouseCmnds->showNormal ();
m_mouseCmnds->raise ();
@@ -2844,7 +2976,7 @@ void MainWindow::on_DecodeButton_clicked (bool /* checked */) //Decode request
if(m_mode=="MSK144") {
ui->DecodeButton->setChecked(false);
} else {
- if(!m_mode.startsWith ("WSPR") && !m_decoderBusy) {
+ if(m_mode!="WSPR" && !m_decoderBusy) {
dec_data.params.newdat=0;
dec_data.params.nagain=1;
decode();
@@ -2854,7 +2986,10 @@ void MainWindow::on_DecodeButton_clicked (bool /* checked */) //Decode request
void MainWindow::freezeDecode(int n) //freezeDecode()
{
- if((n%100)==2) on_DecodeButton_clicked (true);
+ if((n%100)==2) {
+ if(m_mode=="FST4" and m_config.single_decode() and ui->sbFtol->value()>10) ui->sbFtol->setValue(10);
+ on_DecodeButton_clicked (true);
+ }
}
void MainWindow::on_ClrAvgButton_clicked()
@@ -2877,13 +3012,6 @@ void MainWindow::decode() //decode()
if( m_dateTimeLastTX.isValid () ) {
qint64 isecs_since_tx = m_dateTimeLastTX.secsTo(now);
dec_data.params.lapcqonly= (isecs_since_tx > 300);
-// QTextStream(stdout) << "last tx " << isecs_since_tx
-// #if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0)
-// << Qt::endl
-// #else
-// << endl
-// #endif
-// ;
} else {
m_dateTimeLastTX = now.addSecs(-900);
dec_data.params.lapcqonly=true;
@@ -2891,23 +3019,24 @@ void MainWindow::decode() //decode()
if( m_diskData ) {
dec_data.params.lapcqonly=false;
}
-
m_msec0=QDateTime::currentMSecsSinceEpoch();
if(!m_dataAvailable or m_TRperiod==0.0) return;
ui->DecodeButton->setChecked (true);
- if(!dec_data.params.nagain && m_diskData && !m_bFastMode && m_mode!="FT8" && m_mode!="FT4") {
+ if(!dec_data.params.nagain && m_diskData && (m_TRperiod >= 60.0)) {
dec_data.params.nutc=dec_data.params.nutc/100;
}
if(dec_data.params.nagain==0 && dec_data.params.newdat==1 && (!m_diskData)) {
+ qint64 nperiods=now.toMSecsSinceEpoch()/(1000.0*m_TRperiod);
+ m_dateTimeSeqStart=QDateTime::fromMSecsSinceEpoch(qint64(1000.0*nperiods*m_TRperiod)).toUTC();
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
int imin=ms/60000;
int ihr=imin/60;
imin=imin % 60;
if(m_TRperiod>=60) imin=imin - (imin % (int(m_TRperiod)/60));
dec_data.params.nutc=100*ihr + imin;
- if(m_mode=="ISCAT" or m_mode=="MSK144" or m_bFast9 or m_mode=="FT8" or m_mode=="FT4") {
+ if(m_TRperiod < 60) {
qint64 ms=1000.0*(2.0-m_TRperiod);
- if(m_mode=="FT4") ms=1000.0*(2.0-m_TRperiod);
+ if(m_mode=="FST4") ms=1000.0*(6.0-m_TRperiod);
//Adjust for FT8 early decode:
if(m_mode=="FT8" and m_ihsym==m_earlyDecode and !m_diskData) ms+=(m_hsymStop-m_earlyDecode)*288;
if(m_mode=="FT8" and m_ihsym==m_earlyDecode2 and !m_diskData) ms+=(m_hsymStop-m_earlyDecode2)*288;
@@ -2954,6 +3083,17 @@ void MainWindow::decode() //decode()
dec_data.params.ntol=20;
dec_data.params.naggressive=0;
}
+ if(m_mode=="FST4") {
+ dec_data.params.ntol=ui->sbFtol->value();
+ if(m_config.single_decode()) {
+ dec_data.params.nfa=m_wideGraph->rxFreq() - ui->sbFtol->value();
+ dec_data.params.nfb=m_wideGraph->rxFreq() + ui->sbFtol->value();
+ } else {
+ dec_data.params.nfa=ui->sbF_Low->value();
+ dec_data.params.nfb=ui->sbF_High->value();
+ }
+ }
+ if(m_mode=="FST4W") dec_data.params.ntol=ui->sbFST4W_FTol->value();
if(dec_data.params.nutc < m_nutc0) m_RxLog = 1; //Date and Time to file "ALL.TXT".
if(dec_data.params.newdat==1 and !m_diskData) m_nutc0=dec_data.params.nutc;
dec_data.params.ntxmode=9;
@@ -2977,6 +3117,8 @@ void MainWindow::decode() //decode()
dec_data.params.nmode=5;
m_BestCQpriority="";
}
+ if(m_mode=="FST4") dec_data.params.nmode=240;
+ if(m_mode=="FST4W") dec_data.params.nmode=241;
dec_data.params.ntrperiod=m_TRperiod;
dec_data.params.nsubmode=m_nSubMode;
if(m_mode=="QRA64") dec_data.params.nsubmode=100 + m_nSubMode;
@@ -2993,6 +3135,7 @@ void MainWindow::decode() //decode()
dec_data.params.nexp_decode = static_cast<int> (m_config.special_op_id());
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()+2);
::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);
@@ -3005,68 +3148,58 @@ void MainWindow::decode() //decode()
//newdat=1 ==> this is new data, must do the big FFT
//nagain=1 ==> decode only at fQSO +/- Tol
- char *to = (char*)mem_jt9->data();
- char *from = (char*) dec_data.ipc;
- int size=sizeof(struct dec_data);
- if(dec_data.params.newdat==0) {
- int noffset {offsetof (struct dec_data, params.nutc)};
- to += noffset;
- from += noffset;
- size -= noffset;
- }
- if(m_mode=="ISCAT" or m_mode=="MSK144" or m_bFast9) {
- float t0=m_t0;
- float t1=m_t1;
- qApp->processEvents(); //Update the waterfall
- if(m_nPick > 0) {
- t0=m_t0Pick;
- t1=m_t1Pick;
- }
- static short int d2b[360000];
- narg[0]=dec_data.params.nutc;
- if(m_kdone>int(12000.0*m_TRperiod)) {
- m_kdone=int(12000.0*m_TRperiod);
- }
- narg[1]=m_kdone;
- narg[2]=m_nSubMode;
- narg[3]=dec_data.params.newdat;
- narg[4]=dec_data.params.minSync;
- narg[5]=m_nPick;
- narg[6]=1000.0*t0;
- narg[7]=1000.0*t1;
- narg[8]=2; //Max decode lines per decode attempt
- if(dec_data.params.minSync<0) narg[8]=50;
- if(m_mode=="ISCAT") narg[9]=101; //ISCAT
- if(m_mode=="JT9") narg[9]=102; //Fast JT9
- if(m_mode=="MSK144") narg[9]=104; //MSK144
- narg[10]=ui->RxFreqSpinBox->value();
- narg[11]=ui->sbFtol->value ();
- narg[12]=0;
- narg[13]=-1;
- narg[14]=m_config.aggressive();
- memcpy(d2b,dec_data.d2,2*360000);
- watcher3.setFuture (QtConcurrent::run (std::bind (fast_decode_,&d2b[0],
- &narg[0],&m_TRperiod,&m_msg[0][0],
- dec_data.params.mycall,dec_data.params.hiscall,8000,12,12)));
- } else {
- mem_jt9->lock ();
- memcpy(to, from, qMin(mem_jt9->size(), size));
- mem_jt9->unlock ();
-
-/*
- auto now = QDateTime::currentDateTimeUtc();
- double tsec = fmod(double(now.toMSecsSinceEpoch()),86400000.0)/1000.0;
- double tseq = fmod(double(now.toMSecsSinceEpoch()),1000.0*m_TRperiod)/1000.0;
- if(tseq < 0.5*m_TRperiod) tseq+= m_TRperiod;
- if(m_ihsym==m_earlyDecode) qDebug() << "";
- QString t;
- t = t.asprintf("aa release_jt9 %11.3f %5d %5d %7.3f ",tsec,m_ihsym,m_ihsym,tseq);
- qDebug().noquote() << t << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz");
-*/
-
- to_jt9(m_ihsym,1,-1); //Send m_ihsym to jt9[.exe] and start decoding
- decodeBusy(true);
- }
+ if (auto * to = reinterpret_cast<char *> (mem_jt9->data()))
+ {
+ char *from = (char*) dec_data.ipc;
+ int size=sizeof(struct dec_data);
+ if(dec_data.params.newdat==0) {
+ int noffset {offsetof (struct dec_data, params.nutc)};
+ to += noffset;
+ from += noffset;
+ size -= noffset;
+ }
+ if(m_mode=="ISCAT" or m_mode=="MSK144" or m_bFast9) {
+ float t0=m_t0;
+ float t1=m_t1;
+ qApp->processEvents(); //Update the waterfall
+ if(m_nPick > 0) {
+ t0=m_t0Pick;
+ t1=m_t1Pick;
+ }
+ static short int d2b[360000];
+ narg[0]=dec_data.params.nutc;
+ if(m_kdone>int(12000.0*m_TRperiod)) {
+ m_kdone=int(12000.0*m_TRperiod);
+ }
+ narg[1]=m_kdone;
+ narg[2]=m_nSubMode;
+ narg[3]=dec_data.params.newdat;
+ narg[4]=dec_data.params.minSync;
+ narg[5]=m_nPick;
+ narg[6]=1000.0*t0;
+ narg[7]=1000.0*t1;
+ narg[8]=2; //Max decode lines per decode attempt
+ if(dec_data.params.minSync<0) narg[8]=50;
+ if(m_mode=="ISCAT") narg[9]=101; //ISCAT
+ if(m_mode=="JT9") narg[9]=102; //Fast JT9
+ if(m_mode=="MSK144") narg[9]=104; //MSK144
+ narg[10]=ui->RxFreqSpinBox->value();
+ narg[11]=ui->sbFtol->value ();
+ narg[12]=0;
+ narg[13]=-1;
+ narg[14]=m_config.aggressive();
+ memcpy(d2b,dec_data.d2,2*360000);
+ watcher3.setFuture (QtConcurrent::run (std::bind (fast_decode_,&d2b[0],
+ &narg[0],&m_TRperiod,&m_msg[0][0],
+ dec_data.params.mycall,dec_data.params.hiscall,8000,12,12)));
+ } else {
+ mem_jt9->lock ();
+ memcpy(to, from, qMin(mem_jt9->size(), size));
+ mem_jt9->unlock ();
+ to_jt9(m_ihsym,1,-1); //Send m_ihsym to jt9[.exe] and start decoding
+ decodeBusy(true);
+ }
+ }
}
void::MainWindow::fast_decode_done()
@@ -3114,18 +3247,24 @@ void::MainWindow::fast_decode_done()
void MainWindow::to_jt9(qint32 n, qint32 istart, qint32 idone)
{
- dec_data_t * dd = reinterpret_cast<dec_data_t *> (mem_jt9->data());
- mem_jt9->lock ();
- dd->ipc[0]=n;
- if(istart>=0) dd->ipc[1]=istart;
- if(idone>=0) dd->ipc[2]=idone;
- mem_jt9->unlock ();
+ if (auto * dd = reinterpret_cast<dec_data_t *> (mem_jt9->data()))
+ {
+ mem_jt9->lock ();
+ dd->ipc[0]=n;
+ if(istart>=0) dd->ipc[1]=istart;
+ if(idone>=0) dd->ipc[2]=idone;
+ mem_jt9->unlock ();
+ }
}
void MainWindow::decodeDone ()
{
if(m_mode!="FT8" or dec_data.params.nzhsym==50) m_nDecodes=0;
if(m_mode=="QRA64") m_wideGraph->drawRed(0,0);
+ if ("FST4W" == m_mode)
+ {
+ uploadWSPRSpots (true); // DE station info and trigger posts
+ }
auto tnow = QDateTime::currentDateTimeUtc ();
double tdone = fmod(double(tnow.time().second()),m_TRperiod);
int mswait;
@@ -3161,7 +3300,19 @@ void MainWindow::readFromStdout() //readFromStdout
// truncate before line ending chars
line_read = line_read.left (p - line_read.constData ());
}
- if(m_mode!="FT8" and m_mode!="FT4") {
+ bool haveFSpread {false};
+ float fSpread {0.};
+ if (m_mode.startsWith ("FST4"))
+ {
+ auto text = line_read.mid (64, 6).trimmed ();
+ if (text.size ())
+ {
+ fSpread = text.toFloat (&haveFSpread);
+ line_read = line_read.left (64);
+ }
+ }
+ if (m_mode!="FT8" and m_mode!="FT4"
+ && !m_mode.startsWith ("FST4")) {
//Pad 22-char msg to at least 37 chars
line_read = line_read.left(44) + " " + line_read.mid(44);
}
@@ -3213,7 +3364,10 @@ void MainWindow::readFromStdout() //readFromStdout
}
m_tBlankLine = line_read.left(ntime);
}
-
+ if ("FST4W" == m_mode)
+ {
+ uploadWSPRSpots (true, line_read);
+ }
DecodedText decodedtext0 {QString::fromUtf8(line_read.constData())};
DecodedText decodedtext {QString::fromUtf8(line_read.constData()).remove("TU; ")};
@@ -3242,9 +3396,11 @@ void MainWindow::readFromStdout() //readFromStdout
m_bDisplayedOnce=true;
}
} else {
- ui->decodedTextBrowser->displayDecodedText(decodedtext0,m_baseCall,m_mode,m_config.DXCC(),
- m_logBook,m_currentBand,m_config.ppfx(),
- (ui->cbCQonly->isVisible() and ui->cbCQonly->isChecked()));
+ DecodedText decodedtext1=decodedtext0;
+ ui->decodedTextBrowser->displayDecodedText(decodedtext1,m_baseCall,m_mode,m_config.DXCC(),
+ m_logBook,m_currentBand,m_config.ppfx(),
+ ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(),
+ haveFSpread, fSpread);
if(m_bBestSPArmed and m_mode=="FT4") {
QString messagePriority=ui->decodedTextBrowser->CQPriority();
@@ -3270,7 +3426,7 @@ void MainWindow::readFromStdout() //readFromStdout
//Right (Rx Frequency) window
bool bDisplayRight=bAvgMsg;
int audioFreq=decodedtext.frequencyOffset();
- if(m_mode=="FT8" or m_mode=="FT4") {
+ if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4") {
auto const& parts = decodedtext.string().remove("<").remove(">")
.split (' ', SkipEmptyParts);
if (parts.size() > 6) {
@@ -3353,7 +3509,8 @@ void MainWindow::readFromStdout() //readFromStdout
//### I think this is where we are preventing Hounds from spotting Fox ###
if(m_mode!="FT8" or (SpecOp::HOUND != m_config.special_op_id())) {
- if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="QRA64" or m_mode=="JT4" or m_mode=="JT65" or m_mode=="JT9") {
+ if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="QRA64" or m_mode=="JT4"
+ or m_mode=="JT65" or m_mode=="JT9" or m_mode=="FST4") {
auto_sequence (decodedtext, 25, 50);
}
@@ -3371,8 +3528,14 @@ void MainWindow::readFromStdout() //readFromStdout
// extract details and send to PSKreporter
int nsec=QDateTime::currentMSecsSinceEpoch()/1000-m_secBandChanged;
bool okToPost=(nsec > int(4*m_TRperiod)/5);
- if (stdMsg && okToPost) pskPost(decodedtext);
-
+ if(m_mode=="FST4W" and okToPost) {
+ line_read=line_read.left(22) + " CQ " + line_read.trimmed().mid(22);
+ auto p = line_read.lastIndexOf (' ');
+ DecodedText FST4W_post {QString::fromUtf8 (line_read.left (p).constData ())};
+ pskPost(FST4W_post);
+ } else {
+ if (stdMsg && okToPost) pskPost(decodedtext);
+ }
if((m_mode=="JT4" or m_mode=="JT65" or m_mode=="QRA64") and m_msgAvgWidget!=NULL) {
if(m_msgAvgWidget->isVisible()) {
QFile f(m_config.temp_dir ().absoluteFilePath ("avemsg.txt"));
@@ -3478,11 +3641,12 @@ void MainWindow::pskPost (DecodedText const& decodedtext)
}
int snr = decodedtext.snr();
Frequency frequency = m_freqNominal + audioFrequency;
- pskSetLocal ();
if(grid.contains (grid_regexp)) {
// qDebug() << "To PSKreporter:" << deCall << grid << frequency << msgmode << snr;
- psk_Reporter->addRemoteStation(deCall,grid,QString::number(frequency),msgmode,
- QString::number(snr),QString::number(QDateTime::currentDateTimeUtc ().toTime_t()));
+ if (!m_psk_Reporter.addRemoteStation (deCall, grid, frequency, msgmode, snr))
+ {
+ showStatusMessage (tr ("Spotting to PSK Reporter unavailable"));
+ }
}
}
@@ -3491,7 +3655,7 @@ void MainWindow::killFile ()
if (m_fnameWE.size () && !(m_saveAll || (m_saveDecoded && m_bDecoded))) {
QFile f1 {m_fnameWE + ".wav"};
if(f1.exists()) f1.remove();
- if(m_mode.startsWith ("WSPR")) {
+ if(m_mode=="WSPR" or m_mode=="FST4W") {
QFile f2 {m_fnameWE + ".c2"};
if(f2.exists()) f2.remove();
}
@@ -3502,7 +3666,7 @@ void MainWindow::on_EraseButton_clicked ()
{
qint64 ms=QDateTime::currentMSecsSinceEpoch();
ui->decodedTextBrowser2->erase ();
- if(m_mode.startsWith ("WSPR") or m_mode=="Echo" or m_mode=="ISCAT") {
+ if(m_mode=="WSPR" or m_mode=="Echo" or m_mode=="ISCAT" or m_mode=="FST4W") {
ui->decodedTextBrowser->erase ();
} else {
if((ms-m_msErase)<500) {
@@ -3554,9 +3718,17 @@ void MainWindow::guiUpdate()
if(m_modeTx=="JT4") txDuration=1.0 + 207.0*2520/11025.0; // JT4
if(m_modeTx=="JT9") txDuration=1.0 + 85.0*m_nsps/12000.0; // JT9
if(m_modeTx=="JT65") txDuration=1.0 + 126*4096/11025.0; // JT65
- if(m_modeTx=="QRA64") txDuration=1.0 + 84*6912/12000.0; // QRA64
- if(m_modeTx=="WSPR") txDuration=2.0 + 162*8192/12000.0; // WSPR
- if(m_modeTx=="WSPR-LF") txDuration=2.0 + 114*24576/12000.0; // WSPR-LF
+ if(m_modeTx=="QRA64") txDuration=1.0 + 84*6912/12000.0; // QRA64
+ if(m_modeTx=="WSPR") txDuration=2.0 + 162*8192/12000.0; // WSPR
+ if(m_modeTx=="FST4" or m_mode=="FST4W") { //FST4, FST4W
+ if(m_TRperiod==15) txDuration=1.0 + 160*720/12000.0;
+ if(m_TRperiod==30) txDuration=1.0 + 160*1680/12000.0;
+ if(m_TRperiod==60) txDuration=1.0 + 160*3888/12000.0;
+ if(m_TRperiod==120) txDuration=1.0 + 160*8200/12000.0;
+ if(m_TRperiod==300) txDuration=1.0 + 160*21504/12000.0;
+ if(m_TRperiod==900) txDuration=1.0 + 160*66560/12000.0;
+ if(m_TRperiod==1800) txDuration=1.0 + 160*134400/12000.0;
+ }
if(m_modeTx=="ISCAT" or m_mode=="MSK144" or m_bFast9) {
txDuration=m_TRperiod-0.25; // ISCAT, JT9-fast, MSK144
}
@@ -3567,7 +3739,7 @@ void MainWindow::guiUpdate()
if((icw[0]>0) and (!m_bFast9)) tx2 += icw[0]*2560.0/48000.0; //Full length including CW ID
if(tx2>m_TRperiod) tx2=m_TRperiod;
- if(!m_txFirst and !m_mode.startsWith ("WSPR")) {
+ if(!m_txFirst and m_mode!="WSPR" and m_mode!="FST4W") {
tx1 += m_TRperiod;
tx2 += m_TRperiod;
}
@@ -3588,29 +3760,25 @@ void MainWindow::guiUpdate()
if(m_transmitting) m_bEchoTxed=true;
}
- if(m_mode.startsWith ("WSPR")) {
+ if(m_mode=="WSPR" or m_mode=="FST4W") {
if(m_nseq==0 and m_ntr==0) { //Decide whether to Tx or Rx
m_tuneup=false; //This is not an ATU tuneup
- if(m_pctx==0) m_WSPR_tx_next = false; //Don't transmit if m_pctx=0
bool btx = m_auto && m_WSPR_tx_next; // To Tx, we need m_auto and
// scheduled transmit
- if(m_auto and m_txNext) btx=true; //TxNext button overrides
- if(m_auto and m_pctx==100) btx=true; //Always transmit
-
+ m_WSPR_tx_next = false;
if(btx) {
m_ntr=-1; //This says we will have transmitted
- m_txNext=false;
- ui->pbTxNext->setChecked(false);
- m_bTxTime=true; //Start a WSPR Tx sequence
+ ui->pbTxNext->setChecked (false);
+ m_bTxTime=true; //Start a WSPR or FST4W Tx sequence
} else {
-// This will be a WSPR Rx sequence.
+ // This will be a WSPR or FST4W Rx sequence.
m_ntr=1; //This says we will have received
- m_bTxTime=false; //Start a WSPR Rx sequence
+ m_bTxTime=false; //Start a WSPR or FST4W Rx sequence
}
}
} else {
-// For all modes other than WSPR
+ // For all modes other than WSPR and Fst4W
m_bTxTime = (t2p >= tx1) and (t2p < tx2);
if(m_mode=="Echo") m_bTxTime = m_bTxTime and m_bEchoTxOK;
if(m_mode=="FT8" and ui->tx5->currentText().contains("/B ")) {
@@ -3630,8 +3798,7 @@ void MainWindow::guiUpdate()
// Don't transmit another mode in the 30 m WSPR sub-band
Frequency onAirFreq = m_freqNominal + ui->TxFreqSpinBox->value();
- if ((onAirFreq > 10139900 and onAirFreq < 10140320) and
- !m_mode.startsWith ("WSPR")) {
+ if ((onAirFreq > 10139900 and onAirFreq < 10140320) and m_mode!="WSPR") {
m_bTxTime=false;
if (m_auto) auto_tx_mode (false);
if(onAirFreq!=m_onAirFreq0) {
@@ -3664,7 +3831,7 @@ void MainWindow::guiUpdate()
}
}
- if (m_config.watchdog() && !m_mode.startsWith ("WSPR")
+ if (m_config.watchdog() && m_mode!="WSPR" && m_mode!="FST4W"
&& m_idleMinutes >= m_config.watchdog ()) {
tx_watchdog (true); // disable transmit
}
@@ -3678,8 +3845,6 @@ void MainWindow::guiUpdate()
if(m_ntx == 4) txMsg=ui->tx4->text();
if(m_ntx == 5) txMsg=ui->tx5->currentText();
if(m_ntx == 6) txMsg=ui->tx6->text();
- if(m_ntx == 7) txMsg=ui->genMsg->text();
- if(m_ntx == 8) txMsg=ui->freeTextMsg->currentText();
int msgLength=txMsg.trimmed().length();
if(msgLength==0 and !m_tune) on_stopTxButton_clicked();
@@ -3729,26 +3894,26 @@ void MainWindow::guiUpdate()
}
setXIT (ui->TxFreqSpinBox->value ());
- Q_EMIT m_config.transceiver_ptt (true); //Assert the PTT
+ m_config.transceiver_ptt (true); //Assert the PTT
m_tx_when_ready = true;
}
// if(!m_bTxTime and !m_tune and m_mode!="FT4") m_btxok=false; //Time to stop transmitting
if(!m_bTxTime and !m_tune) m_btxok=false; //Time to stop transmitting
}
- if(m_mode.startsWith ("WSPR") and
+ if((m_mode=="WSPR" or m_mode=="FST4W") and
((m_ntr==1 and m_rxDone) or (m_ntr==-1 and m_nseq>tx2))) {
if(m_monitoring) {
m_rxDone=false;
}
if(m_transmitting) {
WSPR_history(m_freqNominal,-1);
- m_bTxTime=false; //Time to stop a WSPR transmission
+ m_bTxTime=false; //Time to stop a WSPR or FST4W transmission
m_btxok=false;
}
else if (m_ntr != -1) {
WSPR_scheduling ();
- m_ntr=0; //This WSPR Rx sequence is complete
+ m_ntr=0; //This WSPR or FST4W Rx sequence is complete
}
}
@@ -3759,26 +3924,8 @@ void MainWindow::guiUpdate()
QByteArray ba;
QByteArray ba0;
- if(m_mode.startsWith ("WSPR")) {
- QString sdBm,msg0,msg1,msg2;
- sdBm = sdBm.asprintf(" %d",m_dBm);
- m_tx=1-m_tx;
- int i2=m_config.my_callsign().indexOf("/");
- if(i2>0
- || (6 == m_config.my_grid ().size ()
- && !ui->WSPR_prefer_type_1_check_box->isChecked ())) {
- if(i2<0) { // "Type 2" WSPR message
- msg1=m_config.my_callsign() + " " + m_config.my_grid().mid(0,4) + sdBm;
- } else {
- msg1=m_config.my_callsign() + sdBm;
- }
- msg0="<" + m_config.my_callsign() + "> " + m_config.my_grid()+ sdBm;
- if(m_tx==0) msg2=msg0;
- if(m_tx==1) msg2=msg1;
- } else {
- msg2=m_config.my_callsign() + " " + m_config.my_grid().mid(0,4) + sdBm; // Normal WSPR message
- }
- ba=msg2.toLatin1();
+ if(m_mode=="WSPR") {
+ ba=WSPR_message().toLatin1();
} else {
if(SpecOp::HOUND == m_config.special_op_id() and m_ntx!=3) { //Hound transmits only Tx1 or Tx3
m_ntx=1;
@@ -3797,8 +3944,6 @@ void MainWindow::guiUpdate()
if(m_ntx == 4) ba=ui->tx4->text().toLocal8Bit();
if(m_ntx == 5) ba=ui->tx5->currentText().toLocal8Bit();
if(m_ntx == 6) ba=ui->tx6->text().toLocal8Bit();
- if(m_ntx == 7) ba=ui->genMsg->text().toLocal8Bit();
- if(m_ntx == 8) ba=ui->freeTextMsg->currentText().toLocal8Bit();
}
ba2msg(ba,message);
@@ -3827,9 +3972,8 @@ void MainWindow::guiUpdate()
&m_currentMessageType, 22, 22);
if(m_modeTx=="WSPR") genwspr_(message, msgsent, const_cast<int *> (itone),
22, 22);
-// if(m_modeTx=="WSPR-LF") genwspr_fsk8_(message, msgsent, const_cast<int *> (itone),
-// 22, 22);
- if(m_modeTx=="MSK144" or m_modeTx=="FT8" or m_modeTx=="FT4") {
+ if(m_modeTx=="MSK144" or m_modeTx=="FT8" or m_modeTx=="FT4"
+ or m_modeTx=="FST4" or m_modeTx=="FST4W") {
char MyCall[6];
char MyGrid[6];
::memcpy(MyCall, (m_config.my_callsign()+" ").toLatin1(), sizeof MyCall);
@@ -3843,8 +3987,9 @@ void MainWindow::guiUpdate()
m_modulator->set_nsym(nsym);
}
}
+
if(m_modeTx=="FT8") {
- if(SpecOp::FOX==m_config.special_op_id() and ui->tabWidget->currentIndex()==2) {
+ if(SpecOp::FOX==m_config.special_op_id() and ui->tabWidget->currentIndex()==1) {
foxTxSequencer();
} else {
int i3=0;
@@ -3861,7 +4006,6 @@ void MainWindow::guiUpdate()
int nwave=nsym*nsps;
gen_ft8wave_(const_cast<int *>(itone),&nsym,&nsps,&bt,&fsample,&f0,foxcom_.wave,
foxcom_.wave,&icmplx,&nwave);
-
if(SpecOp::FOX == m_config.special_op_id()) {
//Fox must generate the full Tx waveform, not just an itone[] array.
QString fm = QString::fromStdString(message).trimmed();
@@ -3889,6 +4033,39 @@ void MainWindow::guiUpdate()
gen_ft4wave_(const_cast<int *>(itone),&nsym,&nsps,&fsample,&f0,foxcom_.wave,
foxcom_.wave,&icmplx,&nwave);
}
+ if(m_modeTx=="FST4" or m_modeTx=="FST4W") {
+ int ichk=0;
+ int iwspr=0;
+ char fst4msgbits[101];
+ QString wmsg;
+ if(m_mode=="FST4W") {
+ iwspr = 1;
+ wmsg=WSPR_message();
+ ba=wmsg.toLatin1();
+ ba2msg(ba,message);
+ }
+ genfst4_(message,&ichk,msgsent,const_cast<char *> (fst4msgbits),
+ const_cast<int *>(itone), &iwspr, 37, 37);
+ int hmod=1; //No FST4/W submodes
+ int nsps=720;
+ if(m_TRperiod==30) nsps=1680;
+ if(m_TRperiod==60) nsps=3888;
+ if(m_TRperiod==120) nsps=8200;
+ if(m_TRperiod==300) nsps=21504;
+ if(m_TRperiod==900) nsps=66560;
+ if(m_TRperiod==1800) nsps=134400;
+ nsps=4*nsps; //48000 Hz sampling
+ int nsym=160;
+ float fsample=48000.0;
+ float dfreq=hmod*fsample/nsps;
+ float f0=ui->TxFreqSpinBox->value() - m_XIT + 1.5*dfreq;
+ int nwave=(nsym+2)*nsps;
+ int icmplx=0;
+ gen_fst4wave_(const_cast<int *>(itone),&nsym,&nsps,&nwave,
+ &fsample,&hmod,&f0,&icmplx,foxcom_.wave,foxcom_.wave);
+
+ QString t = QString::fromStdString(message).trimmed();
+ }
if(SpecOp::EU_VHF==m_config.special_op_id()) {
if(m_ntx==2) m_xSent=ui->tx2->text().right(13);
@@ -3926,7 +4103,7 @@ void MainWindow::guiUpdate()
write_all("Tx",m_currentMessage);
if (m_config.TX_messages ()) {
ui->decodedTextBrowser2->displayTransmittedText(m_currentMessage,m_modeTx,
- ui->TxFreqSpinBox->value(),m_bFastMode);
+ ui->TxFreqSpinBox->value(),m_bFastMode,m_TRperiod);
}
}
@@ -4003,35 +4180,27 @@ void MainWindow::guiUpdate()
m_restart=false;
//----------------------------------------------------------------------
} else {
- if (!m_auto && m_sentFirst73)
- {
+ if (!m_auto && m_sentFirst73) {
m_sentFirst73 = false;
- if (1 == ui->tabWidget->currentIndex())
- {
- ui->genMsg->setText(ui->tx6->text());
- m_ntx=7;
- m_QSOProgress = CALLING;
- m_gen_message_is_cq = true;
- ui->rbGenMsg->setChecked(true);
- }
}
}
if (g_iptt == 1 && m_iptt0 == 0) {
auto const& current_message = QString::fromLatin1 (msgsent);
- if(m_config.watchdog () && !m_mode.startsWith ("WSPR")
+ if(m_config.watchdog () && m_mode!="WSPR" && m_mode!="FST4W"
&& current_message != m_msgSent0) {
tx_watchdog (false); // in case we are auto sequencing
m_msgSent0 = current_message;
}
-// if(m_mode!="FT4") {
- if(!m_tune) write_all("Tx",m_currentMessage);
-
- if (m_config.TX_messages () && !m_tune && SpecOp::FOX!=m_config.special_op_id()) {
- ui->decodedTextBrowser2->displayTransmittedText(current_message, m_modeTx,
- ui->TxFreqSpinBox->value(),m_bFastMode);
+ if (m_mode != "FST4W" && m_mode != "WSPR")
+ {
+ if(!m_tune) write_all("Tx",m_currentMessage);
+ if (m_config.TX_messages () && !m_tune && SpecOp::FOX!=m_config.special_op_id())
+ {
+ ui->decodedTextBrowser2->displayTransmittedText(current_message, m_modeTx,
+ ui->TxFreqSpinBox->value(),m_bFastMode,m_TRperiod);
+ }
}
-// }
switch (m_ntx)
{
@@ -4077,16 +4246,11 @@ void MainWindow::guiUpdate()
}
}
-//Once per second:
+//Once per second (onesec)
if(nsec != m_sec0) {
-// qDebug() << "onesec" << m_mode;
- if(m_freqNominal!=0 and m_freqNominal<50000000 and m_config.enable_VHF_features()) {
- if(!m_bVHFwarned) vhfWarning();
- } else {
- m_bVHFwarned=false;
- }
+// qDebug() << "AAA" << nsec;
+ if(m_mode=="FST4") chk_FST4_freq_range();
m_currentBand=m_config.bands()->find(m_freqNominal);
-
if( SpecOp::HOUND == m_config.special_op_id() ) {
qint32 tHound=QDateTime::currentMSecsSinceEpoch()/1000 - m_tAutoOn;
//To keep calling Fox, Hound must reactivate Enable Tx at least once every 2 minutes
@@ -4118,7 +4282,7 @@ void MainWindow::guiUpdate()
if(m_transmitting) {
char s[42];
- if(SpecOp::FOX==m_config.special_op_id() and ui->tabWidget->currentIndex()==2) {
+ if(SpecOp::FOX==m_config.special_op_id() and ui->tabWidget->currentIndex()==1) {
sprintf(s,"Tx: %d Slots",foxcom_.nslots);
} else {
sprintf(s,"Tx: %s",msgsent);
@@ -4126,11 +4290,11 @@ void MainWindow::guiUpdate()
m_nsendingsh=0;
if(s[4]==64) m_nsendingsh=1;
if(m_nsendingsh==1 or m_currentMessageType==7) {
- tx_status_label.setStyleSheet("QLabel{background-color: #66ffff}");
+ tx_status_label.setStyleSheet("QLabel{color: #000000; background-color: #66ffff}");
} else if(m_nsendingsh==-1 or m_currentMessageType==6) {
- tx_status_label.setStyleSheet("QLabel{background-color: #ffccff}");
+ tx_status_label.setStyleSheet("QLabel{color: #000000; background-color: #ffccff}");
} else {
- tx_status_label.setStyleSheet("QLabel{background-color: #ffff33}");
+ tx_status_label.setStyleSheet("QLabel{color: #000000; background-color: #ffff33}");
}
if(m_tune) {
tx_status_label.setText("Tx: TUNE");
@@ -4140,7 +4304,7 @@ void MainWindow::guiUpdate()
} else {
s[40]=0;
QString t{QString::fromLatin1(s)};
- if(SpecOp::FOX==m_config.special_op_id() and ui->tabWidget->currentIndex()==2 and foxcom_.nslots==1) {
+ if(SpecOp::FOX==m_config.special_op_id() and ui->tabWidget->currentIndex()==1 and foxcom_.nslots==1) {
t=m_fm1.trimmed();
}
if(m_mode=="FT4") t="Tx: "+ m_currentMessage;
@@ -4149,11 +4313,11 @@ void MainWindow::guiUpdate()
}
} else if(m_monitoring) {
if (!m_tx_watchdog) {
- tx_status_label.setStyleSheet("QLabel{background-color: #00ff00}");
+ tx_status_label.setStyleSheet("QLabel{color: #000000; background-color: #00ff00}");
auto t = tr ("Receiving");
if(m_mode=="MSK144") {
int npct=int(100.0*m_fCPUmskrtd/0.298667);
- if(npct>90) tx_status_label.setStyleSheet("QLabel{background-color: #ff0000}");
+ if(npct>90) tx_status_label.setStyleSheet("QLabel{color: #000000; background-color: #ff0000}");
t += QString {" %1%"}.arg (npct, 2);
}
tx_status_label.setText (t);
@@ -4213,11 +4377,11 @@ void MainWindow::startTx2()
ui->signal_meter_widget->setValue(0,0);
if(m_mode=="Echo" and !m_tune) m_bTransmittedEcho=true;
- if(m_mode.startsWith ("WSPR") and !m_tune) {
+ if((m_mode=="WSPR" or m_mode=="FST4W") and !m_tune) {
if (m_config.TX_messages ()) {
t = " Transmitting " + m_mode + " ----------------------- " +
m_config.bands ()->find (m_freqNominal);
- t=WSPR_hhmm(0) + ' ' + t.rightJustified (66, '-');
+ t=beacon_start_time (m_TRperiod / 2) + ' ' + t.rightJustified (66, '-');
ui->decodedTextBrowser->appendText(t);
}
write_all("Tx",m_currentMessage);
@@ -4242,14 +4406,14 @@ void MainWindow::stopTx()
void MainWindow::stopTx2()
{
- Q_EMIT m_config.transceiver_ptt (false); //Lower PTT
+ m_config.transceiver_ptt (false); //Lower PTT
if (m_mode == "JT9" && m_bFast9
&& ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked()
&& m_ntx == 5 && m_nTx73 >= 5) {
on_stopTxButton_clicked ();
m_nTx73 = 0;
}
- if((m_mode.startsWith("WSPR") and m_ntr==-1) and !m_tuneup) {
+ if(((m_mode=="WSPR" or m_mode=="FST4W") and m_ntr==-1) and !m_tuneup) {
m_wideGraph->setWSPRtransmitted();
WSPR_scheduling ();
m_ntr=0;
@@ -4474,9 +4638,9 @@ void MainWindow::doubleClickOnCall2(Qt::KeyboardModifiers modifiers)
void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers)
{
QTextCursor cursor;
- if(m_mode=="ISCAT") {
+ if(m_mode=="ISCAT" or m_mode=="FST4W") {
MessageBox::information_message (this,
- "Double-click not available for ISCAT mode");
+ "Double-click not available for ISCAT or FST4W mode");
return;
}
if(m_decodedText2) {
@@ -4499,7 +4663,7 @@ void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers)
}
return;
}
- DecodedText message {cursor.block().text().trimmed().remove("TU; ")};
+ DecodedText message {cursor.block().text().trimmed().left(61).remove("TU; ")};
m_bDoubleClicked = true;
processMessage (message, modifiers);
}
@@ -4519,7 +4683,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
|| ("JT9" == m_mode && mode != "@")
|| ("MSK144" == m_mode && !("&" == mode || "^" == mode))
|| ("QRA64" == m_mode && mode.left (1) != ":")) {
- return; //Currently we do auto-sequencing only in FT4, FT8, and MSK144
+ return; //Currently we do auto-sequencing only in FT4, FT8, MSK144, and FST4
}
//Skip the rest if no decoded text extracted
@@ -4560,6 +4724,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
QString hiscall;
QString hisgrid;
message.deCallAndGrid(/*out*/hiscall,hisgrid);
+
if(message.string().contains(hiscall+"/R")) {
hiscall+="/R";
ui->dxCallEntry->setText(hiscall);
@@ -4573,8 +4738,6 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
int nw=w.size();
if(nw>=4) {
if(message_words.size()<3) return;
- // Temporary? Correct for the fact that message.deCallAndGrid() does not work for EU VHF contest messages
- QString t=message_words.at(nw-2);
int n=w.at(nw-2).toInt();
if(n>=520001 and n<=592047) {
hiscall=w.at(1);
@@ -4607,6 +4770,13 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
return;
}
+ // ignore calls by other hounds
+ if (SpecOp::HOUND == m_config.special_op_id()
+ && message.messageWords ().indexOf (QRegularExpression {R"(R\+-[0-9]+)"}) >= 0)
+ {
+ return;
+ }
+
QString firstcall = message.call();
if(firstcall.length()==5 and firstcall.mid(0,3)=="CQ ") firstcall="CQ";
if(!m_bFastMode and (!m_config.enable_VHF_features() or m_mode=="FT8")) {
@@ -4621,7 +4791,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
ui->TxFreqSpinBox->setValue(frequency);
}
if(m_mode != "JT4" && m_mode != "JT65" && !m_mode.startsWith ("JT9") &&
- m_mode != "QRA64" && m_mode!="FT8" && m_mode!="FT4") {
+ m_mode != "QRA64" && m_mode!="FT8" && m_mode!="FT4" && m_mode!="FST4") {
return;
}
}
@@ -4634,7 +4804,6 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
// Determine appropriate response to received message
auto dtext = " " + message.string () + " ";
dtext=dtext.remove("<").remove(">");
- int gen_msg {0};
if(dtext.contains (" " + m_baseCall + " ")
|| dtext.contains ("<" + m_baseCall + "> ")
//###??? || dtext.contains ("<" + m_baseCall + " " + hiscall + "> ")
@@ -4684,7 +4853,6 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
if(SpecOp::EU_VHF==m_config.special_op_id() and message_words.at(1).contains(m_baseCall) and
(!message_words.at(2).contains(qso_partner_base_call)) and (!m_bDoubleClicked)) {
-// qDebug() << "aa" << "Ignoring:" << message.string().mid(24);
return;
}
@@ -4694,58 +4862,52 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
or bEU_VHF_w2 or (m_QSOProgress==CALLING))) {
if(message_words.at(3).contains(grid_regexp) and SpecOp::EU_VHF!=m_config.special_op_id()) {
if(SpecOp::NA_VHF==m_config.special_op_id() or SpecOp::WW_DIGI==m_config.special_op_id()){
- gen_msg=setTxMsg(3);
+ setTxMsg(3);
m_QSOProgress=ROGER_REPORT;
} else {
if(m_mode=="JT65" and message_words.size()>4 and message_words.at(4)=="OOO") {
- gen_msg=setTxMsg(3);
+ setTxMsg(3);
m_QSOProgress=ROGER_REPORT;
} else {
- gen_msg=setTxMsg(2);
+ setTxMsg(2);
m_QSOProgress=REPORT;
}
}
} else if(w34.contains(grid_regexp) and SpecOp::EU_VHF==m_config.special_op_id()) {
if(nrpt==0) {
- gen_msg=setTxMsg(2);
+ setTxMsg(2);
m_QSOProgress=REPORT;
} else {
if(w2=="R") {
- gen_msg=setTxMsg(4);
+ setTxMsg(4);
m_QSOProgress=ROGERS;
} else {
- gen_msg=setTxMsg(3);
+ setTxMsg(3);
m_QSOProgress=ROGER_REPORT;
}
}
} else if(SpecOp::RTTY == m_config.special_op_id() and bRTTY) {
if(w2=="R") {
- gen_msg=setTxMsg(4);
+ setTxMsg(4);
m_QSOProgress=ROGERS;
} else {
- gen_msg=setTxMsg(3);
+ setTxMsg(3);
m_QSOProgress=ROGER_REPORT;
}
m_xRcvd=t[n-2] + " " + t[n-1];
-// qDebug() << "bb" << w2 << w34 << t0 << m_xRcvd;
} else if(SpecOp::FIELD_DAY==m_config.special_op_id() and bFieldDay_msg) {
if(t0=="R") {
- gen_msg=setTxMsg(4);
+ setTxMsg(4);
m_QSOProgress=ROGERS;
} else {
- gen_msg=setTxMsg(3);
+ setTxMsg(3);
m_QSOProgress=ROGER_REPORT;
}
} else { // no grid on end of msg
QString r=message_words.at (3);
if(m_QSOProgress >= ROGER_REPORT && (r=="RRR" || r.toInt()==73 || "RR73" == r)) {
if(m_mode=="FT4" and r=="RR73") m_dateTimeRcvdRR73=QDateTime::currentDateTimeUtc();
- if(ui->tabWidget->currentIndex()==1) {
- gen_msg = 5;
- if (ui->rbGenMsg->isChecked ()) m_ntx=7;
- m_gen_message_is_cq = false;
- } else {
m_bTUmsg=false;
m_nextCall=""; //### Temporary: disable use of "TU;" message
if(SpecOp::RTTY == m_config.special_op_id() and m_nextCall!="") {
@@ -4766,7 +4928,6 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
ui->txrb5->setChecked(true);
}
}
- }
m_QSOProgress = SIGNOFF;
} else if((m_QSOProgress >= REPORT
|| (m_QSOProgress >= REPLYING &&
@@ -4780,24 +4941,19 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
if(nRpt>=529 and nRpt<=599) m_xRcvd=t[n-2] + " " + t[n-1];
}
ui->txrb4->setChecked(true);
- if(ui->tabWidget->currentIndex()==1) {
- gen_msg = 4;
- m_ntx=7;
- m_gen_message_is_cq = false;
- }
} else if(m_QSOProgress>=CALLING and
((r.toInt()>=-50 && r.toInt()<=49) or (r.toInt()>=529 && r.toInt()<=599))) {
if(SpecOp::EU_VHF==m_config.special_op_id() or
SpecOp::FIELD_DAY==m_config.special_op_id() or
SpecOp::RTTY==m_config.special_op_id()) {
- gen_msg=setTxMsg(2);
+ setTxMsg(2);
m_QSOProgress=REPORT;
} else {
if(r.left(2)=="R-" or r.left(2)=="R+") {
- gen_msg=setTxMsg(4);
+ setTxMsg(4);
m_QSOProgress=ROGERS;
} else {
- gen_msg=setTxMsg(3);
+ setTxMsg(3);
m_QSOProgress=ROGER_REPORT;
}
}
@@ -4810,15 +4966,8 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
&& message_words.size () > 2 && message_words.at (1).contains (m_baseCall)
&& message_words.at (2) == "73") {
// 73 back to compound call holder
- if(ui->tabWidget->currentIndex()==1) {
- gen_msg = 5;
- if (ui->rbGenMsg->isChecked ()) m_ntx=7;
- m_gen_message_is_cq = false;
- }
- else {
- m_ntx=5;
- ui->txrb5->setChecked(true);
- }
+ m_ntx=5;
+ ui->txrb5->setChecked(true);
m_QSOProgress = SIGNOFF;
}
else if (!(m_bAutoReply && (m_QSOProgress > CALLING))) {
@@ -4828,21 +4977,10 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
m_ntx=3;
m_QSOProgress = ROGER_REPORT;
ui->txrb3->setChecked (true);
- if (ui->tabWidget->currentIndex () == 1) {
- gen_msg = 3;
- m_ntx = 7;
- m_gen_message_is_cq = false;
- }
} else if (!is_73) { // don't respond to sign off messages
m_ntx=2;
m_QSOProgress = REPORT;
ui->txrb2->setChecked(true);
- if(ui->tabWidget->currentIndex()==1) {
- gen_msg = 2;
- m_ntx=7;
- m_gen_message_is_cq = false;
- }
-
if (m_bDoubleClickAfterCQnnn and m_transmitting) {
on_stopTxButton_clicked();
TxAgainTimer.start(1500);
@@ -4863,7 +5001,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
// m_nextGrid=message_words.at(3);
// m_nextRpt=message.report();
// ui->labNextCall->setText("Next: " + m_nextCall);
-// ui->labNextCall->setStyleSheet("QLabel {background-color: #66ff66}");
+// ui->labNextCall->setStyleSheet("QLabel {color: #000000; background-color: #66ff66}");
// }
return;
}
@@ -4871,14 +5009,8 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
else if (firstcall == "DE" && message_words.size () > 3 && message_words.at (3) == "73") {
if (m_QSOProgress >= ROGERS && base_call == qso_partner_base_call && m_currentMessageType) {
// 73 back to compound call holder
- if(ui->tabWidget->currentIndex()==1) {
- gen_msg = 5;
- m_ntx=7;
- m_gen_message_is_cq = false;
- } else {
- m_ntx=5;
- ui->txrb5->setChecked(true);
- }
+ m_ntx=5;
+ ui->txrb5->setChecked(true);
m_QSOProgress = SIGNOFF;
} else {
// treat like a CQ/QRZ
@@ -4891,22 +5023,11 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
m_QSOProgress = REPORT;
ui->txrb2->setChecked (true);
}
- if(ui->tabWidget->currentIndex()==1) {
- gen_msg = 1;
- m_ntx=7;
- m_gen_message_is_cq = false;
- }
}
}
else if (is_73 && !message.isStandardMessage ()) {
- if(ui->tabWidget->currentIndex()==1) {
- gen_msg = 5;
- if (ui->rbGenMsg->isChecked ()) m_ntx=7;
- m_gen_message_is_cq = false;
- } else {
- m_ntx=5;
- ui->txrb5->setChecked(true);
- }
+ m_ntx=5;
+ ui->txrb5->setChecked(true);
m_QSOProgress = SIGNOFF;
} else {
// just work them
@@ -4919,11 +5040,6 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
m_QSOProgress = REPORT;
ui->txrb2->setChecked (true);
}
- if (1 == ui->tabWidget->currentIndex ()) {
- gen_msg = m_ntx;
- m_ntx=7;
- m_gen_message_is_cq = false;
- }
}
// if we get here then we are reacting to the message
if (m_bAutoReply) m_bCallingCQ = CALLING == m_QSOProgress;
@@ -4977,29 +5093,17 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
m_bTUmsg=false; //### Temporary: disable use of "TU;" messages
if (!m_nTx73 and !m_bTUmsg) {
genStdMsgs(rpt);
- if (gen_msg) {
- switch (gen_msg) {
- case 1: ui->genMsg->setText (ui->tx1->text ()); break;
- case 2: ui->genMsg->setText (ui->tx2->text ()); break;
- case 3: ui->genMsg->setText (ui->tx3->text ()); break;
- case 4: ui->genMsg->setText (ui->tx4->text ()); break;
- case 5: ui->genMsg->setText (ui->tx5->currentText ()); break;
- }
- if (gen_msg != 5) { // allow user to pre-select a free message
- ui->rbGenMsg->setChecked (true);
- }
- }
}
if(m_transmitting) m_restart=true;
if (ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked ()
&& !m_bDoubleClicked && m_mode!="FT4") {
return;
}
- if(m_config.quick_call()) auto_tx_mode(true);
+ if(m_config.quick_call() && m_bDoubleClicked) auto_tx_mode(true);
m_bDoubleClicked=false;
}
-int MainWindow::setTxMsg(int n)
+void MainWindow::setTxMsg(int n)
{
m_ntx=n;
if(n==1) ui->txrb1->setChecked(true);
@@ -5008,11 +5112,6 @@ int MainWindow::setTxMsg(int n)
if(n==4) ui->txrb4->setChecked(true);
if(n==5) ui->txrb5->setChecked(true);
if(n==6) ui->txrb6->setChecked(true);
- if(ui->tabWidget->currentIndex()==1) {
- m_ntx=7; //### FIX THIS ###
- m_gen_message_is_cq = false;
- }
- return n;
}
void MainWindow::genCQMsg ()
@@ -5084,11 +5183,11 @@ bool MainWindow::stdCall(QString const& w)
{
static QRegularExpression standard_call_re {
R"(
- ^\s* # optional leading spaces
+ ^\s* # optional leading spaces
( [A-Z]{0,2} | [A-Z][0-9] | [0-9][A-Z] ) # part 1
( [0-9][A-Z]{0,3} ) # part 2
- (/R | /P)? # optional suffix
- \s*$ # optional trailing spaces
+ (/R | /P)? # optional suffix
+ \s*$ # optional trailing spaces
)", QRegularExpression::CaseInsensitiveOption | QRegularExpression::ExtendedPatternSyntaxOption};
return standard_call_re.match (w).hasMatch ();
}
@@ -5104,7 +5203,6 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
ui->tx3->clear ();
ui->tx4->clear ();
if(unconditional) ui->tx5->lineEdit ()->clear (); //Test if it needs sending again
- ui->genMsg->clear ();
m_gen_message_is_cq = false;
return;
}
@@ -5141,7 +5239,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
int n=rpt.toInt();
rpt = rpt.asprintf("%+2.2d",n);
- if(m_mode=="MSK144" or m_mode=="FT8" or m_mode=="FT4") {
+ if(m_mode=="MSK144" or m_mode=="FT8" or m_mode=="FT4" || m_mode=="FST4") {
QString t2,t3;
QString sent=rpt;
QString rs,rst;
@@ -5205,7 +5303,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
}
}
- if((m_mode!="MSK144" and m_mode!="FT8" and m_mode!="FT4")) {
+ if((m_mode!="MSK144" and m_mode!="FT8" and m_mode!="FT4" && m_mode != "FST4")) {
t=t00 + rpt;
msgtype(t, ui->tx2);
t=t0 + "R" + rpt;
@@ -5221,7 +5319,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
}
t=t0 + (m_send_RR73 ? "RR73" : "RRR");
- if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8" or m_mode=="FT4") {
+ if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8" or m_mode=="FT4" || m_mode == "FST4") {
if(!bHisCall and bMyCall) t=hisCall + " <" + my_callsign + "> " + (m_send_RR73 ? "RR73" : "RRR");
if(bHisCall and !bMyCall) t="<" + hisCall + "> " + my_callsign + " " + (m_send_RR73 ? "RR73" : "RRR");
}
@@ -5229,7 +5327,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
msgtype(t, ui->tx4);
t=t0 + "73";
- if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8" or m_mode=="FT4") {
+ if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8" or m_mode=="FT4" || m_mode == "FST4") {
if(!bHisCall and bMyCall) t=hisCall + " <" + my_callsign + "> 73";
if(bHisCall and !bMyCall) t="<" + hisCall + "> " + my_callsign + " 73";
}
@@ -5245,7 +5343,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
}
}
- if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="MSK144") return;
+ if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="MSK144" || m_mode == "FST4") return;
if (is_compound) {
if (is_type_one) {
@@ -5258,9 +5356,9 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
case Configuration::type_2_msg_1_full:
msgtype(t + my_grid, ui->tx1);
if (!eme_short_codes) {
- if((m_mode=="MSK144" || m_mode=="FT8" || m_mode=="FT4") &&
+ if((m_mode=="MSK144" || m_mode=="FT8" || m_mode=="FT4" || m_mode == "FST4") &&
SpecOp::NA_VHF == m_config.special_op_id()) {
- msgtype(t + "R " + my_grid, ui->tx3);
+ msgtype(t + "R " + my_grid, ui->tx3); // #### Unreachable code
} else {
msgtype(t + "R" + rpt, ui->tx3);
}
@@ -5271,7 +5369,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
break;
case Configuration::type_2_msg_3_full:
- if ((m_mode=="MSK144" || m_mode=="FT8" || m_mode=="FT4") &&
+ if ((m_mode=="MSK144" || m_mode=="FT8" || m_mode=="FT4" || m_mode == "FST4") &&
SpecOp::NA_VHF == m_config.special_op_id()) {
msgtype(t + "R " + my_grid, ui->tx3);
msgtype(t + "RRR", ui->tx4);
@@ -5287,9 +5385,9 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
case Configuration::type_2_msg_5_only:
msgtype(t00 + my_grid, ui->tx1);
if (!eme_short_codes) {
- if ((m_mode=="MSK144" || m_mode=="FT8" || m_mode=="FT4") &&
+ if ((m_mode=="MSK144" || m_mode=="FT8" || m_mode=="FT4" || m_mode == "FST4") &&
SpecOp::NA_VHF == m_config.special_op_id()) {
- msgtype(t + "R " + my_grid, ui->tx3);
+ msgtype(t + "R " + my_grid, ui->tx3); // #### Unreachable code
msgtype(t + "RRR", ui->tx4);
} else {
msgtype(t0 + "R" + rpt, ui->tx3);
@@ -5346,19 +5444,12 @@ void MainWindow::clearDX ()
m_qsoStop.clear ();
m_inQSOwith.clear();
genStdMsgs (QString {});
- if (ui->tabWidget->currentIndex() == 1) {
- ui->genMsg->setText(ui->tx6->text());
- m_ntx=7;
- m_gen_message_is_cq = true;
- ui->rbGenMsg->setChecked(true);
+ if (m_mode=="FT8" and SpecOp::HOUND == m_config.special_op_id()) {
+ m_ntx=1;
+ ui->txrb1->setChecked(true);
} else {
- if (m_mode=="FT8" and SpecOp::HOUND == m_config.special_op_id()) {
- m_ntx=1;
- ui->txrb1->setChecked(true);
- } else {
- m_ntx=6;
- ui->txrb6->setChecked(true);
- }
+ m_ntx=6;
+ ui->txrb6->setChecked(true);
}
m_QSOProgress = CALLING;
}
@@ -5585,6 +5676,12 @@ void MainWindow::on_tx6_editingFinished() //tx6 edited
msgtype(t, ui->tx6);
}
+void MainWindow::on_RoundRobin_currentTextChanged(QString text)
+{
+ ui->sbTxPercent->setEnabled (text == tr ("Random"));
+}
+
+
void MainWindow::on_dxCallEntry_textChanged (QString const& call)
{
m_hisCall = call;
@@ -5700,7 +5797,7 @@ void MainWindow::acceptQSO (QDateTime const& QSO_date_off, QString const& call,
, QString const& name, QDateTime const& QSO_date_on, QString const& operator_call
, QString const& my_call, QString const& my_grid
, QString const& exchange_sent, QString const& exchange_rcvd
- , QByteArray const& ADIF)
+ , QString const& propmode, QByteArray const& ADIF)
{
QString date = QSO_date_on.toString("yyyyMMdd");
if (!m_logBook.add (call, grid, m_config.bands()->find(dial_freq), mode, ADIF))
@@ -5711,7 +5808,7 @@ void MainWindow::acceptQSO (QDateTime const& QSO_date_off, QString const& call,
m_messageClient->qso_logged (QSO_date_off, call, grid, dial_freq, mode, rpt_sent, rpt_received
, tx_power, comments, name, QSO_date_on, operator_call, my_call, my_grid
- , exchange_sent, exchange_rcvd);
+ , exchange_sent, exchange_rcvd, propmode);
m_messageClient->logged_ADIF (ADIF);
// Log to N1MM Logger
@@ -5797,6 +5894,9 @@ void MainWindow::displayWidgets(qint64 n)
if(i==30) ui->labDXped->setVisible(b);
if(i==31) ui->cbRxAll->setVisible(b);
if(i==32) ui->cbCQonly->setVisible(b);
+ if(i==33) ui->sbTR_FST4W->setVisible(b);
+ if(i==34) ui->sbF_Low->setVisible(b);
+ if(i==35) ui->sbF_High->setVisible(b);
j=j>>1;
}
ui->pbBestSP->setVisible(m_mode=="FT4");
@@ -5809,9 +5909,86 @@ void MainWindow::displayWidgets(qint64 n)
if(m_mode=="MSK144") b=SpecOp::EU_VHF==m_config.special_op_id();
ui->sbSerialNumber->setVisible(b);
m_lastCallsign.clear (); // ensures Tx5 is updated for new modes
+ b=m_mode.startsWith("FST4");
+ ui->sbNB->setVisible(b);
genStdMsgs (m_rpt, true);
}
+void MainWindow::on_actionFST4_triggered()
+{
+ m_mode="FST4";
+ m_modeTx="FST4";
+ ui->actionFST4->setChecked(true);
+ m_bFast9=false;
+ m_bFastMode=false;
+ m_fastGraph->hide();
+ m_wideGraph->show();
+ m_nsps=6912; //For symspec only
+ m_FFTSize = m_nsps / 2;
+ Q_EMIT FFTSize(m_FFTSize);
+ ui->label_6->setText(tr ("Band Activity"));
+ ui->label_7->setText(tr ("Rx Frequency"));
+ WSPR_config(false);
+ if(m_config.single_decode()) {
+// 012345678901234567890123456789012345
+ displayWidgets(nWidgets("111111000100111000010000000100000000"));
+ m_wideGraph->setSingleDecode(true);
+ } else {
+ displayWidgets(nWidgets("111011000100111000010000000100000011"));
+ m_wideGraph->setSingleDecode(false);
+ ui->sbFtol->setValue(20);
+ }
+ setup_status_bar(false);
+ ui->cbAutoSeq->setChecked(true);
+ m_wideGraph->setMode(m_mode);
+ m_wideGraph->setModeTx(m_modeTx);
+ m_wideGraph->setPeriod(m_TRperiod,6912);
+ m_wideGraph->setRxFreq(ui->RxFreqSpinBox->value());
+ m_wideGraph->setTol(ui->sbFtol->value());
+ m_wideGraph->setTxFreq(ui->TxFreqSpinBox->value());
+ m_wideGraph->setFST4_FreqRange(ui->sbF_Low->value(),ui->sbF_High->value());
+ chk_FST4_freq_range();
+ switch_mode (Modes::FST4);
+ m_wideGraph->setMode(m_mode);
+ ui->sbTR->values ({15, 30, 60, 120, 300, 900, 1800});
+ on_sbTR_valueChanged (ui->sbTR->value());
+ statusChanged();
+ m_bOK_to_chk=true;
+ chk_FST4_freq_range();
+}
+
+void MainWindow::on_actionFST4W_triggered()
+{
+ m_mode="FST4W";
+ m_modeTx="FST4W";
+ ui->actionFST4W->setChecked(true);
+ m_bFast9=false;
+ m_bFastMode=false;
+ m_fastGraph->hide();
+ m_wideGraph->show();
+ m_nsps=6912; //For symspec only
+ m_FFTSize = m_nsps / 2;
+ Q_EMIT FFTSize(m_FFTSize);
+ WSPR_config(true);
+// 012345678901234567890123456789012345
+ displayWidgets(nWidgets("000000000000000001010000000000000100"));
+ setup_status_bar(false);
+ ui->band_hopping_group_box->setChecked(false);
+ ui->band_hopping_group_box->setVisible(false);
+ on_sbTR_FST4W_valueChanged (ui->sbTR_FST4W->value ());
+ ui->WSPRfreqSpinBox->setMinimum(100);
+ ui->WSPRfreqSpinBox->setMaximum(5000);
+ m_wideGraph->setMode(m_mode);
+ m_wideGraph->setModeTx(m_modeTx);
+ m_wideGraph->setPeriod(m_TRperiod,6912);
+ m_wideGraph->setTxFreq(ui->WSPRfreqSpinBox->value());
+ m_wideGraph->setRxFreq(ui->sbFST4W_RxFreq->value());
+ m_wideGraph->setTol(ui->sbFST4W_FTol->value());
+ ui->sbFtol->setValue(100);
+ switch_mode (Modes::FST4W);
+ statusChanged();
+}
+
void MainWindow::on_actionFT4_triggered()
{
m_mode="FT4";
@@ -5833,7 +6010,6 @@ void MainWindow::on_actionFT4_triggered()
m_wideGraph->setModeTx(m_modeTx);
m_send_RR73=true;
VHF_features_enabled(bVHF);
-// ui->cbAutoSeq->setChecked(false);
m_fastGraph->hide();
m_wideGraph->show();
ui->decodedTextLabel2->setText(" UTC dB DT Freq " + tr ("Message"));
@@ -5843,7 +6019,7 @@ void MainWindow::on_actionFT4_triggered()
ui->label_7->setText(tr ("Rx Frequency"));
ui->label_6->setText(tr ("Band Activity"));
ui->decodedTextLabel->setText( " UTC dB DT Freq " + tr ("Message"));
- displayWidgets(nWidgets("111010000100111000010000000110001"));
+ displayWidgets(nWidgets("111010000100111000010000000110001000"));
ui->txrb2->setEnabled(true);
ui->txrb4->setEnabled(true);
ui->txrb5->setEnabled(true);
@@ -5892,7 +6068,7 @@ void MainWindow::on_actionFT8_triggered()
ui->label_6->setText(tr ("Band Activity"));
ui->decodedTextLabel->setText( " UTC dB DT Freq " + tr ("Message"));
}
- displayWidgets(nWidgets("111010000100111000010000100110001"));
+ displayWidgets(nWidgets("111010000100111000010000100110001000"));
ui->txrb2->setEnabled(true);
ui->txrb4->setEnabled(true);
ui->txrb5->setEnabled(true);
@@ -5908,9 +6084,9 @@ void MainWindow::on_actionFT8_triggered()
ui->txFirstCheckBox->setEnabled(false);
ui->cbHoldTxFreq->setChecked(true);
ui->cbAutoSeq->setEnabled(false);
- ui->tabWidget->setCurrentIndex(2);
+ ui->tabWidget->setCurrentIndex(1);
ui->TxFreqSpinBox->setValue(300);
- displayWidgets(nWidgets("111010000100111000010000000000100"));
+ displayWidgets(nWidgets("111010000100111000010000000000100000"));
ui->labDXped->setText(tr ("Fox"));
on_fox_log_action_triggered();
}
@@ -5920,7 +6096,7 @@ void MainWindow::on_actionFT8_triggered()
ui->cbAutoSeq->setEnabled(false);
ui->tabWidget->setCurrentIndex(0);
ui->cbHoldTxFreq->setChecked(true);
- displayWidgets(nWidgets("111010000100110000010000000000110"));
+ displayWidgets(nWidgets("111010000100110000010000000000110000"));
ui->labDXped->setText(tr ("Hound"));
ui->txrb1->setChecked(true);
ui->txrb2->setEnabled(false);
@@ -5995,9 +6171,9 @@ void MainWindow::on_actionJT4_triggered()
ui->sbSubmode->setValue(0);
}
if(bVHF) {
- displayWidgets(nWidgets("111110010010110110111100000000000"));
+ displayWidgets(nWidgets("111110010010110110111100000000000000"));
} else {
- displayWidgets(nWidgets("111010000000110000110000000000000"));
+ displayWidgets(nWidgets("111010000000110000110000000000000000"));
}
fast_config(false);
statusChanged();
@@ -6031,18 +6207,22 @@ void MainWindow::on_actionJT9_triggered()
}
ui->sbSubmode->setMaximum(7);
if(m_bFast9) {
- m_TRperiod = ui->sbTR->value ();
+ ui->sbTR->values ({5, 10, 15, 30});
+ on_sbTR_valueChanged (ui->sbTR->value());
m_wideGraph->hide();
m_fastGraph->showNormal();
ui->TxFreqSpinBox->setValue(700);
ui->RxFreqSpinBox->setValue(700);
- ui->decodedTextLabel->setText("UTC dB T Freq " + tr ("Message"));
- ui->decodedTextLabel2->setText("UTC dB T Freq " + tr ("Message"));
+ ui->decodedTextLabel->setText(" UTC dB T Freq " + tr ("Message"));
+ ui->decodedTextLabel2->setText(" UTC dB T Freq " + tr ("Message"));
} else {
ui->cbAutoSeq->setChecked(false);
- m_TRperiod=60.0;
- ui->decodedTextLabel->setText("UTC dB DT Freq " + tr ("Message"));
- ui->decodedTextLabel2->setText("UTC dB DT Freq " + tr ("Message"));
+ if (m_mode != "FST4")
+ {
+ m_TRperiod=60.0;
+ ui->decodedTextLabel->setText("UTC dB DT Freq " + tr ("Message"));
+ ui->decodedTextLabel2->setText("UTC dB DT Freq " + tr ("Message"));
+ }
}
m_wideGraph->setPeriod(m_TRperiod,m_nsps);
m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe
@@ -6050,9 +6230,9 @@ void MainWindow::on_actionJT9_triggered()
ui->label_6->setText(tr ("Band Activity"));
ui->label_7->setText(tr ("Rx Frequency"));
if(bVHF) {
- displayWidgets(nWidgets("111110101000111110010000000000000"));
+ displayWidgets(nWidgets("111110101000111110010000000000000000"));
} else {
- displayWidgets(nWidgets("111010000000111000010000000000001"));
+ displayWidgets(nWidgets("111010000000111000010000000000001000"));
}
fast_config(m_bFastMode);
ui->cbAutoSeq->setVisible(m_bFast9);
@@ -6091,15 +6271,15 @@ void MainWindow::on_actionJT9_JT65_triggered()
ui->label_7->setText(tr ("Rx Frequency"));
ui->decodedTextLabel->setText("UTC dB DT Freq " + tr ("Message"));
ui->decodedTextLabel2->setText("UTC dB DT Freq " + tr ("Message"));
- displayWidgets(nWidgets("111010000001111000010000000000001"));
+ displayWidgets(nWidgets("111010000001111000010000000000001000"));
fast_config(false);
statusChanged();
}
void MainWindow::on_actionJT65_triggered()
{
- if(m_mode=="JT4" or m_mode.startsWith ("WSPR")) {
-// If coming from JT4 or WSPR mode, pretend temporarily that we're coming
+ if(m_mode=="JT4" or m_mode=="WSPR" or m_mode=="FST4W") {
+// If coming from JT4, WSPR, or FST4W mode, pretend temporarily that we're coming
// from JT9 and click the pbTxMode button
m_modeTx="JT9";
on_pbTxMode_clicked();
@@ -6125,6 +6305,9 @@ void MainWindow::on_actionJT65_triggered()
m_wideGraph->setPeriod(m_TRperiod,m_nsps);
m_wideGraph->setMode(m_mode);
m_wideGraph->setModeTx(m_modeTx);
+ m_wideGraph->setRxFreq(ui->RxFreqSpinBox->value());
+ m_wideGraph->setTol(ui->sbFtol->value());
+ m_wideGraph->setTxFreq(ui->TxFreqSpinBox->value());
setup_status_bar (bVHF);
m_bFastMode=false;
m_bFast9=false;
@@ -6139,9 +6322,9 @@ void MainWindow::on_actionJT65_triggered()
ui->label_7->setText(tr ("Rx Frequency"));
}
if(bVHF) {
- displayWidgets(nWidgets("111110010000110110101100010000000"));
+ displayWidgets(nWidgets("111110010000110110101100010000000000"));
} else {
- displayWidgets(nWidgets("111010000000111000010000000000001"));
+ displayWidgets(nWidgets("111010000000111000010000000000001000"));
}
fast_config(false);
if(ui->cbShMsgs->isChecked()) {
@@ -6173,7 +6356,7 @@ void MainWindow::on_actionQRA64_triggered()
ui->TxFreqSpinBox->setValue(1000);
QString fname {QDir::toNativeSeparators(m_config.temp_dir ().absoluteFilePath ("red.dat"))};
m_wideGraph->setRedFile(fname);
- displayWidgets(nWidgets("111110010010110110000000001000000"));
+ displayWidgets(nWidgets("111110010010110110000000001000000000"));
statusChanged();
}
@@ -6182,7 +6365,8 @@ void MainWindow::on_actionISCAT_triggered()
m_mode="ISCAT";
m_modeTx="ISCAT";
ui->actionISCAT->setChecked(true);
- m_TRperiod = ui->sbTR->value ();
+ ui->sbTR->values ({5, 10, 15, 30});
+ on_sbTR_valueChanged (ui->sbTR->value ());
m_modulator->setTRPeriod(m_TRperiod);
m_detector->setTRPeriod(m_TRperiod);
m_wideGraph->setPeriod(m_TRperiod,m_nsps);
@@ -6209,7 +6393,7 @@ void MainWindow::on_actionISCAT_triggered()
ui->sbSubmode->setMaximum(1);
if(m_nSubMode==0) ui->TxFreqSpinBox->setValue(1012);
if(m_nSubMode==1) ui->TxFreqSpinBox->setValue(560);
- displayWidgets(nWidgets("100111000000000110000000000000000"));
+ displayWidgets(nWidgets("100111000000000110000000000000000000"));
fast_config(true);
statusChanged ();
}
@@ -6227,7 +6411,9 @@ void MainWindow::on_actionMSK144_triggered()
if("QRA64"==m_mode) ui->actionQRA64->setChecked(true);
if("WSPR"==m_mode) ui->actionWSPR->setChecked(true);
if("Echo"==m_mode) ui->actionEcho->setChecked(true);
- if("FreqCal"==m_mode) ui->actionFreqCal->setChecked(true);
+ if("FreqCal"==m_mode) ui->actionFreqCal->setChecked(true);
+ if("FST4"==m_mode) ui->actionFST4->setChecked(true);
+ if("FST4W"==m_mode) ui->actionFST4W->setChecked(true);
// Make sure that MSK144 is not checked.
ui->actionMSK144->setChecked(false);
MessageBox::warning_message (this, tr ("Improper mode"),
@@ -6247,7 +6433,8 @@ void MainWindow::on_actionMSK144_triggered()
VHF_features_enabled(true);
m_bFastMode=true;
m_bFast9=false;
- m_TRperiod = ui->sbTR->value ();
+ ui->sbTR->values ({5, 10, 15, 30});
+ on_sbTR_valueChanged (ui->sbTR->value());
m_wideGraph->hide();
m_fastGraph->showNormal();
ui->TxFreqSpinBox->setValue(1500);
@@ -6255,8 +6442,8 @@ void MainWindow::on_actionMSK144_triggered()
ui->RxFreqSpinBox->setMinimum(1400);
ui->RxFreqSpinBox->setMaximum(1600);
ui->RxFreqSpinBox->setSingleStep(10);
- ui->decodedTextLabel->setText("UTC dB T Freq " + tr ("Message"));
- ui->decodedTextLabel2->setText("UTC dB T Freq " + tr ("Message"));
+ ui->decodedTextLabel->setText(" UTC dB T Freq " + tr ("Message"));
+ ui->decodedTextLabel2->setText(" UTC dB T Freq " + tr ("Message"));
m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe
m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe
m_fastGraph->setTRPeriod(m_TRperiod);
@@ -6268,7 +6455,7 @@ void MainWindow::on_actionMSK144_triggered()
ui->rptSpinBox->setValue(0);
ui->rptSpinBox->setSingleStep(1);
ui->sbFtol->values ({20, 50, 100, 200});
- displayWidgets(nWidgets("101111110100000000010001000010000"));
+ displayWidgets(nWidgets("101111110100000000010001000010000000"));
fast_config(m_bFastMode);
statusChanged();
@@ -6300,34 +6487,19 @@ void MainWindow::on_actionWSPR_triggered()
setup_status_bar (false);
ui->actionWSPR->setChecked(true);
VHF_features_enabled(false);
+ ui->WSPRfreqSpinBox->setMinimum(1400);
+ ui->WSPRfreqSpinBox->setMaximum(1600);
m_wideGraph->setPeriod(m_TRperiod,m_nsps);
m_wideGraph->setMode(m_mode);
m_wideGraph->setModeTx(m_modeTx);
m_bFastMode=false;
m_bFast9=false;
ui->TxFreqSpinBox->setValue(ui->WSPRfreqSpinBox->value());
- displayWidgets(nWidgets("000000000000000001010000000000000"));
+ displayWidgets(nWidgets("000000000000000001010000000000000000"));
fast_config(false);
statusChanged();
}
-void MainWindow::on_actionWSPR_LF_triggered()
-{
- on_actionWSPR_triggered();
- m_mode="WSPR-LF";
- switch_mode (Modes::WSPR);
- m_modeTx="WSPR-LF";
- m_TRperiod=240.0;
- m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe
- m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe
- m_hsymStop=813;
- m_toneSpacing=12000.0/24576.0;
- setup_status_bar (false);
- ui->actionWSPR_LF->setChecked(true);
- m_wideGraph->setPeriod(m_TRperiod,m_nsps);
- statusChanged();
-}
-
void MainWindow::on_actionEcho_triggered()
{
on_actionJT4_triggered();
@@ -6356,7 +6528,7 @@ void MainWindow::on_actionEcho_triggered()
m_bFast9=false;
WSPR_config(true);
ui->decodedTextLabel->setText(" UTC N Level Sig DF Width Q");
- displayWidgets(nWidgets("000000000000000000000010000000000"));
+ displayWidgets(nWidgets("000000000000000000000010000000000000"));
fast_config(false);
statusChanged();
}
@@ -6368,7 +6540,8 @@ void MainWindow::on_actionFreqCal_triggered()
ui->actionFreqCal->setChecked(true);
switch_mode(Modes::FreqCal);
m_wideGraph->setMode(m_mode);
- m_TRperiod = ui->sbTR->value ();
+ ui->sbTR->values ({5, 10, 15, 30});
+ on_sbTR_valueChanged (ui->sbTR->value());
m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe
m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe
m_nsps=6912; //For symspec only
@@ -6381,7 +6554,7 @@ void MainWindow::on_actionFreqCal_triggered()
// 18:15:47 0 1 1500 1550.349 0.100 3.5 10.2
ui->decodedTextLabel->setText(" UTC Freq CAL Offset fMeas DF Level S/N");
ui->measure_check_box->setChecked (false);
- displayWidgets(nWidgets("001101000000000000000000000001000"));
+ displayWidgets(nWidgets("001101000000000000000000000001000000"));
statusChanged();
}
@@ -6390,14 +6563,15 @@ void MainWindow::switch_mode (Mode mode)
m_fastGraph->setMode(m_mode);
m_config.frequencies ()->filter (m_config.region (), mode);
auto const& row = m_config.frequencies ()->best_working_frequency (m_freqNominal);
+ ui->bandComboBox->setCurrentIndex (row);
if (row >= 0) {
- ui->bandComboBox->setCurrentIndex (row);
on_bandComboBox_activated (row);
}
ui->rptSpinBox->setSingleStep(1);
ui->rptSpinBox->setMinimum(-50);
ui->rptSpinBox->setMaximum(49);
- ui->sbFtol->values ({10, 20, 50, 100, 200, 500, 1000});
+ ui->sbFtol->values ({1, 2, 5, 10, 20, 50, 100, 200, 300, 400, 500, 1000});
+ ui->sbFST4W_FTol->values({1, 2, 5, 10, 20, 50, 100});
if(m_mode=="MSK144") {
ui->RxFreqSpinBox->setMinimum(1400);
ui->RxFreqSpinBox->setMaximum(1600);
@@ -6407,7 +6581,6 @@ void MainWindow::switch_mode (Mode mode)
ui->RxFreqSpinBox->setMaximum(5000);
ui->RxFreqSpinBox->setSingleStep(1);
}
- m_bVHFwarned=false;
bool b=m_mode=="FreqCal";
ui->tabWidget->setVisible(!b);
if(b) {
@@ -6431,19 +6604,26 @@ void MainWindow::WSPR_config(bool b)
ui->label_7->setVisible(!b and ui->cbMenus->isChecked());
ui->logQSOButton->setVisible(!b);
ui->DecodeButton->setEnabled(!b);
- if(b and (m_mode!="Echo")) {
+ bool bFST4W=(m_mode=="FST4W");
+ ui->sbTxPercent->setEnabled(!bFST4W or (tr("Random") == ui->RoundRobin->currentText()));
+ ui->band_hopping_group_box->setVisible(true);
+ ui->RoundRobin->setVisible(bFST4W);
+ ui->sbFST4W_RxFreq->setVisible(bFST4W);
+ ui->sbFST4W_FTol->setVisible(bFST4W);
+ ui->RoundRobin->lineEdit()->setAlignment(Qt::AlignCenter);
+ if(b and m_mode!="Echo" and m_mode!="FST4W") {
QString t="UTC dB DT Freq Drift Call Grid dBm ";
if(m_config.miles()) t += " mi";
if(!m_config.miles()) t += " km";
ui->decodedTextLabel->setText(t);
if (m_config.is_transceiver_online ()) {
- Q_EMIT m_config.transceiver_tx_frequency (0); // turn off split
+ m_config.transceiver_tx_frequency (0); // turn off split
}
m_bSimplex = true;
- } else {
- ui->decodedTextLabel->setText("UTC dB DT Freq " + tr ("Message"));
- m_bSimplex = false;
- }
+ } else
+ {
+ m_bSimplex = false;
+ }
enable_DXCC_entity (m_config.DXCC ()); // sets text window proportions and (re)inits the logbook
}
@@ -6480,6 +6660,41 @@ void MainWindow::on_RxFreqSpinBox_valueChanged(int n)
statusUpdate ();
}
+void MainWindow::on_sbF_Low_valueChanged(int n)
+{
+ m_wideGraph->setFST4_FreqRange(n,ui->sbF_High->value());
+ chk_FST4_freq_range();
+}
+
+void MainWindow::on_sbF_High_valueChanged(int n)
+{
+ m_wideGraph->setFST4_FreqRange(ui->sbF_Low->value(),n);
+ chk_FST4_freq_range();
+}
+
+void MainWindow::chk_FST4_freq_range()
+{
+ if(!m_bOK_to_chk) return;
+ if(ui->sbF_Low->value() < m_wideGraph->nStartFreq()) ui->sbF_Low->setValue(m_wideGraph->nStartFreq());
+ if(ui->sbF_High->value() > m_wideGraph->Fmax()) {
+ int n=m_wideGraph->Fmax()/100;
+ ui->sbF_High->setValue(100*n);
+ }
+ int maxDiff=2000;
+ if(m_TRperiod==120) maxDiff=1000;
+ if(m_TRperiod==300) maxDiff=400;
+ if(m_TRperiod>=900) maxDiff=200;
+ int diff=ui->sbF_High->value() - ui->sbF_Low->value();
+
+ if(diff<100 or diff>maxDiff) {
+ ui->sbF_Low->setStyleSheet("QSpinBox { background-color: red; }");
+ ui->sbF_High->setStyleSheet("QSpinBox { background-color: red; }");
+ } else {
+ ui->sbF_Low->setStyleSheet("");
+ ui->sbF_High->setStyleSheet("");
+ }
+}
+
void MainWindow::on_actionQuickDecode_toggled (bool checked)
{
m_ndepth ^= (-checked ^ m_ndepth) & 0x00000001;
@@ -6500,6 +6715,8 @@ void MainWindow::on_actionInclude_averaging_toggled (bool checked)
m_ndepth ^= (-checked ^ m_ndepth) & 0x00000010;
}
+
+
void MainWindow::on_actionInclude_correlation_toggled (bool checked)
{
m_ndepth ^= (-checked ^ m_ndepth) & 0x00000020;
@@ -6581,17 +6798,20 @@ void MainWindow::on_bandComboBox_currentIndexChanged (int index)
// Lookup band
auto const& band = m_config.bands ()->find (frequency);
- if (!band.isEmpty ())
+ ui->bandComboBox->setCurrentText (band.size () ? band : m_config.bands ()->oob ());
+ displayDialFrequency ();
+}
+
+void MainWindow::on_bandComboBox_editTextChanged (QString const& text)
+{
+ if (text.size () && m_config.bands ()->oob () != text)
{
ui->bandComboBox->lineEdit ()->setStyleSheet ({});
- ui->bandComboBox->setCurrentText (band);
}
else
{
ui->bandComboBox->lineEdit ()->setStyleSheet ("QLineEdit {color: yellow; background-color : red;}");
- ui->bandComboBox->setCurrentText (m_config.bands ()->oob ());
}
- displayDialFrequency ();
}
void MainWindow::on_bandComboBox_activated (int index)
@@ -6622,7 +6842,7 @@ void MainWindow::band_changed (Frequency f)
}
if (m_bandEdited) {
- if (!m_mode.startsWith ("WSPR")) { // band hopping preserves auto Tx
+ if (m_mode!="WSPR") { // band hopping preserves auto Tx
if (f + m_wideGraph->nStartFreq () > m_freqNominal + ui->TxFreqSpinBox->value ()
|| f + m_wideGraph->nStartFreq () + m_wideGraph->fSpan () <=
m_freqNominal + ui->TxFreqSpinBox->value ()) {
@@ -6635,29 +6855,24 @@ void MainWindow::band_changed (Frequency f)
}
m_lastBand.clear ();
m_bandEdited = false;
- psk_Reporter->sendReport(); // Upload any queued spots before changing band
+ if (m_config.spot_to_psk_reporter ())
+ {
+ // Upload any queued spots before changing band
+ m_psk_Reporter.sendReport();
+ }
if (!m_transmitting) monitor (true);
if ("FreqCal" == m_mode)
{
m_frequency_list_fcal_iter = m_config.frequencies ()->find (f);
}
- float r=m_freqNominal/(f+0.0001);
- if(r<0.9 or r>1.1) m_bVHFwarned=false;
setRig (f);
setXIT (ui->TxFreqSpinBox->value ());
}
}
-void MainWindow::vhfWarning()
-{
- MessageBox::warning_message (this, tr ("VHF features warning"),
- "VHF/UHF/Microwave features is enabled on a lower frequency band.");
- m_bVHFwarned=true;
-}
-
void MainWindow::enable_DXCC_entity (bool on)
{
- if (on and !m_mode.startsWith ("WSPR") and m_mode!="Echo") {
+ if (on and m_mode!="WSPR" and m_mode!="FST4W" and m_mode!="Echo") {
//m_logBook.init(); // re-read the log and cty.dat files
// ui->gridLayout->setColumnStretch(0,55); // adjust proportions of text displays
// ui->gridLayout->setColumnStretch(1,45);
@@ -6668,111 +6883,6 @@ void MainWindow::enable_DXCC_entity (bool on)
updateGeometry ();
}
-void MainWindow::on_pbCallCQ_clicked()
-{
- genStdMsgs(m_rpt);
- ui->genMsg->setText(ui->tx6->text());
- m_ntx=7;
- m_QSOProgress = CALLING;
- m_gen_message_is_cq = true;
- ui->rbGenMsg->setChecked(true);
- if(m_transmitting) m_restart=true;
- set_dateTimeQSO(-1);
-}
-
-void MainWindow::on_pbAnswerCaller_clicked()
-{
- genStdMsgs(m_rpt);
- QString t=ui->tx3->text();
- int i0=t.indexOf(" R-");
- if(i0<0) i0=t.indexOf(" R+");
- t=t.mid(0,i0+1)+t.mid(i0+2,3);
- ui->genMsg->setText(t);
- m_ntx=7;
- m_QSOProgress = REPORT;
- m_gen_message_is_cq = false;
- ui->rbGenMsg->setChecked(true);
- if(m_transmitting) m_restart=true;
- set_dateTimeQSO(2);
-}
-
-void MainWindow::on_pbSendRRR_clicked()
-{
- genStdMsgs(m_rpt);
- ui->genMsg->setText(ui->tx4->text());
- m_ntx=7;
- m_QSOProgress = ROGERS;
- m_gen_message_is_cq = false;
- ui->rbGenMsg->setChecked(true);
- if(m_transmitting) m_restart=true;
-}
-
-void MainWindow::on_pbAnswerCQ_clicked()
-{
- genStdMsgs(m_rpt);
- ui->genMsg->setText(ui->tx1->text());
- QString t=ui->tx2->text();
- int i0=t.indexOf("/");
- int i1=t.indexOf(" ");
- if(i0>0 and i0<i1) ui->genMsg->setText(t);
- m_ntx=7;
- m_QSOProgress = REPLYING;
- m_gen_message_is_cq = false;
- ui->rbGenMsg->setChecked(true);
- if(m_transmitting) m_restart=true;
-}
-
-void MainWindow::on_pbSendReport_clicked()
-{
- genStdMsgs(m_rpt);
- ui->genMsg->setText(ui->tx3->text());
- m_ntx=7;
- m_QSOProgress = ROGER_REPORT;
- m_gen_message_is_cq = false;
- ui->rbGenMsg->setChecked(true);
- if(m_transmitting) m_restart=true;
- set_dateTimeQSO(3);
-}
-
-void MainWindow::on_pbSend73_clicked()
-{
- genStdMsgs(m_rpt);
- ui->genMsg->setText(ui->tx5->currentText());
- m_ntx=7;
- m_QSOProgress = SIGNOFF;
- m_gen_message_is_cq = false;
- ui->rbGenMsg->setChecked(true);
- if(m_transmitting) m_restart=true;
-}
-
-void MainWindow::on_rbGenMsg_clicked(bool checked)
-{
- m_freeText=!checked;
- if(!m_freeText) {
- if(m_ntx != 7 && m_transmitting) m_restart=true;
- m_ntx=7;
- // would like to set m_QSOProgress but what to? So leave alone and
- // assume it is correct
- }
-}
-
-void MainWindow::on_rbFreeText_clicked(bool checked)
-{
- m_freeText=checked;
- if(m_freeText) {
- m_ntx=8;
- // would like to set m_QSOProgress but what to? So leave alone and
- // assume it is correct. Perhaps should store old value to be
- // restored above in on_rbGenMsg_clicked
- if (m_transmitting) m_restart=true;
- }
-}
-
-void MainWindow::on_freeTextMsg_currentTextChanged (QString const& text)
-{
- msgtype(text, ui->freeTextMsg->lineEdit ());
-}
-
void MainWindow::on_rptSpinBox_valueChanged(int n)
{
int step=ui->rptSpinBox->singleStep();
@@ -6859,7 +6969,7 @@ void MainWindow::rigOpen ()
ui->readFreq->setText ("");
ui->readFreq->setEnabled (true);
m_config.transceiver_online ();
- Q_EMIT m_config.sync_transceiver (true, true);
+ m_config.sync_transceiver (true, true);
}
void MainWindow::on_pbR2T_clicked()
@@ -6882,7 +6992,7 @@ void MainWindow::on_readFreq_clicked()
if (m_config.transceiver_online ())
{
- Q_EMIT m_config.sync_transceiver (true, true);
+ m_config.sync_transceiver (true, true);
}
}
@@ -6918,7 +7028,8 @@ void MainWindow::setXIT(int n, Frequency base)
m_XIT = 0;
if (!m_bSimplex) {
// m_bSimplex is false, so we can use split mode if requested
- if (m_config.split_mode () && (!m_config.enable_VHF_features () || m_mode == "FT8")) {
+ if (m_config.split_mode () && (!m_config.enable_VHF_features () || m_mode == "FT8" ||
+ m_mode=="FST4")) {
// Don't use XIT for VHF & up
m_XIT=(n/500)*500 - 1500;
}
@@ -6931,7 +7042,7 @@ void MainWindow::setXIT(int n, Frequency base)
// frequency
m_freqTxNominal = base + m_XIT;
if (m_astroWidget) m_astroWidget->nominal_frequency (m_freqNominal, m_freqTxNominal);
- Q_EMIT m_config.transceiver_tx_frequency (m_freqTxNominal + m_astroCorrection.tx);
+ m_config.transceiver_tx_frequency (m_freqTxNominal + m_astroCorrection.tx);
}
}
//Now set the audio Tx freq
@@ -6941,7 +7052,7 @@ void MainWindow::setXIT(int n, Frequency base)
void MainWindow::setFreq4(int rxFreq, int txFreq)
{
if (ui->RxFreqSpinBox->isEnabled ()) ui->RxFreqSpinBox->setValue(rxFreq);
- if(m_mode.startsWith ("WSPR")) {
+ if(m_mode=="WSPR" or m_mode=="FST4W") {
ui->WSPRfreqSpinBox->setValue(txFreq);
} else {
if (ui->TxFreqSpinBox->isEnabled ()) {
@@ -6969,14 +7080,15 @@ void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const&
{
Transceiver::TransceiverState old_state {m_rigState};
//transmitDisplay (s.ptt ());
- if (s.ptt () && !m_rigState.ptt ()) { // safe to start audio
+ if (s.ptt () // && !m_rigState.ptt ()
+ ) { // safe to start audio
// (caveat - DX Lab Suite Commander)
if (m_tx_when_ready && g_iptt) { // waiting to Tx and still needed
int ms_delay=1000*m_config.txDelay();
if(m_mode=="FT4") ms_delay=20;
ptt1Timer.start(ms_delay); //Start-of-transmission sequencer delay
+ m_tx_when_ready = false;
}
- m_tx_when_ready = false;
}
m_rigState = s;
auto old_freqNominal = m_freqNominal;
@@ -7012,33 +7124,7 @@ void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const&
|| !(ui->cbCQTx->isEnabled () && ui->cbCQTx->isVisible () && ui->cbCQTx->isChecked()))) {
m_lastDialFreq = m_freqNominal;
m_secBandChanged=QDateTime::currentMSecsSinceEpoch()/1000;
- /*
- if(s.frequency () < 30000000u && !m_mode.startsWith ("WSPR")) {
- // Write freq changes to ALL.TXT only below 30 MHz.
- QFile f2 {m_config.writeable_data_dir ().absoluteFilePath ("ALL.TXT")};
- if (f2.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) {
- QTextStream out(&f2);
- out << QDateTime::currentDateTimeUtc().toString("yyyy-MM-dd hh:mm")
- << " " << qSetRealNumberPrecision (12) << (m_freqNominal / 1.e6) << " MHz "
- << m_mode
-#if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0)
- << Qt::endl
-#else
- << endl
-#endif
- ;
- f2.close();
- } else {
- MessageBox::warning_message (this, tr ("File Error")
- ,tr ("Cannot open \"%1\" for append: %2")
- .arg (f2.fileName ()).arg (f2.errorString ()));
- }
- }
- */
-
- if (m_config.spot_to_psk_reporter ()) {
- pskSetLocal ();
- }
+ pskSetLocal ();
statusChanged();
m_wideGraph->setDialFreq(m_freqNominal / 1.e6);
}
@@ -7115,7 +7201,7 @@ void MainWindow::transmit (double snr)
if(m_nSubMode==0) toneSpacing=11025.0/4096.0;
if(m_nSubMode==1) toneSpacing=2*11025.0/4096.0;
if(m_nSubMode==2) toneSpacing=4*11025.0/4096.0;
- Q_EMIT sendMessage (NUM_JT65_SYMBOLS,
+ Q_EMIT sendMessage (m_mode, NUM_JT65_SYMBOLS,
4096.0*12000.0/11025.0, ui->TxFreqSpinBox->value () - m_XIT,
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
true, false, snr, m_TRperiod);
@@ -7127,7 +7213,7 @@ 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_config.special_op_id() and !m_tune) toneSpacing=-1;
- Q_EMIT sendMessage (NUM_FT8_SYMBOLS,
+ 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);
@@ -7136,19 +7222,39 @@ void MainWindow::transmit (double snr)
if (m_modeTx == "FT4") {
m_dateTimeSentTx3=QDateTime::currentDateTimeUtc();
toneSpacing=-2.0; //Transmit a pre-computed, filtered waveform.
- Q_EMIT sendMessage (NUM_FT4_SYMBOLS,
+ Q_EMIT sendMessage (m_mode, NUM_FT4_SYMBOLS,
576.0, ui->TxFreqSpinBox->value() - m_XIT,
toneSpacing, m_soundOutput, m_config.audio_output_channel(),
true, false, snr, m_TRperiod);
}
+ if (m_modeTx == "FST4" or m_modeTx == "FST4W") {
+ m_dateTimeSentTx3=QDateTime::currentDateTimeUtc();
+ toneSpacing=-2.0; //Transmit a pre-computed, filtered waveform.
+ int nsps=720;
+ if(m_TRperiod==30) nsps=1680;
+ if(m_TRperiod==60) nsps=3888;
+ if(m_TRperiod==120) nsps=8200;
+ if(m_TRperiod==300) nsps=21504;
+ if(m_TRperiod==900) nsps=66560;
+ if(m_TRperiod==1800) nsps=134400;
+ int hmod=1; //No FST4/W submodes
+ double dfreq=hmod*12000.0/nsps;
+ double f0=ui->WSPRfreqSpinBox->value() - m_XIT;
+ if(m_mode=="FST4") f0=ui->TxFreqSpinBox->value() - m_XIT;
+ if(!m_tune) f0 += + 1.5*dfreq;
+ Q_EMIT sendMessage (m_mode, NUM_FST4_SYMBOLS,double(nsps),f0,toneSpacing,
+ m_soundOutput,m_config.audio_output_channel(),
+ true, false, snr, m_TRperiod);
+ }
+
if (m_modeTx == "QRA64") {
if(m_nSubMode==0) toneSpacing=12000.0/6912.0;
if(m_nSubMode==1) toneSpacing=2*12000.0/6912.0;
if(m_nSubMode==2) toneSpacing=4*12000.0/6912.0;
if(m_nSubMode==3) toneSpacing=8*12000.0/6912.0;
if(m_nSubMode==4) toneSpacing=16*12000.0/6912.0;
- Q_EMIT sendMessage (NUM_QRA64_SYMBOLS,
+ Q_EMIT sendMessage (m_mode, NUM_QRA64_SYMBOLS,
6912.0, ui->TxFreqSpinBox->value () - m_XIT,
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
true, false, snr, m_TRperiod);
@@ -7167,7 +7273,7 @@ void MainWindow::transmit (double snr)
sps=nsps[m_nSubMode-4];
m_toneSpacing=12000.0/sps;
}
- Q_EMIT sendMessage (NUM_JT9_SYMBOLS, sps,
+ Q_EMIT sendMessage (m_mode, NUM_JT9_SYMBOLS, sps,
ui->TxFreqSpinBox->value() - m_XIT, m_toneSpacing,
m_soundOutput, m_config.audio_output_channel (),
true, fastmode, snr, m_TRperiod);
@@ -7186,7 +7292,7 @@ void MainWindow::transmit (double snr)
int nsym;
nsym=NUM_MSK144_SYMBOLS;
if(itone[40] < 0) nsym=40;
- Q_EMIT sendMessage (nsym, double(m_nsps), f0, m_toneSpacing,
+ Q_EMIT sendMessage (m_mode, nsym, double(m_nsps), f0, m_toneSpacing,
m_soundOutput, m_config.audio_output_channel (),
true, true, snr, m_TRperiod);
}
@@ -7199,7 +7305,7 @@ void MainWindow::transmit (double snr)
if(m_nSubMode==4) toneSpacing=18*4.375;
if(m_nSubMode==5) toneSpacing=36*4.375;
if(m_nSubMode==6) toneSpacing=72*4.375;
- Q_EMIT sendMessage (NUM_JT4_SYMBOLS,
+ Q_EMIT sendMessage (m_mode, NUM_JT4_SYMBOLS,
2520.0*12000.0/11025.0, ui->TxFreqSpinBox->value () - m_XIT,
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
true, false, snr, m_TRperiod);
@@ -7208,22 +7314,16 @@ void MainWindow::transmit (double snr)
int nToneSpacing=1;
if(m_config.x2ToneSpacing()) nToneSpacing=2;
if(m_config.x4ToneSpacing()) nToneSpacing=4;
- Q_EMIT sendMessage (NUM_WSPR_SYMBOLS, 8192.0,
+ Q_EMIT sendMessage (m_mode, NUM_WSPR_SYMBOLS, 8192.0,
ui->TxFreqSpinBox->value() - 1.5 * 12000 / 8192,
m_toneSpacing*nToneSpacing, m_soundOutput,
m_config.audio_output_channel(),true, false, snr,
m_TRperiod);
}
- if (m_mode=="WSPR-LF") {
- Q_EMIT sendMessage (NUM_WSPR_LF_SYMBOLS, 24576.0,
- ui->TxFreqSpinBox->value(),
- m_toneSpacing, m_soundOutput,
- m_config.audio_output_channel(),true, false, snr,
- m_TRperiod);
- }
+
if(m_mode=="Echo") {
//??? should use "fastMode = true" here ???
- Q_EMIT sendMessage (27, 1024.0, 1500.0, 0.0, m_soundOutput,
+ Q_EMIT sendMessage (m_mode, 27, 1024.0, 1500.0, 0.0, m_soundOutput,
m_config.audio_output_channel(),
false, false, snr, m_TRperiod);
}
@@ -7239,7 +7339,7 @@ void MainWindow::transmit (double snr)
toneSpacing=11025.0/256.0;
f0=13*toneSpacing;
}
- Q_EMIT sendMessage (NUM_ISCAT_SYMBOLS, sps, f0, toneSpacing, m_soundOutput,
+ Q_EMIT sendMessage (m_mode, NUM_ISCAT_SYMBOLS, sps, f0, toneSpacing, m_soundOutput,
m_config.audio_output_channel(),
true, true, snr, m_TRperiod);
}
@@ -7282,7 +7382,34 @@ void MainWindow::on_outAttenuation_valueChanged (int a)
void MainWindow::on_actionShort_list_of_add_on_prefixes_and_suffixes_triggered()
{
if (!m_prefixes) {
- m_prefixes.reset (new HelpTextWindow {tr ("Prefixes"), ":/prefixes.txt", {"Courier", 10}});
+ m_prefixes.reset (new HelpTextWindow {tr ("Prefixes")
+ , R"(Type 1 Prefixes:
+
+ 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X
+ 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R
+ 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R
+ 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2
+ A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6
+ C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9
+ D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP
+ ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO
+ FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD
+ MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK
+ HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5
+ J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2
+ KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU
+ LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ
+ P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5
+ S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33
+ T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT
+ TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7
+ V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5
+ VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4
+ XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU
+ YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3
+ ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5
+
+Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P)", {"Courier", 10}});
}
m_prefixes->showNormal();
m_prefixes->raise ();
@@ -7301,6 +7428,8 @@ bool MainWindow::shortList(QString callsign)
void MainWindow::pskSetLocal ()
{
+ if (!m_config.spot_to_psk_reporter ()) return;
+
// find the station row, if any, that matches the band we are on
auto stations = m_config.stations ();
auto matches = stations->match (stations->index (0, StationList::band_column)
@@ -7314,9 +7443,7 @@ void MainWindow::pskSetLocal ()
, StationList::description_column).data ().toString ();
}
// qDebug() << "To PSKreporter: local station details";
- psk_Reporter->setLocalStation(m_config.my_callsign (), m_config.my_grid (),
- antenna_description, QString {"WSJT-X v" + version() + " " +
- m_revision}.simplified ());
+ m_psk_Reporter.setLocalStation(m_config.my_callsign (), m_config.my_grid (), antenna_description);
}
void MainWindow::transmitDisplay (bool transmitting)
@@ -7331,18 +7458,13 @@ void MainWindow::transmitDisplay (bool transmitting)
auto QSY_allowed = !transmitting or m_config.tx_QSY_allowed () or
!m_config.split_mode ();
if (ui->cbHoldTxFreq->isChecked ()) {
- ui->RxFreqSpinBox->setEnabled (QSY_allowed);
+ ui->TxFreqSpinBox->setEnabled (QSY_allowed);
ui->pbT2R->setEnabled (QSY_allowed);
}
- if (!m_mode.startsWith ("WSPR")) {
+ if (m_mode!="WSPR" and m_mode!="FST4W") {
if(m_config.enable_VHF_features ()) {
-//### During tests, at least, allow use of Tx Freq spinner with VHF features enabled.
- // used fixed 1000Hz Tx DF for VHF & up QSO modes
-// ui->TxFreqSpinBox->setValue(1000);
-// ui->TxFreqSpinBox->setEnabled (false);
ui->TxFreqSpinBox->setEnabled (true);
-//###
} else {
ui->TxFreqSpinBox->setEnabled (QSY_allowed and !m_bFastMode);
ui->pbR2T->setEnabled (QSY_allowed);
@@ -7392,15 +7514,35 @@ void::MainWindow::VHF_features_enabled(bool b)
void MainWindow::on_sbTR_valueChanged(int value)
{
-// if(!m_bFastMode and n>m_nSubMode) m_MinW=m_nSubMode;
- if(m_bFastMode or m_mode=="FreqCal") {
+ // if(!m_bFastMode and n>m_nSubMode) m_MinW=m_nSubMode;
+ if(m_bFastMode or m_mode=="FreqCal" or m_mode=="FST4" or m_mode=="FST4W") {
m_TRperiod = value;
+ if (m_mode == "FST4" || m_mode == "FST4W")
+ {
+ if (m_TRperiod < 60)
+ {
+ ui->decodedTextLabel->setText(" UTC dB DT Freq " + tr ("Message"));
+ if (m_mode != "FST4W")
+ {
+ ui->decodedTextLabel2->setText(" UTC dB DT Freq " + tr ("Message"));
+ }
+ }
+ else
+ {
+ ui->decodedTextLabel->setText("UTC dB DT Freq " + tr ("Message"));
+ if (m_mode != "FST4W")
+ {
+ ui->decodedTextLabel2->setText("UTC dB DT Freq " + tr ("Message"));
+ }
+ }
+ }
m_fastGraph->setTRPeriod (value);
m_modulator->setTRPeriod (value); // TODO - not thread safe
m_detector->setTRPeriod (value); // TODO - not thread safe
m_wideGraph->setPeriod (value, m_nsps);
progressBar.setMaximum (value);
}
+ if(m_mode=="FST4") chk_FST4_freq_range();
if(m_monitoring) {
on_stopButton_clicked();
on_monitorButton_clicked(true);
@@ -7411,6 +7553,11 @@ void MainWindow::on_sbTR_valueChanged(int value)
statusUpdate ();
}
+void MainWindow::on_sbTR_FST4W_valueChanged(int value)
+{
+ on_sbTR_valueChanged(value);
+}
+
QChar MainWindow::current_submode () const
{
QChar submode {0};
@@ -7605,7 +7752,7 @@ void MainWindow::replayDecodes ()
if (message.size() >= 4 && message.left (4) != "----")
{
auto const& parts = message.split (' ', SkipEmptyParts);
- if (parts.size () >= 5 && parts[3].contains ('.')) // WSPR
+ if (parts.size () >= 5 && parts[3].contains ('.')) //
{
postWSPRDecode (false, parts);
}
@@ -7686,23 +7833,23 @@ void MainWindow::p1ReadFromStdout() //p1readFromStdout
if(m_nWSPRdecodes==0 and ui->band_hopping_group_box->isChecked()) {
t = " " + tr ("Receiving") + " " + m_mode + " ----------------------- " +
m_config.bands ()->find (m_dialFreqRxWSPR);
- t=WSPR_hhmm(-60) + ' ' + t.rightJustified (66, '-');
+ t=beacon_start_time (-m_TRperiod / 2) + ' ' + t.rightJustified (66, '-');
ui->decodedTextBrowser->appendText(t);
}
killFileTimer.start (45*1000); //Kill in 45s (for slow modes)
}
m_nWSPRdecodes=0;
ui->DecodeButton->setChecked (false);
- if(m_uploadSpots
- && m_config.is_transceiver_online ()) { // need working rig control
+ if (m_uploadWSPRSpots
+ && m_config.is_transceiver_online ()) { // need working rig control
#if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0)
uploadTimer.start(QRandomGenerator::global ()->bounded (0, 20000)); // Upload delay
#else
uploadTimer.start(20000 * qrand()/((double)RAND_MAX + 1.0)); // Upload delay
#endif
} else {
- QFile f(QDir::toNativeSeparators(m_config.writeable_data_dir ().absolutePath()) + "/wspr_spots.txt");
- if(f.exists()) f.remove();
+ QFile f {QDir::toNativeSeparators (m_config.writeable_data_dir ().absoluteFilePath ("wspr_spots.txt"))};
+ if (f.exists ()) f.remove ();
}
m_RxLog=0;
m_startAnother=m_loopall;
@@ -7773,20 +7920,24 @@ void MainWindow::p1ReadFromStdout() //p1readFromStdout
}
}
-QString MainWindow::WSPR_hhmm(int n)
+QString MainWindow::beacon_start_time (int n)
{
- QDateTime t=QDateTime::currentDateTimeUtc().addSecs(n);
- int m=t.toString("hhmm").toInt()/2;
- QString t1;
- t1 = t1.asprintf("%04d",2*m);
- return t1;
+ auto bt = qt_truncate_date_time_to (QDateTime::currentDateTimeUtc ().addSecs (n), m_TRperiod * 1.e3);
+ if (m_TRperiod < 60.)
+ {
+ return bt.toString ("HHmmss");
+ }
+ else
+ {
+ return bt.toString ("HHmm");
+ }
}
void MainWindow::WSPR_history(Frequency dialFreq, int ndecodes)
{
QDateTime t=QDateTime::currentDateTimeUtc().addSecs(-60);
QString t1=t.toString("yyMMdd");
- QString t2=WSPR_hhmm(-60);
+ QString t2=beacon_start_time (-m_TRperiod / 2);
QString t3;
t3 = t3.asprintf("%13.6f",0.000001*dialFreq);
if(ndecodes<0) {
@@ -7814,23 +7965,36 @@ void MainWindow::WSPR_history(Frequency dialFreq, int ndecodes)
}
}
-void MainWindow::uploadSpots()
+void MainWindow::uploadWSPRSpots (bool direct_post, QString const& decode_text)
{
- // do not spot replays or if rig control not working
- if(m_diskData || !m_config.is_transceiver_online ()) return;
+ // do not spot if disabled, replays, or if rig control not working
+ if(!m_uploadWSPRSpots || m_diskData || !m_config.is_transceiver_online ()) return;
if(m_uploading) {
qDebug() << "Previous upload has not completed, spots were lost";
wsprNet->abortOutstandingRequests ();
m_uploading = false;
}
- QString rfreq = QString("%1").arg(0.000001*(m_dialFreqRxWSPR + 1500), 0, 'f', 6);
- QString tfreq = QString("%1").arg(0.000001*(m_dialFreqRxWSPR +
- ui->TxFreqSpinBox->value()), 0, 'f', 6);
- wsprNet->upload(m_config.my_callsign(), m_config.my_grid(), rfreq, tfreq,
- m_mode, QString::number(ui->autoButton->isChecked() ? m_pctx : 0),
- QString::number(m_dBm), version(),
- QDir::toNativeSeparators(m_config.writeable_data_dir ().absolutePath()) + "/wspr_spots.txt");
- m_uploading = true;
+ QString rfreq = QString("%1").arg((m_dialFreqRxWSPR + 1500) / 1e6, 0, 'f', 6);
+ QString tfreq = QString("%1").arg((m_dialFreqRxWSPR +
+ ui->TxFreqSpinBox->value()) / 1e6, 0, 'f', 6);
+ auto pct = QString::number (ui->autoButton->isChecked () ? ui->sbTxPercent->value () : 0);
+ if (!direct_post)
+ {
+ wsprNet->upload (m_config.my_callsign (), m_config.my_grid (), rfreq, tfreq,
+ m_mode, m_TRperiod, pct,
+ QString::number (m_dBm), version (),
+ m_config.writeable_data_dir ().absoluteFilePath ("wspr_spots.txt"));
+ }
+ else
+ {
+ wsprNet->post (m_config.my_callsign (), m_config.my_grid (), rfreq, tfreq,
+ m_mode, m_TRperiod, pct,
+ QString::number (m_dBm), version (), decode_text);
+ }
+ if (!decode_text.size ())
+ {
+ m_uploading = true;
+ }
}
void MainWindow::uploadResponse(QString response)
@@ -7850,24 +8014,9 @@ void MainWindow::on_TxPowerComboBox_currentIndexChanged(int index)
m_dBm = ui->TxPowerComboBox->itemData (index).toInt ();
}
-void MainWindow::on_sbTxPercent_valueChanged(int n)
-{
- m_pctx=n;
- if(m_pctx>0) {
- ui->pbTxNext->setEnabled(true);
- } else {
- m_txNext=false;
- ui->pbTxNext->setChecked(false);
- ui->pbTxNext->setEnabled(false);
- }
-}
-
void MainWindow::on_cbUploadWSPR_Spots_toggled(bool b)
{
- m_uploadSpots=b;
- if(m_uploadSpots) ui->cbUploadWSPR_Spots->setStyleSheet("");
- if(!m_uploadSpots) ui->cbUploadWSPR_Spots->setStyleSheet(
- "QCheckBox{background-color: yellow}");
+ m_uploadWSPRSpots=b;
}
void MainWindow::on_WSPRfreqSpinBox_valueChanged(int n)
@@ -7875,14 +8024,55 @@ void MainWindow::on_WSPRfreqSpinBox_valueChanged(int n)
ui->TxFreqSpinBox->setValue(n);
}
+void MainWindow::on_sbFST4W_RxFreq_valueChanged(int n)
+{
+ m_wideGraph->setRxFreq(n);
+ statusUpdate ();
+}
+
+void MainWindow::on_sbFST4W_FTol_valueChanged(int n)
+{
+ ui->sbFST4W_RxFreq->setSingleStep(n);
+ m_wideGraph->setTol(n);
+ statusUpdate ();
+}
+
void MainWindow::on_pbTxNext_clicked(bool b)
{
- m_txNext=b;
+ if (b && !ui->autoButton->isChecked ())
+ {
+ ui->autoButton->click (); // make sure Tx is possible
+ }
}
void MainWindow::WSPR_scheduling ()
{
+ if (ui->pbTxNext->isEnabled () && ui->pbTxNext->isChecked ())
+ {
+ // Tx Next button overrides all scheduling
+ m_WSPR_tx_next = true;
+ return;
+ }
+ QString t=ui->RoundRobin->currentText();
+ if(m_mode=="FST4W" and t != tr ("Random")) {
+ bool ok;
+ int i=t.left (1).toInt (&ok) - 1;
+ if (!ok) return;
+ int n=t.right (1).toInt (&ok);
+ if (!ok || 0 == n) return;
+
+ qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
+ int nsec=ms/1000;
+ int ntr=m_TRperiod;
+ int j=((nsec+ntr-1) % (n*ntr))/ntr;
+ m_WSPR_tx_next = i == j;
+ return;
+ }
m_WSPR_tx_next = false;
+ if (!ui->sbTxPercent->isEnabled () || !ui->sbTxPercent->value ())
+ {
+ return; // don't schedule if %age disabled or zero
+ }
if (m_config.is_transceiver_online () // need working rig control for hopping
&& !m_config.is_dummy_rig ()
&& ui->band_hopping_group_box->isChecked ()) {
@@ -7895,22 +8085,25 @@ void MainWindow::WSPR_scheduling ()
if (hop_data.frequencies_index_ >= 0) { // new band
ui->bandComboBox->setCurrentIndex (hop_data.frequencies_index_);
on_bandComboBox_activated (hop_data.frequencies_index_);
- QStringList prefixes {".bat", ".cmd", ".exe", ""};
- QString target;
- for (auto const& prefix : prefixes)
- {
- target = QDir {m_appDir}.absoluteFilePath (QLatin1String {"user_hardware"});
- QFileInfo f {target + prefix};
- if (f.isExecutable ()) {
- break;
- }
- }
- if (target.size ())
- {
- // Execute user's hardware controller
- p3.start(QDir::toNativeSeparators (target)
- , QStringList {m_config.bands ()->find (m_freqNominal).remove ('m')});
- }
+ // Execute user's hardware controller
+ auto band = m_config.bands ()->find (m_freqNominal).remove ('m');
+#if defined(Q_OS_WIN)
+ // On windows we use CMD.EXE to find and execute the
+ // user_hardware executable. This means that the first matching
+ // file extension on the PATHEXT environment variable found on
+ // the PATH environment variable path list. This give maximum
+ // flexibility for users to write user_hardware in their
+ // language of choice, and place the file anywhere on the PATH
+ // environment variable. Equivalent to typing user_hardware
+ // without any path or extension at the CMD.EXE prompt.
+ p3.start("CMD", QStringList {"/C", "user_hardware", band});
+#else
+ // On non-Windows systems we expect the user_hardware executable
+ // to be anywhere in the paths specified in the PATH environment
+ // variable path list, and executable. Equivalent to typing
+ // user_hardware without any path at the shell prompt.
+ p3.start("/bin/sh", QStringList {"-c", "user_hardware " + band});
+#endif
// Produce a short tuneup signal
m_tuneup = false;
@@ -7925,7 +8118,7 @@ void MainWindow::WSPR_scheduling ()
band_hopping_label.setText (hop_data.period_name_);
}
else {
- m_WSPR_tx_next = m_WSPR_band_hopping.next_is_tx ("WSPR-LF" == m_mode);
+ m_WSPR_tx_next = m_WSPR_band_hopping.next_is_tx(m_mode=="FST4W");
}
}
@@ -8009,11 +8202,11 @@ void MainWindow::setRig (Frequency f)
{
if (m_transmitting && m_config.split_mode ())
{
- Q_EMIT m_config.transceiver_tx_frequency (m_freqTxNominal + m_astroCorrection.tx);
+ m_config.transceiver_tx_frequency (m_freqTxNominal + m_astroCorrection.tx);
}
else
{
- Q_EMIT m_config.transceiver_frequency (m_freqNominal + m_astroCorrection.rx);
+ m_config.transceiver_frequency (m_freqNominal + m_astroCorrection.rx);
}
}
}
@@ -8166,7 +8359,7 @@ void MainWindow::tx_watchdog (bool triggered)
m_bTxTime=false;
if (m_tune) stop_tuning ();
if (m_auto) auto_tx_mode (false);
- tx_status_label.setStyleSheet ("QLabel{background-color: #ff0000}");
+ tx_status_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff0000}");
tx_status_label.setText (tr ("Runaway Tx watchdog"));
QApplication::alert (this);
}
@@ -8180,7 +8373,7 @@ void MainWindow::tx_watchdog (bool triggered)
void MainWindow::update_watchdog_label ()
{
- if (m_config.watchdog () && !m_mode.startsWith ("WSPR"))
+ if (m_config.watchdog () && m_mode!="WSPR" && m_mode!="FST4W")
{
watchdog_label.setText (tr ("WD:%1m").arg (m_config.watchdog () - m_idleMinutes));
watchdog_label.setVisible (true);
@@ -8217,7 +8410,7 @@ void MainWindow::on_cbFirst_toggled(bool b)
void MainWindow::on_cbAutoSeq_toggled(bool b)
{
if(!b) ui->cbFirst->setChecked(false);
- ui->cbFirst->setVisible((m_mode=="FT8" or m_mode=="FT4") and b);
+ ui->cbFirst->setVisible((m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4") and b);
}
void MainWindow::on_measure_check_box_stateChanged (int state)
@@ -8780,7 +8973,7 @@ void MainWindow::foxGenWaveform(int i,QString fm)
QString txModeArg;
txModeArg = txModeArg.asprintf("FT8fox %d",i+1);
ui->decodedTextBrowser2->displayTransmittedText(fm.trimmed(), txModeArg,
- ui->TxFreqSpinBox->value()+60*i,m_bFastMode);
+ ui->TxFreqSpinBox->value()+60*i,m_bFastMode,m_TRperiod);
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]
@@ -8914,13 +9107,8 @@ void MainWindow::write_all(QString txRx, QString message)
t = t.asprintf("%5d",ui->TxFreqSpinBox->value());
if (txRx=="Tx") msg=" 0 0.0" + t + " " + message;
auto time = QDateTime::currentDateTimeUtc ();
- if( txRx=="Rx" ) {
- double tdec = fmod(double(time.time().second()),m_TRperiod);
- if( "MSK144" != m_mode && tdec < 0.5*m_TRperiod ) {
- tdec+=m_TRperiod;
- }
- time = time.addSecs(-tdec);
- }
+ if( txRx=="Rx" ) time=m_dateTimeSeqStart;
+
t = t.asprintf("%10.3f ",m_freqNominal/1.e6);
if (m_diskData) {
if (m_fileDateTime.size()==11) {
@@ -8937,7 +9125,7 @@ void MainWindow::write_all(QString txRx, QString message)
QFile f{m_config.writeable_data_dir().absoluteFilePath(file_name)};
if (f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) {
QTextStream out(&f);
- out << line
+ out << line.trimmed()
#if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0)
<< Qt::endl
#else
@@ -8994,6 +9182,8 @@ void MainWindow::on_pbBestSP_clicked()
void MainWindow::set_mode (QString const& mode)
{
if ("FT4" == mode) on_actionFT4_triggered ();
+ else if ("FST4" == mode) on_actionFST4_triggered ();
+ else if ("FST4W" == mode) on_actionFST4W_triggered ();
else if ("FT8" == mode) on_actionFT8_triggered ();
else if ("JT4" == mode) on_actionJT4_triggered ();
else if ("JT9" == mode) on_actionJT9_triggered ();
@@ -9004,7 +9194,6 @@ void MainWindow::set_mode (QString const& mode)
else if ("ISCAT" == mode) on_actionISCAT_triggered ();
else if ("MSK144" == mode) on_actionMSK144_triggered ();
else if ("WSPR" == mode) on_actionWSPR_triggered ();
- else if ("WSPR-LF" == mode) on_actionWSPR_LF_triggered ();
else if ("Echo" == mode) on_actionEcho_triggered ();
}
@@ -9066,3 +9255,27 @@ void MainWindow::remote_configure (QString const& mode, quint32 frequency_tolera
tx_watchdog (false);
QApplication::alert (this);
}
+
+QString MainWindow::WSPR_message()
+{
+ QString sdBm,msg0,msg1,msg2;
+ sdBm = sdBm.asprintf(" %d",m_dBm);
+ m_tx=1-m_tx;
+ int i2=m_config.my_callsign().indexOf("/");
+ if(i2>0
+ || (6 == m_config.my_grid ().size ()
+ && !ui->WSPR_prefer_type_1_check_box->isChecked ())) {
+ if(i2<0) { // "Type 2" WSPR message
+ msg1=m_config.my_callsign() + " " + m_config.my_grid().mid(0,4) + sdBm;
+ } else {
+ msg1=m_config.my_callsign() + sdBm;
+ }
+ msg0="<" + m_config.my_callsign() + "> " + m_config.my_grid();
+ if(m_mode=="WSPR") msg0 += sdBm;
+ if(m_tx==0) msg2=msg0;
+ if(m_tx==1) msg2=msg1;
+ } else {
+ msg2=m_config.my_callsign() + " " + m_config.my_grid().mid(0,4) + sdBm; // Normal WSPR message
+ }
+ return msg2;
+}