mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-21 19:55:20 -05:00
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:
parent
a45f1f079c
commit
67ba6ac23d
@ -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:
|
||||
|
88
foxcalls.cpp
88
foxcalls.cpp
@ -2,6 +2,7 @@
|
||||
#include "qt_helpers.hpp"
|
||||
#include <QSettings>
|
||||
#include <QApplication>
|
||||
#include <QMap>
|
||||
#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<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) {
|
||||
QTextDocument *doc = ui->foxPlainTextEdit->document();
|
||||
QFont font = doc->defaultFont();
|
||||
@ -50,6 +59,85 @@ void FoxCalls::insertText(QString t)
|
||||
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; 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->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);
|
||||
}
|
||||
|
@ -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::FoxCalls> ui;
|
||||
};
|
||||
|
110
foxcalls.ui
110
foxcalls.ui
@ -10,18 +10,17 @@
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>19</x>
|
||||
<y>30</y>
|
||||
<width>321</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
@ -31,30 +30,56 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_3">
|
||||
<widget class="QRadioButton" name="rbCall">
|
||||
<property name="text">
|
||||
<string>Call</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_2">
|
||||
<widget class="QRadioButton" name="rbGrid">
|
||||
<property name="text">
|
||||
<string>Grid</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton">
|
||||
<widget class="QRadioButton" name="rbSNR">
|
||||
<property name="text">
|
||||
<string>dB</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_4">
|
||||
<widget class="QRadioButton" name="rbAge">
|
||||
<property name="text">
|
||||
<string>Freq</string>
|
||||
<string>Age</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbReverse">
|
||||
<property name="text">
|
||||
<string>Reverse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -72,32 +97,9 @@
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="foxPlainTextEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>90</y>
|
||||
<width>411</width>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>27</x>
|
||||
<y>70</y>
|
||||
<width>341</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
@ -108,6 +110,36 @@
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="foxPlainTextEdit">
|
||||
<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>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
@ -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
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user