Added debug logging button, however, it doesn't propagate the debug

signal through all the modules yet. So, for now, it is hidden.
knobtest
Elliott Liggett 2022-09-15 09:42:19 -07:00
rodzic 95994ed737
commit 2225953d03
5 zmienionych plików z 28 dodań i 1 usunięć

Wyświetl plik

@ -27,6 +27,8 @@ loggingWindow::loggingWindow(QWidget *parent) :
connect(socket, SIGNAL(disconnected()), this, SLOT(disconnectedFromHost()));
connect(socket, SIGNAL(readyRead()), this, SLOT(handleDataFromLoggingHost()));
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(handleLoggingHostError(QAbstractSocket::SocketError)));
ui->debugBtn->setHidden(true); // this button doesn't work yet.
}
loggingWindow::~loggingWindow()
@ -169,3 +171,8 @@ void loggingWindow::on_copyPathBtn_clicked()
{
clipboard->setText(logFilename);
}
void loggingWindow::on_debugBtn_clicked(bool checked)
{
emit setDebugMode(checked);
}

Wyświetl plik

@ -45,6 +45,8 @@ private slots:
void on_copyPathBtn_clicked();
void on_debugBtn_clicked(bool checked);
signals:
void setDebugMode(bool debugOn);

Wyświetl plik

@ -106,6 +106,16 @@
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="debugBtn">
<property name="toolTip">
<string>Enable or disable debug logging</string>
</property>
<property name="text">
<string>Debug</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearDisplayBtn">
<property name="toolTip">

Wyświetl plik

@ -39,6 +39,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, const QString s
setWindowTitle(QString("wfview"));
logWindow = new loggingWindow();
initLogging();
qInfo(logSystem()) << version;
@ -51,7 +52,6 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, const QString s
trxadj = new transceiverAdjustments();
abtBox = new aboutbox();
selRad = new selectRadio();
logWindow = new loggingWindow();
qRegisterMetaType<udpPreferences>(); // Needs to be registered early.
qRegisterMetaType<rigCapabilities>();
@ -6975,6 +6975,8 @@ void wfmain::initLogging()
// Set handler
qInstallMessageHandler(messageHandler);
connect(logWindow, SIGNAL(setDebugMode(bool)), this, SLOT(setDebugLogging(bool)));
// Interval timer for log window updates:
logCheckingTimer.setInterval(100);
connect(&logCheckingTimer, SIGNAL(timeout()), this, SLOT(logCheck()));
@ -7000,6 +7002,11 @@ void wfmain::handleLogText(QString text)
logWindow->acceptLogText(text);
}
void wfmain::setDebugLogging(bool debugModeOn)
{
this->debugMode = debugModeOn;
}
void wfmain::messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg)
{
// Open stream file writes

Wyświetl plik

@ -296,6 +296,7 @@ private slots:
void setRadioTimeDateSend();
void logCheck();
void setDebugLogging(bool debugModeOn);
// void on_getFreqBtn_clicked();