From 0c6fa7018e269e39883fcef48e6a6f0a1e63522e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 4 Dec 2017 15:35:11 +0000 Subject: [PATCH] Document the sortHoundCalls() routine. Don't let signal_meter_widget expand unreasonably. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8284 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 22 +++++++++++----------- mainwindow.ui | 6 ++++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 9503d99c7..4ef0eb131 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -7106,7 +7106,7 @@ QString MainWindow::sortHoundCalls(QString t, int isort, int min_dB, int max_dB) nlines=lines.length()-1; for(i=0; i= min_dB and nsnr <= max_dB) { + int nsnr=t1.toInt(); // get snr + if(nsnr >= min_dB and nsnr <= max_dB) { // keep only if snr is in specified range if(isort==1) t += map[a] + "\n"; if(isort==3 or isort==4) { - i=2; - if(isort==4) i=4; + i=2; // sort Hound calls by snr + if(isort==4) i=4; // sort Hound calls by distance t1=map[a].split(" ",QString::SkipEmptyParts).at(i); - n=1000*(t1.toInt()+100) + j; + n=1000*(t1.toInt()+100) + j; // pack (snr or dist) and index j into n } - if(isort==2) { + if(isort==2) { // sort Hound calls by grid 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; + n=1000*n + j; // pack ngrid and index j into n } - list.insert(j,n); - lines2.insert(j,map[a]); + list.insert(j,n); // add n to list at [j] + lines2.insert(j,map[a]); // add map[a] to lines2 at [j] j++; } } @@ -7155,7 +7155,7 @@ QString MainWindow::sortHoundCalls(QString t, int isort, int min_dB, int max_dB) } int nn=lines2.length(); - if(isort==0) { + if(isort==0) { // shuffle Hound calls to random order int a[nn]; for(i=0; i 0 + + + 50 + 16777215 + + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html>