Index: mainwindow.cpp
===================================================================
--- mainwindow.cpp (revision 6470)
+++ mainwindow.cpp (working copy)
@@ -492,7 +492,6 @@
m_freeText=false;
m_msErase=0;
m_sentFirst73=false;
- m_watchdogLimit=7;
m_repeatMsg=0;
m_secBandChanged=0;
m_lockTxFreq=false;
@@ -709,6 +708,9 @@
m_settings->setValue ("AstroDisplayed", m_astroWidget && m_astroWidget->isVisible());
m_settings->setValue ("MsgAvgDisplayed", m_msgAvgWidget && m_msgAvgWidget->isVisible());
m_settings->setValue ("FreeText", ui->freeTextMsg->currentText ());
+ m_settings->setValue("WatchdogLimit",m_watchdogLimit);
+ if (m_config.watchdog()) ui->watchdogSpinBox->hide();
+ else ui->watchdogSpinBox->show();
m_settings->endGroup();
m_settings->beginGroup("Common");
@@ -761,6 +763,8 @@
auto displayMsgAvg = m_settings->value ("MsgAvgDisplayed", false).toBool ();
if (m_settings->contains ("FreeText")) ui->freeTextMsg->setCurrentText (
m_settings->value ("FreeText").toString ());
+ m_watchdogLimit=m_settings->value("WatchdogLimit",3).toInt();
+ ui->watchdogSpinBox->setValue(m_watchdogLimit);
m_settings->endGroup();
// do this outside of settings group because it uses groups internally
@@ -1230,6 +1234,9 @@
}
ui->sbTxPercent->setPalette(palette);
}
+ m_repeatMsg = 0;
+ setWatchdogSpinBox(true);
+ m_msgSent0 = "";
}
void MainWindow::auto_tx_mode (bool state)
@@ -2590,6 +2597,7 @@
}
iptt0=g_iptt;
btxok0=m_btxok;
+ setWatchdogSpinBox(false);
} //End of GUIupdate
@@ -2654,9 +2662,11 @@
m_nTx73=0;
}
if (m_mode.mid(0,4)!="WSPR" and m_mode!="Echo" and m_config.watchdog() and
- m_repeatMsg>=m_watchdogLimit-1) {
+ m_repeatMsg>=m_watchdogLimit) {
on_stopTxButton_clicked();
- msgBox("Runaway Tx watchdog");
+ QPalette* palette = new QPalette();
+ palette->setColor(QPalette::Base,Qt::red);
+ ui->watchdogSpinBox->setPalette(*palette);
m_repeatMsg=0;
}
if(m_mode.mid(0,4)=="WSPR" and m_ntr==-1 and !m_tuneup) {
@@ -2697,6 +2707,7 @@
{
m_ntx=n;
m_repeatMsg=0;
+ setWatchdogSpinBox(true);
}
void MainWindow::on_txb1_clicked() //txb1
@@ -2770,6 +2781,8 @@
if(m_decodedText2) messages= ui->decodedTextBrowser->toPlainText();
if(ui->cbCQRx->isChecked()) m_bDoubleClickAfterCQnnn=true;
processMessage(messages, position, ctrl);
+ m_repeatMsg = 0;
+ setWatchdogSpinBox(true);
}
void MainWindow::processMessage(QString const& messages, int position, bool ctrl)
@@ -4015,6 +4028,7 @@
qsy (f);
setXIT (ui->TxFreqSpinBox->value ());
m_repeatMsg = 0; // reset Tx watchdog
+ setWatchdogSpinBox(true);
}
}
@@ -4140,6 +4154,7 @@
} else {
m_sentFirst73=false;
m_repeatMsg=0;
+ setWatchdogSpinBox(true);
itone[0]=0;
on_monitorButton_clicked (true);
m_tune_attenuation_restore = ui->outAttenuation->value();
@@ -4177,6 +4192,7 @@
if (m_auto and !m_tuneup) auto_tx_mode (false);
m_btxok=false;
m_repeatMsg=0;
+ setWatchdogSpinBox(true);
}
void MainWindow::rigOpen ()
@@ -5216,3 +5232,31 @@
Q_EMIT m_config.transceiver_frequency(m_dialFreq);
}
+
+void MainWindow::on_watchdogSpinBox_valueChanged(int arg1)
+{
+ m_watchdogLimit = arg1;
+}
+
+// Update the watchdogSpinBox -- only during transmit unless now is true
+void MainWindow::setWatchdogSpinBox(bool now)
+{
+ static int last;
+ if (last != m_repeatMsg) {
+ last = m_repeatMsg;
+ }
+ if (m_config.watchdog()) {
+ ui->watchdogSpinBox->show();
+ }
+ else {
+ ui->watchdogSpinBox->hide();
+ }
+ if (m_transmitting || now) {
+ QPalette *palette = new QPalette();
+ palette->setColor(QPalette::Base,Qt::white);
+ if (m_repeatMsg >= m_watchdogLimit)
+ palette->setColor(QPalette::Base,Qt::yellow);
+ ui->watchdogSpinBox->setPalette(*palette);
+ // we set it to red in stopTx2 when watchdog limit is reached at end of transmission
+ }
+}
Index: mainwindow.h
===================================================================
--- mainwindow.h (revision 6470)
+++ mainwindow.h (working copy)
@@ -249,6 +249,8 @@
void on_actionJTMSK_triggered();
void on_sbCQRxFreq_valueChanged(int n);
void on_cbCQRx_toggled(bool b);
+ void on_watchdogSpinBox_valueChanged(int arg1);
+ void setWatchdogSpinBox(bool now);
private:
Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo,
Index: mainwindow.ui
===================================================================
--- mainwindow.ui (revision 6470)
+++ mainwindow.ui (working copy)
@@ -7,7 +7,7 @@
0
0
786
- 475
+ 493
@@ -606,6 +606,25 @@
-
+
-
+
+
+ <html><head/><body><p># of Tx repeats before watchdog timeout<br>Yellow means last tx underway<br>Red is timed out</p></body></html>
+
+
+ Repeat
+
+
+ 0
+
+
+ 15
+
+
+ 3
+
+
+
-
@@ -773,7 +792,7 @@
- -
+
-