mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-24 10:22:26 -04:00
WIP on SuperFox integration into WSJT-X.
This commit is contained in:
parent
b495531f78
commit
027b84f047
@ -1,4 +1,4 @@
|
|||||||
subroutine foxgen(bSuperFox)
|
subroutine foxgen(bSuperFox,cmnd)
|
||||||
|
|
||||||
! Called from MainWindow::foxTxSequencer() to generate the Tx waveform in
|
! Called from MainWindow::foxTxSequencer() to generate the Tx waveform in
|
||||||
! FT8 Fox mode. The Tx message can contain up to 5 "slots", each carrying
|
! FT8 Fox mode. The Tx message can contain up to 5 "slots", each carrying
|
||||||
@ -18,6 +18,7 @@ subroutine foxgen(bSuperFox)
|
|||||||
parameter (NWAVE=(160+2)*134400*4) !the biggest waveform we generate (FST4-1800 at 48kHz)
|
parameter (NWAVE=(160+2)*134400*4) !the biggest waveform we generate (FST4-1800 at 48kHz)
|
||||||
parameter (NFFT=614400,NH=NFFT/2)
|
parameter (NFFT=614400,NH=NFFT/2)
|
||||||
logical*1 bSuperFox
|
logical*1 bSuperFox
|
||||||
|
character*120 cmnd
|
||||||
character*40 cmsg
|
character*40 cmsg
|
||||||
character*37 msg,msgsent
|
character*37 msg,msgsent
|
||||||
integer itone(79)
|
integer itone(79)
|
||||||
@ -31,7 +32,7 @@ subroutine foxgen(bSuperFox)
|
|||||||
equivalence (x,cx),(y,cy)
|
equivalence (x,cx),(y,cy)
|
||||||
|
|
||||||
if(bSuperFox) then
|
if(bSuperFox) then
|
||||||
call foxgen2(nslots,cmsg)
|
call foxgen2(nslots,cmsg,cmnd)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -1,24 +1,25 @@
|
|||||||
subroutine foxgen2(nslots,cmsg)
|
subroutine foxgen2(nslots,cmsg,line)
|
||||||
|
|
||||||
! Called from foxgen() when it's time to encode a SuperFox message and
|
! Called from foxgen() when it's time to encode a SuperFox message and
|
||||||
! generate the waveform to be transmitted. We need to parse the old-style
|
! generate the waveform to be transmitted. We need to parse the old-style
|
||||||
! Fox messages and extract the necessary pieces.
|
! Fox messages and extract the necessary pieces.
|
||||||
|
|
||||||
use packjt77
|
use packjt77
|
||||||
|
character*120 line
|
||||||
character*40 cmsg(5) !Old-style Fox messages are here
|
character*40 cmsg(5) !Old-style Fox messages are here
|
||||||
character*37 msg
|
character*37 msg
|
||||||
character*22 sfmsg
|
character*26 sfmsg
|
||||||
character*12 mycall
|
character*13 mycall
|
||||||
character*4 mygrid
|
character*4 mygrid
|
||||||
character*6 hiscall_1,hiscall_2
|
character*6 hiscall_1,hiscall_2
|
||||||
character*4 rpt_1,rpt_2
|
character*4 rpt1,rpt2
|
||||||
character*13 w(19)
|
character*13 w(19)
|
||||||
integer nw(19)
|
integer nw(19)
|
||||||
integer ntype !Message type: 0 Free Text
|
integer ntype !Message type: 0 Free Text
|
||||||
! 1 CQ MyCall MyGrid
|
! 1 CQ MyCall MyGrid
|
||||||
! 2 Call_1 MyCall RR73
|
! 2 Call_1 MyCall RR73
|
||||||
! 3 Call_1 MyCall rpt_1
|
! 3 Call_1 MyCall rpt1
|
||||||
! 4 Call_1 RR73; Call_2 <MyCall> rpt_2
|
! 4 Call_1 RR73; Call_2 <MyCall> rpt2
|
||||||
|
|
||||||
if(nslots.lt.1 .or. nslots.gt.5) return
|
if(nslots.lt.1 .or. nslots.gt.5) return
|
||||||
k=0
|
k=0
|
||||||
@ -27,8 +28,8 @@ subroutine foxgen2(nslots,cmsg)
|
|||||||
hiscall_2=''
|
hiscall_2=''
|
||||||
mycall=''
|
mycall=''
|
||||||
mygrid=''
|
mygrid=''
|
||||||
rpt_1=''
|
rpt1=''
|
||||||
rpt_2=''
|
rpt2=''
|
||||||
msg=cmsg(i)(1:37)
|
msg=cmsg(i)(1:37)
|
||||||
call split77(msg,nwords,nw,w)
|
call split77(msg,nwords,nw,w)
|
||||||
ntype=0
|
ntype=0
|
||||||
@ -40,37 +41,38 @@ subroutine foxgen2(nslots,cmsg)
|
|||||||
ntype=4
|
ntype=4
|
||||||
hiscall_1=w(1)(1:6)
|
hiscall_1=w(1)(1:6)
|
||||||
hiscall_2=w(3)(1:6)
|
hiscall_2=w(3)(1:6)
|
||||||
rpt_1='RR73'
|
rpt1='RR73'
|
||||||
rpt_2=w(5)(1:4)
|
rpt2=w(5)(1:4)
|
||||||
mycall=w(4)(2:nw(4)-1)
|
mycall=w(4)(2:nw(4)-1)
|
||||||
else if(index(msg,' RR73').gt.0) then
|
else if(index(msg,' RR73').gt.0) then
|
||||||
ntype=2
|
ntype=2
|
||||||
hiscall_1=w(1)(1:6)
|
hiscall_1=w(1)(1:6)
|
||||||
mycall=w(2)(1:12)
|
mycall=w(2)(1:12)
|
||||||
rpt_1='RR73'
|
rpt1='RR73'
|
||||||
else if(nwords.eq.3 .and. nw(3).eq.3 .and. &
|
else if(nwords.eq.3 .and. nw(3).eq.3 .and. &
|
||||||
(w(3)(1:1).eq.'-' .or. w(3)(1:1).eq.'+')) then
|
(w(3)(1:1).eq.'-' .or. w(3)(1:1).eq.'+')) then
|
||||||
ntype=3
|
ntype=3
|
||||||
hiscall_1=w(1)(1:6)
|
hiscall_1=w(1)(1:6)
|
||||||
mycall=w(2)(1:12)
|
mycall=w(2)(1:12)
|
||||||
rpt_1=w(3)(1:4)
|
rpt1=w(3)(1:4)
|
||||||
endif
|
endif
|
||||||
! write(*,3001) ntype,cmsg(i),hiscall_1,rpt_1,hiscall_2,rpt_2, &
|
! write(*,3001) ntype,cmsg(i),hiscall_1,rpt1,hiscall_2,rpt2, &
|
||||||
! mycall(1:6),mygrid
|
! mycall(1:6),mygrid
|
||||||
!3001 format(i1,2x,a37,1x,a6,1x,a4,1x,a6,1x,a4,1x,a6,1x,a4)
|
!3001 format(i1,2x,a37,1x,a6,1x,a4,1x,a6,1x,a4,1x,a6,1x,a4)
|
||||||
|
|
||||||
k=k+1
|
k=k+1
|
||||||
if(ntype.le.3) call sfox_assemble(ntype,k,msg(1:22),mycall,mygrid)
|
if(ntype.le.3) call sfox_assemble(ntype,k,msg(1:26),mycall,mygrid,line)
|
||||||
if(ntype.eq.4) then
|
if(ntype.eq.4) then
|
||||||
sfmsg=w(1)(1:nw(1))//' '//mycall(1:len(trim(mycall))+1)//'RR73'
|
sfmsg=w(1)(1:nw(1))//' '//mycall(1:len(trim(mycall))+1)//'RR73'
|
||||||
call sfox_assemble(2,k,sfmsg,mycall,mygrid)
|
call sfox_assemble(2,k,sfmsg,mycall,mygrid,line)
|
||||||
sfmsg=w(3)(1:nw(3))//' '//mycall(1:len(trim(mycall))+1)//w(5)(1:3)
|
sfmsg=w(3)(1:nw(3))//' '//mycall(1:len(trim(mycall))+1)//w(5)(1:3)
|
||||||
k=k+1
|
k=k+1
|
||||||
call sfox_assemble(3,k,sfmsg,mycall,mygrid)
|
call sfox_assemble(3,k,sfmsg,mycall,mygrid,line)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
call sfox_assemble(ntype,11,msg(1:22),mycall,mygrid) !k=11 to finish up
|
|
||||||
|
call sfox_assemble(ntype,11,msg(1:26),mycall,mygrid,line) !k=11 to finish up
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine foxgen2
|
end subroutine foxgen2
|
||||||
|
@ -1,70 +1,91 @@
|
|||||||
subroutine sfox_assemble(ntype,k,msg,mycall0,mygrid0)
|
subroutine sfox_assemble(ntype,k,msg,mycall0,mygrid0,line)
|
||||||
|
|
||||||
! In subsequent calls, assemble all necessary information for a SuperFox
|
! In subsequent calls, assemble all necessary information for a SuperFox
|
||||||
! transmission.
|
! transmission.
|
||||||
|
|
||||||
character*22 msg
|
character*120 line
|
||||||
character*22 msg0,msg1,msg2(10),msg3(5)
|
character*26 msg
|
||||||
character*12 mycall0,mycall
|
character*26 msg0,msg1,msg2(5),msg3(5)
|
||||||
|
character*4 rpt2(5)
|
||||||
|
character*6 hiscall(10)
|
||||||
|
character*13 mycall0,mycall
|
||||||
character*4 mygrid0,mygrid
|
character*4 mygrid0,mygrid
|
||||||
integer ntype !Message type: 0 Free Text
|
integer ntype !Message type: 0 Free Text
|
||||||
! 1 CQ MyCall MyGrid
|
! 1 CQ MyCall MyGrid
|
||||||
! 2 Call_1 MyCall RR73
|
! 2 Call_1 MyCall RR73
|
||||||
! 3 Call_1 MyCall rpt
|
! 3 Call_1 MyCall rpt
|
||||||
integer nmsg(0:3) !Number of messages of type ntype
|
integer nmsg(0:3) !Number of messages of type ntype
|
||||||
data nmsg/0,0,0,0/,nbits/0/,ntx/0/
|
data nmsg/0,0,0,0/,nbits/0/,ntx/0/,nb_mycall/0/
|
||||||
save
|
save
|
||||||
|
|
||||||
if(mycall0(1:1).ne.' ') mycall=mycall0
|
if(mycall0(1:1).ne.' ') mycall=mycall0
|
||||||
if(mygrid0(1:1).ne.' ') mygrid=mygrid0
|
if(mygrid0(1:1).ne.' ') mygrid=mygrid0
|
||||||
|
if(ntype.ge.1) nb_mycall=28 !### Allow for nonstandard MyCall ###
|
||||||
|
if(sum(nmsg).eq.0) then
|
||||||
|
hiscall=' '
|
||||||
|
rpt2=' '
|
||||||
|
endif
|
||||||
|
|
||||||
if(k.le.10) then
|
if(k.le.10) then
|
||||||
if(ntype.eq.0) then
|
if(ntype.eq.0) then
|
||||||
if(nbits.le.191) then !Enough room for a free text message?
|
if(nbits+nb_mycall.le.191) then !Enough room for a free text message?
|
||||||
nmsg(ntype)=nmsg(ntype)+1
|
nmsg(ntype)=nmsg(ntype)+1
|
||||||
nbits=nbits+142
|
nbits=nbits+142
|
||||||
msg0=msg
|
msg0=msg
|
||||||
endif
|
endif
|
||||||
else if(ntype.eq.1) then
|
else if(ntype.eq.1) then
|
||||||
if(nbits.le.290) then
|
if(nbits+nb_mycall.le.318) then !Enough room for a CQ ?
|
||||||
nmsg(ntype)=nmsg(ntype)+1
|
nmsg(ntype)=nmsg(ntype)+1
|
||||||
nbits=nbits+43
|
nbits=nbits+15
|
||||||
msg1=msg
|
msg1=msg
|
||||||
endif
|
endif
|
||||||
else if(ntype.eq.2) then
|
else if(ntype.eq.2) then
|
||||||
if(nbits.le.305) then
|
if(nbits+nb_mycall.le.305) then !Enough room for a RR73 message?
|
||||||
nmsg(ntype)=nmsg(ntype)+1
|
nmsg(ntype)=nmsg(ntype)+1
|
||||||
nbits=nbits+28
|
nbits=nbits+28
|
||||||
j=nmsg(ntype)
|
j=nmsg(ntype)
|
||||||
msg2(j)=msg
|
msg2(j)=msg
|
||||||
|
i1=index(msg,' ')
|
||||||
|
hiscall(j+5)=msg(1:i1-1)
|
||||||
endif
|
endif
|
||||||
else
|
else if(ntype.eq.3) then
|
||||||
if(nbits.le.300) then
|
if(nbits+nb_mycall.le.300) then !Enough room for a message with report?
|
||||||
nmsg(ntype)=nmsg(ntype)+1
|
nmsg(ntype)=nmsg(ntype)+1
|
||||||
nbits=nbits+33
|
nbits=nbits+33
|
||||||
j=nmsg(ntype)
|
j=nmsg(ntype)
|
||||||
msg3(j)=msg
|
msg3(j)=msg
|
||||||
|
i1=index(msg,' ')
|
||||||
|
hiscall(j)=msg(1:i1-1)
|
||||||
|
i1=max(index(msg,'-'),index(msg,'+'))
|
||||||
|
rpt2(j)=msg(i1:i1+3)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if(k.ge.11) then
|
if(k.ge.11) then
|
||||||
! All necessary pieces are in place. Now encode the SuperFox message and
|
! All pieces are now available. Put them into a command line for external
|
||||||
! generate the waveform to be transmitted.
|
! program sfox_tx.
|
||||||
ntx=ntx+1 !Transmission number
|
ntx=ntx+1 !Transmission number
|
||||||
write(*,3002) ntx,ntype,nmsg(0:3),nbits
|
nbits=nbits+nb_mycall !Add bits for MyCall
|
||||||
3002 format(i3,i5,2x,4i3,i6)
|
|
||||||
if(nmsg(0).ge.1) write(*,3010) ntx,msg0
|
if(nmsg(1).ge.1) then
|
||||||
3010 format(i3,2x,a22)
|
line=msg1
|
||||||
if(nmsg(1).ge.1) write(*,3010) ntx,msg1
|
else
|
||||||
do i=1,nmsg(2)
|
line=trim(mycall)
|
||||||
write(*,3010) ntx,msg2(i)
|
|
||||||
enddo
|
|
||||||
do i=1,nmsg(3)
|
do i=1,nmsg(3)
|
||||||
write(*,3010) ntx,msg3(i)
|
line=trim(line)//' '//trim(hiscall(i))//' '//rpt2(i)
|
||||||
enddo
|
enddo
|
||||||
|
do i=1,nmsg(2)
|
||||||
|
line=trim(line)//' '//trim(hiscall(i))
|
||||||
|
enddo
|
||||||
|
endif
|
||||||
|
|
||||||
nmsg=0
|
nmsg=0
|
||||||
nbits=0
|
nbits=0
|
||||||
|
nb_mycall=0
|
||||||
|
hiscall=' '
|
||||||
|
rpt2=' '
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -176,7 +176,7 @@ extern "C" {
|
|||||||
void calibrate_(char const * data_dir, int* iz, double* a, double* b, double* rms,
|
void calibrate_(char const * data_dir, int* iz, double* a, double* b, double* rms,
|
||||||
double* sigmaa, double* sigmab, int* irc, fortran_charlen_t);
|
double* sigmaa, double* sigmab, int* irc, fortran_charlen_t);
|
||||||
|
|
||||||
void foxgen_(bool* bSuperFox);
|
void foxgen_(bool* bSuperFox, char* cmnd, fortran_charlen_t);
|
||||||
|
|
||||||
void plotsave_(float swide[], int* m_w , int* m_h1, int* irow);
|
void plotsave_(float swide[], int* m_w , int* m_h1, int* irow);
|
||||||
|
|
||||||
@ -4824,7 +4824,12 @@ void MainWindow::guiUpdate()
|
|||||||
QString foxCall=m_config.my_callsign() + " ";
|
QString foxCall=m_config.my_callsign() + " ";
|
||||||
::memcpy(foxcom_.mycall, foxCall.toLatin1(), sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_
|
::memcpy(foxcom_.mycall, foxCall.toLatin1(), sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_
|
||||||
bool bSuperFox=m_config.superFox();
|
bool bSuperFox=m_config.superFox();
|
||||||
foxgen_(&bSuperFox);
|
char cmnd[120];
|
||||||
|
foxgen_(&bSuperFox, cmnd, 120);
|
||||||
|
if(bSuperFox) {
|
||||||
|
QString t=QString::fromLatin1(cmnd).trimmed();
|
||||||
|
sfox_tx(t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10299,7 +10304,13 @@ Transmit:
|
|||||||
QString foxCall=m_config.my_callsign() + " ";
|
QString foxCall=m_config.my_callsign() + " ";
|
||||||
::memcpy(foxcom_.mycall, foxCall.toLatin1(),sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_
|
::memcpy(foxcom_.mycall, foxCall.toLatin1(),sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_
|
||||||
bool bSuperFox=m_config.superFox();
|
bool bSuperFox=m_config.superFox();
|
||||||
foxgen_(&bSuperFox);
|
qDebug() << "bb" << foxcom_.nslots << foxcom_.mycall << foxcom_.cmsg;
|
||||||
|
char cmnd[120];
|
||||||
|
foxgen_(&bSuperFox, cmnd, 120);
|
||||||
|
if(bSuperFox) {
|
||||||
|
QString t=QString::fromLatin1(cmnd).trimmed();
|
||||||
|
sfox_tx(t);
|
||||||
|
}
|
||||||
m_tFoxTxSinceCQ++;
|
m_tFoxTxSinceCQ++;
|
||||||
|
|
||||||
for(QString hc: m_foxQSO.keys()) { //Check for strikeout or timeout
|
for(QString hc: m_foxQSO.keys()) { //Check for strikeout or timeout
|
||||||
@ -10874,3 +10885,12 @@ void MainWindow::on_jt65Button_clicked()
|
|||||||
{
|
{
|
||||||
on_actionJT65_triggered();
|
on_actionJT65_triggered();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::sfox_tx(QString t)
|
||||||
|
{
|
||||||
|
qint64 ms0 = QDateTime::currentMSecsSinceEpoch();
|
||||||
|
p2.start("sfox_tx", QStringList {t});
|
||||||
|
p2.waitForFinished();
|
||||||
|
QString t2=p2.readAllStandardOutput();
|
||||||
|
qDebug() << "aa" << QDateTime::currentMSecsSinceEpoch() - ms0 << t2;
|
||||||
|
}
|
||||||
|
@ -379,6 +379,7 @@ private:
|
|||||||
bool elide_tx1_not_allowed () const;
|
bool elide_tx1_not_allowed () const;
|
||||||
void readWidebandDecodes();
|
void readWidebandDecodes();
|
||||||
void configActiveStations();
|
void configActiveStations();
|
||||||
|
void sfox_tx(QString t);
|
||||||
|
|
||||||
QProcessEnvironment const& m_env;
|
QProcessEnvironment const& m_env;
|
||||||
NetworkAccessManager m_network_manager;
|
NetworkAccessManager m_network_manager;
|
||||||
@ -622,6 +623,8 @@ private:
|
|||||||
NonInheritingProcess p1;
|
NonInheritingProcess p1;
|
||||||
NonInheritingProcess p3;
|
NonInheritingProcess p3;
|
||||||
|
|
||||||
|
QProcess p2;
|
||||||
|
|
||||||
WSPRNet *wsprNet;
|
WSPRNet *wsprNet;
|
||||||
|
|
||||||
QTimer m_guiTimer;
|
QTimer m_guiTimer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user