summaryrefslogtreecommitdiff
path: root/widgets/mainwindow.h
diff options
context:
space:
mode:
authorhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
committerhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
commitc25cbdf6fb6d946175f4335fab77bfea601b56db (patch)
tree6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /widgets/mainwindow.h
parent71f5689252c9f13e70e1c24856904475b2307809 (diff)
parent0685fcada9f95fe90f70b387cd7d757da8209624 (diff)
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'widgets/mainwindow.h')
-rw-r--r--widgets/mainwindow.h814
1 files changed, 729 insertions, 85 deletions
diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h
index 7aee7db6..fdc0d444 100644
--- a/widgets/mainwindow.h
+++ b/widgets/mainwindow.h
@@ -12,31 +12,51 @@
#include <QProgressBar>
#include <QTimer>
#include <QDateTime>
+#include <QElapsedTimer>
+#include <QMap>
+#include <QRegExp>
+#include <QRegularExpression>
#include <QList>
#include <QAudioDeviceInfo>
#include <QStringList>
#include <QScopedPointer>
#include <QDir>
-#include <QProgressDialog>
#include <QAbstractSocket>
#include <QHostAddress>
#include <QPointer>
#include <QSet>
+#include <QHash>
#include <QVector>
#include <QScrollBar>
+#include <QTextBlock>
#include <QQueue>
#include <QFuture>
+#include <QFutureSynchronizer>
#include <QFutureWatcher>
#include <QDateTime>
+#include <array>
+#include <initializer_list>
+#include <memory>
+
+class QHBoxLayout;
#include "MultiGeometryWidget.hpp"
#include "NonInheritingProcess.hpp"
#include "Audio/AudioDevice.hpp"
+#include "Audio/TxIdentity.hpp"
+#include "Audio/TxPlaybackDiagnostics.hpp"
+#include "Audio/TxPlaybackEvidence.hpp"
+#include "Audio/TxRequest.hpp"
+#include "Audio/WavLoadCoordinator.hpp"
#include "commons.h"
+#include "FastDecode.hpp"
+#include "ReferenceSpectrum.hpp"
#include "Radio.hpp"
+#include "OperatingFrequency.hpp"
#include "models/Modes.hpp"
#include "models/FrequencyList.hpp"
#include "Configuration.hpp"
+#include "JttyN1mmOutput.hpp"
#include "WSPR/WSPRBandHopping.hpp"
#include "Transceiver/Transceiver.hpp"
#include "DisplayManual.hpp"
@@ -44,11 +64,24 @@
#include "Network/Cloudlog.hpp"
#include "logbook/logbook.h"
#include "astro.h"
+#include "qtextbrowser.h"
#include "widgets/QSYMessageCreator.h"
#include "widgets/QSYMessage.h"
+#include "widgets/displaytext.h"
#include "widgets/qsymonitor.h"
#include "MessageBox.hpp"
#include "Network/NetworkAccessManager.hpp"
+#include "AutoRespondSelectionLatch.hpp"
+#include "AutoRespondScoring.hpp"
+#include "AutoRespondPeriod.hpp"
+#include "HoundTransmissionPolicy.hpp"
+#include "JttyDraftAcceptanceTracker.hpp"
+#include "QsoProgress.hpp"
+#include "DecodeOperatingContext.hpp"
+#include "DecoderOutputFramer.hpp"
+#include "Ft8MtdDecodeCoordinator.hpp"
+#include "RigFrequencyChangePolicy.hpp"
+#include "BeaconTxController.hpp"
#define NUM_JT4_SYMBOLS 206 //(72+31)*2, embedded sync
#define NUM_JT65_SYMBOLS 126 //63 data + 63 sync
@@ -74,7 +107,15 @@ namespace Ui {
class MainWindow;
}
+class QWidget;
+class QRadioButton;
+struct QMapDecodeRecord;
+class QFocusFrame;
+class QFrame;
+class QButtonGroup;
+
class QProcessEnvironment;
+class QPaintEvent;
class QSharedMemory;
class QSplashScreen;
class QSettings;
@@ -99,14 +140,32 @@ class EQSL;
class WSPRNet;
class SoundOutput;
class Modulator;
-class SoundInput;
+class AudioInputSource;
class Detector;
class SampleDownloader;
class MultiSettings;
+
+namespace DecodedMessageReaction
+{
+ enum class ContestHint;
+ enum class ReactionDisposition;
+ enum class SelectionOrigin;
+ enum class WaitDecodeSource;
+ struct QsoReactionEffect;
+ struct QsoReactionPlan;
+ struct QsoReactionSnapshot;
+}
class EqualizationToolsDialog;
class DecodedText;
class Cloudlog;
+#include "Audio/TxAudioQueue.hpp"
+#include "Modulator/JttyTxStream.hpp"
+
+#ifdef WIN32
+class MMTTYIF;
+#endif
+
class MainWindow
: public MultiGeometryWidget<3, QMainWindow>
{
@@ -118,28 +177,128 @@ public:
using Mode = Modes::Mode;
using SpecOp = Configuration::SpecialOperatingActivity;
+ enum class JttyTxRejectReason
+ {
+ Empty,
+ EncodingFailed,
+ QueueFull,
+ BackendRejected,
+ Aborted,
+ NotAvailable
+ };
+ Q_ENUM(JttyTxRejectReason)
+
+ static QRegExp const message_alphabet;
+ static QRegularExpression const grid_regexp;
+ static QRegularExpression const non_r_db_regexp;
+
explicit MainWindow(QDir const& temp_directory, bool multiple, MultiSettings *,
QSharedMemory *shdmem, unsigned downSampleFactor,
- QSplashScreen *, QProcessEnvironment const&,
+ QSplashScreen *, QProcessEnvironment const&, bool automated_test,
+ QString base_style_sheet,
+ std::unique_ptr<AudioInputSource> audio_input_source = {},
+ std::unique_ptr<SoundOutput> sound_output = {},
+ QString decoder_data_path = {},
QWidget *parent = nullptr);
~MainWindow();
- int decoderBusy () const {return m_decoderBusy;}
+#ifdef WIN32
+ void initMMTTY(quint16 port);
+ MMTTYIF *getMmttyIf() const;
+#endif
+
+ bool decoderBusy () const
+ {return m_fastDecodePending || DecodeOwner::None != m_decodeOwner || m_ft8MtdDecodeCoordinator.hasPending ();}
+ void set_mode_from_command_line(const QString& mode, bool lock_mode = false);
+ bool decoderBackendRunning () const;
+ bool diskDataActive () const {return m_diskData;}
+ bool monitoringActive () const {return m_monitoring;}
+#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST)
+ struct LiveAudioTestFt8TransmitRequest
+ {
+ qint64 session_id {-1};
+ qint64 generation {-1};
+ };
+
+ bool liveAudioTestMultithreadedFt8Enabled () const {return m_multithreadFT8;}
+ int liveAudioTestFt8ThreadCount () const {return m_ft8threads;}
+ int liveAudioTestDecodeDepth () const {return m_ndepth & 7;}
+ int liveAudioTestFt8Cycles () const {return m_nFT8Cycles;}
+ int liveAudioTestFt8Sensitivity () const {return m_ft8Sensitivity;}
+ int liveAudioTestFt8DecoderStart () const {return m_ft8DecoderStart;}
+ QString liveAudioTestFt8BackpressureDiagnostics () const;
+ static constexpr int liveAudioTestDecodeLowFrequency () {return 200;}
+ static constexpr int liveAudioTestDecodeHighFrequency () {return 3000;}
+ bool configureLiveAudioTestDecodeRange ();
+ bool prepareLiveAudioTestFt8InputCompletion ();
+ QString completeLiveAudioTestFt8Input (qint64 frames);
+ bool configureLiveAudioTestHandoff ();
+ quint64 liveAudioTestPublishedDecoderGeneration () const
+ {
+ return m_automated_test && DecodeOwner::Jt9 == m_decodeOwner
+ && m_activeJt9Decode.generation == m_nextDecoderGeneration
+ ? m_activeJt9Decode.generation : 0;
+ }
+ quint64 liveAudioTestDecodeCycleGeneration () const {return m_decodeCycleGeneration;}
+ quint64 liveAudioTestReceiveEpoch () const {return m_receiveConsumer.epoch ();}
+ bool liveAudioTestReceivingAudio () const {return m_receivingAudio;}
+ LiveAudioTestFt8TransmitRequest startLiveAudioTestFt8Transmit (
+ qint64 targetPeriodStartMs);
+#endif
-public slots:
+ Q_SIGNALS:
+ void decoderBackendStarted () const;
+ void decoderBackendFailed (QString reason) const;
+ void decodeCycleStarted (quint64 generation) const;
+ void decodeCycleCompleted (quint64 generation) const;
+ void decodeCycleAborted (quint64 generation) const;
+#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST)
+ void ft8DecoderInvocation (bool multithreaded, int threadCount, int depth,
+ int cycles, bool subpass, int decoderStart,
+ int halfSymbols, int sampleCount,
+ int lowFrequency, int highFrequency) const;
+ void decoderOutputLine (QByteArray line) const;
+ void liveAudioTestJttyFramesConsumed (qint64 frames) const;
+ void liveAudioTestReceiveRejected (qint64 notifiedFrames) const;
+ void liveAudioTestReceiveRange (quint64 epoch, int start, int end, bool accepted) const;
+ void liveAudioTestReceiveBlock (ReceiveAudio block) const;
+ void liveAudioTestReceiveCallback (qint64 notifiedFrames,
+ qint64 currentFrames,
+ qint16 observedLastSample) const;
+ void liveAudioTestFt8TransmitStartDecided (qint64 sessionId,
+ qint64 generation,
+ qint64 targetPeriodStartMs,
+ bool accepted,
+ qint64 actualStartMs) const;
+#endif
+ void decodedMessageProcessed (QString message) const;
+ void decodedMessageDisplayed (QString message) const;
+ void jttyTextAccepted(qint64 requestId) const;
+ void jttyTextRejected(qint64 requestId, JttyTxRejectReason reason) const;
+ void jttyTextCompleted(qint64 requestId) const;
+ void jttySessionDrained(qint64 sessionId) const;
+
+ public slots:
void showSoundInError(const QString& errorMsg);
void showSoundOutError(const QString& errorMsg);
void showStatusMessage(const QString& statusMsg);
+ // JTTY text submission is asynchronous. The returned request id is completed
+ // by accepted/rejected signals; accepted means queued for backend transmit,
+ // not finished on RF. Graceful external OFF commands should stop submitting
+ // new text and let the JTTY drain path stop TX; use abort_jtty_tx() for hard
+ // abort.
+ qint64 submitJttyText(QString message);
+ void updateJttyDecodeHeadings();
void dataSink(qint64 frames);
void fastSink(qint64 frames);
void tci_mod_active(bool on) {m_tci_mod_active = on;}
void diskDat();
void freezeDecode(int n);
void guiUpdate();
- void doubleClickOnCall (Qt::KeyboardModifiers);
- void doubleClickOnCall2(Qt::KeyboardModifiers);
- void doubleClickOnFoxQueue(Qt::KeyboardModifiers);
- void doubleClickOnFoxInProgress(Qt::KeyboardModifiers modifiers);
+ void doubleClickOnCall (QString const& line, QString const& word, Qt::KeyboardModifiers);
+ void doubleClickOnCall2(QString const& line, QString const& word, Qt::KeyboardModifiers);
+ void doubleClickOnFoxQueue(QString const& line, QString const& word, Qt::KeyboardModifiers);
+ void doubleClickOnFoxInProgress(QString const& line, QString const& word, Qt::KeyboardModifiers modifiers);
void readFromStdout();
void p1ReadFromStdout();
void setXIT(int n, Frequency base = 0u);
@@ -147,14 +306,63 @@ public slots:
void msgAvgDecode2();
void fastPick(int x0, int x1, int y);
void skedFreq(double sf);
+ void jttyDecodeAgainAt(float secondsAgo);
private:
+ enum class DecodeOwner
+ {
+ None,
+ Jt9,
+ Wsprd
+ };
+
+ enum class DecodeEndState
+ {
+ Completed,
+ Aborted
+ };
+
+ enum class Jt9ProcessPhase
+ {
+ InitialStarting,
+ Ready,
+ StopRequested,
+ Terminating,
+ Killing,
+ ReplacementStarting,
+ Closing
+ };
+
+ enum class DecodePublishResult
+ {
+ Published,
+ Unavailable,
+ Failed
+ };
+
+ struct ActiveJt9Decode
+ {
+ qint32 generation {0};
+ DecodeOperatingContext context;
+ bool copiedSamples {false};
+ bool obsolete {false};
+ Ft8MtdDecodeCoordinator::Stage ft8Stage {Ft8MtdDecodeCoordinator::Stage::None};
+ qint64 ft8Period {-1};
+ };
+
+ static constexpr int MaxActiveStationRows = 50;
+ // Keep this matched with MAX_CALLERS in the Q65 q3list Fortran helpers.
+ static constexpr int MaxQ65PileupCallers = 50;
+
void change_layout (std::size_t) override;
void keyPressEvent (QKeyEvent *) override;
void closeEvent(QCloseEvent *) override;
+ void paintEvent(QPaintEvent *) override;
void childEvent(QChildEvent *) override;
bool eventFilter(QObject *, QEvent *) override;
void showQSYMessage(QString message);
+ void save_wave_file(QString const& name, int samples, Frequency frequency,
+ QString const& dgrd);
private slots:
void initialize_fonts ();
@@ -189,10 +397,11 @@ private slots:
void on_pb10G_clicked();
void on_pb24G_clicked();
void check_button_color();
+ void reset_transmit_controls_after_stop ();
void stopWRTimeout();
void stopWCTimeout();
void bandHoppingTimer();
- void bandHopping();
+ void bandHopping(bool user_requested = false);
void on_houndButton_clicked(bool checked);
void on_cbHoldTxFreq_clicked (bool);
void on_ft8Button_clicked();
@@ -227,7 +436,6 @@ private slots:
void on_actionQSG_Q65_triggered();
void on_actionQSG_X250_M3_triggered();
void on_actionQuick_Start_Guide_to_WSJT_X_2_7_and_QMAP_triggered();
- void on_actionRecommended_Audio_Settings_triggered();
void on_actionOnline_User_Guide_triggered();
void on_actionLocal_User_Guide_triggered();
void on_actionWide_Waterfall_triggered();
@@ -246,10 +454,10 @@ private slots:
void on_actionSpecial_mouse_commands_triggered();
void on_actionSolve_FreqCal_triggered();
void on_actionCopyright_Notice_triggered();
+ void on_actionTrademark_Policy_triggered();
void on_actionSWL_Mode_triggered (bool checked);
void on_DecodeButton_clicked (bool);
void decode();
- void decodeBusy(bool b);
void on_EraseButton_clicked();
void band_activity_cleared ();
void rx_frequency_activity_cleared ();
@@ -302,6 +510,7 @@ private slots:
void on_actionFST4_triggered();
void on_actionFST4W_triggered();
void on_TxFreqSpinBox_valueChanged(int arg1);
+ void on_TxFreqSpinBox_2_valueChanged(int arg1);
void on_actionSave_decoded_triggered();
void on_actionQuickDecode_toggled (bool);
void on_actionMediumDecode_toggled (bool);
@@ -337,7 +546,6 @@ private slots:
void on_actionStartLate_toggled(bool checked);
void on_actionFT8WidebandDXCallSearch_toggled(bool checked);
void on_actionUse_multithreaded_FT8_decoder_triggered(bool checked);
- //ft8md
void bumpFqso(int n);
void on_actionErase_ALL_TXT_triggered();
@@ -346,15 +554,17 @@ private slots:
void on_actionErase_WSPR_hashtable_triggered();
void on_actionErase_list_of_Q65_callers_triggered();
void on_actionExport_Cabrillo_log_triggered();
- void startTx2();
+ bool startTx2();
void startP1();
void stopTx();
void stopTx2();
void on_rptSpinBox_valueChanged(int n);
- void killFile();
+ void killWaveFile();
void on_tuneButton_clicked (bool);
void on_pbR2T_clicked();
+ void on_pbR2T_2_clicked();
void on_pbT2R_clicked();
+ void on_pbT2R_2_clicked();
void acceptQSO (QDateTime const&, QString const& call, QString const& grid
, Frequency dial_freq, QString const& mode
, QString const& rpt_sent, QString const& rpt_received
@@ -370,9 +580,11 @@ private slots:
void on_bandComboBox_activated (int index);
void on_readFreq_clicked();
void on_RxFreqSpinBox_valueChanged(int n);
+ void on_RxFreqSpinBox_2_valueChanged(int n);
void on_outAttenuation_valueChanged (int);
void rigOpen ();
void handle_transceiver_update (Transceiver::TransceiverState const&);
+ void handle_transceiver_closing (bool failed);
void handle_transceiver_failure (QString const& reason);
void handle_leavingSettings();
void on_actionAstronomical_data_toggled (bool);
@@ -382,6 +594,9 @@ private slots:
void on_actionShort_list_of_add_on_prefixes_and_suffixes_triggered();
void band_changed (Frequency);
void monitor (bool);
+ void applyMonitorEffects (bool checked, bool restored);
+ void applyOperatingFrequencyTransition (OperatingFrequency::Transition const&);
+ OperatingFrequency::Context operatingFrequencyContext () const;
void end_tuning ();
void stop_tuning ();
void stopTuneATU();
@@ -402,8 +617,8 @@ private slots:
void on_cbSWL_toggled(bool b);
void on_cbTx6_toggled(bool b);
void on_cbMenus_toggled(bool b);
- void on_cbCQonly_toggled(bool b);
void on_cbAutoSeq_toggled(bool b);
+ void on_cbIncludeTime_toggled(bool b);
void networkError (QString const&);
void on_ClrAvgButton_clicked();
void on_actionWSPR_triggered();
@@ -429,10 +644,12 @@ private slots:
void on_sbTR_valueChanged (int);
void on_sbTR_FST4W_valueChanged (int);
void on_sbFtol_valueChanged (int);
+ void on_sbFtol_2_valueChanged (int);
void on_cbFast9_clicked(bool b);
void on_sbCQTxFreq_valueChanged(int n);
void on_cbCQTx_toggled(bool b);
void on_actionMSK144_triggered();
+ void on_actionJTTY_triggered();
void on_actionQ65_triggered();
void on_actionFreqCal_triggered();
void splash_done ();
@@ -446,16 +663,16 @@ private slots:
void on_pbFreeText_clicked();
void FoxReset(QString reason);
void on_comboBoxHoundSort_activated (int index);
- void not_GA_warning_message ();
void checkMSK144ContestType();
void on_pbBestSP_clicked();
- void on_RoundRobin_currentTextChanged(QString text);
+ void on_RoundRobin_currentTextChanged(QString);
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
, QString const& dx_grid, bool generate_messages);
void callSandP2(int nline);
+ void qmapCallSandP(QMapDecodeRecord const& record, bool doubleClick);
void refreshHoundQueueDisplay();
void queueActiveWindowHound2(QString text);
void update_tx5(const QString &qsy_text);
@@ -465,6 +682,62 @@ private slots:
void on_rbEchoMessage_toggled(bool b);
void on_rbEchoCW_toggled(bool b);
void on_leEchoMessage_textChanged();
+ void on_pbSendMessage_clicked();
+ void on_Tx_Message_returnPressed();
+
+ void on_pbF1_clicked();
+ void on_pbF2_clicked();
+ void on_pbF3_clicked();
+ void on_pbF4_clicked();
+ void on_pbF5_clicked();
+ void on_pbF6_clicked();
+ void on_pbF7_clicked();
+ void on_pbF8_clicked();
+#ifdef WIN32
+ void logText(const QString &text);
+#endif
+
+private:
+ enum class FrequencyRequestOrigin
+ {
+ User,
+ Automatic
+ };
+
+ enum class DecodeAlertSound { None, DXcall, Wanted };
+
+ struct Q65StationSelection
+ {
+ QString call;
+ QString grid;
+ QString submode;
+ QString report;
+ bool txFirst;
+ };
+
+ void applyExperimentalFT8Filter(const DecodedText& dt, bool& filtered);
+ void applyQ65StationSelection (Q65StationSelection const& selection);
+ void processFoxSignals(const DecodedText& dt);
+ void processSFoxVerification(const DecodedText& dt, bool& filtered);
+ DecodedMessageReaction::ReactionDisposition processWaitReplyCall(
+ DecodedText const& dt, DecodedMessageReaction::WaitDecodeSource source,
+ bool * block_right_display = nullptr);
+ bool applyFiltering(const DecodedText& dt, bool& filtered);
+ void applyHighlighting(const DecodedText& dt, DisplayText * decodePane, bool updateAlertState,
+ bool& play_Wanted, bool& play_DXcall);
+ void cycleRespondMode();
+ static DecodeAlertSound selectDecodeAlertSound(bool alertsEnabled, bool dxCallAlertEnabled, bool wantedAlertEnabled,
+ bool play_Wanted, bool play_DXcall, bool hasDXCall);
+ void playDecodeAlertSound(bool play_Wanted, bool play_DXcall);
+ void playDecodeAlertSound(DecodeAlertSound sound);
+ void updateRespondTarget(const DecodedText& dt, const QString& text, bool pounce,
+ QDateTime const& decodePeriodStart, bool diskData);
+ QString selectedTxMessage() const;
+ AutoRespondPolicy autoRespondPolicy() const;
+ bool pendingCqAutoRespondIntent() const;
+ void displayDecodedTextLine(const DecodedText& dt, const QByteArray& line_read, const QString& distance, bool haveFSpread, float fSpread, bool bDisplayPoints);
+ QString calculateDistanceAndBearing(const DecodedText& dt);
+ void processSuperHoundVerification(const DecodedText& dt);
private:
Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo,
@@ -475,6 +748,7 @@ private:
unsigned downSampleFactor, AudioDevice::Channel) const;
Q_SIGNAL void suspendAudioInputStream () const;
Q_SIGNAL void resumeAudioInputStream () const;
+ Q_SIGNAL void stopAudioInputStream () const;
Q_SIGNAL void startDetector (AudioDevice::Channel) const;
Q_SIGNAL void FFTSize (unsigned) const;
Q_SIGNAL void detectorClose () const;
@@ -482,17 +756,27 @@ 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 (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 sendMessage (TxEvidence::TxRequest, SoundOutput *) const;
+ Q_SIGNAL void startJttyStream (TxEvidence::TxRequest, SoundOutput *);
+ Q_SIGNAL void endJttyStream () 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);
+ void dispatchTxRequest (TxEvidence::TxRequest const& request);
+ void beginTxEvidenceSession ();
+ void beginTxEvidenceGeneration (qint64 committedEndSample = -1,
+ bool targetKnown = false);
+ void recordTxSourceCommit (TxEvidence::TxStartSnapshot const& snapshot);
+ void recordRawTxPlayout (TxEvidence::TxRawPlayoutSnapshot const& snapshot);
+ void noteTxStopReason (TxEvidence::TxStopReason reason);
+ void noteTxModeChange (QString const& mode);
+ int txStopTailMs (bool tciAudio) const;
+ void stopTxEvidence (int tailMs);
+ void captureJttyTxEvidenceTotals (qint64 servedSamples, qint64 totalSamples,
+ QString const& diagnostic);
void astroUpdate ();
void writeAllTxt(QString message);
void auto_sequence (DecodedText const& message, unsigned start_tolerance, unsigned stop_tolerance);
@@ -501,29 +785,117 @@ private:
void setColorHighlighting();
void chkFT4();
bool elide_tx1_not_allowed () const;
+ void toggle_tx1_enabled_preference ();
+ bool rr73_tx4_allowed () const;
+ bool send_rr73_for_tx4 () const;
+ void set_rr73_tx4 (bool enabled);
void readWidebandDecodes();
void configActiveStations();
- void sfox_tx();
+ bool sfox_tx();
+ void clearSuperFoxPreparedTx();
+ void abortSuperFoxTxStart();
+ void displayFoxTxMsgs();
+ void jtty_tx(QString message);
+ void submitJttyDraft(QString message);
+#ifdef WIN32
+ void handleMmttyTxString(QString message);
+ void handleMmttyStartTx();
+ void handleMmttyStopTx();
+ void handleMmttyAbortTx();
+ void handleMmttyJttyAccepted(qint64 requestId);
+ void handleMmttyJttyRejected(qint64 requestId, JttyTxRejectReason reason);
+ void handleMmttyJttyCompleted(qint64 requestId);
+ void handleMmttyJttySessionDrained(qint64 sessionId);
+ void completeMmttyJttyOutput(bool drained = false);
+ void startPendingMmttyJttyTx();
+ QString jttyRejectReasonText(JttyTxRejectReason reason) const;
+#endif
+ void execute_jtty_tx(qint64 requestId, QString message);
+ void execute_jtty_tones(qint64 requestId, QString const& message,
+ int const itone[], int nsym);
+ void advanceJttyTxQueueEpoch();
+ qint64 jttyTxCommittedSamples() const;
+ void completeJttyTxEnqueue(qint64 requestId, QString const& message,
+ TxAudioQueueProgress progress, bool newSession,
+ bool useTciAudio);
+ void recordAcceptedJttyTextRequest(qint64 requestId, qint64 endSample);
+ QVector<qint64> takeCompletedJttyTextRequests(TxAudioQueueEpoch epoch,
+ qint64 totalAtDrain);
+ void clearAcceptedJttyTextRequests(TxAudioQueueEpoch epoch);
+ void handleJttyContestSerial(QString const& message);
+ void abort_jtty_tx();
+ void interruptJttyTx();
+ void rejectPendingJttyTciMessages(JttyTxRejectReason reason);
+ void sync_tci_tx_volume (bool force = false);
+ void onJttyBackendDrained(TxAudioQueueDrainState drain);
+ void onJttyBackendEnqueueAccepted(qint64 enqueueId, qint64 sampleCount,
+ TxAudioQueueProgress progress);
+ void onJttyBackendEnqueueFailed(TxAudioQueueEpoch epoch, qint64 enqueueId);
+ void handleJttyTxWatchdog();
+ void resetJttyTxState();
+ void startJttyTxWatchdog(int durationMs);
+ void jtty_save_wav();
+ bool jtty_key_struck(QKeyEvent * e);
+ bool sendJttyFunctionKey(int index);
+ // istart0/istop (sample indices into dec_data.d2) bound the Fortran scan
+ // to a window instead of the whole buffer; -1/-1 (the default) means
+ // unwindowed, matching the original behavior exactly. Returns true when
+ // this call delivers a completed message admitted to the QSO history.
+ bool jtty_decode(int k, int istart0 = -1, int istop = -1);
+ void renderJttyAllFreqLines();
+ void renderJttyQsoLines();
+ void jtty_again();
+ void flushJttyDecodeLines();
+ QString jtty_msg_expand(QString msg);
+ QString specOpLabel() const;
+ void initializeFFT(int nsps);
+ void initializeFFT(int nsps, int fftSize);
+ void setTxButtonsEnabled(bool enabled);
+ void setDXInfo(QString const& call, QString const& grid);
+ void setDecodeTitles(QString const& lh, QString const& rh);
+ void setDecodeHeadings(QString const& lh, QString const& rh);
+ void updateDecodeAccessibility();
+
bool play_DXcall = false;
bool play_Wanted = false;
bool inSettings = false;
+ quint64 m_startup_trace_run {0};
+ bool m_startup_paint_reported {false};
+ bool m_startup_decoder_reported {false};
+ bool m_startup_audio_reported {false};
+ bool m_startup_logbook_reported {false};
+ bool m_startup_rig_reported {false};
+ bool m_event_filter_ready {false};
QProcessEnvironment const& m_env;
NetworkAccessManager m_network_manager;
bool m_valid;
QSplashScreen * m_splash;
QString m_revision;
bool m_multiple;
+ bool m_automated_test;
MultiSettings * m_multi_settings;
QPushButton * m_configurations_button;
QSettings * m_settings;
+ QString m_base_style_sheet;
QScopedPointer<Ui::MainWindow> ui;
+ QButtonGroup * m_tx_message_button_group {nullptr};
+ QFocusFrame * m_main_window_focus_frame {nullptr};
+ QFrame * m_message_selector_focus_frame {nullptr};
+ bool m_keyboard_focus_active {false};
+ bool m_tx_first_user_enabled {true};
+ bool m_tx_first_mode_enabled {true};
+
+#ifdef WIN32
+ MMTTYIF * m_mmttyif {nullptr};
+#endif
Configuration m_config;
+ QDir m_decoderDataDir;
LogBook m_logBook; // must be after Configuration construction
Cloudlog m_cloudlog;
WSPRBandHopping m_WSPR_band_hopping;
- bool m_WSPR_tx_next;
+ BeaconTx::Controller m_beaconTxController;
MessageBox m_rigErrorMessageBox;
QScopedPointer<SampleDownloader> m_sampleDownloader;
QScopedPointer<EqualizationToolsDialog> m_equalizationToolsDialog;
@@ -554,8 +926,11 @@ private:
Detector * m_detector;
unsigned m_FFTSize;
- SoundInput * m_soundInput;
+ AudioInputSource * m_soundInput;
+ quint64 m_decodeCycleGeneration {0};
Modulator * m_modulator;
+ QScopedPointer<TxAudioQueue> m_jttyTxQueue;
+ JttyTxStream * m_jttyTxStream;
SoundOutput * m_soundOutput;
int m_rx_audio_buffer_frames;
int m_tx_audio_buffer_frames;
@@ -568,11 +943,9 @@ private:
qint64 m_fullFoxCallTime;
qint64 m_msEchoTxStart=0;
- Frequency m_freqNominal;
+ OperatingFrequency m_operatingFrequency;
Frequency m_freqNominalPeriod;
- Frequency m_freqTxNominal;
- quint64 m_msk144basefreq;
- quint64 m_msk144oldfreq;
+ Frequency m_msk144basefreq {0};
quint64 m_mslastTX; //ft8md
qint32 m_nlasttx; //ft8md
qint32 m_lapmyc; //ft8md
@@ -581,11 +954,11 @@ private:
double m_tRemaining;
double m_TRperiod;
- double m_fSpread;
+ double m_fSpread {0.};
double m_s6;
- double m_fDither;
- double m_fAudioShift;
- double m_skedFreq;
+ double m_fDither {0.};
+ double m_fAudioShift {0.};
+ double m_skedFreq {1296.065};
float m_DTtol;
float m_t0;
@@ -614,12 +987,12 @@ private:
qint32 m_ft8DecoderStart;
qint32 m_nsecBandChanged;
qint32 m_nFT4depth;
+ qint32 m_nsym_jtty;
//ft8md
qint32 m_sec0;
qint32 m_RxLog;
qint32 m_nutc0;
- qint32 m_ntr;
qint32 m_tx;
quint64 m_mslastMon;
int m_addtx;
@@ -660,8 +1033,7 @@ private:
qint32 m_maxFoxWait=3; //Max wait time for expected Hound replies
qint32 m_foxCQtime=10; //CQs at least every 5 minutes
qint32 m_tFoxTxSinceCQ=999; //Fox Tx cycles since most recent CQ
- qint32 m_nFoxFreq; //Audio freq at which Hound received a call from Fox
- qint32 m_nSentFoxRrpt=0; //Serial number for next R+rpt Hound will send to Fox
+ HoundTransmissionPolicy::State m_houndTransmissionState;
qint32 m_kin0=0;
qint32 m_earlyDecode=41;
qint32 m_earlyDecode2=47;
@@ -674,15 +1046,50 @@ private:
qint32 m_echoSec0=0;
qint32 m_fetched=0;
qint32 m_position;
+ qint64 m_decoderDiagSequence=0;
+ qint64 m_decoderDiagActiveSequence=0;
+ qint32 m_nextDecoderGeneration=0;
+ qint32 m_decoderDiagStartIhsym=0;
+ qint32 m_decoderDiagStartHsymStop=0;
+ qint32 m_decoderDiagStartNzhsym=0;
+ qint32 m_decoderDiagStartNewdat=0;
+ qint32 m_decoderDiagStartNagain=0;
+ qint32 m_decoderDiagStartNdiskdat=0;
+ qint32 m_decoderDiagProgressCount=0;
+ double m_decoderDiagStartTRperiod=0.0;
+ QElapsedTimer m_decoderDiagElapsedTimer;
+ QElapsedTimer m_decoderDiagProgressTimer;
+ QString m_decoderDiagStartMode;
+ QMap<QString, QDateTime> m_decoderDiagLastSampleUtc;
bool m_btxok; //True if OK to transmit
bool m_diskData;
bool m_loopall;
- bool m_decoderBusy;
+ DecodeOwner m_decodeOwner=DecodeOwner::None;
+ Jt9ProcessPhase m_jt9ProcessPhase=Jt9ProcessPhase::InitialStarting;
+ bool m_modeLocked = false;
+ bool m_decoderDiagActive=false;
+ bool m_decoderDiagBusyRequestLogged=false;
+ bool m_decoderDiagOverrunLogged=false;
+ bool m_decoderDiagHardHangLogged=false;
+ bool m_decoderDiagAbnormalClear=false;
+ bool m_decoderCompletedSinceStart=false;
+ bool m_jt9PayloadValid=false;
+ bool m_closing=false;
bool m_txFirst;
+ bool m_tx1_enabled_preference {true};
bool m_auto;
bool m_restart;
+ bool m_generated_message_error;
bool m_startAnother;
+ ActiveJt9Decode m_activeJt9Decode;
+ DecoderOutputFramer m_decoderOutputFramer;
+ Ft8MtdDecodeCoordinator m_ft8MtdDecodeCoordinator;
+#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST)
+ qint64 m_liveAudioTestPendingFt8FinalPeriod {-1};
+ bool m_liveAudioTestAwaitFt8InputCompletion {false};
+ bool m_liveAudioTestFt8InputComplete {false};
+#endif
// start ft8md
bool m_FT8EarlyStart;
@@ -711,7 +1118,6 @@ private:
bool m_dataAvailable;
bool m_bDecoded;
bool m_noSuffix;
- bool m_decodedText2;
bool m_sentFirst73;
bool m_tci_mod_active;
bool m_tci;
@@ -724,16 +1130,13 @@ private:
bool m_bShMsgs;
bool m_bSWL;
bool m_uploadWSPRSpots;
- bool m_uploading;
bool m_grid6;
- bool m_tuneup;
bool m_bTxTime;
- bool m_rxDone;
bool m_bSimplex; // not using split even if it is available
bool m_bEchoTxOK;
bool m_bTransmittedEcho;
bool m_bEchoTxed;
- bool m_bFastMode;
+ bool m_bFastMode=false;
bool m_bFast9;
bool m_bFastDecodeCalled;
bool m_bDoubleClickAfterCQnnn;
@@ -748,26 +1151,24 @@ private:
bool m_bCallingCQ;
bool m_bAutoReply;
QString m_lastloggedcall; //ft8md
- bool m_bCheckedContest;
+ bool m_contestModeHintShown;
bool m_bWarnedSplit=false;
bool m_bTUmsg;
bool m_bBestSPArmed=false;
bool m_bOK_to_chk=false;
bool m_bSentReport=false;
bool m_discard_decoded_hounds_this_cycle=false; // if something changes, like frequency, discard decoded messages that may be in-flight.
+ bool m_houndVerified=false;
SpecOp m_specOp;
- enum
- {
- CALLING,
- REPLYING,
- REPORT,
- ROGER_REPORT,
- ROGERS,
- SIGNOFF
- }
- m_QSOProgress; //State machine counter
+ static constexpr QsoProgress CALLING {QsoProgress::Calling};
+ static constexpr QsoProgress REPLYING {QsoProgress::Replying};
+ static constexpr QsoProgress REPORT {QsoProgress::Report};
+ static constexpr QsoProgress ROGER_REPORT {QsoProgress::RogerReport};
+ static constexpr QsoProgress ROGERS {QsoProgress::Rogers};
+ static constexpr QsoProgress SIGNOFF {QsoProgress::Signoff};
+ QsoProgress m_QSOProgress;
enum {CALL, GRID, DXCC, MULT};
@@ -787,6 +1188,7 @@ private:
// labels in status bar
QLabel tx_status_label;
+ bool m_tx_inhibited {false};
QLabel config_label;
QLabel mode_label;
QLabel last_tx_label;
@@ -795,10 +1197,24 @@ private:
QLabel ndecodes_label;
QProgressBar progressBar;
QLabel watchdog_label;
-
- QFuture<void> m_wav_future;
- QFutureWatcher<void> m_wav_future_watcher;
- QFutureWatcher<void> watcher3;
+ QLabel * m_txFrequencyLabel {};
+ QLabel * m_frequencyToleranceLabel {};
+ QLabel * m_rxFrequencyLabel {};
+ QLabel * m_reportLabel {};
+ QLabel * m_trPeriodLabel {};
+ QLabel * m_submodeLabel {};
+ QLabel * m_maxDriftLabel {};
+ QHBoxLayout * m_frequencyToleranceRow {};
+ QHBoxLayout * m_modeCheckboxRow {};
+ WavLoadCoordinator m_wav_load_coordinator;
+ QFutureWatcher<FastDecodeResult> watcher3;
+ bool m_fastDecodePending = false;
+ ReferenceSpectrumInput m_referenceInput;
+ ReceiveAudioConsumer m_receiveConsumer;
+ QQueue<ReceiveAudio> m_receiveQueue;
+ ReceiveAudio m_activeReceiveAudio;
+ bool m_receivingAudio = false;
+ QFutureSynchronizer<QString> m_saveWAVSynchronizer;
QFutureWatcher<QString> m_saveWAVWatcher;
NonInheritingProcess proc_jt9;
@@ -812,6 +1228,10 @@ private:
EQSL *Eqsl;
QTimer m_guiTimer;
+ QTimer m_decoderShutdownTimer;
+ QTimer m_decoderTerminateTimer;
+ QTimer m_decoderKillTimer;
+ QTimer m_decoderStartTimer;
QTimer stopWRTimer; //Wait & Reply
QTimer stopWCTimer; //Wait & Call
QTimer ptt1Timer; //StartTx delay
@@ -819,12 +1239,19 @@ private:
QTimer logQSOTimer;
QTimer killFileTimer;
QTimer tuneButtonTimer;
+ QTimer rigTuneTimer;
QTimer uploadTimer;
QTimer tuneATU_Timer;
QTimer TxAgainTimer;
QTimer minuteTimer;
QTimer splashTimer;
QTimer p1Timer;
+ QTimer m_jttyTxWatchdog;
+ QTimer m_refSpecTimer;
+ AutoRespondSelectionLatch m_autoRespondSelectionLatch;
+ AutoRespondScores m_autoRespondScores;
+ AutoRespondPeriodState m_autoRespondPeriodState;
+ int m_refSpecSecondsRemaining = 0;
QString m_path;
QString m_baseCall;
@@ -835,7 +1262,6 @@ private:
QString m_palette;
QString m_dateTime;
QString m_mode;
- QString m_modeTx;//ft8md
QString m_fnameWE; // save path without extension
QString m_rpt;
QString m_nextRpt;
@@ -864,8 +1290,13 @@ private:
QString m_deGrid;
QString m_freeTextMsg;
QString m_freeTextMsg0;
- QString m_ready2call[50];
- QString m_callers[50];
+ std::array<QString, MaxActiveStationRows> m_ready2call;
+ std::array<QString, MaxQ65PileupCallers> m_callers;
+ // Q65 Pileup mode: selected DX call whose last Tx was copied by a decode.
+ // The value is consumed by the next matching Q65 Tx message.
+ QString m_q65PileupCopiedLastRxCall;
+ // Q65 Pileup mode: callers whose latest decode carried the copied flag ('#'); a standing display annotation, cleared only on leaving the Pileup context, not per decode pass.
+ QSet<QString> m_q65PileupCopiedCallers;
QSet<QString> m_pfx;
QSet<QString> m_sfx;
@@ -959,13 +1390,77 @@ private:
bool m_transmitting;
bool m_tune;
bool m_tx_watchdog; // true when watchdog triggered
+ TxEvidence::TxPlaybackDiagnostics m_txPlaybackDiagnostics;
+ TxEvidence::TxSessionId m_txEvidenceSession;
+ TxEvidence::TxSessionId m_txEvidenceSourceSession;
+ TxEvidence::TxGeneration m_txEvidenceGeneration;
+ TxEvidence::TxStopReason m_pendingTxStopReason {TxEvidence::TxStopReason::NormalEnd};
+#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST)
+ qint64 m_liveAudioTestFt8StartWindowOpenMs {-1};
+ qint64 m_liveAudioTestFt8StartWindowCloseMs {-1};
+ qint64 m_liveAudioTestFt8StartSessionId {-1};
+ qint64 m_liveAudioTestFt8StartGeneration {-1};
+#endif
+ bool m_jttyTxActive;
+ bool m_jttyTxUsesTciAudio;
+ TxAudioQueueEpoch m_jttyTxQueueEpoch;
+ TxAudioQueueProgress m_jttyTxQueueProgress;
+ struct PendingJttyTciMessage
+ {
+ TxAudioQueueEpoch epoch;
+ qint64 enqueueId;
+ qint64 requestId;
+ qint64 sampleCount;
+ QString message;
+ bool newSession;
+ };
+ QVector<PendingJttyTciMessage> m_pendingJttyTciMessages;
+ struct AcceptedJttyTxRequest
+ {
+ TxAudioQueueEpoch epoch;
+ qint64 requestId;
+ qint64 endSample;
+ };
+ QVector<AcceptedJttyTxRequest> m_acceptedJttyTxRequests;
+ JttyDraftAcceptanceTracker m_jttyDraftAcceptanceTracker;
+ qint64 m_jttyTxRequestId;
+ qint64 m_jttyTciEnqueueId;
+ struct JttyQsoLine
+ {
+ qint64 messageId {0};
+ float frequency {0.f};
+ QString text;
+ float sequenceStart {0.f};
+ QDateTime messageStartUtc;
+ };
+ QVector<JttyQsoLine> m_jttyQsoLines;
+ QTextBlock m_jttyQsoGroupStart;
+ QTextBlock m_jttyQsoGroupEnd;
+ int m_jttyQsoGroupEndPosition {-1};
+ bool m_jttyQsoRenderedLowerCase {false};
+ bool m_jttyQsoRenderedIncludeTime {false};
+ struct JttyDecodeLine
+ {
+ qint64 messageId {0};
+ float frequency {0.f};
+ QString text;
+ float sequenceStart {0.f};
+ QDateTime messageStartUtc;
+ bool complete {false};
+ bool written {false};
+ DecodeOperatingContext context;
+ };
+ QVector<JttyDecodeLine> m_jttyAllFreqLines;
+ int m_jttyLastAllFreqsK = -1; // detects a restarted decode (new WAV, or "decode again")
+ qint32 m_jttyLastSavedWavK0 = -1; // m_k0 at last JTTY WAV save; skips saving unchanged audio again
+ QTextBlock m_jttyAllFreqsGroupStart; // start of decodedTextBrowser's currently-growing group
+#ifdef WIN32
+ Jtty::N1mmOutput m_mmttyJttyOutput;
+#endif
bool m_block_pwr_tooltip;
bool m_PwrBandSetOK;
bool m_bDisplayedOnce;
- Frequency m_lastMonitoredFrequency;
double m_toneSpacing;
- int m_firstDecode;
- QProgressDialog m_optimizingProgress;
QTimer m_heartbeat;
MessageClient * m_messageClient;
PSKReporter m_psk_Reporter;
@@ -979,28 +1474,73 @@ private:
//---------------------------------------------------- private functions
void readSettings();
+ void configureModeControlsLayout();
+ void updateModeControlsLayout();
+ void applyApplicationStyle(QFont const&, bool dark);
+ void setTrPeriodVisible(bool);
void set_application_font (QFont const&);
+ void updateMainWindowControlSizes();
+ void updateFrequencyToleranceRowAlignment();
void setDecodedTextFont (QFont const&);
void writeSettings();
void createStatusBar();
+ void handleTxInhibitStatus (bool supported, bool inhibited, QString const& holder,
+ quint32 hold_rx, quint32 release_rx,
+ quint32 expiries, quint32 invalid);
+ void startTxAudioAfterPttDelay ();
void updateStatusBar();
+ void updateMainWindowAccessibility();
+ void registerMainWindowFocusControls();
+ std::array<QRadioButton *, 6> txNextButtons() const;
+ std::array<QWidget *, 13> focusIndicatorWidgets() const;
+ void showMainWindowFocusIndicator(QWidget *widget);
+ void hideMainWindowFocusIndicators();
+ void updateTxNextFocusPolicies();
+ void updateTxFirstEnabledState();
+ void setTxFirstModeEnabled(bool enabled);
+ bool switchTxNextMessage(QKeyEvent const *key_event);
+ bool switchMainWindowTab(QKeyEvent const *key_event);
void genStdMsgs(QString rpt, bool unconditional = false);
void genCQMsg();
void clearDX ();
void lookup();
+ QString expandTxMacros(QString const& message) const;
void ba2msg(QByteArray ba, char* message);
void msgtype(QString t, QLineEdit* tx);
+ void show_generated_message_error ();
+ void clear_generated_message_error ();
+ void update_generated_message_error ();
void stub();
void statusChanged();
void fixStop();
+ void finishReferenceSpectrumMeasurement(bool notify);
+ void updateReferenceSpectrumCountdown();
bool shortList(QString callsign) const;
void transmit (double snr = 99.);
void rigFailure (QString const& reason);
void pskSetLocal ();
void pskPost(DecodedText const& decodedtext);
+ void pskPost(DecodedText const& decodedtext,
+ DecodeOperatingContext const& context);
void displayDialFrequency ();
void transmitDisplay (bool);
- void processMessage(DecodedText const& message, Qt::KeyboardModifiers = Qt::NoModifier);
+ void handleDecodeSelection(QString const& line, QString const& word,
+ Qt::KeyboardModifiers modifiers,
+ DecodedMessageReaction::SelectionOrigin selection_origin);
+ void processMessage(DecodedText const& message, Qt::KeyboardModifiers modifiers,
+ DecodedMessageReaction::SelectionOrigin selection_origin);
+ void processSyntheticMessage(DecodedText const& message);
+ DecodedMessageReaction::QsoReactionSnapshot qsoReactionSnapshot(
+ Qt::KeyboardModifiers modifiers = Qt::NoModifier) const;
+ DecodedMessageReaction::QsoReactionSnapshot qsoReactionSnapshot(
+ Qt::KeyboardModifiers modifiers,
+ DecodedMessageReaction::SelectionOrigin selection_origin) const;
+ void applyQsoReactionPlan(DecodedMessageReaction::QsoReactionPlan const& plan,
+ DecodedText const& message, bool * block_right_display = nullptr);
+ void applyQsoReactionEffect(DecodedMessageReaction::QsoReactionEffect const& effect,
+ DecodedText const& message, bool * block_right_display);
+ void showContestHint(DecodedMessageReaction::ContestHint hint);
+ void refreshQsoPane(DecodedText const& message);
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 ();
@@ -1008,9 +1548,28 @@ private:
void postWSPRDecode (bool is_new, QStringList message_parts);
void enable_DXCC_entity (bool on);
void switch_mode (Mode);
- void WSPR_scheduling ();
+ bool hasMsk144BaseFrequency () const {return m_msk144basefreq > 0;}
+ BeaconTx::RoundRobinPolicy beaconRoundRobinPolicy () const;
+ BeaconTx::RoundRobinPolicy configuredRoundRobinPolicy () const;
+ void enterBeaconMode ();
+ void processBeaconActions (BeaconTx::Controller::Actions actions);
+ BeaconTx::ScheduleProposal beaconScheduleProposal ();
+ bool applyBeaconBandChange (BeaconTx::HoppingProposal const& proposal);
void freqCalStep();
- void setRig (Frequency = 0); // zero frequency means no change
+ RigFrequencyChangePolicy::Activity rigFrequencyActivity () const;
+ RigFrequencyChangePolicy::Decision rigFrequencyChangeDecision (
+ RigFrequencyChangePolicy::ChangeKind) const;
+ bool nominalFrequencyChangeAllowed (FrequencyRequestOrigin);
+ bool requestNominalFrequencyChange (Frequency, FrequencyRequestOrigin);
+ bool dispatchNominalFrequency (Frequency corrected, FrequencyRequestOrigin, bool monitoring);
+ bool requestBandChange (Frequency, FrequencyRequestOrigin);
+ bool workingFrequencyAt (int row, Frequency&) const;
+ void applyBandChange (Frequency, Frequency previous_frequency);
+ bool requestBandButtonFrequency (Frequency lookup_frequency, Frequency fallback_frequency,
+ double msk144_tr_period = 0.);
+ bool requestAlternateBandFrequency (Frequency);
+ bool reapplyCurrentRigFrequencyCorrection ();
+ void restoreNominalFrequencySelection ();
void WSPR_history(Frequency dialFreq, int ndecodes);
QString beacon_start_time (int n = 0);
QString WSPR_message();
@@ -1019,36 +1578,73 @@ private:
void useNextCall();
void abortQSO();
void updateRate();
- void write_all(QString txRx, QString message);
+ void write_all(QString txRx, QString message,
+ DecodeOperatingContext const * context = nullptr);
bool isWorked(int itype, QString key, float fMHz=0, QString="");
- QString save_wave_file (QString const& name
- , short const * data
- , int samples
- , QString const& my_callsign
- , QString const& my_grid
- , QString const& mode
- , qint32 sub_mode
- , Frequency frequency
- , QString const& his_call
- , QString const& his_grid) const;
- void hound_reply ();
+ void hound_reply (int foxFrequency);
QString sortHoundCalls(QString t, int isort, int max_dB);
void rm_tb4(QString houndCall);
void read_wav_file (QString const& fname);
- void decodeDone ();
+ void wav_file_loaded ();
+ void update_wav_file_actions ();
+ void finishDecodeUi ();
bool subProcessFailed (QProcess *, int exit_code, QProcess::ExitStatus);
void subProcessError (QProcess *, QProcess::ProcessError);
void statusUpdate () const;
void update_watchdog_label ();
+ bool normalWatchdogWarningActive () const;
+ bool isHoundOperation () const;
+ bool isSuperHoundOperation () const;
+ void updateHoundVerificationStyle ();
void invalidate_frequencies_filter ();
void on_the_minute ();
void add_child_to_event_filter (QObject *);
void remove_child_from_event_filter (QObject *);
void setup_status_bar (bool vhf);
void tx_watchdog (bool triggered);
- qint64 nWidgets(QString t);
- void displayWidgets(qint64 n);
+ enum class ModeUiControl
+ {
+ TxFirst,
+ TxFrequency,
+ RxFrequency,
+ FrequencyTolerance,
+ Report,
+ TrPeriod,
+ CqTxFrequency,
+ ShortMessages,
+ Fast9,
+ AutoSequence,
+ Tx6,
+ CopyRxToTx,
+ CopyTxToRx,
+ HoldTxFrequency,
+ Submode,
+ Sync,
+ WsprControls,
+ ClearAverage,
+ DecodeDepth,
+ IncludeAveraging,
+ IncludeCorrelation,
+ EchoGraph,
+ Swl,
+ ApFt8,
+ ApJt65,
+ ApDxCall,
+ Respond,
+ Measure,
+ DxpedLabel,
+ RxAll,
+ CqOnly,
+ Fst4wTrPeriod,
+ LowFrequency,
+ HighFrequency,
+ AutoClearAverage,
+ MaxDrift,
+ FoxQueueTab
+ };
+ using ModeUiState = std::initializer_list<ModeUiControl>;
+ void applyModeUiState(ModeUiState);
QChar current_submode () const; // returns QChar {0} if submode is not appropriate
void write_transmit_entry (QString const& file_name);
void selectHound(QString t, bool bTopQueue);
@@ -1057,11 +1653,60 @@ private:
void updateFoxQSOsInProgressDisplay();
void foxQueueTopCallCommand();
void foxRxSequencer(QString msg, QString houndCall, QString rptRcvd);
- void foxTxSequencer();
+ bool foxTxSequencer();
void foxGenWaveform(int i,QString fm);
void writeFoxQSO (QString const& msg);
void update_foxLogWindow_rate();
- void to_jt9(qint32 n, qint32 istart, qint32 idone);
+ DecodePublishResult publishDecodeRequest(
+ bool copySamples,
+ Ft8MtdDecodeCoordinator::Stage ft8Stage = Ft8MtdDecodeCoordinator::Stage::None,
+ qint64 ft8Period = -1);
+ DecodePublishResult publishPendingFt8Decode ();
+ void decode (Ft8MtdDecodeCoordinator::Stage stage, qint64 ft8Period = -1);
+ qint64 currentFt8DecodePeriod () const;
+ bool usesFt8MtdFinal () const;
+ int configuredFt8MtdEarlyStageCount () const;
+ std::unique_ptr<Ft8MtdDecodeCoordinator::PendingMtdDecode>
+ capturePendingFt8MtdDecode (qint64 period) const;
+ void cancelPendingFt8Decode (QString const& reason);
+ void reportFt8BackpressureDecision (
+ Ft8MtdDecodeCoordinator::Decision const& decision, qint64 period);
+ void reportFt8BackpressureRecovery (qint64 period);
+ void emitFt8DecoderInvocation (decoder_params_t const& params) const;
+ bool handleDecoderOutputEvent(DecoderOutputFramer::Event const& event,
+ bool& decodeCompleted);
+ DecodeOperatingContext currentDecodeOperatingContext() const;
+ bool decodeOperatingContextMatchesCurrent(
+ DecodeOperatingContext const& context) const;
+ bool pendingFt8DecodeOperatingContextMatchesCurrent(
+ DecodeOperatingContext const& context) const;
+ bool activeDecodeOperatingContextMatchesCurrent() const;
+ bool initializeDecoderSharedMemory();
+ void startDecoderProcess();
+ bool beginDecode(
+ DecodeOwner owner, decoder_params_t const * diagnosticParams = nullptr,
+ DecodeOperatingContext const * diagnosticContext = nullptr);
+ void endDecode(DecodeOwner owner,
+ DecodeEndState state = DecodeEndState::Completed);
+ void updateDecodeControls();
+ bool usesJt9Process() const;
+ bool decoderRestartInProgress() const;
+ void abortJt9Transaction();
+ void recoverDecoderAtBoundary(QString const& reason, bool manual);
+ void requestDecoderRestart(QString const& reason);
+ qint64 decoderDiagnosticElapsedMs() const;
+ qint64 decoderDiagnosticIdleMs() const;
+ qint64 decoderRequestDeadlineMs() const;
+ bool decoderRequestDeadlineExpired() const;
+ void beginDecoderDiagnostic(
+ decoder_params_t const * params = nullptr,
+ DecodeOperatingContext const * context = nullptr);
+ void markDecoderProgress();
+ void logDecoderBusyRequest(QString const& reason);
+ void logDecoderProgress();
+ void logDecoderAbnormalClear(QString const& reason);
+ void finishDecoderDiagnostic();
+ void clearHungDecoderStatus(QString const& reason);
bool is77BitMode () const;
void cease_auto_Tx_after_QSO ();
Q_SLOT void ARRL_Digi_Display();
@@ -1069,7 +1714,6 @@ private:
void activeWorked(QString call, QString band);
void read_log();
void refreshPileupList();
- QString userAgent();
void handleVerifyMsg(int status, QDateTime ts, QString callsign, QString code, unsigned int hz, QString const &response);
void writeFoxTxMsgs();
#ifdef FOX_OTP