mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-12-23 19:25:37 -05:00
Make it possible to find MSK144 code-definition files in the "data_dir" on all platforms.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6747 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
26b20882ba
commit
df518f4e1d
@ -1,4 +1,4 @@
|
||||
subroutine fast_decode(id2,narg,line)
|
||||
subroutine fast_decode(id2,narg,line,pchk_file)
|
||||
|
||||
parameter (NMAX=30*12000)
|
||||
integer*2 id2(NMAX)
|
||||
@ -9,15 +9,9 @@ subroutine fast_decode(id2,narg,line)
|
||||
logical pick
|
||||
character*6 cfile6
|
||||
character*80 line(100)
|
||||
character*80 pchk_file,gen_file
|
||||
character*512 pchk_file
|
||||
save npts
|
||||
|
||||
pchk_file=line(1)
|
||||
i=index(pchk_file,".pchk")
|
||||
gen_file=pchk_file(1:i-1)//".gen"
|
||||
! print*,pchk_file
|
||||
! print*,gen_file
|
||||
|
||||
nutc=narg(0)
|
||||
ndat0=narg(1)
|
||||
nsubmode=narg(2)
|
||||
@ -39,7 +33,7 @@ subroutine fast_decode(id2,narg,line)
|
||||
call jtmsk_decode(id2,narg,line)
|
||||
go to 900
|
||||
else if(nmode.eq.104) then
|
||||
call msk144_decode(id2,ndat0,nutc,0,line)
|
||||
call msk144_decode(id2,ndat0,nutc,0,pchk_file,line)
|
||||
go to 900
|
||||
endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype)
|
||||
subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype,pchk_file)
|
||||
|
||||
!!!!!!!!!!!!!!!!!! Experimental small blocklength ldpc version
|
||||
! s8 + 48bits + s8 + 80 bits = 144 bits (72ms message duration)
|
||||
@ -22,7 +22,7 @@ subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype)
|
||||
use iso_c_binding, only: c_loc,c_size_t
|
||||
use packjt
|
||||
use hashing
|
||||
character*85 pchk_file,gen_file
|
||||
character*512 pchk_file,gen_file
|
||||
character*22 msg0
|
||||
character*22 message !Message to be generated
|
||||
character*22 msgsent !Message as it will be received
|
||||
@ -53,11 +53,8 @@ subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype)
|
||||
if( first ) then
|
||||
first=.false.
|
||||
nsym=128
|
||||
!! Fix this
|
||||
! pchk_file="/Users/sfranke/Builds/wsjtx_install/peg-128-80-reg3.pchk"
|
||||
! gen_file="/Users/sfranke/Builds/wsjtx_install/peg-128-80-reg3.gen"
|
||||
pchk_file="./data/peg-128-80-reg3.pchk"
|
||||
gen_file="./data/peg-128-80-reg3.gen"
|
||||
i=index(pchk_file,".pchk")
|
||||
gen_file=pchk_file(1:i-1)//".gen"
|
||||
call init_ldpc(trim(pchk_file)//char(0),trim(gen_file)//char(0))
|
||||
pi=4.*atan(1.0)
|
||||
twopi=8.*atan(1.0)
|
||||
|
@ -1,4 +1,4 @@
|
||||
subroutine msk144_decode(id2,npts,nutc,nprint,line)
|
||||
subroutine msk144_decode(id2,npts,nutc,nprint,pchk_file,line)
|
||||
|
||||
! Calls the experimental decoder for JTMSK 72ms ldpc messages
|
||||
|
||||
@ -15,6 +15,7 @@ subroutine msk144_decode(id2,npts,nutc,nprint,line)
|
||||
complex cdat2(24000)
|
||||
character*22 msg,msg0 !Decoded message
|
||||
character*80 line(100) !Decodes passed back to caller
|
||||
character*512 pchk_file
|
||||
equivalence (hist,d)
|
||||
|
||||
nsnr0=-99
|
||||
@ -58,7 +59,7 @@ subroutine msk144_decode(id2,npts,nutc,nprint,line)
|
||||
iz=ib-ia+1
|
||||
cdat2(1:iz)=c(ia:ib) !Select nlen complex samples
|
||||
t0=ia/12000.0
|
||||
call syncmsk144(cdat2,iz,msg,freq,nutc,t0)
|
||||
call syncmsk144(cdat2,iz,pchk_file,msg,freq,nutc,t0)
|
||||
if(msg(1:1).ne.' ') then
|
||||
if(msg.ne.msg0) then
|
||||
nline=nline+1
|
||||
|
@ -1,4 +1,5 @@
|
||||
subroutine syncmsk144(cdat,npts,msgreceived,fest,nutc,t0) !nutc and t0 are for debug output
|
||||
subroutine syncmsk144(cdat,npts,pchk_file,msgreceived,fest,nutc,t0)
|
||||
!nutc and t0 are for debug output
|
||||
use iso_c_binding, only: c_loc,c_size_t
|
||||
use packjt
|
||||
use hashing
|
||||
@ -6,7 +7,7 @@ subroutine syncmsk144(cdat,npts,msgreceived,fest,nutc,t0) !nutc and t0 are for
|
||||
|
||||
parameter (NSPM=864)
|
||||
character*22 msgreceived
|
||||
character*85 pchk_file,gen_file
|
||||
character*512 pchk_file,gen_file
|
||||
complex cdat(npts) !Analytic signal
|
||||
complex cdat2(npts)
|
||||
complex c(NSPM)
|
||||
@ -43,9 +44,8 @@ subroutine syncmsk144(cdat,npts,msgreceived,fest,nutc,t0) !nutc and t0 are for
|
||||
save first,cb,pi,twopi,dt,f0,f1
|
||||
|
||||
if(first) then
|
||||
! These files can be found in /lib/ldpc/jtmode_codes directory
|
||||
pchk_file="./data/peg-128-80-reg3.pchk"
|
||||
gen_file="./data/peg-128-80-reg3.gen"
|
||||
i=index(pchk_file,".pchk")
|
||||
gen_file=pchk_file(1:i-1)//".gen"
|
||||
call init_ldpc(trim(pchk_file)//char(0),trim(gen_file)//char(0))
|
||||
! define half-sine pulse and raised-cosine edge window
|
||||
pi=4d0*datan(1d0)
|
||||
|
@ -72,7 +72,7 @@ extern "C" {
|
||||
int* itext, int len1, int len2);
|
||||
|
||||
void genmsk144_(char* msg, int* ichk, char* msgsent, int itone[],
|
||||
int* itext, int len1, int len2);
|
||||
int* itext, char pchkFile[], int len1, int len2, int len3);
|
||||
|
||||
void gen65_(char* msg, int* ichk, char* msgsent, int itone[],
|
||||
int* itext, int len1, int len2);
|
||||
@ -101,7 +101,8 @@ extern "C" {
|
||||
float* level, float* sigdb, float* snr, float* dfreq,
|
||||
float* width);
|
||||
|
||||
void fast_decode_(short id2[], int narg[], char msg[], int len);
|
||||
void fast_decode_(short id2[], int narg[], char msg[], char pchkFile[],
|
||||
int len1, int len2);
|
||||
void hash_calls_(char calls[], int* ih9, int len);
|
||||
void degrade_snr_(short d2[], int* n, float* db, float* bandwidth);
|
||||
void wav12_(short d2[], short d1[], int* nbytes, short* nbitsam2);
|
||||
@ -730,6 +731,12 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
int ntr[]={5,10,15,30};
|
||||
m_TRperiod=ntr[m_TRindex-11];
|
||||
}
|
||||
QString pchkFile = m_config.data_dir().absoluteFilePath("peg-128-80-reg3.pchk");
|
||||
QByteArray ba = pchkFile.toLocal8Bit();
|
||||
for(int i=0; i<512; i++) {
|
||||
m_pchkFile[i]=32;
|
||||
if(i<pchkFile.length()) m_pchkFile[i]=ba[i];
|
||||
}
|
||||
|
||||
// this must be the last statement of constructor
|
||||
if (!m_valid) throw std::runtime_error {"Fatal initialization exception"};
|
||||
@ -1965,19 +1972,8 @@ void MainWindow::decode() //decode()
|
||||
narg[13]=-1;
|
||||
narg[14]=m_config.aggressive();
|
||||
memcpy(d2b,dec_data.d2,2*360000);
|
||||
|
||||
// I'm sure there's a better way to do this... I'm sending the file path to
|
||||
// fast_decode() as the first word of the m_msg[] array.
|
||||
//###
|
||||
QString pchk_file = m_config.data_dir().absoluteFilePath("peg-128-80-reg3.pchk");
|
||||
m_ba = pchk_file.toLocal8Bit();
|
||||
for(int i=0; i<80; i++) {
|
||||
m_msg[0][i]=32;
|
||||
if(i<pchk_file.length()) m_msg[0][i]=m_ba[i];
|
||||
}
|
||||
//###
|
||||
|
||||
*future3 = QtConcurrent::run(fast_decode_,&d2b[0],&narg[0],&m_msg[0][0],80);
|
||||
*future3 = QtConcurrent::run(std::bind(fast_decode_,&d2b[0],&narg[0],&m_msg[0][0],
|
||||
&m_pchkFile[0],80,512));
|
||||
watcher3->setFuture(*future3);
|
||||
} else {
|
||||
memcpy(to, from, qMin(mem_jt9->size(), size));
|
||||
@ -2484,7 +2480,7 @@ void MainWindow::guiUpdate()
|
||||
if(m_modeTx=="JTMSK") genmsk_(message, &ichk, msgsent, const_cast<int *> (itone),
|
||||
&m_currentMessageType, len1, len1);
|
||||
if(m_modeTx=="MSK144") genmsk144_(message, &ichk, msgsent, const_cast<int *> (itone),
|
||||
&m_currentMessageType, len1, len1);
|
||||
&m_currentMessageType, &m_pchkFile[0], len1, len1, 512);
|
||||
msgsent[22]=0;
|
||||
}
|
||||
}
|
||||
|
@ -439,6 +439,7 @@ private:
|
||||
bool m_first_error;
|
||||
|
||||
char m_msg[100][80];
|
||||
char m_pchkFile[512];
|
||||
|
||||
// labels in status bar
|
||||
QLabel * tx_status_label;
|
||||
@ -513,8 +514,6 @@ private:
|
||||
|
||||
QDateTime m_dateTimeQSO;
|
||||
|
||||
QByteArray m_ba;
|
||||
|
||||
QSharedMemory *mem_jt9;
|
||||
LogBook m_logBook;
|
||||
DecodedText m_QSOText;
|
||||
|
Loading…
Reference in New Issue
Block a user