From b7fea629603055d05d88d388623a1c8818d1ab27 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 20 Dec 2017 16:19:48 +0000 Subject: [PATCH] Add labels to Log window, and correct the log-window entry logic. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8355 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 20 +++++++++---- messageaveraging.cpp | 31 ++++++++++++++++++- messageaveraging.h | 4 +++ messageaveraging.ui | 71 ++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 118 insertions(+), 8 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 2e787600f..e3f527973 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -7298,6 +7298,10 @@ void MainWindow::selectHound(QString line) QTextCursor cursor = ui->textBrowser4->textCursor(); cursor.setPosition(0); // Scroll to top of list ui->textBrowser4->setTextCursor(cursor); + if(m_msgAvgWidget != NULL and m_msgAvgWidget->isVisible()) { + m_msgAvgWidget->foxLabQueued(m_houndQueue.size()); + } + } //------------------------------------------------------------------------------ @@ -7316,10 +7320,12 @@ void MainWindow::houndCallers() QString t=""; QString line,houndCall,paddedHoundCall; m_nHoundsCalling=0; + int nTotal=0; //Total number of decoded Hounds calling Fox in 4 most recent Rx sequences // Read and process the file of Hound callers. while(!s.atEnd()) { line=s.readLine(); + nTotal++; houndCall=line.mid(0,6).trimmed(); paddedHoundCall=houndCall + " "; //Don't list a hound already in the queue @@ -7337,9 +7343,13 @@ void MainWindow::houndCallers() int i1=countryName.lastIndexOf(";"); continent=countryName.mid(i1+2,-1); t = t + line + " " + continent + "\n"; - m_nHoundsCalling++; // Total number of decoded Hounds calling Fox + m_nHoundsCalling++; // Number of accepted Hounds to be sorted } } + if(m_msgAvgWidget != NULL and m_msgAvgWidget->isVisible()) { + m_msgAvgWidget->foxLabCallers(nTotal); + } + // Sort and display accumulated list of Hound callers if(t.length()>30) { m_isort=ui->comboBoxHoundSort->currentIndex(); @@ -7360,7 +7370,6 @@ void MainWindow::foxRxSequencer(QString houndCall, QString houndGrid) * message appears for slot i, we queue its message to be repeated. */ - qDebug() << "AA" << houndCall << houndGrid; for(int i=0; iisVisible()) { - m_msgAvgWidget->displayAvg(logLine); + m_msgAvgWidget->foxAddLog(logLine); } + on_logQSOButton_clicked(); m_loggedByFox[m_hisCall] += (m_lastBand + " "); @@ -7442,6 +7451,7 @@ TxTimeout: m_houndGrid[i]=""; } } + if(!fm.contains(";")) { fm.remove("<"); fm.remove(">"); diff --git a/messageaveraging.cpp b/messageaveraging.cpp index 8aefb005a..9f28ba9f7 100644 --- a/messageaveraging.cpp +++ b/messageaveraging.cpp @@ -22,6 +22,9 @@ MessageAveraging::MessageAveraging(QSettings * settings, QFont const& font, QWid ui->header_label->setText(" Date Time Call Grid Sent Rcvd Band"); } else { ui->header_label->setText(" UTC Sync DT Freq "); + ui->lab1->setVisible(false); + ui->lab2->setVisible(false); + ui->lab3->setVisible(false); } setWindowTitle(m_title_); } @@ -87,5 +90,31 @@ void MessageAveraging::foxLogSetup() { m_title_=QApplication::applicationName () + " - Fox Log"; setWindowTitle(m_title_); - ui->header_label->setText(" Date Time Call Grid Sent Rcvd Band"); + ui->header_label->setText(" Date Time Call Grid Sent Rcvd Band"); +} + +void MessageAveraging::foxLabCallers(int n) +{ + QString t; + t.sprintf("Callers: %3d",n); + ui->lab1->setText(t); +} + +void MessageAveraging::foxLabQueued(int n) +{ + QString t; + t.sprintf("Queued: %3d",n); + ui->lab2->setText(t); +} + +void MessageAveraging::foxLabRate(int n) +{ + QString t; + t.sprintf("Rate: %3d",n); + ui->lab3->setText(t); +} + +void MessageAveraging::foxAddLog(QString logLine) +{ + ui->msgAvgPlainTextEdit->insertPlainText(logLine + "\n"); } diff --git a/messageaveraging.h b/messageaveraging.h index 23b43417b..5bbdb3d0c 100644 --- a/messageaveraging.h +++ b/messageaveraging.h @@ -18,6 +18,10 @@ public: void displayAvg(QString const&); void changeFont (QFont const&); void foxLogSetup(); + void foxLabCallers(int n); + void foxLabQueued(int n); + void foxLabRate(int n); + void foxAddLog(QString logLine); protected: void closeEvent (QCloseEvent *) override; diff --git a/messageaveraging.ui b/messageaveraging.ui index 436a63023..c65a80f92 100644 --- a/messageaveraging.ui +++ b/messageaveraging.ui @@ -2,13 +2,21 @@ MessageAveraging + + + 0 + 0 + 276 + 268 + + Message Averaging - + UTC Sync DT Freq @@ -18,13 +26,72 @@ - + QPlainTextEdit::NoWrap + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 20 + + + + Callers: 0 + + + + + + + + 0 + 20 + + + + Queued: 0 + + + + + + + + 0 + 20 + + + + Rate: 0 + + + + +