diff options
Diffstat (limited to 'widgets')
| -rw-r--r-- | widgets/HelpTextWindow.cpp | 15 | ||||
| -rw-r--r-- | widgets/HelpTextWindow.hpp | 2 | ||||
| -rw-r--r-- | widgets/LazyFillComboBox.cpp | 3 | ||||
| -rw-r--r-- | widgets/LazyFillComboBox.hpp | 40 | ||||
| -rw-r--r-- | widgets/about.cpp | 8 | ||||
| -rw-r--r-- | widgets/astro.cpp | 118 | ||||
| -rw-r--r-- | widgets/astro.h | 12 | ||||
| -rw-r--r-- | widgets/displaytext.cpp | 72 | ||||
| -rw-r--r-- | widgets/displaytext.h | 8 | ||||
| -rw-r--r-- | widgets/logqso.cpp | 55 | ||||
| -rw-r--r-- | widgets/logqso.h | 2 | ||||
| -rw-r--r-- | widgets/logqso.ui | 75 | ||||
| -rw-r--r-- | widgets/mainwindow.cpp | 1849 | ||||
| -rw-r--r-- | widgets/mainwindow.h | 59 | ||||
| -rw-r--r-- | widgets/mainwindow.ui | 2034 | ||||
| -rw-r--r-- | widgets/plotter.cpp | 84 | ||||
| -rw-r--r-- | widgets/plotter.h | 8 | ||||
| -rw-r--r-- | widgets/widegraph.cpp | 14 | ||||
| -rw-r--r-- | widgets/widegraph.h | 2 | ||||
| -rw-r--r-- | widgets/widegraph.ui | 6 | ||||
| -rw-r--r-- | widgets/widgets.pri | 5 |
21 files changed, 2390 insertions, 2081 deletions
diff --git a/widgets/HelpTextWindow.cpp b/widgets/HelpTextWindow.cpp index 51bfc89f..7ac1367b 100644 --- a/widgets/HelpTextWindow.cpp +++ b/widgets/HelpTextWindow.cpp @@ -3,30 +3,19 @@ #include <QApplication> #include <QString> #include <QPalette> -#include <QFile> -#include <QTextStream> #include "qt_helpers.hpp" -#include "widgets/MessageBox.hpp" #include "moc_HelpTextWindow.cpp" -HelpTextWindow::HelpTextWindow (QString const& title, QString const& file_name, QFont const& font, QWidget * parent) +HelpTextWindow::HelpTextWindow (QString const& title, QString const& text, QFont const& font, QWidget * parent) : QLabel {parent, Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint} { - QFile source {file_name}; - if (!source.open (QIODevice::ReadOnly | QIODevice::Text)) - { - MessageBox::warning_message (this, tr ("Help file error") - , tr ("Cannot open \"%1\" for reading").arg (source.fileName ()) - , tr ("Error: %1").arg (source.errorString ())); - return; - } setWindowTitle(QApplication::applicationName () + " - " + title); setMargin (10); setBackgroundRole (QPalette::Base); setAutoFillBackground (true); setStyleSheet (font_as_stylesheet (font)); - setText (QTextStream {&source}.readAll ()); + setText (text); setMinimumSize (sizeHint ()); } diff --git a/widgets/HelpTextWindow.hpp b/widgets/HelpTextWindow.hpp index 5cc5a6dc..96caaad6 100644 --- a/widgets/HelpTextWindow.hpp +++ b/widgets/HelpTextWindow.hpp @@ -12,7 +12,7 @@ class HelpTextWindow final Q_OBJECT public: - HelpTextWindow (QString const& title, QString const& file_name, QFont const& = QFont {}, QWidget * parent = nullptr); + HelpTextWindow (QString const& title, QString const& text, QFont const& = QFont {}, QWidget * parent = nullptr); }; #endif diff --git a/widgets/LazyFillComboBox.cpp b/widgets/LazyFillComboBox.cpp new file mode 100644 index 00000000..08968f35 --- /dev/null +++ b/widgets/LazyFillComboBox.cpp @@ -0,0 +1,3 @@ +#include "LazyFillComboBox.hpp" + +#include "moc_LazyFillComboBox.cpp" diff --git a/widgets/LazyFillComboBox.hpp b/widgets/LazyFillComboBox.hpp new file mode 100644 index 00000000..7d905267 --- /dev/null +++ b/widgets/LazyFillComboBox.hpp @@ -0,0 +1,40 @@ +#ifndef LAZY_FILL_COMBO_BOX_HPP__ +#define LAZY_FILL_COMBO_BOX_HPP__ + +#include <QComboBox> + +class QWidget; + +// +// Class LazyFillComboBox +// +// QComboBox derivative that signals show and hide of the pop up list. +// +class LazyFillComboBox final + : public QComboBox +{ + Q_OBJECT + +public: + Q_SIGNAL void about_to_show_popup (); + Q_SIGNAL void popup_hidden (); + + explicit LazyFillComboBox (QWidget * parent = nullptr) + : QComboBox {parent} + { + } + + void showPopup () override + { + Q_EMIT about_to_show_popup (); + QComboBox::showPopup (); + } + + void hidePopup () override + { + QComboBox::hidePopup (); + Q_EMIT popup_hidden (); + } +}; + +#endif diff --git a/widgets/about.cpp b/widgets/about.cpp index b1af0180..c8b63082 100644 --- a/widgets/about.cpp +++ b/widgets/about.cpp @@ -20,10 +20,10 @@ CAboutDlg::CAboutDlg(QWidget *parent) : "weak-signal Amateur Radio communication. <br /><br />" "© 2001-2020 by Joe Taylor, K1JT, Bill Somerville, G4WJS, <br />" "and Steve Franke, K9AN. <br /><br />" - "We gratefully acknowledge contributions from AC6SL, AE4JY, DJ0OT, <br />" - "G3WDG, G4KLA, IV3NWV, IW3RAB, K3WYC, KA6MAL, KA9Q, KB1ZMX,<br />" - "KD6EKQ, KI7MT, KK1D, ND0B, PY2SDR, VE1SKY, VK3ACF, VK4BDJ,<br />" - "VK7MO, W4TI, W4TV, and W9MDB.<br /><br />" + "We gratefully acknowledge contributions from AC6SL, AE4JY,<br />" + "DF2ET, DJ0OT, G3WDG, G4KLA, IV3NWV, IW3RAB, KA1GT, K3WYC,<br />" + "KA6MAL, KA9Q, KB1ZMX, KD6EKQ, KI7MT, KK1D, ND0B, PY2SDR,<br />" + "VE1SKY, VK3ACF, VK4BDJ, VK7MO, W4TI, W4TV, and W9MDB.<br /><br />" "WSJT-X is licensed under the terms of Version 3 <br />" "of the GNU General Public License (GPL) <br /><br />" "<a href=" WSJTX_STRINGIZE (PROJECT_HOMEPAGE) ">" diff --git a/widgets/astro.cpp b/widgets/astro.cpp index 122b86ef..87ca7224 100644 --- a/widgets/astro.cpp +++ b/widgets/astro.cpp @@ -25,13 +25,13 @@ extern "C" { void astrosub(int nyear, int month, int nday, double uth, double freqMoon, - const char * mygrid, size_t mygrid_len, const char * hisgrid, - size_t hisgrid_len, double * azsun, double * elsun, double * azmoon, + const char * mygrid, const char * hisgrid, + double * azsun, double * elsun, double * azmoon, double * elmoon, double * azmoondx, double * elmoondx, int * ntsky, int * ndop, int * ndop00, double * ramoon, double * decmoon, double * dgrd, double * poloffset, double * xnr, double * techo, double * width1, - double * width2, bool bTx, const char * AzElFileName, size_t AzElFileName_len, - const char * jpleph, size_t jpleph_len); + double * width2, bool bTx, const char * AzElFileName, + const char * jpleph); } Astro::Astro(QSettings * settings, Configuration const * configuration, QWidget * parent) @@ -42,11 +42,12 @@ Astro::Astro(QSettings * settings, Configuration const * configuration, QWidget , m_DopplerMethod {0} , m_dop {0} , m_dop00 {0} - , m_dx_two_way_dop {0} + //, m_dx_two_way_dop {0} { ui_->setupUi (this); setWindowTitle (QApplication::applicationName () + " - " + tr ("Astronomical Data")); - setStyleSheet ("QWidget {background: white;}"); + setBackgroundRole (QPalette::Base); + setAutoFillBackground (true); connect (ui_->cbDopplerTracking, &QAbstractButton::toggled, ui_->doppler_widget, &QWidget::setVisible); read_settings (); ui_->text_label->clear (); @@ -76,8 +77,8 @@ void Astro::read_settings () case 1: ui_->rbFullTrack->setChecked (true); break; case 2: ui_->rbConstFreqOnMoon->setChecked (true); break; case 3: ui_->rbOwnEcho->setChecked (true); break; - case 4: ui_->rbOnDxEcho->setChecked (true); break; - case 5: ui_->rbCallDx->setChecked (true); break; + case 4: ui_->rbOnDxEcho->setChecked (true); break; + case 5: ui_->rbCallDx->setChecked (true); break; } move (settings_->value ("window/pos", pos ()).toPoint ()); } @@ -111,14 +112,14 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const auto const& jpleph = configuration_->data_dir ().absoluteFilePath ("JPLEPH"); astrosub(nyear, month, nday, uth, static_cast<double> (freq_moon), - mygrid.toLatin1 ().constData (), mygrid.size (), - hisgrid.toLatin1().constData(), hisgrid.size (), + mygrid.toLatin1 ().data (), + hisgrid.toLatin1().data(), &azsun, &elsun, &azmoon, &elmoon, &azmoondx, &elmoondx, &ntsky, &m_dop, &m_dop00, &ramoon, &decmoon, &dgrd, &poloffset, &xnr, &techo, &width1, &width2, bTx, - AzElFileName.toLatin1().constData(), AzElFileName.size (), - jpleph.toLatin1().constData(), jpleph.size ()); + AzElFileName.toLatin1().data(), + jpleph.toLatin1().data()); if(!hisgrid.size ()) { azmoondx=0.0; @@ -167,38 +168,35 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const switch (m_DopplerMethod) { case 1: // All Doppler correction done here; DX station stays at nominal dial frequency. - correction.rx = m_dop; - break; - case 4: // All Doppler correction done here; DX station stays at nominal dial frequency. (Trial for OnDxEcho) - correction.rx = m_dop; - break; - //case 5: // All Doppler correction done here; DX station stays at nominal dial frequency. - + correction.rx = m_dop; + break; + case 4: // All Doppler correction done here; DX station stays at nominal dial frequency. (Trial for OnDxEcho) + correction.rx = m_dop; + break; + //case 5: // All Doppler correction done here; DX station stays at nominal dial frequency. case 3: // Both stations do full correction on Rx and none on Tx //correction.rx = dx_is_self ? m_dop00 : m_dop; - correction.rx = m_dop00; // Now always sets RX to *own* echo freq + correction.rx = m_dop00; // Now always sets RX to *own* echo freq break; - case 2: + case 2: // Doppler correction to constant frequency on Moon correction.rx = m_dop00 / 2; break; - } switch (m_DopplerMethod) { - case 1: correction.tx = -correction.rx; - break; - case 2: correction.tx = -correction.rx; - break; - case 3: correction.tx = 0; - break; - case 4: // correction.tx = m_dop - m_dop00; - - correction.tx = m_dx_two_way_dop - m_dop; - qDebug () << "correction.tx:" << correction.tx; - break; - case 5: correction.tx = - m_dop00; - break; + case 1: correction.tx = -correction.rx; + break; + case 2: correction.tx = -correction.rx; + break; + case 3: correction.tx = 0; + break; + case 4: // correction.tx = m_dop - m_dop00; + correction.tx = (2 * (m_dop - (m_dop00/2))) - m_dop; + //qDebug () << "correction.tx:" << correction.tx; + break; + case 5: correction.tx = - m_dop00; + break; } //if (3 != m_DopplerMethod || 4 != m_DopplerMethod) correction.tx = -correction.rx; @@ -223,14 +221,14 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const double sec {target_date_time.time().second() + 0.001*target_date_time.time().msec()}; double uth {nhr + nmin/60.0 + sec/3600.0}; astrosub(nyear, month, nday, uth, static_cast<double> (freq_moon), - mygrid.toLatin1 ().constData (), mygrid.size (), - hisgrid.toLatin1().constData(), hisgrid.size (), + mygrid.toLatin1 ().data (), + hisgrid.toLatin1().data(), &azsun, &elsun, &azmoon, &elmoon, &azmoondx, &elmoondx, &ntsky, &m_dop, &m_dop00, &ramoon, &decmoon, &dgrd, &poloffset, &xnr, &techo, &width1, &width2, bTx, - AzElFileName.toLatin1().constData(), AzElFileName.size (), - jpleph.toLatin1().constData(), jpleph.size ()); + nullptr, // don't overwrite azel.dat + jpleph.toLatin1().data()); FrequencyDelta offset {0}; switch (m_DopplerMethod) { @@ -241,22 +239,20 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const case 2: // Doppler correction to constant frequency on Moon - offset = m_dop00 / 2; - break; - - case 4: + offset = m_dop00 / 2; + break; + + case 4: // Doppler correction for OnDxEcho - offset = m_dop - m_dx_two_way_dop; + offset = m_dop - (2 * (m_dop - (m_dop00/2))); + break; + + //case 5: correction.tx = - m_dop00; + case 5: offset = m_dop00;// version for _7 break; - - //case 5: correction.tx = - m_dop00; - case 5: offset = m_dop00;// version for _7 - break; - - } correction.tx = -offset; - qDebug () << "correction.tx (no tx qsy):" << correction.tx; + //qDebug () << "correction.tx (no tx qsy):" << correction.tx; } } return correction; @@ -273,46 +269,46 @@ void Astro::check_split () } } -void Astro::on_rbFullTrack_clicked() +void Astro::on_rbFullTrack_clicked(bool) { m_DopplerMethod = 1; check_split (); Q_EMIT tracking_update (); } -void Astro::on_rbOnDxEcho_clicked(bool checked) +void Astro::on_rbOnDxEcho_clicked(bool) { m_DopplerMethod = 4; check_split (); - if (checked) { - m_dx_two_way_dop = 2 * (m_dop - (m_dop00/2)); - qDebug () << "Starting Doppler:" << m_dx_two_way_dop; - } + //if (checked) { + // m_dx_two_way_dop = 2 * (m_dop - (m_dop00/2)); + // qDebug () << "Starting Doppler:" << m_dx_two_way_dop; + //} Q_EMIT tracking_update (); } -void Astro::on_rbOwnEcho_clicked() +void Astro::on_rbOwnEcho_clicked(bool) { m_DopplerMethod = 3; check_split (); Q_EMIT tracking_update (); } -void Astro::on_rbCallDx_clicked() +void Astro::on_rbCallDx_clicked(bool) { m_DopplerMethod = 5; check_split (); Q_EMIT tracking_update (); } -void Astro::on_rbConstFreqOnMoon_clicked() +void Astro::on_rbConstFreqOnMoon_clicked(bool) { m_DopplerMethod = 2; check_split (); Q_EMIT tracking_update (); } -void Astro::on_rbNoDoppler_clicked() +void Astro::on_rbNoDoppler_clicked(bool) { m_DopplerMethod = 0; Q_EMIT tracking_update (); diff --git a/widgets/astro.h b/widgets/astro.h index 4f7f71d5..a2474072 100644 --- a/widgets/astro.h +++ b/widgets/astro.h @@ -55,12 +55,12 @@ protected: void closeEvent (QCloseEvent *) override; private slots: - void on_rbConstFreqOnMoon_clicked(); - void on_rbFullTrack_clicked(); - void on_rbOwnEcho_clicked(); - void on_rbNoDoppler_clicked(); + void on_rbConstFreqOnMoon_clicked(bool); + void on_rbFullTrack_clicked(bool); + void on_rbOwnEcho_clicked(bool); + void on_rbNoDoppler_clicked(bool); void on_rbOnDxEcho_clicked(bool); - void on_rbCallDx_clicked(); + void on_rbCallDx_clicked(bool); void on_cbDopplerTracking_toggled(bool); private: @@ -75,7 +75,7 @@ private: qint32 m_DopplerMethod; int m_dop; int m_dop00; - int m_dx_two_way_dop; + //int m_dx_two_way_dop; }; inline diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index f0f17f64..d498f180 100644 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -241,10 +241,9 @@ void DisplayText::new_period () QString DisplayText::appendWorkedB4 (QString message, QString call, QString const& grid, QColor * bg, QColor * fg, LogBook const& logBook, - QString const& currentBand, QString const& currentMode) + QString const& currentBand, QString const& currentMode, + QString extra) { - // allow for seconds - int padding {message.indexOf (" ") > 4 ? 2 : 0}; QString countryName; bool callB4; bool callB4onBand; @@ -278,7 +277,6 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons } message = message.trimmed (); - QString appendage; highlight_types types; // no shortcuts here as some types may be disabled @@ -329,20 +327,20 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons { case Highlight::Continent: case Highlight::ContinentBand: - appendage = AD1CCty::continent (looked_up.continent); + extra += AD1CCty::continent (looked_up.continent); break; case Highlight::CQZone: case Highlight::CQZoneBand: - appendage = QString {"CQ Zone %1"}.arg (looked_up.CQ_zone); + extra += QString {"CQ Zone %1"}.arg (looked_up.CQ_zone); break; case Highlight::ITUZone: case Highlight::ITUZoneBand: - appendage = QString {"ITU Zone %1"}.arg (looked_up.ITU_zone); + extra += QString {"ITU Zone %1"}.arg (looked_up.ITU_zone); break; default: if (m_bPrincipalPrefix) { - appendage = looked_up.primary_prefix; + extra += looked_up.primary_prefix; } else { @@ -368,26 +366,38 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons countryName.replace ("European", "EU"); countryName.replace ("African", "AF"); - appendage += countryName; + extra += countryName; } } m_CQPriority=DecodeHighlightingModel::highlight_name(top_highlight); - // use a nbsp to save the start of appended text so we can find - // it again later, align appended data at a fixed column if - // there is space otherwise let it float to the right - int space_count {40 + padding - message.size ()}; - if (space_count > 0) { - message += QString {space_count, QChar {' '}}; - } - message += QChar::Nbsp + appendage; + return leftJustifyAppendage (message, extra); +} + +QString DisplayText::leftJustifyAppendage (QString message, QString const& appendage) const +{ + if (appendage.size ()) + { + // allow for seconds + int padding {message.indexOf (" ") > 4 ? 2 : 0}; + + // use a nbsp to save the start of appended text so we can find + // it again later, align appended data at a fixed column if + // there is space otherwise let it float to the right + int space_count {40 + padding - message.size ()}; + if (space_count > 0) { + message += QString {space_count, QChar {' '}}; + } + message += QChar::Nbsp + appendage; + } return message; } void DisplayText::displayDecodedText(DecodedText const& decodedText, QString const& myCall, QString const& mode, bool displayDXCCEntity, LogBook const& logBook, - QString const& currentBand, bool ppfx, bool bCQonly) + QString const& currentBand, bool ppfx, bool bCQonly, + bool haveFSpread, float fSpread) { m_bPrincipalPrefix=ppfx; QColor bg; @@ -420,7 +430,18 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con decodedText.deCallAndGrid (/*out*/ dxCall, dxGrid); QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; if(!dxGrid.contains(grid_regexp)) dxGrid=""; - message = message.left (message.indexOf (QChar::Nbsp)); // strip appended info + message = message.left (message.indexOf (QChar::Nbsp)).trimmed (); // strip appended info + QString extra; + if (haveFSpread) + { + extra += QString {"%1"}.arg (fSpread, 5, 'f', fSpread < 0.95 ? 3 : 2) + QChar {' '}; + } + auto ap_pos = message.lastIndexOf (QRegularExpression {R"((?:\?\s)?a[0-9]$)"}); + if (ap_pos >= 0) + { + extra += message.mid (ap_pos) + QChar {' '}; + message = message.left (ap_pos).trimmed (); + } m_CQPriority=""; if (CQcall) { @@ -434,10 +455,11 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con currentMode = decodedText.isJT65 () ? "JT65" : "JT9"; } message = appendWorkedB4 (message, decodedText.CQersCall(), dxGrid, &bg, &fg - , logBook, currentBand, currentMode); + , logBook, currentBand, currentMode, extra); } else { + message = leftJustifyAppendage (message, extra); highlight_types types {Highlight::CQ}; if (m_config && m_config->lotw_users ().user (decodedText.CQersCall())) { @@ -446,12 +468,17 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con set_colours (m_config, &bg, &fg, types); } } + else + { + message = leftJustifyAppendage (message, extra); + } appendText (message.trimmed (), bg, fg, decodedText.call (), dxCall); } -void DisplayText::displayTransmittedText(QString text, QString modeTx, qint32 txFreq,bool bFastMode) +void DisplayText::displayTransmittedText(QString text, QString modeTx, qint32 txFreq, + bool bFastMode, double TRperiod) { QString t1=" @ "; if(modeTx=="FT4") t1=" + "; @@ -459,10 +486,11 @@ void DisplayText::displayTransmittedText(QString text, QString modeTx, qint32 tx if(modeTx=="JT4") t1=" $ "; if(modeTx=="JT65") t1=" # "; if(modeTx=="MSK144") t1=" & "; + if(modeTx=="FST4") t1=" ` "; QString t2; t2 = t2.asprintf("%4d",txFreq); QString t; - if(bFastMode or modeTx=="FT8" or modeTx=="FT4") { + if(bFastMode or modeTx=="FT8" or modeTx=="FT4" or (TRperiod<60)) { t = QDateTime::currentDateTimeUtc().toString("hhmmss") + \ " Tx " + t2 + t1 + text; } else if(modeTx.mid(0,6)=="FT8fox") { diff --git a/widgets/displaytext.h b/widgets/displaytext.h index fb8bb613..3b577e61 100644 --- a/widgets/displaytext.h +++ b/widgets/displaytext.h @@ -30,8 +30,9 @@ public: void insertLineSpacer(QString const&); void displayDecodedText(DecodedText const& decodedText, QString const& myCall, QString const& mode, bool displayDXCCEntity, LogBook const& logBook, - QString const& currentBand=QString {}, bool ppfx=false, bool bCQonly=false); - void displayTransmittedText(QString text, QString modeTx, qint32 txFreq, bool bFastMode); + QString const& currentBand=QString {}, bool ppfx=false, bool bCQonly=false, + bool haveFSpread = false, float fSpread = 0.); + void displayTransmittedText(QString text, QString modeTx, qint32 txFreq, bool bFastMode, double TRperiod); void displayQSY(QString text); void displayFoxToBeCalled(QString t, QColor bg = QColor {}, QColor fg = QColor {}); void new_period (); @@ -46,6 +47,7 @@ public: Q_SLOT void highlight_callsign (QString const& callsign, QColor const& bg, QColor const& fg, bool last_period_only); private: + QString leftJustifyAppendage (QString message, QString const& appendage) const; void mouseDoubleClickEvent (QMouseEvent *) override; void extend_vertical_scrollbar (int min, int max); @@ -56,7 +58,7 @@ private: QString appendWorkedB4(QString message, QString callsign , QString const& grid, QColor * bg, QColor * fg , LogBook const& logBook, QString const& currentBand - , QString const& currentMode); + , QString const& currentMode, QString extra); QFont char_font_; QAction * erase_action_; QHash<QString, QPair<QColor, QColor>> highlighted_calls_; diff --git a/widgets/logqso.cpp b/widgets/logqso.cpp index 187d2618..7a74b86c 100644 --- a/widgets/logqso.cpp +++ b/widgets/logqso.cpp @@ -15,6 +15,37 @@ #include "ui_logqso.h" #include "moc_logqso.cpp" +namespace +{ + struct PropMode + { + char const * id_; + char const * name_; + }; + constexpr PropMode prop_modes[] = + { + {"", ""} + , {"AS", QT_TRANSLATE_NOOP ("LogQSO", "Aircraft scatter")} + , {"AUE", QT_TRANSLATE_NOOP ("LogQSO", "Aurora-E")} + , {"AUR", QT_TRANSLATE_NOOP ("LogQSO", "Aurora")} + , {"BS", QT_TRANSLATE_NOOP ("LogQSO", "Back scatter")} + , {"ECH", QT_TRANSLATE_NOOP ("LogQSO", "Echolink")} + , {"EME", QT_TRANSLATE_NOOP ("LogQSO", "Earth-moon-earth")} + , {"ES", QT_TRANSLATE_NOOP ("LogQSO", "Sporadic E")} + , {"F2", QT_TRANSLATE_NOOP ("LogQSO", "F2 Reflection")} + , {"FAI", QT_TRANSLATE_NOOP ("LogQSO", "Field aligned irregularities")} + , {"INTERNET", QT_TRANSLATE_NOOP ("LogQSO", "Internet-assisted")} + , {"ION", QT_TRANSLATE_NOOP ("LogQSO", "Ionoscatter")} + , {"IRL", QT_TRANSLATE_NOOP ("LogQSO", "IRLP")} + , {"MS", QT_TRANSLATE_NOOP ("LogQSO", "Meteor scatter")} + , {"RPT", QT_TRANSLATE_NOOP ("LogQSO", "Non-satellite repeater or transponder")} + , {"RS", QT_TRANSLATE_NOOP ("LogQSO", "Rain scatter")} + , {"SAT", QT_TRANSLATE_NOOP ("LogQSO", "Satellite")} + , {"TEP", QT_TRANSLATE_NOOP ("LogQSO", "Trans-equatorial")} + , {"TR", QT_TRANSLATE_NOOP ("LogQSO", "Troposheric ducting")} + }; +} + LogQSO::LogQSO(QString const& programTitle, QSettings * settings , Configuration const * config, LogBook * log, QWidget *parent) : QDialog {parent, Qt::WindowStaysOnTopHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint} @@ -25,6 +56,10 @@ LogQSO::LogQSO(QString const& programTitle, QSettings * settings { ui->setupUi(this); setWindowTitle(programTitle + " - Log QSO"); + for (auto const& prop_mode : prop_modes) + { + ui->comboBoxPropMode->addItem (prop_mode.name_, prop_mode.id_); + } loadSettings (); ui->grid->setValidator (new MaidenheadLocatorValidator {this}); } @@ -39,8 +74,15 @@ void LogQSO::loadSettings () restoreGeometry (m_settings->value ("geometry", saveGeometry ()).toByteArray ()); ui->cbTxPower->setChecked (m_settings->value ("SaveTxPower", false).toBool ()); ui->cbComments->setChecked (m_settings->value ("SaveComments", false).toBool ()); + ui->cbPropMode->setChecked (m_settings->value ("SavePropMode", false).toBool ()); m_txPower = m_settings->value ("TxPower", "").toString (); m_comments = m_settings->value ("LogComments", "").toString(); + int prop_index {0}; + if (ui->cbPropMode->isChecked ()) + { + prop_index = ui->comboBoxPropMode->findData (m_settings->value ("PropMode", "").toString()); + } + ui->comboBoxPropMode->setCurrentIndex (prop_index); m_settings->endGroup (); } @@ -50,8 +92,10 @@ void LogQSO::storeSettings () const m_settings->setValue ("geometry", saveGeometry ()); m_settings->setValue ("SaveTxPower", ui->cbTxPower->isChecked ()); m_settings->setValue ("SaveComments", ui->cbComments->isChecked ()); + m_settings->setValue ("SavePropMode", ui->cbPropMode->isChecked ()); m_settings->setValue ("TxPower", m_txPower); m_settings->setValue ("LogComments", m_comments); + m_settings->setValue ("PropMode", ui->comboBoxPropMode->currentData ()); m_settings->endGroup (); } @@ -100,6 +144,10 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString ui->loggedOperator->setText(m_config->opCall()); ui->exchSent->setText (xSent); ui->exchRcvd->setText (xRcvd); + if (!ui->cbPropMode->isChecked ()) + { + ui->comboBoxPropMode->setCurrentIndex (-1); + } using SpOp = Configuration::SpecialOperatingActivity; auto special_op = m_config->special_op_id (); @@ -178,6 +226,7 @@ void LogQSO::accept() } } + auto const& prop_mode = ui->comboBoxPropMode->currentData ().toString (); //Log this QSO to file "wsjtx.log" static QFile f {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("wsjtx.log")}; if(!f.open(QIODevice::Text | QIODevice::Append)) { @@ -191,7 +240,7 @@ void LogQSO::accept() dateTimeOff.time().toString("hh:mm:ss,") + hisCall + "," + hisGrid + "," + strDialFreq + "," + mode + "," + rptSent + "," + rptRcvd + "," + m_txPower + - "," + m_comments + "," + name; + "," + m_comments + "," + name + "," + prop_mode; QTextStream out(&f); out << logEntry << #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) @@ -220,6 +269,7 @@ void LogQSO::accept() , m_myGrid , xsent , xrcvd + , prop_mode , m_log->QSOToADIF (hisCall , hisGrid , mode @@ -236,7 +286,8 @@ void LogQSO::accept() , m_txPower , operator_call , xsent - , xrcvd)); + , xrcvd + , prop_mode)); QDialog::accept(); } diff --git a/widgets/logqso.h b/widgets/logqso.h index 739a601f..f6e8d4fe 100644 --- a/widgets/logqso.h +++ b/widgets/logqso.h @@ -42,7 +42,7 @@ signals: , 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); protected: void hideEvent (QHideEvent *); diff --git a/widgets/logqso.ui b/widgets/logqso.ui index a03a3028..7b885cd0 100644 --- a/widgets/logqso.ui +++ b/widgets/logqso.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>377</width> - <height>287</height> + <width>440</width> + <height>322</height> </rect> </property> <property name="sizePolicy"> @@ -46,6 +46,9 @@ <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="buddy"> + <cstring>call</cstring> + </property> </widget> </item> <item> @@ -68,6 +71,9 @@ <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="buddy"> + <cstring>start_date_time</cstring> + </property> </widget> </item> <item> @@ -103,6 +109,9 @@ <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="buddy"> + <cstring>end_date_time</cstring> + </property> </widget> </item> <item> @@ -142,6 +151,9 @@ <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="buddy"> + <cstring>mode</cstring> + </property> </widget> </item> <item> @@ -171,6 +183,9 @@ <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="buddy"> + <cstring>band</cstring> + </property> </widget> </item> <item> @@ -200,6 +215,9 @@ <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="buddy"> + <cstring>sent</cstring> + </property> </widget> </item> <item> @@ -229,6 +247,9 @@ <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="buddy"> + <cstring>rcvd</cstring> + </property> </widget> </item> <item> @@ -258,6 +279,9 @@ <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="buddy"> + <cstring>grid</cstring> + </property> </widget> </item> <item> @@ -290,6 +314,9 @@ <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="buddy"> + <cstring>name</cstring> + </property> </widget> </item> <item> @@ -310,6 +337,9 @@ <property name="text"> <string>Tx power</string> </property> + <property name="buddy"> + <cstring>txPower</cstring> + </property> </widget> </item> <item> @@ -339,6 +369,9 @@ <property name="text"> <string>Comments</string> </property> + <property name="buddy"> + <cstring>comments</cstring> + </property> </widget> </item> <item> @@ -369,6 +402,9 @@ <property name="text"> <string>Operator</string> </property> + <property name="buddy"> + <cstring>loggedOperator</cstring> + </property> </widget> </item> <item> @@ -403,6 +439,9 @@ <property name="text"> <string>Exch sent</string> </property> + <property name="buddy"> + <cstring>exchSent</cstring> + </property> </widget> </item> <item> @@ -433,6 +472,9 @@ <property name="text"> <string>Rcvd</string> </property> + <property name="buddy"> + <cstring>exchRcvd</cstring> + </property> </widget> </item> <item> @@ -448,6 +490,30 @@ </layout> </item> <item> + <layout class="QHBoxLayout" name="horizontalLayout_8" stretch="0,0,0"> + <item> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>Prop Mode</string> + </property> + <property name="buddy"> + <cstring>comboBoxPropMode</cstring> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="comboBoxPropMode"/> + </item> + <item> + <widget class="QCheckBox" name="cbPropMode"> + <property name="text"> + <string>Retain</string> + </property> + </widget> + </item> + </layout> + </item> + <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -486,6 +552,11 @@ <tabstop>cbTxPower</tabstop> <tabstop>comments</tabstop> <tabstop>cbComments</tabstop> + <tabstop>loggedOperator</tabstop> + <tabstop>exchSent</tabstop> + <tabstop>exchRcvd</tabstop> + <tabstop>comboBoxPropMode</tabstop> + <tabstop>cbPropMode</tabstop> </tabstops> <resources/> <connections> 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; +} diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h index 6da871b3..071ffd90 100644 --- a/widgets/mainwindow.h +++ b/widgets/mainwindow.h @@ -3,6 +3,7 @@ #define MAINWINDOW_H #include <QMainWindow> +#include <QByteArray> #include <QString> #include <QStringList> #include <QLabel> @@ -21,6 +22,7 @@ #include <QPointer> #include <QSet> #include <QVector> +#include <QQueue> #include <QFuture> #include <QFutureWatcher> @@ -33,7 +35,7 @@ #include "WSPR/WSPRBandHopping.hpp" #include "Transceiver/Transceiver.hpp" #include "DisplayManual.hpp" -#include "Network/psk_reporter.h" +#include "Network/PSKReporter.hpp" #include "logbook/logbook.h" #include "astro.h" #include "MessageBox.hpp" @@ -43,15 +45,14 @@ #define NUM_JT65_SYMBOLS 126 //63 data + 63 sync #define NUM_JT9_SYMBOLS 85 //69 data + 16 sync #define NUM_WSPR_SYMBOLS 162 //(50+31)*2, embedded sync -#define NUM_WSPR_LF_SYMBOLS 412 //300 data + 109 sync + 3 ramp #define NUM_ISCAT_SYMBOLS 1291 //30*11025/256 #define NUM_MSK144_SYMBOLS 144 //s8 + d48 + s8 + d80 #define NUM_QRA64_SYMBOLS 84 //63 data + 21 sync #define NUM_FT8_SYMBOLS 79 #define NUM_FT4_SYMBOLS 105 +#define NUM_FST4_SYMBOLS 160 //240/2 data + 5*8 sync #define NUM_CW_SYMBOLS 250 #define TX_SAMPLE_RATE 48000 -#define N_WIDGETS 33 #define NRING 3456000 extern int volatile itone[NUM_ISCAT_SYMBOLS]; //Audio tones for all Tx symbols @@ -149,7 +150,7 @@ private slots: void on_stopButton_clicked(); void on_actionRelease_Notes_triggered (); void on_actionFT8_DXpedition_Mode_User_Guide_triggered(); - void on_actionQuick_Start_Guide_v2_triggered(); + void on_actionQuick_Start_Guide_triggered(); void on_actionOnline_User_Guide_triggered(); void on_actionLocal_User_Guide_triggered(); void on_actionWide_Waterfall_triggered(); @@ -204,6 +205,8 @@ private slots: void on_actionJT4_triggered(); void on_actionFT4_triggered(); void on_actionFT8_triggered(); + void on_actionFST4_triggered(); + void on_actionFST4W_triggered(); void on_TxFreqSpinBox_valueChanged(int arg1); void on_actionSave_decoded_triggered(); void on_actionQuickDecode_toggled (bool); @@ -219,15 +222,6 @@ private slots: void startP1(); void stopTx(); void stopTx2(); - void on_pbCallCQ_clicked(); - void on_pbAnswerCaller_clicked(); - void on_pbSendRRR_clicked(); - void on_pbAnswerCQ_clicked(); - void on_pbSendReport_clicked(); - void on_pbSend73_clicked(); - void on_rbGenMsg_clicked(bool checked); - void on_rbFreeText_clicked(bool checked); - void on_freeTextMsg_currentTextChanged (QString const&); void on_rptSpinBox_valueChanged(int n); void killFile(); void on_tuneButton_clicked (bool); @@ -240,8 +234,9 @@ private slots: , 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); void on_bandComboBox_currentIndexChanged (int index); + void on_bandComboBox_editTextChanged (QString const& text); void on_bandComboBox_activated (int index); void on_readFreq_clicked(); void on_pbTxMode_clicked(); @@ -276,16 +271,17 @@ private slots: void networkError (QString const&); void on_ClrAvgButton_clicked(); void on_actionWSPR_triggered(); - void on_actionWSPR_LF_triggered(); void on_syncSpinBox_valueChanged(int n); void on_TxPowerComboBox_currentIndexChanged(int); void on_sbTxPercent_valueChanged(int n); void on_cbUploadWSPR_Spots_toggled(bool b); void WSPR_config(bool b); - void uploadSpots(); + void uploadWSPRSpots (bool direct_post = false, QString const& decode_text = QString {}); void TxAgain(); void uploadResponse(QString response); void on_WSPRfreqSpinBox_valueChanged(int n); + void on_sbFST4W_RxFreq_valueChanged(int n); + void on_sbFST4W_FTol_valueChanged(int n); void on_pbTxNext_clicked(bool b); void on_actionEcho_Graph_triggered(); void on_actionEcho_triggered(); @@ -296,6 +292,7 @@ private slots: void on_actionErase_reference_spectrum_triggered(); void on_actionMeasure_phase_response_triggered(); void on_sbTR_valueChanged (int); + void on_sbTR_FST4W_valueChanged (int); void on_sbFtol_valueChanged (int); void on_cbFast9_clicked(bool b); void on_sbCQTxFreq_valueChanged(int n); @@ -308,12 +305,16 @@ private slots: void on_sbNlist_valueChanged(int n); void on_sbNslots_valueChanged(int n); void on_sbMax_dB_valueChanged(int n); + void on_sbF_Low_valueChanged(int n); + void on_sbF_High_valueChanged(int n); + void chk_FST4_freq_range(); void on_pbFoxReset_clicked(); void on_comboBoxHoundSort_activated (int index); void not_GA_warning_message (); void checkMSK144ContestType(); void on_pbBestSP_clicked(); - int setTxMsg(int n); + void on_RoundRobin_currentTextChanged(QString text); + void setTxMsg(int n); bool stdCall(QString const& w); void remote_configure (QString const& mode, quint32 frequency_tolerance, QString const& submode , bool fast_mode, quint32 tr_period, quint32 rx_df, QString const& dx_call @@ -335,13 +336,14 @@ private: Q_SIGNAL void transmitFrequency (double) const; Q_SIGNAL void endTransmitMessage (bool quick = false) const; Q_SIGNAL void tune (bool = true) const; - Q_SIGNAL void sendMessage (unsigned symbolsLength, double framesPerSymbol, - double frequency, double toneSpacing, + Q_SIGNAL void sendMessage (QString mode, unsigned symbolsLength, + double framesPerSymbol, double frequency, double toneSpacing, SoundOutput *, AudioDevice::Channel = AudioDevice::Mono, bool synchronize = true, bool fastMode = false, double dBSNR = 99., int TRperiod=60) const; Q_SIGNAL void outAttenuationChanged (qreal) const; Q_SIGNAL void toggleShorthand () const; + Q_SIGNAL void reset_audio_input_stream (bool report_dropped_frames) const; private: void set_mode (QString const& mode); @@ -441,7 +443,6 @@ private: qint32 m_nclearave; qint32 m_minSync; qint32 m_dBm; - qint32 m_pctx; qint32 m_nseq; qint32 m_nWSPRdecodes; qint32 m_k0; @@ -498,9 +499,8 @@ private: QString m_tBlankLine; bool m_bShMsgs; bool m_bSWL; - bool m_uploadSpots; + bool m_uploadWSPRSpots; bool m_uploading; - bool m_txNext; bool m_grid6; bool m_tuneup; bool m_bTxTime; @@ -527,6 +527,7 @@ private: bool m_bWarnedSplit=false; bool m_bTUmsg; bool m_bBestSPArmed=false; + bool m_bOK_to_chk=false; enum { @@ -659,11 +660,10 @@ private: QDateTime m_dateTimeSentTx3; QDateTime m_dateTimeRcvdRR73; QDateTime m_dateTimeBestSP; + QDateTime m_dateTimeSeqStart; //Nominal start time of Rx sequence about to be decoded QSharedMemory *mem_jt9; QString m_QSOText; - unsigned m_msAudioOutputBuffered; - unsigned m_framesAudioInputBuffered; unsigned m_downSampleFactor; QThread::Priority m_audioThreadPriority; bool m_bandEdited; @@ -675,7 +675,6 @@ private: bool m_tx_watchdog; // true when watchdog triggered bool m_block_pwr_tooltip; bool m_PwrBandSetOK; - bool m_bVHFwarned; bool m_bDisplayedOnce; Frequency m_lastMonitoredFrequency; double m_toneSpacing; @@ -683,7 +682,7 @@ private: QProgressDialog m_optimizingProgress; QTimer m_heartbeat; MessageClient * m_messageClient; - PSK_Reporter *psk_Reporter; + PSKReporter m_psk_Reporter; DisplayManual m_manual; QHash<QString, QVariant> m_pwrBandTxMemory; // Remembers power level by band QHash<QString, QVariant> m_pwrBandTuneMemory; // Remembers power level by band for tuning @@ -714,7 +713,7 @@ private: void pskPost(DecodedText const& decodedtext); void displayDialFrequency (); void transmitDisplay (bool); - void processMessage(DecodedText const&, Qt::KeyboardModifiers = Qt::NoModifier); + void processMessage(DecodedText const& message, Qt::KeyboardModifiers = Qt::NoModifier); void replyToCQ (QTime, qint32 snr, float delta_time, quint32 delta_frequency, QString const& mode, QString const& message_text, bool low_confidence, quint8 modifiers); void locationChange(QString const& location); void replayDecodes (); @@ -726,7 +725,8 @@ private: void freqCalStep(); void setRig (Frequency = 0); // zero frequency means no change void WSPR_history(Frequency dialFreq, int ndecodes); - QString WSPR_hhmm(int n); + QString beacon_start_time (int n = 0); + QString WSPR_message(); void fast_config(bool b); void CQTxFreq(); void useNextCall(); @@ -749,7 +749,7 @@ private: void rm_tb4(QString houndCall); void read_wav_file (QString const& fname); void decodeDone (); - void subProcessFailed (QProcess *, int exit_code, QProcess::ExitStatus); + bool subProcessFailed (QProcess *, int exit_code, QProcess::ExitStatus); void subProcessError (QProcess *, QProcess::ProcessError); void statusUpdate () const; void update_watchdog_label (); @@ -760,7 +760,6 @@ private: void tx_watchdog (bool triggered); qint64 nWidgets(QString t); void displayWidgets(qint64 n); - void vhfWarning(); QChar current_submode () const; // returns QChar {0} if submode is not appropriate void write_transmit_entry (QString const& file_name); void selectHound(QString t); diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui index ac2b23bc..558fefe0 100644 --- a/widgets/mainwindow.ui +++ b/widgets/mainwindow.ui @@ -376,6 +376,7 @@ </property> <property name="styleSheet"> <string notr="true">QPushButton:checked { + color: #000000; background-color: #00ff00; border-style: outset; border-width: 1px; @@ -447,6 +448,7 @@ </property> <property name="styleSheet"> <string notr="true">QPushButton:checked { + color: rgb(0, 0, 0); background-color: cyan; border-style: outset; border-width: 1px; @@ -480,6 +482,7 @@ </property> <property name="styleSheet"> <string notr="true">QPushButton:checked { + color: rgb(0, 0, 0); background-color: red; border-style: outset; border-width: 1px; @@ -523,6 +526,7 @@ </property> <property name="styleSheet"> <string notr="true">QPushButton:checked { + color: rgb(0, 0, 0); background-color: red; border-style: outset; border-width: 1px; @@ -553,358 +557,7 @@ </layout> </item> <item> - <layout class="QGridLayout" name="gridLayout_5" columnstretch="0,0,0,0,0"> - <item row="0" column="2"> - <widget class="QLabel" name="labDialFreq"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>USB dial frequency</string> - </property> - <property name="styleSheet"> - <string notr="true">QLabel { - font-family: MS Shell Dlg 2; - font-size: 16pt; - color : yellow; - background-color : black; -} -QLabel[oob="true"] { - background-color: red; -} -</string> - </property> - <property name="text"> - <string>14.078 000</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="margin"> - <number>5</number> - </property> - </widget> - </item> - <item row="1" column="0" rowspan="2"> - <widget class="SignalMeter" name="signal_meter_widget"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - <property name="toolTip"> - <string><html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html></string> - </property> - <property name="accessibleName"> - <string>Rx Signal</string> - </property> - <property name="accessibleDescription"> - <string>30dB recommended when only noise present -Green when good -Red when clipping may occur -Yellow when too low</string> - </property> - <property name="frameShape"> - <enum>QFrame::Panel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Sunken</enum> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QWidget" name="DX_controls_widget" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="palette"> - <palette> - <active> - <colorrole role="Base"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>252</red> - <green>252</green> - <blue>252</blue> - </color> - </brush> - </colorrole> - <colorrole role="Window"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>159</red> - <green>175</green> - <blue>213</blue> - </color> - </brush> - </colorrole> - </active> - <inactive> - <colorrole role="Base"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>252</red> - <green>252</green> - <blue>252</blue> - </color> - </brush> - </colorrole> - <colorrole role="Window"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>159</red> - <green>175</green> - <blue>213</blue> - </color> - </brush> - </colorrole> - </inactive> - <disabled> - <colorrole role="Base"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>159</red> - <green>175</green> - <blue>213</blue> - </color> - </brush> - </colorrole> - <colorrole role="Window"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>159</red> - <green>175</green> - <blue>213</blue> - </color> - </brush> - </colorrole> - </disabled> - </palette> - </property> - <property name="autoFillBackground"> - <bool>true</bool> - </property> - <property name="text"> - <string>DX Call</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="margin"> - <number>5</number> - </property> - <property name="indent"> - <number>2</number> - </property> - <property name="buddy"> - <cstring>dxCallEntry</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="label_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="palette"> - <palette> - <active> - <colorrole role="Base"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>252</red> - <green>252</green> - <blue>252</blue> - </color> - </brush> - </colorrole> - <colorrole role="Window"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>159</red> - <green>175</green> - <blue>213</blue> - </color> - </brush> - </colorrole> - </active> - <inactive> - <colorrole role="Base"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>252</red> - <green>252</green> - <blue>252</blue> - </color> - </brush> - </colorrole> - <colorrole role="Window"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>159</red> - <green>175</green> - <blue>213</blue> - </color> - </brush> - </colorrole> - </inactive> - <disabled> - <colorrole role="Base"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>159</red> - <green>175</green> - <blue>213</blue> - </color> - </brush> - </colorrole> - <colorrole role="Window"> - <brush brushstyle="SolidPattern"> - <color alpha="255"> - <red>159</red> - <green>175</green> - <blue>213</blue> - </color> - </brush> - </colorrole> - </disabled> - </palette> - </property> - <property name="autoFillBackground"> - <bool>true</bool> - </property> - <property name="text"> - <string>DX Grid</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="margin"> - <number>5</number> - </property> - <property name="indent"> - <number>2</number> - </property> - <property name="buddy"> - <cstring>dxGridEntry</cstring> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLineEdit" name="dxCallEntry"> - <property name="toolTip"> - <string>Callsign of station to be worked</string> - </property> - <property name="text"> - <string/> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QPushButton" name="lookupButton"> - <property name="toolTip"> - <string>Search for callsign in database</string> - </property> - <property name="text"> - <string>&Lookup</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="dxGridEntry"> - <property name="toolTip"> - <string>Locator of station to be worked</string> - </property> - <property name="text"> - <string/> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="2" column="0" colspan="2"> - <widget class="QLabel" name="labAz"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="autoFillBackground"> - <bool>true</bool> - </property> - <property name="text"> - <string>Az: 251 16553 km</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="indent"> - <number>4</number> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QPushButton" name="addButton"> - <property name="toolTip"> - <string>Add callsign and locator to database</string> - </property> - <property name="text"> - <string>Add</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="0" column="4"> - <widget class="QLabel" name="label"> - <property name="text"> - <string> Pwr</string> - </property> - </widget> - </item> + <layout class="QGridLayout" name="gridLayout_5" rowstretch="1,0,1,1"> <item row="0" column="1" alignment="Qt::AlignHCenter|Qt::AlignVCenter"> <widget class="QPushButton" name="readFreq"> <property name="enabled"> @@ -947,34 +600,6 @@ QPushButton[state="ok"] { </property> </widget> </item> - <item row="1" column="4" rowspan="2"> - <widget class="QSlider" name="outAttenuation"> - <property name="toolTip"> - <string>Adjust Tx audio level</string> - </property> - <property name="maximum"> - <number>450</number> - </property> - <property name="value"> - <number>0</number> - </property> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="invertedAppearance"> - <bool>true</bool> - </property> - <property name="invertedControls"> - <bool>true</bool> - </property> - <property name="tickPosition"> - <enum>QSlider::TicksBelow</enum> - </property> - <property name="tickInterval"> - <number>50</number> - </property> - </widget> - </item> <item row="0" column="0"> <widget class="QComboBox" name="bandComboBox"> <property name="toolTip"> @@ -997,46 +622,7 @@ QPushButton[state="ok"] { </property> </widget> </item> - <item row="2" column="2"> - <widget class="QLabel" name="labUTC"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="styleSheet"> - <string notr="true">QLabel { - font-family: MS Shell Dlg 2; - font-size: 16pt; - background-color : black; - color : yellow; -}</string> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Sunken</enum> - </property> - <property name="lineWidth"> - <number>2</number> - </property> - <property name="midLineWidth"> - <number>0</number> - </property> - <property name="text"> - <string><html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html></string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="margin"> - <number>5</number> - </property> - </widget> - </item> - <item row="0" column="3" rowspan="3"> + <item row="0" column="3" rowspan="4"> <widget class="QStackedWidget" name="controls_stack_widget"> <property name="currentIndex"> <number>0</number> @@ -1072,152 +658,7 @@ QPushButton[state="ok"] { </property> <item> <layout class="QGridLayout" name="gridLayout_3"> - <item row="1" column="1"> - <widget class="QCheckBox" name="cbHoldTxFreq"> - <property name="toolTip"> - <string><html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html></string> - </property> - <property name="accessibleDescription"> - <string>Check to keep Tx frequency fixed when double-clicking on decoded text.</string> - </property> - <property name="text"> - <string>Hold Tx Freq</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QSpinBox" name="RxFreqSpinBox"> - <property name="toolTip"> - <string>Audio Rx frequency</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="suffix"> - <string> Hz</string> - </property> - <property name="prefix"> - <string>Rx </string> - </property> - <property name="minimum"> - <number>200</number> - </property> - <property name="maximum"> - <number>5000</number> - </property> - <property name="value"> - <number>1500</number> - </property> - </widget> - </item> - <item row="2" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QPushButton" name="pbR2T"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>50</width> - <height>20</height> - </size> - </property> - <property name="toolTip"> - <string>Set Tx frequency to Rx Frequency</string> - </property> - <property name="text"> - <string>â–²</string> - </property> - </widget> - </item> - <item> - <widget class="HintedSpinBox" name="sbFtol"> - <property name="toolTip"> - <string>Frequency tolerance (Hz)</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="prefix"> - <string>F Tol </string> - </property> - <property name="minimum"> - <number>10</number> - </property> - <property name="maximum"> - <number>1000</number> - </property> - <property name="value"> - <number>10</number> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pbT2R"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>50</width> - <height>20</height> - </size> - </property> - <property name="toolTip"> - <string>Set Rx frequency to Tx Frequency</string> - </property> - <property name="text"> - <string>â–¼</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="5" column="1"> - <widget class="QSpinBox" name="syncSpinBox"> - <property name="toolTip"> - <string><html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html></string> - </property> - <property name="accessibleDescription"> - <string>Synchronizing threshold. Lower numbers accept weaker sync signals.</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="prefix"> - <string>Sync </string> - </property> - <property name="minimum"> - <number>-1</number> - </property> - <property name="maximum"> - <number>10</number> - </property> - <property name="value"> - <number>1</number> - </property> - </widget> - </item> - <item row="7" column="0" colspan="2"> + <item row="18" column="0" colspan="2"> <layout class="QHBoxLayout" name="horizontalLayout_5"> <item> <widget class="QCheckBox" name="cbShMsgs"> @@ -1286,20 +727,29 @@ QPushButton[state="ok"] { </item> </layout> </item> - <item row="0" column="0"> - <widget class="QCheckBox" name="txFirstCheckBox"> + <item row="8" column="1"> + <widget class="LettersSpinBox" name="sbSubmode"> <property name="toolTip"> - <string><html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences.</p></body></html></string> + <string><html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html></string> </property> <property name="accessibleDescription"> - <string>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences.</string> + <string>Submode determines tone spacing; A is narrowest.</string> </property> - <property name="text"> - <string>Tx even/1st</string> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="prefix"> + <string>Submode </string> + </property> + <property name="minimum"> + <number>0</number> + </property> + <property name="maximum"> + <number>7</number> </property> </widget> </item> - <item row="6" column="0" colspan="2"> + <item row="17" column="0" colspan="2"> <layout class="QHBoxLayout" name="horizontalLayout_11"> <item> <widget class="QSpinBox" name="sbCQTxFreq"> @@ -1352,29 +802,26 @@ Not available to nonstandard callsign holders.</string> </item> </layout> </item> - <item row="4" column="1"> - <widget class="LettersSpinBox" name="sbSubmode"> - <property name="toolTip"> - <string><html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html></string> - </property> - <property name="accessibleDescription"> - <string>Submode determines tone spacing; A is narrowest.</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> + <item row="0" column="1"> + <widget class="QPushButton" name="pbTxMode"> + <property name="enabled"> + <bool>true</bool> </property> - <property name="prefix"> - <string>Submode </string> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="minimum"> - <number>0</number> + <property name="toolTip"> + <string>Toggle Tx mode</string> </property> - <property name="maximum"> - <number>7</number> + <property name="text"> + <string>Tx JT9 @</string> </property> </widget> </item> - <item row="8" column="0" colspan="2"> + <item row="19" column="0" colspan="2"> <layout class="QHBoxLayout" name="horizontalLayout_15"> <item> <widget class="QLabel" name="labDXped"> @@ -1415,6 +862,7 @@ Not available to nonstandard callsign holders.</string> <widget class="QPushButton" name="pbBestSP"> <property name="styleSheet"> <string notr="true">QPushButton:checked { + color: rgb(0, 0, 0); background-color: red; border-style: outset; border-width: 1px; @@ -1449,82 +897,178 @@ When not checked you can view the calibration results.</string> </item> </layout> </item> - <item row="4" column="0"> - <widget class="QSpinBox" name="rptSpinBox"> + <item row="1" column="0"> + <widget class="QSpinBox" name="TxFreqSpinBox"> <property name="toolTip"> - <string><html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html></string> + <string>Audio Tx frequency</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="suffix"> + <string> Hz</string> + </property> + <property name="prefix"> + <string>Tx </string> + </property> + <property name="minimum"> + <number>200</number> + </property> + <property name="maximum"> + <number>5000</number> + </property> + <property name="value"> + <number>1500</number> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QSpinBox" name="sbSerialNumber"> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="prefix"> + <string>Tx# </string> + </property> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>4095</number> + </property> + </widget> + </item> + <item row="20" column="0"> + <spacer name="verticalSpacer_4"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="1"> + <widget class="QCheckBox" name="cbHoldTxFreq"> + <property name="toolTip"> + <string><html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html></string> </property> <property name="accessibleDescription"> - <string>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</string> + <string>Check to keep Tx frequency fixed when double-clicking on decoded text.</string> + </property> + <property name="text"> + <string>Hold Tx Freq</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QCheckBox" name="txFirstCheckBox"> + <property name="toolTip"> + <string><html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences.</p></body></html></string> + </property> + <property name="accessibleDescription"> + <string>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences.</string> + </property> + <property name="text"> + <string>Tx even/1st</string> + </property> + </widget> + </item> + <item row="9" column="1"> + <widget class="QSpinBox" name="syncSpinBox"> + <property name="toolTip"> + <string><html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html></string> + </property> + <property name="accessibleDescription"> + <string>Synchronizing threshold. Lower numbers accept weaker sync signals.</string> </property> <property name="alignment"> <set>Qt::AlignCenter</set> </property> <property name="prefix"> - <string> Report </string> + <string>Sync </string> </property> <property name="minimum"> - <number>-50</number> + <number>-1</number> </property> <property name="maximum"> - <number>49</number> + <number>10</number> </property> <property name="value"> - <number>-15</number> + <number>1</number> </property> </widget> </item> - <item row="5" column="0"> - <widget class="RestrictedSpinBox" name="sbTR"> + <item row="6" column="1"> + <widget class="QLabel" name="labNextCall"> <property name="toolTip"> - <string><html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html></string> + <string><html><head/><body><p>Double-click on another caller to queue that call for your next QSO.</p></body></html></string> </property> <property name="accessibleDescription"> - <string>Tx/Rx or Frequency calibration sequence length</string> + <string>Double-click on another caller to queue that call for your next QSO.</string> + </property> + <property name="text"> + <string>Next Call</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QSpinBox" name="sbF_High"> <property name="alignment"> <set>Qt::AlignCenter</set> </property> <property name="suffix"> - <string> s</string> + <string/> </property> <property name="prefix"> - <string>T/R </string> + <string>F High </string> </property> <property name="minimum"> - <number>5</number> + <number>100</number> </property> <property name="maximum"> - <number>30</number> + <number>5000</number> + </property> + <property name="singleStep"> + <number>100</number> </property> <property name="value"> - <number>30</number> + <number>1400</number> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QPushButton" name="pbTxMode"> - <property name="enabled"> - <bool>true</bool> + <item row="4" column="1"> + <widget class="QSpinBox" name="sbF_Low"> + <property name="alignment"> + <set>Qt::AlignCenter</set> </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <property name="prefix"> + <string>F Low </string> </property> - <property name="toolTip"> - <string>Toggle Tx mode</string> + <property name="minimum"> + <number>100</number> </property> - <property name="text"> - <string>Tx JT9 @</string> + <property name="maximum"> + <number>5000</number> + </property> + <property name="singleStep"> + <number>100</number> + </property> + <property name="value"> + <number>600</number> </property> </widget> </item> - <item row="1" column="0"> - <widget class="QSpinBox" name="TxFreqSpinBox"> + <item row="5" column="0"> + <widget class="QSpinBox" name="RxFreqSpinBox"> <property name="toolTip"> - <string>Audio Tx frequency</string> + <string>Audio Rx frequency</string> </property> <property name="alignment"> <set>Qt::AlignCenter</set> @@ -1533,7 +1077,7 @@ When not checked you can view the calibration results.</string> <string> Hz</string> </property> <property name="prefix"> - <string>Tx </string> + <string>Rx </string> </property> <property name="minimum"> <number>200</number> @@ -1546,49 +1090,145 @@ When not checked you can view the calibration results.</string> </property> </widget> </item> - <item row="9" column="0"> - <spacer name="verticalSpacer_4"> - <property name="orientation"> - <enum>Qt::Vertical</enum> + <item row="4" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QPushButton" name="pbR2T"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>20</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>50</width> + <height>20</height> + </size> + </property> + <property name="toolTip"> + <string>Set Tx frequency to Rx Frequency</string> + </property> + <property name="accessibleName"> + <string>Set Tx frequency to Rx Frequency</string> + </property> + <property name="text"> + <string>â–²</string> + </property> + </widget> + </item> + <item> + <widget class="HintedSpinBox" name="sbFtol"> + <property name="toolTip"> + <string>Frequency tolerance (Hz)</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="prefix"> + <string>F Tol </string> + </property> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>1000</number> + </property> + <property name="value"> + <number>10</number> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pbT2R"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>20</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>50</width> + <height>20</height> + </size> + </property> + <property name="toolTip"> + <string>Set Rx frequency to Tx Frequency</string> + </property> + <property name="accessibleName"> + <string>Set Rx frequency to Tx Frequency</string> + </property> + <property name="text"> + <string>â–¼</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="6" column="0"> + <widget class="QSpinBox" name="rptSpinBox"> + <property name="toolTip"> + <string><html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html></string> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> + <property name="accessibleDescription"> + <string>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</string> </property> - </spacer> - </item> - <item row="3" column="1"> - <widget class="QSpinBox" name="sbSerialNumber"> <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + <set>Qt::AlignCenter</set> </property> <property name="prefix"> - <string>Tx# </string> + <string> Report </string> </property> <property name="minimum"> - <number>1</number> + <number>-50</number> </property> <property name="maximum"> - <number>4095</number> + <number>49</number> + </property> + <property name="value"> + <number>-15</number> </property> </widget> </item> - <item row="2" column="1"> - <widget class="QLabel" name="labNextCall"> + <item row="7" column="0"> + <widget class="RestrictedSpinBox" name="sbTR"> <property name="toolTip"> - <string><html><head/><body><p>Double-click on another caller to queue that call for your next QSO.</p></body></html></string> + <string><html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html></string> </property> <property name="accessibleDescription"> - <string>Double-click on another caller to queue that call for your next QSO.</string> - </property> - <property name="text"> - <string>Next Call</string> + <string>Tx/Rx or Frequency calibration sequence length</string> </property> <property name="alignment"> <set>Qt::AlignCenter</set> </property> + <property name="suffix"> + <string> s</string> + </property> + <property name="prefix"> + <string>T/R </string> + </property> + <property name="minimum"> + <number>5</number> + </property> + <property name="maximum"> + <number>1800</number> + </property> + <property name="value"> + <number>30</number> + </property> </widget> </item> </layout> @@ -1920,274 +1560,9 @@ list. The list can be maintained in Settings (F2).</string> </item> </layout> </widget> - <widget class="QWidget" name="tab_2"> - <attribute name="title"> - <string>2</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <property name="leftMargin"> - <number>6</number> - </property> - <property name="topMargin"> - <number>6</number> - </property> - <property name="rightMargin"> - <number>6</number> - </property> - <property name="bottomMargin"> - <number>6</number> - </property> - <item> - <layout class="QGridLayout" name="gridLayout_4"> - <property name="horizontalSpacing"> - <number>0</number> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label_9"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="text"> - <string>Calling CQ </string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QPushButton" name="pbCallCQ"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Generate a CQ message</string> - </property> - <property name="text"> - <string>CQ</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QPushButton" name="pbSendRRR"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Generate message with RRR</string> - </property> - <property name="text"> - <string>RRR</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QPushButton" name="pbAnswerCaller"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Generate message with report</string> - </property> - <property name="text"> - <string>dB</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="label_10"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="text"> - <string>Answering CQ</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QPushButton" name="pbAnswerCQ"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Generate message for replying to a CQ</string> - </property> - <property name="text"> - <string>Grid</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QPushButton" name="pbSendReport"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Generate message with R+report</string> - </property> - <property name="text"> - <string>R+dB</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QPushButton" name="pbSend73"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Generate message with 73</string> - </property> - <property name="text"> - <string>73</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLineEdit" name="genMsg"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>3</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="rbGenMsg"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>26</height> - </size> - </property> - <property name="toolTip"> - <string>Send this standard (generated) message</string> - </property> - <property name="text"> - <string>Gen msg</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QComboBox" name="freeTextMsg"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>3</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>150</width> - <height>0</height> - </size> - </property> - <property name="toolTip"> - <string>Enter a free text message (maximum 13 characters) -or select a predefined macro from the dropdown list. -Press ENTER to add the current text to the predefined -list. The list can be maintained in Settings (F2).</string> - </property> - <property name="editable"> - <bool>true</bool> - </property> - <property name="insertPolicy"> - <enum>QComboBox::InsertAtBottom</enum> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="rbFreeText"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Send this free-text message (max 13 characters)</string> - </property> - <property name="text"> - <string>Free msg</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> <widget class="QWidget" name="tab_3"> <attribute name="title"> - <string>3</string> + <string>2</string> </attribute> <layout class="QGridLayout" name="gridLayout_11"> <item row="0" column="1" rowspan="2"> @@ -2564,7 +1939,32 @@ list. The list can be maintained in Settings (F2).</string> <number>1400</number> </property> <property name="maximum"> - <number>1700</number> + <number>1600</number> + </property> + <property name="value"> + <number>1500</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="sbFST4W_RxFreq"> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="suffix"> + <string> Hz</string> + </property> + <property name="prefix"> + <string>Rx </string> + </property> + <property name="minimum"> + <number>100</number> + </property> + <property name="maximum"> + <number>4900</number> + </property> + <property name="singleStep"> + <number>100</number> </property> <property name="value"> <number>1500</number> @@ -2572,9 +1972,152 @@ list. The list can be maintained in Settings (F2).</string> </widget> </item> <item> + <widget class="HintedSpinBox" name="sbFST4W_FTol"> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="suffix"> + <string> Hz</string> + </property> + <property name="prefix"> + <string>F Tol </string> + </property> + <property name="minimum"> + <number>100</number> + </property> + <property name="maximum"> + <number>500</number> + </property> + <property name="singleStep"> + <number>100</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="RoundRobin"> + <property name="editable"> + <bool>true</bool> + </property> + <property name="currentIndex"> + <number>0</number> + </property> + <item> + <property name="text"> + <string>Random</string> + </property> + </item> + <item> + <property name="text"> + <string>1/2</string> + </property> + </item> + <item> + <property name="text"> + <string>2/2</string> + </property> + </item> + <item> + <property name="text"> + <string>1/3</string> + </property> + </item> + <item> + <property name="text"> + <string>2/3</string> + </property> + </item> + <item> + <property name="text"> + <string>3/3</string> + </property> + </item> + <item> + <property name="text"> + <string>1/4</string> + </property> + </item> + <item> + <property name="text"> + <string>2/4</string> + </property> + </item> + <item> + <property name="text"> + <string>3/4</string> + </property> + </item> + <item> + <property name="text"> + <string>4/4</string> + </property> + </item> + <item> + <property name="text"> + <string>1/5</string> + </property> + </item> + <item> + <property name="text"> + <string>2/5</string> + </property> + </item> + <item> + <property name="text"> + <string>3/5</string> + </property> + </item> + <item> + <property name="text"> + <string>4/5</string> + </property> + </item> + <item> + <property name="text"> + <string>5/5</string> + </property> + </item> + <item> + <property name="text"> + <string>1/6</string> + </property> + </item> + <item> + <property name="text"> + <string>2/6</string> + </property> + </item> + <item> + <property name="text"> + <string>3/6</string> + </property> + </item> + <item> + <property name="text"> + <string>4/6</string> + </property> + </item> + <item> + <property name="text"> + <string>5/6</string> + </property> + </item> + <item> + <property name="text"> + <string>6/6</string> + </property> + </item> + </widget> + </item> + <item> <widget class="QSpinBox" name="sbTxPercent"> <property name="toolTip"> - <string>Percentage of 2-minute sequences devoted to transmitting.</string> + <string>Percentage of minute sequences devoted to transmitting.</string> + </property> + <property name="styleSheet"> + <string notr="true">QSpinBox:enabled[notx="true"] { + color: rgb(0, 0, 0); + background-color: rgb(255, 255, 0); +}</string> </property> <property name="alignment"> <set>Qt::AlignCenter</set> @@ -2591,6 +2134,25 @@ list. The list can be maintained in Settings (F2).</string> </widget> </item> <item> + <widget class="RestrictedSpinBox" name="sbTR_FST4W"> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="suffix"> + <string> s</string> + </property> + <property name="prefix"> + <string>T/R </string> + </property> + <property name="minimum"> + <number>15</number> + </property> + <property name="maximum"> + <number>1800</number> + </property> + </widget> + </item> + <item> <widget class="QGroupBox" name="band_hopping_group_box"> <property name="title"> <string>Band Hopping</string> @@ -2625,6 +2187,12 @@ list. The list can be maintained in Settings (F2).</string> <property name="toolTip"> <string>Upload decoded messages to WSPRnet.org.</string> </property> + <property name="styleSheet"> + <string notr="true">QCheckBox:unchecked { + color: rgb(0, 0, 0); + background-color: rgb(255, 255, 0); +}</string> + </property> <property name="text"> <string>Upload spots</string> </property> @@ -2641,7 +2209,7 @@ list. The list can be maintained in Settings (F2).</string> <string>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</string> </property> <property name="text"> - <string>Prefer type 1 messages</string> + <string>Prefer Type 1 messages</string> </property> <property name="checked"> <bool>true</bool> @@ -2660,10 +2228,11 @@ list. The list can be maintained in Settings (F2).</string> <item> <widget class="QPushButton" name="pbTxNext"> <property name="toolTip"> - <string>Transmit during the next 2-minute sequence.</string> + <string><html><head/><body><p>Transmit during the next sequence.</p></body></html></string> </property> <property name="styleSheet"> <string notr="true">QPushButton:checked { + color: rgb(0, 0, 0); background-color: red; border-style: outset; border-width: 1px; @@ -2749,6 +2318,442 @@ list. The list can be maintained in Settings (F2).</string> </widget> </widget> </item> + <item row="0" column="2"> + <widget class="QLabel" name="labDialFreq"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>USB dial frequency</string> + </property> + <property name="styleSheet"> + <string notr="true">QLabel { + font-family: MS Shell Dlg 2; + font-size: 16pt; + color : yellow; + background-color : black; +} +QLabel[oob="true"] { + background-color: red; +}</string> + </property> + <property name="text"> + <string>14.078 000</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item row="0" column="4"> + <widget class="QLabel" name="label"> + <property name="text"> + <string> Pwr</string> + </property> + </widget> + </item> + <item row="3" column="2"> + <widget class="QLabel" name="labUTC"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QLabel { + font-family: MS Shell Dlg 2; + font-size: 16pt; + background-color : black; + color : yellow; +}</string> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + <property name="lineWidth"> + <number>2</number> + </property> + <property name="midLineWidth"> + <number>0</number> + </property> + <property name="text"> + <string><html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html></string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item row="2" column="0" rowspan="2"> + <widget class="SignalMeter" name="signal_meter_widget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>100</width> + <height>16777215</height> + </size> + </property> + <property name="toolTip"> + <string><html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html></string> + </property> + <property name="accessibleName"> + <string>Rx Signal</string> + </property> + <property name="accessibleDescription"> + <string>30dB recommended when only noise present +Green when good +Red when clipping may occur +Yellow when too low</string> + </property> + <property name="frameShape"> + <enum>QFrame::Panel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + </widget> + </item> + <item row="1" column="4" rowspan="3"> + <widget class="QSlider" name="outAttenuation"> + <property name="toolTip"> + <string>Adjust Tx audio level</string> + </property> + <property name="maximum"> + <number>450</number> + </property> + <property name="value"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="invertedAppearance"> + <bool>true</bool> + </property> + <property name="invertedControls"> + <bool>true</bool> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBelow</enum> + </property> + <property name="tickInterval"> + <number>50</number> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QSpinBox" name="sbNB"> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="prefix"> + <string>NB </string> + </property> + <property name="minimum"> + <number>-2</number> + </property> + <property name="maximum"> + <number>25</number> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QWidget" name="DX_controls_widget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item row="1" column="0"> + <widget class="QLabel" name="label_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>252</red> + <green>252</green> + <blue>252</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>159</red> + <green>175</green> + <blue>213</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>252</red> + <green>252</green> + <blue>252</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>159</red> + <green>175</green> + <blue>213</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>159</red> + <green>175</green> + <blue>213</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>159</red> + <green>175</green> + <blue>213</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="autoFillBackground"> + <bool>true</bool> + </property> + <property name="text"> + <string>DX Call</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + <property name="indent"> + <number>2</number> + </property> + <property name="buddy"> + <cstring>dxCallEntry</cstring> + </property> + </widget> + </item> + <item row="3" column="0" colspan="2"> + <widget class="QLabel" name="labAz"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="autoFillBackground"> + <bool>true</bool> + </property> + <property name="text"> + <string>Az: 251 16553 km</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="indent"> + <number>4</number> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLineEdit" name="dxCallEntry"> + <property name="toolTip"> + <string>Callsign of station to be worked</string> + </property> + <property name="text"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLabel" name="label_4"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>252</red> + <green>252</green> + <blue>252</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>159</red> + <green>175</green> + <blue>213</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>252</red> + <green>252</green> + <blue>252</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>159</red> + <green>175</green> + <blue>213</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>159</red> + <green>175</green> + <blue>213</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>159</red> + <green>175</green> + <blue>213</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="autoFillBackground"> + <bool>true</bool> + </property> + <property name="text"> + <string>DX Grid</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + <property name="indent"> + <number>2</number> + </property> + <property name="buddy"> + <cstring>dxGridEntry</cstring> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QPushButton" name="lookupButton"> + <property name="toolTip"> + <string>Search for callsign in database</string> + </property> + <property name="text"> + <string>&Lookup</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLineEdit" name="dxGridEntry"> + <property name="toolTip"> + <string>Locator of station to be worked</string> + </property> + <property name="text"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QPushButton" name="addButton"> + <property name="toolTip"> + <string>Add callsign and locator to database</string> + </property> + <property name="text"> + <string>Add</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </item> </layout> @@ -2827,7 +2832,7 @@ list. The list can be maintained in Settings (F2).</string> <addaction name="actionOnline_User_Guide"/> <addaction name="actionLocal_User_Guide"/> <addaction name="actionFT8_DXpedition_Mode_User_Guide"/> - <addaction name="actionQuick_Start_Guide_v2"/> + <addaction name="actionQuick_Start_Guide"/> <addaction name="download_samples_action"/> <addaction name="separator"/> <addaction name="actionKeyboard_shortcuts"/> @@ -2842,6 +2847,8 @@ list. The list can be maintained in Settings (F2).</string> <property name="title"> <string>Mode</string> </property> + <addaction name="actionFST4"/> + <addaction name="actionFST4W"/> <addaction name="actionFT4"/> <addaction name="actionFT8"/> <addaction name="actionJT4"/> @@ -2854,7 +2861,6 @@ list. The list can be maintained in Settings (F2).</string> <addaction name="actionMSK144"/> <addaction name="separator"/> <addaction name="actionWSPR"/> - <addaction name="actionWSPR_LF"/> <addaction name="separator"/> <addaction name="actionEcho"/> <addaction name="separator"/> @@ -2896,17 +2902,6 @@ list. The list can be maintained in Settings (F2).</string> <enum>QAction::QuitRole</enum> </property> </action> - <action name="actionDeviceSetup"> - <property name="checkable"> - <bool>false</bool> - </property> - <property name="text"> - <string>Configuration</string> - </property> - <property name="shortcut"> - <string>F2</string> - </property> - </action> <action name="actionAbout"> <property name="text"> <string>About WSJT-X</string> @@ -3035,14 +3030,6 @@ list. The list can be maintained in Settings (F2).</string> <string>Deep</string> </property> </action> - <action name="actionMonitor_OFF_at_startup"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Monitor OFF at startup</string> - </property> - </action> <action name="actionErase_ALL_TXT"> <property name="text"> <string>Erase ALL.TXT</string> @@ -3053,97 +3040,6 @@ list. The list can be maintained in Settings (F2).</string> <string>Erase wsjtx_log.adi</string> </property> </action> - <action name="actionConvert_JT9_x_to_RTTY"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Convert mode to RTTY for logging</string> - </property> - </action> - <action name="actionLog_dB_reports_to_Comments"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Log dB reports to Comments</string> - </property> - </action> - <action name="actionPrompt_to_log_QSO"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Prompt me to log QSO</string> - </property> - </action> - <action name="actionBlank_line_between_decoding_periods"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Blank line between decoding periods</string> - </property> - </action> - <action name="actionClear_DX_Call_and_Grid_after_logging"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Clear DX Call and Grid after logging</string> - </property> - </action> - <action name="actionDisplay_distance_in_miles"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Display distance in miles</string> - </property> - </action> - <action name="actionDouble_click_on_call_sets_Tx_Enable"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Double-click on call sets Tx Enable</string> - </property> - <property name="shortcut"> - <string>F7</string> - </property> - </action> - <action name="action_73TxDisable"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Tx disabled after sending 73</string> - </property> - </action> - <action name="actionRunaway_Tx_watchdog"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Runaway Tx watchdog</string> - </property> - </action> - <action name="actionAllow_multiple_instances"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Allow multiple instances</string> - </property> - </action> - <action name="actionLockTxFreq"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Tx freq locked to Rx freq</string> - </property> - </action> <action name="actionJT65"> <property name="checkable"> <bool>true</bool> @@ -3160,30 +3056,6 @@ list. The list can be maintained in Settings (F2).</string> <string>JT9+JT65</string> </property> </action> - <action name="actionTx2QSO"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Tx messages to Rx Frequency window</string> - </property> - </action> - <action name="actionGray1"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Gray1</string> - </property> - </action> - <action name="actionEnable_DXCC_entity"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Show DXCC entity and worked B4 status</string> - </property> - </action> <action name="actionAstronomical_data"> <property name="checkable"> <bool>true</bool> @@ -3363,23 +3235,6 @@ list. The list can be maintained in Settings (F2).</string> <string>Equalization tools ...</string> </property> </action> - <action name="actionWSPR_LF"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>WSPR-LF</string> - </property> - <property name="toolTip"> - <string>Experimental LF/MF mode</string> - </property> - <property name="visible"> - <bool>false</bool> - </property> - </action> <action name="actionFT8"> <property name="checkable"> <bool>true</bool> @@ -3443,19 +3298,14 @@ list. The list can be maintained in Settings (F2).</string> <string>Color highlighting scheme</string> </property> </action> - <action name="actionContest_Log"> - <property name="text"> - <string>Contest Log</string> - </property> - </action> <action name="actionExport_Cabrillo_log"> <property name="text"> <string>Export Cabrillo log ...</string> </property> </action> - <action name="actionQuick_Start_Guide_v2"> + <action name="actionQuick_Start_Guide"> <property name="text"> - <string>Quick-Start Guide to WSJT-X 2.0</string> + <string>Quick-Start Guide to FST4 and FST4W</string> </property> </action> <action name="contest_log_action"> @@ -3476,6 +3326,22 @@ list. The list can be maintained in Settings (F2).</string> <string>FT4</string> </property> </action> + <action name="actionFST4"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>FST4</string> + </property> + </action> + <action name="actionFST4W"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>FST4W</string> + </property> + </action> </widget> <layoutdefault spacing="6" margin="11"/> <customwidgets> @@ -3532,8 +3398,6 @@ list. The list can be maintained in Settings (F2).</string> <tabstop>addButton</tabstop> <tabstop>txFirstCheckBox</tabstop> <tabstop>TxFreqSpinBox</tabstop> - <tabstop>rptSpinBox</tabstop> - <tabstop>sbTR</tabstop> <tabstop>sbCQTxFreq</tabstop> <tabstop>cbCQTx</tabstop> <tabstop>cbShMsgs</tabstop> @@ -3544,16 +3408,6 @@ list. The list can be maintained in Settings (F2).</string> <tabstop>sbSubmode</tabstop> <tabstop>syncSpinBox</tabstop> <tabstop>tabWidget</tabstop> - <tabstop>pbCallCQ</tabstop> - <tabstop>pbAnswerCQ</tabstop> - <tabstop>pbAnswerCaller</tabstop> - <tabstop>pbSendReport</tabstop> - <tabstop>pbSendRRR</tabstop> - <tabstop>pbSend73</tabstop> - <tabstop>genMsg</tabstop> - <tabstop>rbGenMsg</tabstop> - <tabstop>freeTextMsg</tabstop> - <tabstop>rbFreeText</tabstop> <tabstop>outAttenuation</tabstop> <tabstop>genStdMsgsPushButton</tabstop> <tabstop>tx1</tabstop> diff --git a/widgets/plotter.cpp b/widgets/plotter.cpp index c5ade99a..d612b2eb 100644 --- a/widgets/plotter.cpp +++ b/widgets/plotter.cpp @@ -48,7 +48,8 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor m_Percent2DScreen0 {0}, m_rxFreq {1020}, m_txFreq {0}, - m_startFreq {0} + m_startFreq {0}, + m_tol {100} { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setFocusPolicy(Qt::StrongFocus); @@ -56,6 +57,7 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor setAutoFillBackground(false); setAttribute(Qt::WA_OpaquePaintEvent, false); setAttribute(Qt::WA_NoSystemBackground, true); + setMouseTracking(true); m_bReplot=false; // contextual pop up menu @@ -161,7 +163,6 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) int iz=XfromFreq(5000.0); int jz=iz*m_binsPerPixel; m_fMax=FreqfromX(iz); - if(bScroll and swide[0]<1.e29) { flat4_(swide,&iz,&m_Flatten); if(!m_bReplot) flat4_(&dec_data.savg[j0],&jz,&m_Flatten); @@ -184,7 +185,6 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) if (swide[i]<1.e29) painter1.setPen(g_ColorTbl[y1]); painter1.drawPoint(i,m_j); } - m_line++; float y2min=1.e30; @@ -211,7 +211,7 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) for(int k=0; k<m_binsPerPixel; k++) { sum+=spectra_.syellow[j++]; } - y2=gain2d*sum/m_binsPerPixel + m_plot2dZero; + y2=2.0*gain2d*sum/m_binsPerPixel + m_plot2dZero; } if(m_bReference) { //Reference (red) @@ -330,7 +330,6 @@ void CPlotter::DrawOverlay() //DrawOverlay() double df = m_binsPerPixel*m_fftBinWidth; QPen penOrange(QColor(255,165,0),3); -// QPen penGreen(Qt::green, 3); //Mark Tol range with green line QPen penGreen(QColor(15,153,105), 3); //Mark Tol range or BW with dark green line QPen penRed(Qt::red, 3); //Mark Tx freq with red QPainter painter(&m_OverlayPixmap); @@ -415,7 +414,18 @@ void CPlotter::DrawOverlay() //DrawOverlay() float bw=9.0*12000.0/m_nsps; //JT9 if(m_mode=="FT4") bw=3*12000.0/576.0; //FT4 ### (3x, or 4x???) ### if(m_mode=="FT8") bw=7*12000.0/1920.0; //FT8 - + if(m_mode.startsWith("FST4")) { + int h=int(pow(2.0,m_nSubMode)); + int nsps=800; + if(m_TRperiod==30) nsps=1680; + if(m_TRperiod==60) nsps=4000; + if(m_TRperiod==120) nsps=8400; + if(m_TRperiod==300) nsps=21504; + if(m_TRperiod==900) nsps=66560; + if(m_TRperiod==1800) nsps=134400; + float baud=12000.0/nsps; + bw=3.0*h*baud; + } if(m_mode=="JT4") { //JT4 bw=3*11025.0/2520.0; //Max tone spacing (3/4 of actual BW) if(m_nSubMode==1) bw=2*bw; @@ -471,13 +481,13 @@ void CPlotter::DrawOverlay() //DrawOverlay() if(m_mode=="WSPR") { x1=XfromFreq(1400); x2=XfromFreq(1600); - painter0.drawLine(x1,29,x2,29); + painter0.drawLine(x1,26,x2,26); } - if(m_mode=="WSPR-LF") { - x1=XfromFreq(1600); - x2=XfromFreq(1700); - painter0.drawLine(x1,29,x2,29); + if(m_mode=="FST4W") { + x1=XfromFreq(m_rxFreq-m_tol); + x2=XfromFreq(m_rxFreq+m_tol); + painter0.drawLine(x1,26,x2,26); } if(m_mode=="FreqCal") { //FreqCal @@ -492,13 +502,23 @@ void CPlotter::DrawOverlay() //DrawOverlay() int yTxTop=12; int yRxBottom=yTxTop + 2*yh + 4; if(m_mode=="JT9" or m_mode=="JT65" or m_mode=="JT9+JT65" - or m_mode=="QRA64" or m_mode=="FT8" or m_mode=="FT4") { + or m_mode=="QRA64" or m_mode=="FT8" or m_mode=="FT4" + or m_mode.startsWith("FST4")) { + + if(m_mode=="FST4" and !m_bSingleDecode) { + x1=XfromFreq(m_nfa); + x2=XfromFreq(m_nfb); + painter0.drawLine(x1,25,x1+5,30); // Mark FST4 F_Low + painter0.drawLine(x1,25,x1+5,20); + painter0.drawLine(x2,25,x2-5,30); // Mark FST4 F_High + painter0.drawLine(x2,25,x2-5,20); + } if(m_mode=="QRA64" or (m_mode=="JT65" and m_bVHF)) { painter0.setPen(penGreen); x1=XfromFreq(m_rxFreq-m_tol); x2=XfromFreq(m_rxFreq+m_tol); - painter0.drawLine(x1,28,x2,28); + painter0.drawLine(x1,26,x2,26); x1=XfromFreq(m_rxFreq); painter0.drawLine(x1,24,x1,30); @@ -523,13 +543,17 @@ void CPlotter::DrawOverlay() //DrawOverlay() painter0.drawLine(x1,yRxBottom-yh,x1,yRxBottom); painter0.drawLine(x1,yRxBottom,x2,yRxBottom); painter0.drawLine(x2,yRxBottom-yh,x2,yRxBottom); - + if(m_mode.startsWith("FST4")) { + x1=XfromFreq(m_rxFreq-m_tol); + x2=XfromFreq(m_rxFreq+m_tol); + painter0.drawLine(x1,26,x2,26); // Mark the Tol range + } } } if(m_mode=="JT9" or m_mode=="JT65" or m_mode=="JT9+JT65" or m_mode.mid(0,4)=="WSPR" or m_mode=="QRA64" or m_mode=="FT8" - or m_mode=="FT4") { + or m_mode=="FT4" or m_mode.startsWith("FST4")) { painter0.setPen(penRed); x1=XfromFreq(m_txFreq); x2=XfromFreq(m_txFreq+bw); @@ -538,11 +562,6 @@ void CPlotter::DrawOverlay() //DrawOverlay() x1=XfromFreq(m_txFreq-0.5*bw); x2=XfromFreq(m_txFreq+0.5*bw); } - if(m_mode=="WSPR-LF") { - bw=3*12000.0/8640.0; //WSPR-LF - x1=XfromFreq(m_txFreq-0.5*bw); - x2=XfromFreq(m_txFreq+0.5*bw); - } // Draw the red "goal post" painter0.drawLine(x1,yTxTop,x1,yTxTop+yh); painter0.drawLine(x1,yTxTop,x2,yTxTop); @@ -644,7 +663,9 @@ void CPlotter::setPlot2dZero(int plot2dZero) //setPlot2dZero void CPlotter::setStartFreq(int f) //SetStartFreq() { m_startFreq=f; + m_fMax=FreqfromX(XfromFreq(5000.0)); resizeEvent(NULL); + DrawOverlay(); update(); } @@ -665,6 +686,7 @@ void CPlotter::setRxRange(int fMin) //setRxRange void CPlotter::setBinsPerPixel(int n) //setBinsPerPixel { m_binsPerPixel = n; + m_fMax=FreqfromX(XfromFreq(5000.0)); DrawOverlay(); //Redraw scales and ticks update(); //trigger a new paintEvent} } @@ -688,9 +710,16 @@ void CPlotter::setRxFreq (int x) //setRxFreq int CPlotter::rxFreq() {return m_rxFreq;} //rxFreq +void CPlotter::mouseMoveEvent (QMouseEvent * event) +{ + int x=event->x(); + QToolTip::showText(event->globalPos(),QString::number(int(FreqfromX(x)))); + QWidget::mouseMoveEvent(event); +} + void CPlotter::mouseReleaseEvent (QMouseEvent * event) { - if (Qt::LeftButton == event->button ()) { + if (Qt::LeftButton == event->button () and m_mode!="FST4W") { int x=event->x(); if(x<0) x=0; if(x>m_Size.width()) x=m_Size.width(); @@ -791,9 +820,22 @@ void CPlotter::setFlatten(bool b1, bool b2) void CPlotter::setTol(int n) //setTol() { m_tol=n; +} + +void CPlotter::setFST4_FreqRange(int fLow,int fHigh) +{ + m_nfa=fLow; + m_nfb=fHigh; DrawOverlay(); + update(); +} + +void CPlotter::setSingleDecode(bool b) +{ + m_bSingleDecode=b; } + void CPlotter::setColours(QVector<QColor> const& cl) { g_ColorTbl = cl; diff --git a/widgets/plotter.h b/widgets/plotter.h index b3eb8585..ac13b540 100644 --- a/widgets/plotter.h +++ b/widgets/plotter.h @@ -13,6 +13,7 @@ #include <QImage> #include <QVector> #include <QColor> +#include <QToolTip> #define VERT_DIVS 7 //specify grid screen divisions #define HORZ_DIVS 20 @@ -82,6 +83,9 @@ public: void drawRed(int ia, int ib, float swide[]); void setVHF(bool bVHF); void setRedFile(QString fRed); + void setFST4_FreqRange(int fLow,int fHigh); + void setSingleDecode(bool b); + bool scaleOK () const {return m_bScaleOK;} signals: void freezeDecode1(int n); @@ -91,6 +95,7 @@ protected: //re-implemented widget event handlers void paintEvent(QPaintEvent *event) override; void resizeEvent(QResizeEvent* event) override; + void mouseMoveEvent(QMouseEvent * event) override; void mouseReleaseEvent (QMouseEvent * event) override; void mouseDoubleClickEvent (QMouseEvent * event) override; @@ -109,6 +114,7 @@ private: bool m_bReference; bool m_bReference0; bool m_bVHF; + bool m_bSingleDecode; float m_fSpan; @@ -123,6 +129,8 @@ private: qint32 m_nSubMode; qint32 m_ia; qint32 m_ib; + qint32 m_nfa; + qint32 m_nfb; QPixmap m_WaterfallPixmap; QPixmap m_2DPixmap; diff --git a/widgets/widegraph.cpp b/widgets/widegraph.cpp index a78874c7..a369f629 100644 --- a/widgets/widegraph.cpp +++ b/widgets/widegraph.cpp @@ -294,7 +294,7 @@ void WideGraph::setTxFreq(int n) //setTxFreq void WideGraph::setMode(QString mode) //setMode { m_mode=mode; - ui->fSplitSpinBox->setEnabled(m_mode=="JT9+JT65"); + ui->fSplitSpinBox->setEnabled(m_mode=="JT9+JT65" or m_mode.startsWith("FST4")); ui->widePlot->setMode(mode); ui->widePlot->DrawOverlay(); ui->widePlot->update(); @@ -368,7 +368,7 @@ void WideGraph::setRxBand (QString const& band) else { ui->fSplitSpinBox->setValue (m_fMinPerBand.value (band, 2500).toUInt ()); - ui->fSplitSpinBox->setEnabled (m_mode=="JT9+JT65"); + ui->fSplitSpinBox->setEnabled (m_mode=="JT9+JT65" or m_mode.startsWith("FST4")); } ui->widePlot->setRxBand(band); setRxRange (); @@ -500,6 +500,16 @@ void WideGraph::setTol(int n) //setTol ui->widePlot->update(); } +void WideGraph::setFST4_FreqRange(int fLow,int fHigh) +{ + ui->widePlot->setFST4_FreqRange(fLow,fHigh); +} + +void WideGraph::setSingleDecode(bool b) +{ + ui->widePlot->setSingleDecode(b); +} + void WideGraph::on_smoSpinBox_valueChanged(int n) { m_nsmo=n; diff --git a/widgets/widegraph.h b/widgets/widegraph.h index 90f7b51a..f5f70c28 100644 --- a/widgets/widegraph.h +++ b/widgets/widegraph.h @@ -49,6 +49,8 @@ public: void drawRed(int ia, int ib); void setVHF(bool bVHF); void setRedFile(QString fRed); + void setFST4_FreqRange(int fLow,int fHigh); + void setSingleDecode(bool b); signals: void freezeDecode2(int n); diff --git a/widgets/widegraph.ui b/widgets/widegraph.ui index fce5f107..b0165e04 100644 --- a/widgets/widegraph.ui +++ b/widgets/widegraph.ui @@ -362,10 +362,10 @@ <string><html><head/><body><p>Decode JT9 only above this frequency</p></body></html></string> </property> <property name="suffix"> - <string> JT9</string> + <string> Hz</string> </property> <property name="prefix"> - <string>JT65 </string> + <string>Split </string> </property> <property name="minimum"> <number>0</number> @@ -393,7 +393,7 @@ <number>1</number> </property> <property name="maximum"> - <number>50</number> + <number>500</number> </property> </widget> </item> diff --git a/widgets/widgets.pri b/widgets/widgets.pri index 4ff058c6..7a364c4e 100644 --- a/widgets/widgets.pri +++ b/widgets/widgets.pri @@ -10,7 +10,7 @@ SOURCES += \ widgets/AbstractLogWindow.cpp \ widgets/FrequencyLineEdit.cpp widgets/FrequencyDeltaLineEdit.cpp \ widgets/FoxLogWindow.cpp widgets/CabrilloLogWindow.cpp \ - widgets/HelpTextWindow.cpp + widgets/HelpTextWindow.cpp widgets/RestrictedSpinBox.cpp HEADERS += \ widgets/mainwindow.h widgets/plotter.h \ widgets/about.h widgets/widegraph.h \ @@ -21,7 +21,8 @@ HEADERS += \ widgets/fastplot.h widgets/MessageBox.hpp widgets/colorhighlighting.h \ widgets/ExportCabrillo.h widgets/AbstractLogWindow.hpp \ widgets/FoxLogWindow.hpp widgets/CabrilloLogWindow.hpp \ - widgets/DateTimeEdit.hpp widgets/HelpTextWindow.hpp + widgets/DateTimeEdit.hpp widgets/HelpTextWindow.hpp \ + widgets/RestrictedSpinBox.hpp FORMS += \ widgets/mainwindow.ui widgets/about.ui \ |
