More progress on FoxCalls...

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8204 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2017-11-01 14:32:21 +00:00
parent a45f1f079c
commit 67ba6ac23d
5 changed files with 241 additions and 104 deletions

View File

@ -29,7 +29,6 @@ private slots:
void on_gainSlider_valueChanged(int value); void on_gainSlider_valueChanged(int value);
void on_zeroSlider_valueChanged(int value); void on_zeroSlider_valueChanged(int value);
void on_binsPerPixelSpinBox_valueChanged(int n); void on_binsPerPixelSpinBox_valueChanged(int n);
void on_pbColors_clicked(); void on_pbColors_clicked();
private: private:

View File

@ -2,6 +2,7 @@
#include "qt_helpers.hpp" #include "qt_helpers.hpp"
#include <QSettings> #include <QSettings>
#include <QApplication> #include <QApplication>
#include <QMap>
#include "ui_foxcalls.h" #include "ui_foxcalls.h"
#include "moc_foxcalls.cpp" #include "moc_foxcalls.cpp"
@ -17,6 +18,7 @@ FoxCalls::FoxCalls(QSettings * settings, QWidget *parent) :
//Restore user's settings //Restore user's settings
m_settings->beginGroup("FoxCalls"); m_settings->beginGroup("FoxCalls");
restoreGeometry (m_settings->value("geometry").toByteArray()); restoreGeometry (m_settings->value("geometry").toByteArray());
ui->cbReverse->setVisible(false);
} }
FoxCalls::~FoxCalls() FoxCalls::~FoxCalls()
@ -40,6 +42,13 @@ void FoxCalls::saveSettings()
void FoxCalls::insertText(QString t) void FoxCalls::insertText(QString t)
{ {
QMap<QString,QString> map;
QStringList lines,lines2;
QString msg,c2,t1;
QString ABC{"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
QList<int> list;
int i,j,k,n,nlines;
if(m_bFirst) { if(m_bFirst) {
QTextDocument *doc = ui->foxPlainTextEdit->document(); QTextDocument *doc = ui->foxPlainTextEdit->document();
QFont font = doc->defaultFont(); QFont font = doc->defaultFont();
@ -47,9 +56,88 @@ void FoxCalls::insertText(QString t)
font.setPointSize(12); font.setPointSize(12);
doc->setDefaultFont(font); doc->setDefaultFont(font);
ui->label_2->setFont(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_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; i<nlines; i++) {
msg=lines.at(i);
c2=msg.split(" ").at(0);
map[c2]=msg;
}
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;
}
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<int>());
} else {
qSort(list.begin(),list.end());
}
}
if(ui->rbSNR->isChecked() or ui->rbAge->isChecked() or ui->rbGrid->isChecked()) {
for(i=0; i<j; i++) {
k=list[i]%1000;
n=list[i]/1000 - 100;
t += lines2.at(k) + "\n";
}
}
ui->foxPlainTextEdit->setPlainText(t); ui->foxPlainTextEdit->setPlainText(t);
ui->foxPlainTextEdit->setReadOnly (true); 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);
}

View File

@ -28,10 +28,16 @@ public:
void insertText(QString t); void insertText(QString t);
private slots: 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: private:
bool m_bFirst=true; bool m_bFirst=true;
bool m_bReverse;
QString m_t0;
QSettings * m_settings; QSettings * m_settings;
QScopedPointer<Ui::FoxCalls> ui; QScopedPointer<Ui::FoxCalls> ui;
}; };

View File

