From 300b40b55ae617673149ce0f54cc5e93c3ba265e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 1 Nov 2017 18:58:40 +0000 Subject: [PATCH] More work on FoxCalls. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8206 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- foxcalls.cpp | 54 ++++++++++----- foxcalls.h | 2 + foxcalls.ui | 178 +++++++++++++++++++++++++++++++++++++++++-------- mainwindow.cpp | 5 -- 4 files changed, 187 insertions(+), 52 deletions(-) diff --git a/foxcalls.cpp b/foxcalls.cpp index 1a244ca26..93cbecf2e 100644 --- a/foxcalls.cpp +++ b/foxcalls.cpp @@ -19,6 +19,8 @@ FoxCalls::FoxCalls(QSettings * settings, QWidget *parent) : m_settings->beginGroup("FoxCalls"); restoreGeometry (m_settings->value("geometry").toByteArray()); ui->cbReverse->setVisible(false); + ui->foxPlainTextEdit->setReadOnly (true); +// connect (ui->foxPlainTextEdit,SIGNAL(selectCallsign(bool)),this,SLOT(selectCall2(bool))); } FoxCalls::~FoxCalls() @@ -73,25 +75,29 @@ void FoxCalls::insertText(QString t) j=0; t=""; for(auto a: map.keys()) { - if(ui->rbCall->isChecked()) t += map[a] + "\n"; - if(ui->rbSNR->isChecked() or ui->rbAge->isChecked()) { - i=2; - if(ui->rbAge->isChecked()) i=4; - t1=map[a].split(" ",QString::SkipEmptyParts).at(i); - n=1000*(t1.toInt()+100) + j; - } + t1=map[a].split(" ",QString::SkipEmptyParts).at(2); + int nsnr=t1.toInt(); + if(nsnr>=ui->sbMinDB->value() and nsnr<=ui->sbMaxDB->value()) { + if(ui->rbCall->isChecked()) t += map[a] + "\n"; + if(ui->rbSNR->isChecked() or ui->rbAge->isChecked()) { + i=2; + if(ui->rbAge->isChecked()) i=4; + t1=map[a].split(" ",QString::SkipEmptyParts).at(i); + n=1000*(t1.toInt()+100) + j; + } - if(ui->rbGrid->isChecked()) { - t1=map[a].split(" ",QString::SkipEmptyParts).at(1); - int i1=ABC.indexOf(t1.mid(0,1)); - int i2=ABC.indexOf(t1.mid(1,1)); - n=100*(26*i1+i2)+t1.mid(2,2).toInt(); - n=1000*n + j; - } + if(ui->rbGrid->isChecked()) { + t1=map[a].split(" ",QString::SkipEmptyParts).at(1); + int i1=ABC.indexOf(t1.mid(0,1)); + int i2=ABC.indexOf(t1.mid(1,1)); + n=100*(26*i1+i2)+t1.mid(2,2).toInt(); + n=1000*n + j; + } - list.insert(j,n); - lines2.insert(j,map[a]); - j++; + list.insert(j,n); + lines2.insert(j,map[a]); + j++; + } } if(ui->rbSNR->isChecked() or ui->rbAge->isChecked() or ui->rbGrid->isChecked()) { @@ -111,7 +117,9 @@ void FoxCalls::insertText(QString t) } ui->foxPlainTextEdit->setPlainText(t); - ui->foxPlainTextEdit->setReadOnly (true); + QString uniqueCalls; + uniqueCalls.sprintf(" Unique callers: %d",j); + ui->labCallers->setText(uniqueCalls); } void FoxCalls::on_rbCall_toggled(bool b) @@ -141,3 +149,13 @@ void FoxCalls::on_cbReverse_toggled(bool b) m_bReverse=b; insertText(m_t0); } + +void FoxCalls::on_sbMaxDB_valueChanged(int n) +{ + insertText(m_t0); +} + +void FoxCalls::on_sbMinDB_valueChanged(int n) +{ + insertText(m_t0); +} diff --git a/foxcalls.h b/foxcalls.h index b4bef0ded..04bd45292 100644 --- a/foxcalls.h +++ b/foxcalls.h @@ -33,6 +33,8 @@ private slots: void on_rbSNR_toggled(bool b); void on_rbAge_toggled(bool b); void on_cbReverse_toggled(bool b); + void on_sbMaxDB_valueChanged(int n); + void on_sbMinDB_valueChanged(int n); private: bool m_bFirst=true; diff --git a/foxcalls.ui b/foxcalls.ui index 7e5789d99..32b4ec02f 100644 --- a/foxcalls.ui +++ b/foxcalls.ui @@ -6,8 +6,8 @@ 0 0 - 540 - 300 + 546 + 562 @@ -19,7 +19,10 @@ Form - + + + + @@ -112,32 +115,149 @@ - - - - 0 - 0 - - - - - 375 - 0 - - - - - 375 - 16777215 - - - - - Courier New - 12 - - - + + + + + + 0 + 0 + + + + + 375 + 0 + + + + + 375 + 16777215 + + + + + Courier New + 12 + + + + + + + + + + + 16777215 + 20 + + + + Unique callers: 0 + + + + + + + To be called: + + + + + 8 + 17 + 100 + 90 + + + + + 100 + 16777215 + + + + + + + 0 + 130 + 128 + 126 + + + + Called: + + + + + 9 + 16 + 100 + 90 + + + + + 100 + 16777215 + + + + + + + + 13 + 270 + 90 + 22 + + + + Max dB: + + + -50 + + + 50 + + + 30 + + + + + + 13 + 300 + 90 + 22 + + + + Min dB: + + + -50 + + + 50 + + + -30 + + + + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 8d80d1569..3dc2be6f7 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1147,11 +1147,6 @@ void MainWindow::setDecodedTextFont (QFont const& font) if (m_msgAvgWidget) { m_msgAvgWidget->changeFont (font); } - /* - if (m_foxCalls->isVisible()) { - m_foxCalls->changeFont (font); - } - */ updateGeometry (); }