Add Tx watchdog status to UDP Status message

Thanks to Mike W9MDB for contributing this patch.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6892 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2016-07-08 10:25:21 +00:00
parent 42bdbf0de7
commit 73ac2ebc39
9 changed files with 28 additions and 18 deletions

View File

@ -337,7 +337,8 @@ void MessageClient::status_update (Frequency f, QString const& mode, QString con
, QString const& report, QString const& tx_mode , QString const& report, QString const& tx_mode
, bool tx_enabled, bool transmitting, bool decoding , bool tx_enabled, bool transmitting, bool decoding
, qint32 rx_df, qint32 tx_df, QString const& de_call , 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 ()) 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_}; NetworkMessage::Builder out {&message, NetworkMessage::Status, m_->id_, m_->schema_};
out << f << mode.toUtf8 () << dx_call.toUtf8 () << report.toUtf8 () << tx_mode.toUtf8 () out << f << mode.toUtf8 () << dx_call.toUtf8 () << report.toUtf8 () << tx_mode.toUtf8 ()
<< tx_enabled << transmitting << decoding << rx_df << tx_df << de_call.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); m_->send_message (out, message);
} }
} }

View File

@ -49,7 +49,7 @@ public:
Q_SLOT void status_update (Frequency, QString const& mode, QString const& dx_call, QString const& report 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 , 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 , 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 Q_SLOT void decode (bool is_new, QTime time, qint32 snr, float delta_time, quint32 delta_frequency
, QString const& mode, QString const& message); , QString const& mode, QString const& message);
Q_SLOT void WSPR_decode (bool is_new, QTime time, qint32 snr, float delta_time, Frequency Q_SLOT void WSPR_decode (bool is_new, QTime time, qint32 snr, float delta_time, Frequency

View File

@ -203,15 +203,16 @@ void MessageServer::impl::parse_message (QHostAddress const& sender, port_type s
QByteArray de_call; QByteArray de_call;
QByteArray de_grid; QByteArray de_grid;
QByteArray dx_grid; QByteArray dx_grid;
bool watchdog_timeout {false};
in >> f >> mode >> dx_call >> report >> tx_mode >> tx_enabled >> transmitting >> decoding 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) if (check_status (in) != Fail)
{ {
Q_EMIT self_->status_update (id, f, QString::fromUtf8 (mode), QString::fromUtf8 (dx_call) Q_EMIT self_->status_update (id, f, QString::fromUtf8 (mode), QString::fromUtf8 (dx_call)
, QString::fromUtf8 (report), QString::fromUtf8 (tx_mode) , QString::fromUtf8 (report), QString::fromUtf8 (tx_mode)
, tx_enabled, transmitting, decoding, rx_df, tx_df , tx_enabled, transmitting, decoding, rx_df, tx_df
, QString::fromUtf8 (de_call), QString::fromUtf8 (de_grid) , QString::fromUtf8 (de_call), QString::fromUtf8 (de_grid)
, QString::fromUtf8 (dx_grid)); , QString::fromUtf8 (dx_grid), watchdog_timeout);
} }
} }
break; break;

View File

@ -63,7 +63,8 @@ public:
Q_SIGNAL void status_update (QString const& id, Frequency, QString const& mode, QString const& dx_call 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 , QString const& report, QString const& tx_mode, bool tx_enabled
, bool transmitting, bool decoding, qint32 rx_df, qint32 tx_df , 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 client_closed (QString const& id);
Q_SIGNAL void decode (bool is_new, QString const& id, QTime time, qint32 snr, float delta_time 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); , quint32 delta_frequency, QString const& mode, QString const& message);

View File

@ -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*/ 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 , QString const& report, QString const& tx_mode, bool tx_enabled
, bool transmitting, bool decoding, qint32 rx_df, qint32 tx_df , 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_) if (id == id_)
{ {
@ -211,6 +212,7 @@ void ClientWidget::update_status (QString const& id, Frequency f, QString const&
auto_off_button_->setEnabled (tx_enabled); auto_off_button_->setEnabled (tx_enabled);
halt_tx_button_->setEnabled (transmitting); halt_tx_button_->setEnabled (transmitting);
update_dynamic_property (mode_label_, "decoding", decoding); update_dynamic_property (mode_label_, "decoding", decoding);
update_dynamic_property (tx_df_label_, "watchdog_timeout", watchdog_timeout);
} }
} }

View File

@ -26,7 +26,7 @@ public:
Q_SLOT void update_status (QString const& id, Frequency f, QString const& mode, QString const& dx_call 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 , QString const& report, QString const& tx_mode, bool tx_enabled
, bool transmitting, bool decoding, qint32 rx_df, qint32 tx_df , 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*/ 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*/ , float /*delta_time*/, quint32 /*delta_frequency*/, QString const& /*mode*/
, QString const& /*message*/); , QString const& /*message*/);

View File

@ -49,7 +49,7 @@ public:
Q_SLOT void update_status (QString const& id, Frequency f, QString const& /*mode*/, QString const& /*dx_call*/ 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*/ , QString const& /*report*/, QString const& /*tx_mode*/, bool /*tx_enabled*/
, bool /*transmitting*/, bool /*decoding*/, qint32 /*rx_df*/, qint32 /*tx_df*/ , 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_) if (id == id_)
{ {

View File

@ -7,3 +7,7 @@
[decoding="true"] { [decoding="true"] {
background-color: cyan background-color: cyan
} }
[watchdog_timeout="true"] {
background-color: red
}

View File

@ -5717,13 +5717,14 @@ void MainWindow::statusUpdate () const
{ {
if (ui) 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, m_messageClient->status_update (m_freqNominal, m_mode, m_hisCall,
QString::number (ui->rptSpinBox->value ()), QString::number (ui->rptSpinBox->value ()),
m_modeTx, ui->autoButton->isChecked (), m_modeTx, ui->autoButton->isChecked (),
m_transmitting, m_decoderBusy, m_transmitting, m_decoderBusy,
ui->RxFreqSpinBox->value (), ui->TxFreqSpinBox->value (), ui->RxFreqSpinBox->value (), ui->TxFreqSpinBox->value (),
m_config.my_callsign (), m_config.my_grid (), m_config.my_callsign (), m_config.my_grid (),
m_hisGrid); m_hisGrid, watchdog_timeout);
} }
} }