More progress on FoxCalls...

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8199 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2017-10-30 20:47:08 +00:00
parent f01031fed5
commit d4652ef0e5
6 changed files with 100 additions and 21 deletions

View File

@ -14,10 +14,9 @@ FoxCalls::FoxCalls(QSettings * settings, QWidget *parent) :
setWindowTitle (QApplication::applicationName () + " - " + tr ("Fox Callers")); setWindowTitle (QApplication::applicationName () + " - " + tr ("Fox Callers"));
installEventFilter(parent); //Installing the filter installEventFilter(parent); //Installing the filter
//Restore user's settings //Restore user's settings
m_settings->beginGroup("FoxCalls"); m_settings->beginGroup("FoxCalls");
restoreGeometry (m_settings->value ("geometry", saveGeometry ()).toByteArray ()); restoreGeometry (m_settings->value("geometry").toByteArray());
} }
FoxCalls::~FoxCalls() FoxCalls::~FoxCalls()
@ -35,17 +34,22 @@ void FoxCalls::saveSettings()
{ {
//Save user's settings //Save user's settings
m_settings->beginGroup("FoxCalls"); m_settings->beginGroup("FoxCalls");
m_settings->setValue ("geometry", saveGeometry ()); m_settings->setValue("geometry", saveGeometry());
m_settings->endGroup(); m_settings->endGroup();
} }
void FoxCalls::insertText(QString t) void FoxCalls::insertText(QString t)
{ {
if(m_bFirst) {
QTextDocument *doc = ui->foxPlainTextEdit->document(); QTextDocument *doc = ui->foxPlainTextEdit->document();
QFont font = doc->defaultFont(); QFont font = doc->defaultFont();
font.setFamily("Courier New"); font.setFamily("Courier New");
font.setPointSize(12);
doc->setDefaultFont(font); doc->setDefaultFont(font);
qDebug() << font; ui->label_2->setFont(font);
ui->label_2->setText("Call Grid dB Freq Age");
m_bFirst=false;
}
ui->foxPlainTextEdit->setPlainText(t); ui->foxPlainTextEdit->setPlainText(t);
ui->foxPlainTextEdit->setReadOnly (true); ui->foxPlainTextEdit->setReadOnly (true);
} }

View File

@ -4,6 +4,7 @@
#include <QWidget> #include <QWidget>
#include <QScopedPointer> #include <QScopedPointer>
#include <QFont> #include <QFont>
#include <QDebug>
namespace Ui { namespace Ui {
class FoxCalls; class FoxCalls;
@ -30,6 +31,7 @@ private slots:
// void on_binsPerPixelSpinBox_valueChanged(int n); // void on_binsPerPixelSpinBox_valueChanged(int n);
private: private:
bool m_bFirst=true;
QSettings * m_settings; QSettings * m_settings;
QScopedPointer<Ui::FoxCalls> ui; QScopedPointer<Ui::FoxCalls> ui;
}; };

View File

@ -17,7 +17,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>19</x> <x>19</x>
<y>60</y> <y>30</y>
<width>321</width> <width>321</width>
<height>31</height> <height>31</height>
</rect> </rect>
@ -78,7 +78,7 @@
<rect> <rect>
<x>20</x> <x>20</x>
<y>90</y> <y>90</y>
<width>511</width> <width>411</width>
<height>191</height> <height>191</height>
</rect> </rect>
</property> </property>
@ -89,6 +89,25 @@
</font> </font>
</property> </property>
</widget> </widget>
<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>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View File

