From 67ba6ac23dc247038e42d4cf5434cbe69472fe12 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 1 Nov 2017 14:32:21 +0000 Subject: [PATCH] More progress on FoxCalls... git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8204 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- echograph.h | 1 - foxcalls.cpp | 90 +++++++++++++++++++- foxcalls.h | 8 +- foxcalls.ui | 222 +++++++++++++++++++++++++++--------------------- lib/decoder.f90 | 24 ++++-- 5 files changed, 241 insertions(+), 104 deletions(-) diff --git a/echograph.h b/echograph.h index bc8fc52a2..6e91782f1 100644 --- a/echograph.h +++ b/echograph.h @@ -29,7 +29,6 @@ private slots: void on_gainSlider_valueChanged(int value); void on_zeroSlider_valueChanged(int value); void on_binsPerPixelSpinBox_valueChanged(int n); - void on_pbColors_clicked(); private: diff --git a/foxcalls.cpp b/foxcalls.cpp index 41229f85c..1a244ca26 100644 --- a/foxcalls.cpp +++ b/foxcalls.cpp @@ -2,6 +2,7 @@ #include "qt_helpers.hpp" #include #include +#include #include "ui_foxcalls.h" #include "moc_foxcalls.cpp" @@ -17,6 +18,7 @@ FoxCalls::FoxCalls(QSettings * settings, QWidget *parent) : //Restore user's settings m_settings->beginGroup("FoxCalls"); restoreGeometry (m_settings->value("geometry").toByteArray()); + ui->cbReverse->setVisible(false); } FoxCalls::~FoxCalls() @@ -40,6 +42,13 @@ void FoxCalls::saveSettings() void FoxCalls::insertText(QString t) { + QMap map; + QStringList lines,lines2; + QString msg,c2,t1; + QString ABC{"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}; + QList list; + int i,j,k,n,nlines; + if(m_bFirst) { QTextDocument *doc = ui->foxPlainTextEdit->document(); QFont font = doc->defaultFont(); @@ -47,9 +56,88 @@ void FoxCalls::insertText(QString t) font.setPointSize(12); doc->setDefaultFont(font); ui->label_2->setFont(font); - ui->label_2->setText("Call Grid dB Freq Age"); + ui->label_2->setText("Call Grid dB Freq Age"); m_bFirst=false; } + + m_t0=t; +// Save only the most recent transmission from each caller. + lines = t.split("\n"); + nlines=lines.length()-1; + for(i=0; irbCall->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; + } + + list.insert(j,n); + lines2.insert(j,map[a]); + j++; + } + + if(ui->rbSNR->isChecked() or ui->rbAge->isChecked() or ui->rbGrid->isChecked()) { + if(m_bReverse) { + qSort(list.begin(),list.end(),qGreater()); + } else { + qSort(list.begin(),list.end()); + } + } + + if(ui->rbSNR->isChecked() or ui->rbAge->isChecked() or ui->rbGrid->isChecked()) { + for(i=0; ifoxPlainTextEdit->setPlainText(t); ui->foxPlainTextEdit->setReadOnly (true); } + +void FoxCalls::on_rbCall_toggled(bool b) +{ + ui->cbReverse->setVisible(!b); + insertText(m_t0); +} + +void FoxCalls::on_rbGrid_toggled(bool b) +{ + ui->cbReverse->setVisible(b); + insertText(m_t0); +} +void FoxCalls::on_rbSNR_toggled(bool b) +{ + ui->cbReverse->setVisible(b); + insertText(m_t0); +} +void FoxCalls::on_rbAge_toggled(bool b) +{ + ui->cbReverse->setVisible(b); + insertText(m_t0); +} + +void FoxCalls::on_cbReverse_toggled(bool b) +{ + m_bReverse=b; + insertText(m_t0); +} diff --git a/foxcalls.h b/foxcalls.h index 71a3424b6..b4bef0ded 100644 --- a/foxcalls.h +++ b/foxcalls.h @@ -28,10 +28,16 @@ public: void insertText(QString t); private slots: -// void on_binsPerPixelSpinBox_valueChanged(int n); + void on_rbCall_toggled(bool b); + void on_rbGrid_toggled(bool b); + void on_rbSNR_toggled(bool b); + void on_rbAge_toggled(bool b); + void on_cbReverse_toggled(bool b); private: bool m_bFirst=true; + bool m_bReverse; + QString m_t0; QSettings * m_settings; QScopedPointer ui; }; diff --git a/foxcalls.ui b/foxcalls.ui index e508b7277..7e5789d99 100644 --- a/foxcalls.ui +++ b/foxcalls.ui @@ -10,104 +10,136 @@ 300 + + + 0 + 0 + + Form - - - - 19 - 30 - 321 - 31 - - - - - - - Sort by: - - - - - - - Call - - - - - - - Grid - - - - - - - dB - - - - - - - Freq - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 20 - 90 - 411 - 191 - - - - - Courier New - 12 - - - - - - - 27 - 70 - 341 - 16 - - - - - Courier New - 12 - - - - - - + + + + + + + Sort by: + + + + + + + Call + + + true + + + + + + + Grid + + + + + + + dB + + + + + + + Age + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Reverse + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Courier New + 12 + + + + + + + + + + + + 0 + 0 + + + + + 375 + 0 + + + + + 375 + 16777215 + + + + + Courier New + 12 + + + + + diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 48a7a99ee..f7cb41442 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -79,14 +79,26 @@ subroutine multimode_decoder(ss,id2,params,nfsample) logical(params%lapon),params%napwid,params%mycall, & params%mygrid,params%hiscall,params%hisgrid) call timer('decft8 ',1) - n15min=minval(n15fox) - n15max=maxval(n15fox) - print*,nfox,n15min,n15max + n15min=minval(n15fox(1:nfox)) + n15max=maxval(n15fox(1:nfox)) + j=0 + rewind 19 do i=1,nfox - n=n15max-n15fox(i) - write(19,1004) c2fox(i),g2fox(i),nsnrfox(i),nfreqfox(i),n -1004 format(a12,1x,a4,i5,i6,i5) + n=n15fox(i) +! Do this only when c1 = MyCall + if(n15max-n15fox(i).le.4) then + j=j+1 + c2fox(j)=c2fox(i) + g2fox(j)=g2fox(i) + nsnrfox(j)=nsnrfox(i) + nfreqfox(j)=nfreqfox(i) + n15fox(j)=n + m=n15max-n + write(19,1004) c2fox(j),g2fox(j),nsnrfox(j),nfreqfox(j),m +1004 format(a12,1x,a4,i5,i6,i5) + endif enddo + nfox=j flush(19) go to 800 endif