mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-21 19:55:20 -05:00
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:
parent
42bdbf0de7
commit
73ac2ebc39
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
|
@ -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);
|
||||||
|
@ -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_)
|
||||||
{
|
{
|
||||||
@ -203,14 +204,15 @@ void ClientWidget::update_status (QString const& id, Frequency f, QString const&
|
|||||||
mode_label_->setText (QString {"Mode: %1%2"}
|
mode_label_->setText (QString {"Mode: %1%2"}
|
||||||
.arg (mode)
|
.arg (mode)
|
||||||
.arg (tx_mode.isEmpty () || tx_mode == mode ? "" : '(' + tx_mode + ')'));
|
.arg (tx_mode.isEmpty () || tx_mode == mode ? "" : '(' + tx_mode + ')'));
|
||||||
frequency_label_->setText ("QRG: " + Radio::pretty_frequency_MHz_string (f));
|
frequency_label_->setText ("QRG: " + Radio::pretty_frequency_MHz_string (f));
|
||||||
rx_df_label_->setText (rx_df >= 0 ? QString {"Rx: %1"}.arg (rx_df) : "");
|
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) : "");
|
tx_df_label_->setText (tx_df >= 0 ? QString {"Tx: %1"}.arg (tx_df) : "");
|
||||||
report_label_->setText ("SNR: " + report);
|
report_label_->setText ("SNR: " + report);
|
||||||
update_dynamic_property (frequency_label_, "transmitting", transmitting);
|
update_dynamic_property (frequency_label_, "transmitting", transmitting);
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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*/);
|
||||||
|
@ -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_)
|
||||||
{
|
{
|
||||||
|
@ -7,3 +7,7 @@
|
|||||||
[decoding="true"] {
|
[decoding="true"] {
|
||||||
background-color: cyan
|
background-color: cyan
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[watchdog_timeout="true"] {
|
||||||
|
background-color: red
|
||||||
|
}
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user