@ -10,104 +10,136 @@
<height>300</height> <height>300</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<widget class="QWidget" name="horizontalLayoutWidget"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="geometry"> <item>
<rect> <layout class="QHBoxLayout" name="horizontalLayout">
<x>19</x> <item>
<y>30</y> <widget class="QLabel" name="label">
<width>321</width> <property name="text">
<height>31</height> <string>Sort by: </string>
</rect> </property>
</property> </widget>
<layout class="QHBoxLayout" name="horizontalLayout"> </item>
<item> <item>
<widget class="QLabel" name="label"> <widget class="QRadioButton" name="rbCall">
<property name="text"> <property name="text">
<string>Sort by: </string> <string>Call</string>
</property> </property>
</widget> <property name="checked">
</item> <bool>true</bool>
<item> </property>
<widget class="QRadioButton" name="radioButton_3"> </widget>
<property name="text"> </item>
<string>Call</string> <item>
</property> <widget class="QRadioButton" name="rbGrid">
</widget> <property name="text">
</item> <string>Grid</string>
<item> </property>
<widget class="QRadioButton" name="radioButton_2"> </widget>
<property name="text"> </item>
<string>Grid</string> <item>
</property> <widget class="QRadioButton" name="rbSNR">
</widget> <property name="text">
</item> <string>dB</string>
<item> </property>
<widget class="QRadioButton" name="radioButton"> </widget>
<property name="text"> </item>
<string>dB</string> <item>
</property> <widget class="QRadioButton" name="rbAge">
</widget> <property name="text">
</item> <string>Age</string>
<item> </property>
<widget class="QRadioButton" name="radioButton_4"> </widget>
<property name="text"> </item>
<string>Freq</string> <item>
</property> <spacer name="horizontalSpacer">
</widget> <property name="orientation">
</item> <enum>Qt::Horizontal</enum>
<item> </property>
<spacer name="horizontalSpacer_2"> <property name="sizeType">
<property name="orientation"> <enum>QSizePolicy::Fixed</enum>
<enum>Qt::Horizontal</enum> </property>
</property> <property name="sizeHint" stdset="0">
<property name="sizeHint" stdset="0"> <size>
<size> <width>30</width>
<width>40</width> <height>20</height>
<height>20</height> </size>
</size> </property>
</property> </spacer>
</spacer> </item>
</item> <item>
</layout> <widget class="QCheckBox" name="cbReverse">
</widget> <property name="text">
<widget class="QPlainTextEdit" name="foxPlainTextEdit"> <string>Reverse</string>
<property name="geometry"> </property>
<rect> </widget>
<x>20</x> </item>
<y>90</y> <item>
<width>411</width> <spacer name="horizontalSpacer_2">
<height>191</height> <property name="orientation">
</rect> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="font"> <property name="sizeHint" stdset="0">
<font> <size>
<family>Courier New</family> <width>40</width>
<pointsize>12</pointsize> <height>20</height>
</font> </size>
</property> </property>
</widget> </spacer>
<widget class="QLabel" name="label_2"> </item>
<property name="geometry"> </layout>
<rect> </item>
<x>27</x> <item>
<y>70</y> <widget class="QLabel" name="label_2">
<width>341</width> <property name="font">
<height>16</height> <font>
</rect> <family>Courier New</family>
</property> <pointsize>12</pointsize>
<property name="font"> </font>
<font> </property>
<family>Courier New</family> <property name="text">
<pointsize>12</pointsize> <string/>
</font> </property>
</property> </widget>
<property name="text"> </item>
<string/> <item>
</property> <widget class="QPlainTextEdit" name="foxPlainTextEdit">
</widget> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>375</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>375</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Courier New</family>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
</layout>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View File

@ -79,14 +79,26 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
logical(params%lapon),params%napwid,params%mycall, & logical(params%lapon),params%napwid,params%mycall, &
params%mygrid,params%hiscall,params%hisgrid) params%mygrid,params%hiscall,params%hisgrid)
call timer('decft8 ',1) call timer('decft8 ',1)
n15min=minval(n15fox) n15min=minval(n15fox(1:nfox))
n15max=maxval(n15fox) n15max=maxval(n15fox(1:nfox))
print*,nfox,n15min,n15max j=0
rewind 19
do i=1,nfox do i=1,nfox
n=n15max-n15fox(i) n=n15fox(i)
write(19,1004) c2fox(i),g2fox(i),nsnrfox(i),nfreqfox(i),n ! Do this only when c1 = MyCall
1004 format(a12,1x,a4,i5,i6,i5) 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 enddo
nfox=j
flush(19) flush(19)
go to 800 go to 800
endif endif