diff --git a/MessageClient.cpp b/MessageClient.cpp index 63c868ad7..94d5cdf19 100644 --- a/MessageClient.cpp +++ b/MessageClient.cpp @@ -337,7 +337,8 @@ void MessageClient::status_update (Frequency f, QString const& mode, QString con , QString const& report, QString const& tx_mode , bool tx_enabled, bool transmitting, bool decoding , qint32 rx_df, qint32 tx_df, QString const& de_call - , QString const& de_grid, QString const& dx_grid) + , QString const& de_grid, QString const& dx_grid + , bool watchdog_timeout) { if (m_->server_port_ && !m_->server_string_.isEmpty ()) { @@ -345,7 +346,7 @@ void MessageClient::status_update (Frequency f, QString const& mode, QString con NetworkMessage::Builder out {&message, NetworkMessage::Status, m_->id_, m_->schema_}; out << f << mode.toUtf8 () << dx_call.toUtf8 () << report.toUtf8 () << tx_mode.toUtf8 () << tx_enabled << transmitting << decoding << rx_df << tx_df << de_call.toUtf8 () - << de_grid.toUtf8 () << dx_grid.toUtf8 (); + << de_grid.toUtf8 () << dx_grid.toUtf8 () << watchdog_timeout; m_->send_message (out, message); } } diff --git a/MessageClient.hpp b/MessageClient.hpp index 63a26b063..bd59a71ba 100644 --- a/MessageClient.hpp +++ b/MessageClient.hpp @@ -49,7 +49,7 @@ public: Q_SLOT void status_update (Frequency, QString const& mode, QString const& dx_call, QString const& report , QString const& tx_mode, bool tx_enabled, bool transmitting, bool decoding , qint32 rx_df, qint32 tx_df, QString const& de_call, QString const& de_grid - , QString const& dx_grid); + , QString const& dx_grid, bool watchdog_timeout); Q_SLOT void decode (bool is_new, QTime time, qint32 snr, float delta_time, quint32 delta_frequency , QString const& mode, QString const& message); Q_SLOT void WSPR_decode (bool is_new, QTime time, qint32 snr, float delta_time, Frequency diff --git a/MessageServer.cpp b/MessageServer.cpp index 55944bb66..5ba04fc35 100644 --- a/MessageServer.cpp +++ b/MessageServer.cpp @@ -203,15 +203,16 @@ void MessageServer::impl::parse_message (QHostAddress const& sender, port_type s QByteArray de_call; QByteArray de_grid; QByteArray dx_grid; + bool watchdog_timeout {false}; in >> f >> mode >> dx_call >> report >> tx_mode >> tx_enabled >> transmitting >> decoding - >> rx_df >> tx_df >> de_call >> de_grid >> dx_grid; + >> rx_df >> tx_df >> de_call >> de_grid >> dx_grid >> watchdog_timeout; if (check_status (in) != Fail) { Q_EMIT self_->status_update (id, f, QString::fromUtf8 (mode), QString::fromUtf8 (dx_call) , QString::fromUtf8 (report), QString::fromUtf8 (tx_mode) , tx_enabled, transmitting, decoding, rx_df, tx_df , QString::fromUtf8 (de_call), QString::fromUtf8 (de_grid) - , QString::fromUtf8 (dx_grid)); + , QString::fromUtf8 (dx_grid), watchdog_timeout); } } break; diff --git a/MessageServer.hpp b/MessageServer.hpp index 29053d807..c0f2a802d 100644 --- a/MessageServer.hpp +++ b/MessageServer.hpp @@ -63,7 +63,8 @@ public: Q_SIGNAL void status_update (QString const& id, Frequency, QString const& mode, QString const& dx_call , QString const& report, QString const& tx_mode, bool tx_enabled , bool transmitting, bool decoding, qint32 rx_df, qint32 tx_df - , QString const& de_call, QString const& de_grid, QString const& dx_grid); + , QString const& de_call, QString const& de_grid, QString const& dx_grid + , bool watchdog_timeout); Q_SIGNAL void client_closed (QString const& id); Q_SIGNAL void decode (bool is_new, QString const& id, QTime time, qint32 snr, float delta_time , quint32 delta_frequency, QString const& mode, QString const& message); diff --git a/UDPExamples/ClientWidget.cpp b/UDPExamples/ClientWidget.cpp index 7d44c85ee..fd545be46 100644 --- a/UDPExamples/ClientWidget.cpp +++ b/UDPExamples/ClientWidget.cpp @@ -194,7 +194,8 @@ ClientWidget::ClientWidget (QAbstractItemModel * decodes_model, QAbstractItemMod void ClientWidget::update_status (QString const& id, Frequency f, QString const& mode, QString const& /*dx_call*/ , QString const& report, QString const& tx_mode, bool tx_enabled , bool transmitting, bool decoding, qint32 rx_df, qint32 tx_df - , QString const& de_call, QString const& /*de_grid*/, QString const& /*dx_grid*/) + , QString const& de_call, QString const& /*de_grid*/, QString const& /*dx_grid*/ + , bool watchdog_timeout) { if (id == id_) { @@ -203,14 +204,15 @@ void ClientWidget::update_status (QString const& id, Frequency f, QString const& mode_label_->setText (QString {"Mode: %1%2"} .arg (mode) .arg (tx_mode.isEmpty () || tx_mode == mode ? "" : '(' + tx_mode + ')')); - frequency_label_->setText ("QRG: " + Radio::pretty_frequency_MHz_string (f)); - rx_df_label_->setText (rx_df >= 0 ? QString {"Rx: %1"}.arg (rx_df) : ""); - tx_df_label_->setText (tx_df >= 0 ? QString {"Tx: %1"}.arg (tx_df) : ""); - report_label_->setText ("SNR: " + report); - update_dynamic_property (frequency_label_, "transmitting", transmitting); - auto_off_button_->setEnabled (tx_enabled); - halt_tx_button_->setEnabled (transmitting); - update_dynamic_property (mode_label_, "decoding", decoding); + frequency_label_->setText ("QRG: " + Radio::pretty_frequency_MHz_string (f)); + rx_df_label_->setText (rx_df >= 0 ? QString {"Rx: %1"}.arg (rx_df) : ""); + tx_df_label_->setText (tx_df >= 0 ? QString {"Tx: %1"}.arg (tx_df) : ""); + report_label_->setText ("SNR: " + report); + update_dynamic_property (frequency_label_, "transmitting", transmitting); + auto_off_button_->setEnabled (tx_enabled); + halt_tx_button_->setEnabled (transmitting); + update_dynamic_property (mode_label_, "decoding", decoding); + update_dynamic_property (tx_df_label_, "watchdog_timeout", watchdog_timeout); } } diff --git a/UDPExamples/ClientWidget.hpp b/UDPExamples/ClientWidget.hpp index 1e4db73f8..2e0ccfef8 100644 --- a/UDPExamples/ClientWidget.hpp +++ b/UDPExamples/ClientWidget.hpp @@ -26,7 +26,7 @@ public: Q_SLOT void update_status (QString const& id, Frequency f, QString const& mode, QString const& dx_call , QString const& report, QString const& tx_mode, bool tx_enabled , bool transmitting, bool decoding, qint32 rx_df, qint32 tx_df - , QString const& de_call, QString const& de_grid, QString const& dx_grid); + , QString const& de_call, QString const& de_grid, QString const& dx_grid, bool watchdog_timeout); Q_SLOT void decode_added (bool /*is_new*/, QString const& client_id, QTime /*time*/, qint32 /*snr*/ , float /*delta_time*/, quint32 /*delta_frequency*/, QString const& /*mode*/ , QString const& /*message*/); diff --git a/UDPExamples/UDPDaemon.cpp b/UDPExamples/UDPDaemon.cpp index 53102a67e..b25c12b5e 100644 --- a/UDPExamples/UDPDaemon.cpp +++ b/UDPExamples/UDPDaemon.cpp @@ -49,7 +49,7 @@ public: Q_SLOT void update_status (QString const& id, Frequency f, QString const& /*mode*/, QString const& /*dx_call*/ , QString const& /*report*/, QString const& /*tx_mode*/, bool /*tx_enabled*/ , bool /*transmitting*/, bool /*decoding*/, qint32 /*rx_df*/, qint32 /*tx_df*/ - , QString const& /*de_call*/, QString const& /*de_grid*/, QString const& /*dx_grid*/) + , QString const& /*de_call*/, QString const& /*de_grid*/, QString const& /*dx_grid*/, bool /* watchdog_timeout */) { if (id == id_) { diff --git a/UDPExamples/qss/default.qss b/UDPExamples/qss/default.qss index bc4044d98..4f4bdf4fc 100644 --- a/UDPExamples/qss/default.qss +++ b/UDPExamples/qss/default.qss @@ -7,3 +7,7 @@ [decoding="true"] { background-color: cyan } + +[watchdog_timeout="true"] { + background-color: red +} \ No newline at end of file diff --git a/mainwindow.cpp b/mainwindow.cpp index 2a136d853..34226f619 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -5717,13 +5717,14 @@ void MainWindow::statusUpdate () const { if (ui) { + bool watchdog_timeout = !m_mode.startsWith("WSPR") && m_config.watchdog () && m_repeatMsg >= m_config.watchdog (); m_messageClient->status_update (m_freqNominal, m_mode, m_hisCall, QString::number (ui->rptSpinBox->value ()), m_modeTx, ui->autoButton->isChecked (), m_transmitting, m_decoderBusy, ui->RxFreqSpinBox->value (), ui->TxFreqSpinBox->value (), m_config.my_callsign (), m_config.my_grid (), - m_hisGrid); + m_hisGrid, watchdog_timeout); } }