From fddca6522e43f0e3b61acadf062d844d9ae40369 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Tue, 11 Sep 2018 11:20:17 -0400 Subject: [PATCH] Added more sane defaults to tx watchdog. Fixed bug in relay disabled when no relay required --- Configuration.cpp | 3 +++ Configuration.ui | 5 ++++- mainwindow.cpp | 17 +++++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Configuration.cpp b/Configuration.cpp index e843186..1326224 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -1587,6 +1587,9 @@ void Configuration::impl::read_settings () disable_TX_on_73_ = settings_->value ("73TxDisable", false).toBool (); beacon_ = settings_->value ("TxBeacon", 30).toInt (); watchdog_ = settings_->value ("TxWatchdog", 0).toInt (); + if(watchdog_){ + watchdog_ = qMax(5, watchdog_); + } TX_messages_ = settings_->value ("Tx2QSO", true).toBool (); enable_VHF_features_ = settings_->value("VHFUHF",false).toBool (); decode_at_52s_ = settings_->value("Decode52",false).toBool (); diff --git a/Configuration.ui b/Configuration.ui index 90f2ccb..8f40393 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -359,7 +359,7 @@ - Disable message passing (>) when AUTO is enabled + Disable message relay (>) when AUTO is enabled @@ -571,6 +571,9 @@ + + 5 + 0 diff --git a/mainwindow.cpp b/mainwindow.cpp index db472be..ba06d79 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1406,6 +1406,10 @@ void MainWindow::initializeDummyData(){ } displayActivity(true); + + QTimer::singleShot(10000, this, [this](){ + tx_watchdog(true); + }); } void MainWindow::initialize_fonts () @@ -4682,6 +4686,10 @@ void MainWindow::guiUpdate() void MainWindow::startTx() { + if(m_tx_watchdog){ + return; + } + if(!prepareNextMessageFrame()){ return; } @@ -4755,7 +4763,7 @@ void MainWindow::stopTx() tx_status_label.setText(""); } - if(prepareNextMessageFrame()){ + if(!m_tx_watchdog && prepareNextMessageFrame()){ continueTx(); } else { // TODO: jsherer - split this up... @@ -9506,7 +9514,7 @@ void MainWindow::processCommandActivity() { #endif // PROCESS RELAY - else if (d.cmd == ">" && !isAllCall && !m_config.relay_off()) { + else if (d.cmd == ">" && !isAllCall) { // 1. see if there are any more hops to process // 2. if so, forward @@ -9517,8 +9525,8 @@ void MainWindow::processCommandActivity() { auto text = d.text; auto match = re.match(text); - // if the text starts with a callsign, relay. - if(match.hasMatch()){ + // if the text starts with a callsign, and relay is not disabled, then relay. + if(match.hasMatch() && !m_config.relay_off()){ // replace freetext with relayed free text if(match.captured("type") != ">"){ text = text.replace(match.capturedStart("type"), match.capturedLength("type"), ">"); @@ -10834,6 +10842,7 @@ void MainWindow::tx_watchdog (bool triggered) m_bTxTime=false; if (m_tune) stop_tuning (); if (m_auto) auto_tx_mode (false); + stopTx(); tx_status_label.setStyleSheet ("QLabel{background-color: #ff0000}"); tx_status_label.setText ("Runaway Tx watchdog"); QApplication::alert (this);