mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-24 10:22:26 -04:00
Decoded text now appears in main window. However, ... the next decode
request fails. Then 3rd one is OK, 4th fails, etc., etc. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2669 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
3ee18fe688
commit
3c6766fc3d
14
commons.h
14
commons.h
@ -6,27 +6,19 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
extern struct {
|
extern struct {
|
||||||
short int d2[1800*12000]; //This is "common/jt9com/..." in fortran
|
float ss[184*NSMAX]; //This is "common/jt9com/..." in fortran
|
||||||
float ss[184*NSMAX];
|
|
||||||
float savg[NSMAX];
|
float savg[NSMAX];
|
||||||
double fcenter; //USB dial freq (kHz)
|
short int d2[1800*12000];
|
||||||
int nutc; //UTC as integer, HHMM
|
int nutc; //UTC as integer, HHMM
|
||||||
|
int ndiskdat; //1 ==> data read from *.wav file
|
||||||
int ntrperiod; //TR period (seconds)
|
int ntrperiod; //TR period (seconds)
|
||||||
int mousedf; //User-selected DF
|
|
||||||
int mousefqso; //User-selected QSO freq (kHz)
|
int mousefqso; //User-selected QSO freq (kHz)
|
||||||
int nagain; //1 ==> decode only at fQSO +/- Tol
|
int nagain; //1 ==> decode only at fQSO +/- Tol
|
||||||
int ndepth; //How much hinted decoding to do?
|
|
||||||
int ndiskdat; //1 ==> data read from *.tf2 or *.iq file
|
|
||||||
int newdat; //1 ==> new data, must do long FFT
|
int newdat; //1 ==> new data, must do long FFT
|
||||||
int nfa; //Low decode limit (kHz)
|
int nfa; //Low decode limit (kHz)
|
||||||
int nfb; //High decode limit (kHz)
|
int nfb; //High decode limit (kHz)
|
||||||
int ntol; //+/- decoding range around fQSO (Hz)
|
int ntol; //+/- decoding range around fQSO (Hz)
|
||||||
int map65RxLog; //Flags to control log files
|
|
||||||
int nfsample; //Input sample rate
|
|
||||||
int nsave; //Number of s3(64,63) spectra saved
|
|
||||||
int kin;
|
int kin;
|
||||||
int kline;
|
|
||||||
char datetime[20];
|
|
||||||
} jt9com_;
|
} jt9com_;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
subroutine decoder(ntrSeconds)
|
subroutine decoder(ntrSeconds,c0)
|
||||||
|
|
||||||
! Decoder for JT9. Can run stand-alone, reading data from *.wav files;
|
! Decoder for JT9. Can run stand-alone, reading data from *.wav files;
|
||||||
! or as the back end of wsjt-x, with data placed in a shared memory region.
|
! or as the back end of wsjt-x, with data placed in a shared memory region.
|
||||||
@ -12,21 +12,14 @@ subroutine decoder(ntrSeconds)
|
|||||||
real*4 red(NSMAX)
|
real*4 red(NSMAX)
|
||||||
integer*1 i1SoftSymbols(207)
|
integer*1 i1SoftSymbols(207)
|
||||||
integer*2 id2
|
integer*2 id2
|
||||||
complex c0
|
complex c0(NDMAX)
|
||||||
common/jt9com/id2(NMAX),ss(184,NSMAX),savg(NSMAX),c0(NDMAX), &
|
common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, &
|
||||||
nutc,npts8,junk(20)
|
ntr,mousefqso,nagain,newdat,nfa,nfb,ntol,kin
|
||||||
|
|
||||||
|
|
||||||
ntrMinutes=ntrSeconds/60
|
ntrMinutes=ntrSeconds/60
|
||||||
nfa=1000
|
|
||||||
nfb=2000
|
|
||||||
ntol=500
|
|
||||||
mousedf=0
|
|
||||||
mousefqso=1500
|
|
||||||
newdat=1
|
newdat=1
|
||||||
nb=0
|
nb=0
|
||||||
nbslider=100
|
nbslider=100
|
||||||
f0a=0.
|
|
||||||
|
|
||||||
nsps=0
|
nsps=0
|
||||||
if(ntrMinutes.eq.1) nsps=6912
|
if(ntrMinutes.eq.1) nsps=6912
|
||||||
@ -41,26 +34,25 @@ subroutine decoder(ntrSeconds)
|
|||||||
|
|
||||||
|
|
||||||
! Now do the decoding
|
! Now do the decoding
|
||||||
nutc=nutc0
|
nutc=0
|
||||||
nstandalone=1
|
tstep=kstep/12000.0
|
||||||
|
|
||||||
ntol=500
|
ntol=500
|
||||||
nfqso=1500
|
nfqso=1500
|
||||||
|
|
||||||
! Get sync, approx freq
|
! Get sync, approx freq
|
||||||
call sync9(ss,tstep,f0a,df3,ntol,nfqso,sync,fpk,red)
|
call sync9(ss,tstep,df3,ntol,nfqso,sync,fpk,red)
|
||||||
fpk0=fpk
|
npts8=170880 !### TEST ONLY ###
|
||||||
|
call spec9(c0,npts8,nsps,fpk,xdt,i1SoftSymbols)
|
||||||
call spec9(c0,npts8,nsps,f0a,fpk,xdt,i1SoftSymbols)
|
|
||||||
call decode9(i1SoftSymbols,msg)
|
call decode9(i1SoftSymbols,msg)
|
||||||
|
|
||||||
! open(73,file='decoded.txt',status='unknown')
|
open(73,file='decoded.txt',status='unknown')
|
||||||
iutc=0
|
rewind 73
|
||||||
write(*,1010) iutc,xdt,1000.0+fpk,msg,sync,fpk0
|
! write(*,1010) nutc,sync,xdt,1000.0+fpk,msg
|
||||||
write(73,1010) iutc,xdt,1000.0+fpk,msg,sync,fpk0
|
write(73,1010) nutc,sync,xdt,1000.0+fpk,msg
|
||||||
1010 format(i4.4,f6.1,f7.1,2x,a22,2f9.1)
|
1010 format(i4.4,3f7.1,2x,a22)
|
||||||
flush(73)
|
call flush(73)
|
||||||
! close(13)
|
close(73)
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine decoder
|
end subroutine decoder
|
||||||
|
@ -17,7 +17,8 @@ program jt9
|
|||||||
character*22 msg
|
character*22 msg
|
||||||
integer*2 id2
|
integer*2 id2
|
||||||
complex c0(NDMAX)
|
complex c0(NDMAX)
|
||||||
common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX)
|
common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, &
|
||||||
|
ntr,mousefqso,nagain,newdat,nfa,nfb,ntol,kin
|
||||||
|
|
||||||
nargs=iargc()
|
nargs=iargc()
|
||||||
if(nargs.lt.1) then
|
if(nargs.lt.1) then
|
||||||
@ -74,7 +75,7 @@ program jt9
|
|||||||
nhsym=(k-2048)/kstep
|
nhsym=(k-2048)/kstep
|
||||||
if(nhsym.ge.1 .and. nhsym.ne.nhsym0) then
|
if(nhsym.ge.1 .and. nhsym.ne.nhsym0) then
|
||||||
! Emit signal readyForFFT
|
! Emit signal readyForFFT
|
||||||
call symspec(k,ntrperiod,nsps,ndiskdat,nb,nbslider,pxdb, &
|
call symspec(k,ntrperiod,nsps,nb,nbslider,pxdb, &
|
||||||
s,red,df3,ihsym,nzap,slimit,lstrong,c0,npts8)
|
s,red,df3,ihsym,nzap,slimit,lstrong,c0,npts8)
|
||||||
nhsym0=nhsym
|
nhsym0=nhsym
|
||||||
if(ihsym.ge.184) go to 10
|
if(ihsym.ge.184) go to 10
|
||||||
@ -83,14 +84,14 @@ program jt9
|
|||||||
|
|
||||||
10 close(10)
|
10 close(10)
|
||||||
iz=1000.0/df3
|
iz=1000.0/df3
|
||||||
print*,'A',ihsym,nhsym,tstep,df3,ntol,nfqso
|
! print*,'A',ihsym,nhsym,tstep,df3,ntol,nfqso
|
||||||
|
|
||||||
! Now do the decoding
|
! Now do the decoding
|
||||||
nutc=nutc0
|
nutc=nutc0
|
||||||
|
|
||||||
! Get sync, approx freq
|
! Get sync, approx freq
|
||||||
call sync9(ss,tstep,df3,ntol,nfqso,sync,fpk,red)
|
call sync9(ss,tstep,df3,ntol,nfqso,sync,fpk,red)
|
||||||
print*,'B',sync,fpk
|
! print*,'B',sync,fpk,npts8,nsps
|
||||||
call spec9(c0,npts8,nsps,fpk,xdt,i1SoftSymbols)
|
call spec9(c0,npts8,nsps,fpk,xdt,i1SoftSymbols)
|
||||||
call decode9(i1SoftSymbols,msg)
|
call decode9(i1SoftSymbols,msg)
|
||||||
write(*,1010) nutc,sync,xdt,1000.0+fpk,msg
|
write(*,1010) nutc,sync,xdt,1000.0+fpk,msg
|
||||||
|
@ -27,8 +27,6 @@ subroutine peakdf9(c0,npts8,nsps8,istart,foffset,idfpk)
|
|||||||
idfpk=idf
|
idfpk=idf
|
||||||
smax=sum
|
smax=sum
|
||||||
endif
|
endif
|
||||||
write(71,3001) idf,sum
|
|
||||||
3001 format(i5,f12.3)
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
subroutine symspec(k,ntrperiod,nsps,ndiskdat,nb,nbslider,pxdb,s,red, &
|
subroutine symspec(k,ntrperiod,nsps,nb,nbslider,pxdb,s,red, &
|
||||||
df3,ihsym,nzap,slimit,lstrong,c0,npts8)
|
df3,ihsym,nzap,slimit,lstrong,c0,npts8)
|
||||||
|
|
||||||
! Input:
|
! Input:
|
||||||
@ -32,7 +32,8 @@ subroutine symspec(k,ntrperiod,nsps,ndiskdat,nb,nbslider,pxdb,s,red, &
|
|||||||
logical*1 lstrong(0:1023) !Should be (0:512)
|
logical*1 lstrong(0:1023) !Should be (0:512)
|
||||||
integer*2 id2
|
integer*2 id2
|
||||||
complex c0(NDMAX)
|
complex c0(NDMAX)
|
||||||
common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX)
|
common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, &
|
||||||
|
ntr,mousefqso,nagain,newdat,nfa,nfb,ntol,kin
|
||||||
data rms/999.0/,k0/99999999/,ntrperiod0/0/,nfft3z/0/
|
data rms/999.0/,k0/99999999/,ntrperiod0/0/,nfft3z/0/
|
||||||
save
|
save
|
||||||
|
|
||||||
@ -141,15 +142,5 @@ subroutine symspec(k,ntrperiod,nsps,ndiskdat,nb,nbslider,pxdb,s,red, &
|
|||||||
|
|
||||||
call redsync(ss,ntrperiod,ihsym,iz,red)
|
call redsync(ss,ntrperiod,ihsym,iz,red)
|
||||||
|
|
||||||
if(ihsym.eq.160) then
|
|
||||||
rewind 71
|
|
||||||
do i=1,iz
|
|
||||||
write(71,3003) 1000+i*df3,savg(i),red(i)
|
|
||||||
3003 format(3f12.3)
|
|
||||||
enddo
|
|
||||||
flush(71)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine symspec
|
end subroutine symspec
|
||||||
|
@ -12,6 +12,8 @@ int itone[85]; //Tx audio tones for 85 symbols
|
|||||||
int nwave; //Length of Tx waveform
|
int nwave; //Length of Tx waveform
|
||||||
bool btxok; //True if OK to transmit
|
bool btxok; //True if OK to transmit
|
||||||
double outputLatency; //Latency in seconds
|
double outputLatency; //Latency in seconds
|
||||||
|
float c0[2*1800*1500];
|
||||||
|
|
||||||
//qint16 id[30*48000];
|
//qint16 id[30*48000];
|
||||||
|
|
||||||
WideGraph* g_pWideGraph = NULL;
|
WideGraph* g_pWideGraph = NULL;
|
||||||
@ -315,8 +317,8 @@ void MainWindow::dataSink(int k)
|
|||||||
static int nadj=0;
|
static int nadj=0;
|
||||||
static int nb;
|
static int nb;
|
||||||
static int trmin;
|
static int trmin;
|
||||||
|
static int npts8;
|
||||||
static float px=0.0;
|
static float px=0.0;
|
||||||
static float f0a;
|
|
||||||
static float df3;
|
static float df3;
|
||||||
static uchar lstrong[1024];
|
static uchar lstrong[1024];
|
||||||
static float slimit;
|
static float slimit;
|
||||||
@ -332,8 +334,8 @@ void MainWindow::dataSink(int k)
|
|||||||
nb=0;
|
nb=0;
|
||||||
if(m_NB) nb=1;
|
if(m_NB) nb=1;
|
||||||
trmin=m_TRperiod/60;
|
trmin=m_TRperiod/60;
|
||||||
symspec_(&k, &trmin, &m_nsps, &ndiskdat, &nb, &m_NBslider, &px, s, red,
|
symspec_(&k, &trmin, &m_nsps, &nb, &m_NBslider, &px, s, red,
|
||||||
&f0a, &df3, &ihsym, &nzap, &slimit, lstrong);
|
&df3, &ihsym, &nzap, &slimit, lstrong, c0, &npts8);
|
||||||
if(ihsym <=0) return;
|
if(ihsym <=0) return;
|
||||||
QString t;
|
QString t;
|
||||||
m_pctZap=nzap/178.3;
|
m_pctZap=nzap/178.3;
|
||||||
@ -739,16 +741,14 @@ void MainWindow::diskWriteFinished() //diskWriteFinished
|
|||||||
|
|
||||||
void MainWindow::decoderFinished() //decoderFinished
|
void MainWindow::decoderFinished() //decoderFinished
|
||||||
{
|
{
|
||||||
|
QFile f("decoded.txt");
|
||||||
qDebug() << "Decoder Finished";
|
|
||||||
QFile f("fort.73");
|
|
||||||
f.open(QIODevice::ReadOnly);
|
f.open(QIODevice::ReadOnly);
|
||||||
QTextStream in(&f);
|
QTextStream in(&f);
|
||||||
QString line;
|
QString line;
|
||||||
for(int i=0; i<99999; i++) {
|
for(int i=0; i<99999; i++) {
|
||||||
line=in.readLine();
|
line=in.readLine();
|
||||||
if(line.length()<=0) break;
|
if(line.length()<=0) break;
|
||||||
qDebug() << line;
|
ui->decodedTextBrowser->append(line);
|
||||||
}
|
}
|
||||||
f.close();
|
f.close();
|
||||||
}
|
}
|
||||||
@ -836,8 +836,8 @@ void MainWindow::freezeDecode(int n) //freezeDecode()
|
|||||||
void MainWindow::decode() //decode()
|
void MainWindow::decode() //decode()
|
||||||
{
|
{
|
||||||
m_len1=80;
|
m_len1=80;
|
||||||
*future3 = QtConcurrent::run(decoder_, &m_TRperiod);
|
*future3 = QtConcurrent::run(decoder_, &m_TRperiod, &c0[0]);
|
||||||
watcher3->setFuture(*future2);
|
watcher3->setFuture(*future3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -915,7 +915,7 @@ void MainWindow::guiUpdate()
|
|||||||
ba2msg(ba,msgsent);
|
ba2msg(ba,msgsent);
|
||||||
int len1=22;
|
int len1=22;
|
||||||
int len2=22;
|
int len2=22;
|
||||||
genjt9_(message,&m_TRperiod,msgsent,itone,len1,len2);
|
genjt9_(message,msgsent,itone,len1,len2);
|
||||||
if(m_restart) {
|
if(m_restart) {
|
||||||
QFile f("wsjtx_tx.log");
|
QFile f("wsjtx_tx.log");
|
||||||
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append);
|
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append);
|
||||||
|
13
mainwindow.h
13
mainwindow.h
@ -217,15 +217,14 @@ extern void getDev(int* numDevices,char hostAPI_DeviceName[][50],
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
//----------------------------------------------------- C and Fortran routines
|
//----------------------------------------------------- C and Fortran routines
|
||||||
void symspec_(int* k, int* ntrperiod, int* nsps, int* ndiskdat,
|
void symspec_(int* k, int* ntrperiod, int* nsps, int* nb, int* m_NBslider,
|
||||||
int* nb, int* m_NBslider, float* px, float s[], float red[],
|
float* px, float s[], float red[], float* df3, int* nhsym,
|
||||||
float* f0a, float* df3, int* nhsym, int* nzap,
|
int* nzap, float* slimit, uchar lstrong[], float c0[],
|
||||||
float* slimit, uchar lstrong[]);
|
int* npts8);
|
||||||
|
|
||||||
void genjt9_(char* msg, int* minutes, char* msgsent, int itone[],
|
void genjt9_(char* msg, char* msgsent, int itone[], int len1, int len2);
|
||||||
int len1, int len2);
|
|
||||||
|
|
||||||
void decoder_(int* ntrperiod);
|
void decoder_(int* ntrperiod, float c0[]);
|
||||||
|
|
||||||
int ptt_(int* nport, int* itx, int* iptt);
|
int ptt_(int* nport, int* itx, int* iptt);
|
||||||
}
|
}
|
||||||
|
14
soundin.cpp
14
soundin.cpp
@ -7,27 +7,19 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#include <portaudio.h>
|
#include <portaudio.h>
|
||||||
extern struct {
|
extern struct {
|
||||||
short int d2[1800*12000]; //This is "common/jt9com/..." in fortran
|
float ss[184*NSMAX]; //This is "common/jt9com/..." in fortran
|
||||||
float ss[184*NSMAX];
|
|
||||||
float savg[NSMAX];
|
float savg[NSMAX];
|
||||||
double fcenter; //USB dial freq (kHz)
|
short int d2[1800*12000];
|
||||||
int nutc; //UTC as integer, HHMM
|
int nutc; //UTC as integer, HHMM
|
||||||
|
int ndiskdat; //1 ==> data read from *.wav file
|
||||||
int ntrperiod; //TR period (seconds)
|
int ntrperiod; //TR period (seconds)
|
||||||
int mousedf; //User-selected DF
|
|
||||||
int mousefqso; //User-selected QSO freq (kHz)
|
int mousefqso; //User-selected QSO freq (kHz)
|
||||||
int nagain; //1 ==> decode only at fQSO +/- Tol
|
int nagain; //1 ==> decode only at fQSO +/- Tol
|
||||||
int ndepth; //How much hinted decoding to do?
|
|
||||||
int ndiskdat; //1 ==> data read from *.tf2 or *.iq file
|
|
||||||
int newdat; //1 ==> new data, must do long FFT
|
int newdat; //1 ==> new data, must do long FFT
|
||||||
int nfa; //Low decode limit (kHz)
|
int nfa; //Low decode limit (kHz)
|
||||||
int nfb; //High decode limit (kHz)
|
int nfb; //High decode limit (kHz)
|
||||||
int ntol; //+/- decoding range around fQSO (Hz)
|
int ntol; //+/- decoding range around fQSO (Hz)
|
||||||
int map65RxLog; //Flags to control log files
|
|
||||||
int nfsample; //Input sample rate
|
|
||||||
int nsave; //Number of s3(64,63) spectra saved
|
|
||||||
int kin;
|
int kin;
|
||||||
int kline;
|
|
||||||
char datetime[20];
|
|
||||||
} jt9com_;
|
} jt9com_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user