Clean up the AutoLog implementation.

This commit is contained in:
Joe Taylor 2018-10-02 14:04:57 -04:00 committed by Bill Somerville
parent ce5426ed3d
commit a34e30a2e6
3 changed files with 21 additions and 1 deletions

View File

@ -5205,7 +5205,7 @@ void MainWindow::cabLog()
band.sprintf(" %5d ",nfreq);
t=QDateTime::currentDateTimeUtc().toString("yyyy-MM-dd hhmm ") + band +
m_hisCall.leftJustified(13,' ') + m_xSent.leftJustified(14,' ') + m_xRcvd;
m_msgAvgWidget->foxAddLog(t);
m_msgAvgWidget->contestAddLog(m_nContest,t);
}
} else {
MessageBox::warning_message (this, tr("File Open Error"),

View File

@ -22,6 +22,10 @@ MessageAveraging::MessageAveraging(QSettings * settings, QFont const& font, QWid
ui->header_label->setText(" Date Time Call Grid Sent Rcvd Band");
} else if(m_title_.contains("Contest")) {
ui->header_label->setText(" Date UTC Band Call Sent Rcvd");
ui->lab1->setText("QSOs: 0");
ui->lab2->setText("Mults: 0");
ui->lab3->setText("Score: 0");
ui->lab4->setText("Rate: 0");
} else {
ui->header_label->setText(" UTC Sync DT Freq ");
ui->lab1->setVisible(false);
@ -29,6 +33,7 @@ MessageAveraging::MessageAveraging(QSettings * settings, QFont const& font, QWid
ui->lab3->setVisible(false);
ui->lab4->setVisible(false);
}
setWindowTitle(m_title_);
m_nLogged_=0;
}
@ -76,6 +81,7 @@ void MessageAveraging::read_settings ()
SettingsGroup group {settings_, "MessageAveraging"};
restoreGeometry (settings_->value ("window/geometry").toByteArray ());
m_title_=settings_->value("window/title","Message Averaging").toString();
m_nContest_=settings_->value("nContest",0).toInt();
}
void MessageAveraging::write_settings ()
@ -83,6 +89,7 @@ void MessageAveraging::write_settings ()
SettingsGroup group {settings_, "MessageAveraging"};
settings_->setValue ("window/geometry", saveGeometry ());
settings_->setValue("window/title",m_title_);
settings_->setValue("nContest",m_nContest_);
}
void MessageAveraging::displayAvg(QString const& t)
@ -102,6 +109,7 @@ void MessageAveraging::foxLogSetup(int nContest)
setWindowTitle(m_title_);
ui->header_label->setText(" Date UTC Band Call Sent Rcvd");
}
m_nContest_=nContest;
}
void MessageAveraging::foxLabCallers(int n)
@ -133,3 +141,13 @@ void MessageAveraging::foxAddLog(QString logLine)
t.sprintf("Logged: %d",m_nLogged_);
ui->lab3->setText(t);
}
void MessageAveraging::contestAddLog(qint32 nContest, QString logLine)
{
m_nContest_=nContest;
ui->msgAvgPlainTextEdit->appendPlainText(logLine);
m_nLogged_++;
QString t;
t.sprintf("QSOs: %d",m_nLogged_);
ui->lab1->setText(t);
}

View File

@ -22,6 +22,7 @@ public:
void foxLabQueued(int n);
void foxLabRate(int n);
void foxAddLog(QString logLine);
void contestAddLog(qint32 nContest, QString logLine);
protected:
void closeEvent (QCloseEvent *) override;
@ -33,6 +34,7 @@ private:
QSettings * settings_;
QString m_title_;
qint32 m_nLogged_;
qint32 m_nContest_;
QScopedPointer<Ui::MessageAveraging> ui;
};