Added more sane defaults to tx watchdog. Fixed bug in relay disabled when no relay required

This commit is contained in:
Jordan Sherer 2018-09-11 11:20:17 -04:00
parent df0b06ccb7
commit fddca6522e
3 changed files with 20 additions and 5 deletions

View File

@ -1587,6 +1587,9 @@ void Configuration::impl::read_settings ()
disable_TX_on_73_ = settings_->value ("73TxDisable", false).toBool (); disable_TX_on_73_ = settings_->value ("73TxDisable", false).toBool ();
beacon_ = settings_->value ("TxBeacon", 30).toInt (); beacon_ = settings_->value ("TxBeacon", 30).toInt ();
watchdog_ = settings_->value ("TxWatchdog", 0).toInt (); watchdog_ = settings_->value ("TxWatchdog", 0).toInt ();
if(watchdog_){
watchdog_ = qMax(5, watchdog_);
}
TX_messages_ = settings_->value ("Tx2QSO", true).toBool (); TX_messages_ = settings_->value ("Tx2QSO", true).toBool ();
enable_VHF_features_ = settings_->value("VHFUHF",false).toBool (); enable_VHF_features_ = settings_->value("VHFUHF",false).toBool ();
decode_at_52s_ = settings_->value("Decode52",false).toBool (); decode_at_52s_ = settings_->value("Decode52",false).toBool ();

View File

@ -359,7 +359,7 @@
<item> <item>
<widget class="QCheckBox" name="relay_disabled_check_box"> <widget class="QCheckBox" name="relay_disabled_check_box">
<property name="text"> <property name="text">
<string>Disable message passing (&gt;) when AUTO is enabled</string> <string>Disable message relay (&gt;) when AUTO is enabled</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -571,6 +571,9 @@
<property name="prefix"> <property name="prefix">
<string/> <string/>
</property> </property>
<property name="singleStep">
<number>5</number>
</property>
<property name="value"> <property name="value">
<number>0</number> <number>0</number>
</property> </property>

View File

@ -1406,6 +1406,10 @@ void MainWindow::initializeDummyData(){
} }
displayActivity(true); displayActivity(true);
QTimer::singleShot(10000, this, [this](){
tx_watchdog(true);
});
} }
void MainWindow::initialize_fonts () void MainWindow::initialize_fonts ()
@ -4682,6 +4686,10 @@ void MainWindow::guiUpdate()
void MainWindow::startTx() void MainWindow::startTx()
{ {
if(m_tx_watchdog){
return;
}
if(!prepareNextMessageFrame()){ if(!prepareNextMessageFrame()){
return; return;
} }
@ -4755,7 +4763,7 @@ void MainWindow::stopTx()
tx_status_label.setText(""); tx_status_label.setText("");
} }
if(prepareNextMessageFrame()){ if(!m_tx_watchdog && prepareNextMessageFrame()){
continueTx(); continueTx();
} else { } else {
// TODO: jsherer - split this up... // TODO: jsherer - split this up...
@ -9506,7 +9514,7 @@ void MainWindow::processCommandActivity() {
#endif #endif
// PROCESS RELAY // 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 // 1. see if there are any more hops to process
// 2. if so, forward // 2. if so, forward
@ -9517,8 +9525,8 @@ void MainWindow::processCommandActivity() {
auto text = d.text; auto text = d.text;
auto match = re.match(text); auto match = re.match(text);
// if the text starts with a callsign, relay. // if the text starts with a callsign, and relay is not disabled, then relay.
if(match.hasMatch()){ if(match.hasMatch() && !m_config.relay_off()){
// replace freetext with relayed free text // replace freetext with relayed free text
if(match.captured("type") != ">"){ if(match.captured("type") != ">"){
text = text.replace(match.capturedStart("type"), match.capturedLength("type"), ">"); text = text.replace(match.capturedStart("type"), match.capturedLength("type"), ">");
@ -10834,6 +10842,7 @@ void MainWindow::tx_watchdog (bool triggered)
m_bTxTime=false; m_bTxTime=false;
if (m_tune) stop_tuning (); if (m_tune) stop_tuning ();
if (m_auto) auto_tx_mode (false); if (m_auto) auto_tx_mode (false);
stopTx();
tx_status_label.setStyleSheet ("QLabel{background-color: #ff0000}"); tx_status_label.setStyleSheet ("QLabel{background-color: #ff0000}");
tx_status_label.setText ("Runaway Tx watchdog"); tx_status_label.setText ("Runaway Tx watchdog");
QApplication::alert (this); QApplication::alert (this);