@ -54,10 +54,13 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
10 if (params%nagain) then 10 if (params%nagain) then
open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown', & open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown', &
position='append',iostat=ios) position='append',iostat=ios)
if(params%nmode.eq.8) open(19,file=trim(temp_dir)//'/foxcalls.txt', &
status='unknown',position='append',iostat=ios)
else else
open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown', & open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown',iostat=ios)
iostat=ios) if(params%nmode.eq.8) open(19,file=trim(temp_dir)//'/foxcalls.txt', &
end if status='unknown',iostat=ios)
endif
if(ios.ne.0) then if(ios.ne.0) then
nfail=nfail+1 nfail=nfail+1
if(nfail.le.3) then if(nfail.le.3) then
@ -76,6 +79,15 @@ 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)
n15max=maxval(n15fox)
print*,nfox,n15min,n15max
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)
enddo
flush(19)
go to 800 go to 800
endif endif
@ -400,10 +412,31 @@ contains
real, intent(in) :: dt real, intent(in) :: dt
real, intent(in) :: freq real, intent(in) :: freq
character(len=22), intent(in) :: decoded character(len=22), intent(in) :: decoded
character c2*6,g2*4,w*4
integer i1,i2,i3,n15
integer, intent(in) :: nap integer, intent(in) :: nap
real, intent(in) :: qual real, intent(in) :: qual
character*2 annot character*2 annot
character*22 decoded0 character*22 decoded0
logical isgrid4,first
data first/.true./
save
isgrid4(w)=(len_trim(w).eq.4 .and. &
ichar(w(1:1)).ge.ichar('A') .and. ichar(w(1:1)).le.ichar('R') .and. &
ichar(w(2:2)).ge.ichar('A') .and. ichar(w(2:2)).le.ichar('R') .and. &
ichar(w(3:3)).ge.ichar('0') .and. ichar(w(3:3)).le.ichar('9') .and. &
ichar(w(4:4)).ge.ichar('0') .and. ichar(w(4:4)).le.ichar('9'))
if(first) then
c2fox=' '
g2fox=' '
nsnrfox=-99
nfreqfox=-99
n15z=-99
nfox=0
first=.false.
endif
decoded0=decoded decoded0=decoded
annot=' ' annot=' '
@ -415,6 +448,24 @@ contains
1000 format(i6.6,i4,f5.1,i5,' ~ ',1x,a22,1x,a2) 1000 format(i6.6,i4,f5.1,i5,' ~ ',1x,a22,1x,a2)
write(13,1002) params%nutc,nint(sync),snr,dt,freq,0,decoded0 write(13,1002) params%nutc,nint(sync),snr,dt,freq,0,decoded0
1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a22,' FT8') 1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a22,' FT8')
i1=index(decoded0,' ')
i2=i1 + index(decoded0(i1+1:),' ')
i3=i2 + index(decoded0(i2+1:),' ')
c2=decoded0(i1+1:i2-1)
g2=decoded0(i2+1:i3-1)
if(i3-i2.eq.5 .and. isgrid4(g2)) then
n=params%nutc
n15=(3600*(n/10000) + 60*mod((n/100),100) + mod(n,100))/15
nfox=nfox+1
c2fox(nfox)=c2
g2fox(nfox)=g2
nsnrfox(nfox)=snr
nfreqfox(nfox)=nint(freq)
n15fox(nfox)=n15
n15z=n15
endif
call flush(6) call flush(6)
call flush(13) call flush(13)

View File

@ -1,5 +1,14 @@
module ft8_decode module ft8_decode
parameter (MAXFOX=1000)
character*12 c2fox(MAXFOX)
character*4 g2fox(MAXFOX)
integer nsnrfox(MAXFOX)
integer nfreqfox(MAXFOX)
integer n15fox(MAXFOX)
integer n15z
integer nfox
type :: ft8_decoder type :: ft8_decoder
procedure(ft8_decode_callback), pointer :: callback procedure(ft8_decode_callback), pointer :: callback
contains contains

View File

@ -2719,8 +2719,7 @@ void MainWindow::decodeDone ()
m_RxLog=0; m_RxLog=0;
m_blankLine=true; m_blankLine=true;
if(m_config.bFox()) { if(m_config.bFox()) {
QFile f(m_config.temp_dir ().absoluteFilePath ("decoded.txt")); QFile f(m_config.temp_dir().absoluteFilePath("foxcalls.txt"));
if(f.open(QIODevice::ReadOnly | QIODevice::Text)) { if(f.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream s(&f); QTextStream s(&f);
QString t=s.readAll(); QString t=s.readAll();
@ -3401,8 +3400,6 @@ void MainWindow::guiUpdate()
//Once per second: //Once per second:
if(nsec != m_sec0) { if(nsec != m_sec0) {
// qDebug() << "a" << m_foxCalls->font();
// qDebug() << "b" << ui->decodedTextBrowser->font();
if(m_freqNominal!=0 and m_freqNominal<50000000 and m_config.enable_VHF_features()) { if(m_freqNominal!=0 and m_freqNominal<50000000 and m_config.enable_VHF_features()) {
if(!m_bVHFwarned) vhfWarning(); if(!m_bVHFwarned) vhfWarning();
} else { } else {
@ -4754,9 +4751,6 @@ void MainWindow::on_actionFT8_triggered()
displayWidgets(nWidgets("111010000100111000010000")); displayWidgets(nWidgets("111010000100111000010000"));
if(m_config.bFox()) { if(m_config.bFox()) {
if(!m_foxCalls->isVisible()) { if(!m_foxCalls->isVisible()) {
// QStringList headers{"Call","Loc","dB","Freq","UTC"};
// m_foxTable->setHorizontalHeaderLabels(headers);
// m_foxTable->setGeometry(QRect(100,100,550,400));
m_foxCalls->show(); m_foxCalls->show();
} }
} else { } else {