Send (i3,n3) from mainwindow to genft8. First steps at interpreting (i3,n3) to send itype=1 for classic messages and itype=2 otherwise. Very buggy at this stage.

This commit is contained in:
Steve Franke 2018-07-03 09:28:16 -05:00
parent d6c0d1d878
commit c39dd63f79
8 changed files with 30 additions and 21 deletions

View File

@ -58,7 +58,7 @@ subroutine foxgen()
msg=cmsg(n)(1:i1)//cmsg(n)(i2+1:i3-2)//' ' msg=cmsg(n)(1:i1)//cmsg(n)(i2+1:i3-2)//' '
read(cmsg(n)(i4+2:i4+4),*) irpt read(cmsg(n)(i4+2:i4+4),*) irpt
endif endif
call genft8(msg,mygrid,bcontest,0,msgsent,msgbits,itone) call genft8(msg,mygrid,bcontest,0,1,msgsent,msgbits,itone)
! print*,'Foxgen:',n,cmsg(n),msgsent ! print*,'Foxgen:',n,cmsg(n),msgsent
if(i3b.eq.1) then if(i3b.eq.1) then

View File

@ -16,8 +16,9 @@ subroutine ft8apset(mycall12,mygrid6,hiscall12,hisgrid6,bcontest,apsym)
hisgrid=hisgrid6(1:4) hisgrid=hisgrid6(1:4)
if(index(hisgrid," ").eq.0) hisgrid="AA00" if(index(hisgrid," ").eq.0) hisgrid="AA00"
msg=mycall//' '//hiscall//' '//hisgrid msg=mycall//' '//hiscall//' '//hisgrid
i3bit=0 ! ### TEMPORARY ??? ### i3=0 ! ### TEMPORARY ??? ###
call genft8(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone) n3=0 !TEMPORARY
call genft8(msg,mygrid6,bcontest,i3,n3,msgsent,msgbits,itone)
apsym=2*msgbits-1 apsym=2*msgbits-1
return return
end subroutine ft8apset end subroutine ft8apset

View File

@ -381,7 +381,7 @@ subroutine ft8b_1(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
call extractmessage174(decoded,message,ncrcflag) call extractmessage174(decoded,message,ncrcflag)
decoded=decoded0 decoded=decoded0
! This needs fixing for messages with i3bit=1: ! This needs fixing for messages with i3bit=1:
call genft8(message,mygrid6,bcontest,i3bit,msgsent,msgbits,itone) call genft8(message,mygrid6,bcontest,i3bit,0,msgsent,msgbits,itone)
if(lsubtract) call subtractft8(dd0,itone,f1,xdt2) if(lsubtract) call subtractft8(dd0,itone,f1,xdt2)
xsig=0.0 xsig=0.0
xnoi=0.0 xnoi=0.0

View File

@ -316,12 +316,13 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
if(nharderrors.lt.0) cycle if(nharderrors.lt.0) cycle
if(count(cw.eq.0).eq.174) cycle !Reject the all-zero codeword if(count(cw.eq.0).eq.174) cycle !Reject the all-zero codeword
nbadcrc=0 ! If we get this far, must be a valid codeword. nbadcrc=0 ! If we get this far, must be a valid codeword.
i5bit=16*message77(73) + 8*message77(74) + 4*message77(75) + 2*message77(76) + message77(77) i3=4*message77(72) + 2*message77(73) + message77(74)
n3=4*message77(75) + 2*message77(76) + message77(77)
iFreeText=message77(57) iFreeText=message77(57)
if(i5bit.eq.1) message77(57:)=0 if(i5bit.eq.1) message77(57:)=0
call extractmessage77(message77,message) call extractmessage77(message77,message)
! This needs fixing for messages with i5bit=1 ! This needs fixing for messages with i5bit=1
call genft8_174_91(message,mygrid6,bcontest,i5bit,msgsent,msgbits,itone) call genft8_174_91(message,mygrid6,bcontest,i3,n3,msgsent,msgbits,itone)
if(lsubtract) call subtractft8(dd0,itone,f1,xdt) if(lsubtract) call subtractft8(dd0,itone,f1,xdt)
xsig=0.0 xsig=0.0
xnoi=0.0 xnoi=0.0

View File

@ -1,4 +1,4 @@
subroutine genft8(msg,mygrid,bcontest,i3bit,msgsent,msgbits,itone) subroutine genft8(msg,mygrid,bcontest,i3,n3,msgsent,msgbits,itone)
! Encode an FT8 message, producing array itone(). ! Encode an FT8 message, producing array itone().
@ -16,10 +16,16 @@ subroutine genft8(msg,mygrid,bcontest,i3bit,msgsent,msgbits,itone)
integer icos7(0:6) integer icos7(0:6)
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
itype=1
if( ( i3.eq.0 .and. n3.ge.2) .or. i3.ge.2 ) itype=2
write(*,*) 'generating type ',itype,' message'
if(itype.eq.2 ) goto 900
call packmsg(msg,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes call packmsg(msg,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes
call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent
write(cbits,1000) i4Msg6BitWords,32*i3bit write(cbits,1000) i4Msg6BitWords,32*i3
1000 format(12b6.6,b8.8) 1000 format(12b6.6,b8.8)
read(cbits,1001) i1Msg8BitBytes(1:10) read(cbits,1001) i1Msg8BitBytes(1:10)
1001 format(10b8) 1001 format(10b8)
@ -27,13 +33,7 @@ subroutine genft8(msg,mygrid,bcontest,i3bit,msgsent,msgbits,itone)
i1Msg8BitBytes(11)=0 i1Msg8BitBytes(11)=0
icrc12=crc12(c_loc(i1Msg8BitBytes),11) icrc12=crc12(c_loc(i1Msg8BitBytes),11)
! For reference, here's how to check the CRC write(cbits,1003) i4Msg6BitWords,i3,icrc12
! i1Msg8BitBytes(10)=icrc12/256
! i1Msg8BitBytes(11)=iand (icrc12,255)
! checksumok = crc12_check(c_loc (i1Msg8BitBytes), 11)
! if( checksumok ) write(*,*) 'Good checksum'
write(cbits,1003) i4Msg6BitWords,i3bit,icrc12
1003 format(12b6.6,b3.3,b12.12) 1003 format(12b6.6,b3.3,b12.12)
read(cbits,1004) msgbits read(cbits,1004) msgbits
1004 format(87i1) 1004 format(87i1)
@ -51,6 +51,11 @@ subroutine genft8(msg,mygrid,bcontest,i3bit,msgsent,msgbits,itone)
if(j.eq.30) k=k+7 if(j.eq.30) k=k+7
itone(k)=codeword(i)*4 + codeword(i+1)*2 + codeword(i+2) itone(k)=codeword(i)*4 + codeword(i+1)*2 + codeword(i+2)
enddo enddo
return
900 continue
call genft8_174_91(msg,mygrid,bcontest,i3,n3,msgsent,msgbits,itone)
return return
end subroutine genft8 end subroutine genft8

View File

@ -1,4 +1,4 @@
subroutine genft8_174_91(msg,mygrid,bcontest,i5bit,msgsent,msgbits,itone) subroutine genft8_174_91(msg,mygrid,bcontest,i3,n3,msgsent,msgbits,itone)
! Encode an FT8 message, producing array itone(). ! Encode an FT8 message, producing array itone().
@ -19,7 +19,7 @@ subroutine genft8_174_91(msg,mygrid,bcontest,i5bit,msgsent,msgbits,itone)
call packmsg(msg,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes call packmsg(msg,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes
call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent
write(cbits,'(12b6.6,b8.8)') i4Msg6BitWords,8*i5bit write(cbits,'(11b6.6,b5.5,b3.3,b3.3)') i4Msg6BitWords,i3,n3
read(cbits,'(77i1)') msgbits read(cbits,'(77i1)') msgbits
call encode174_91(msgbits,codeword) !Encode the test message call encode174_91(msgbits,codeword) !Encode the test message

View File

@ -77,7 +77,7 @@ extern "C" {
fortran_charlen_t); fortran_charlen_t);
// float s[], int* jh, char line[], char mygrid[], // float s[], int* jh, char line[], char mygrid[],
void genft8_(char* msg, char* MyGrid, bool* bcontest, int* i3bit, char* msgsent, void genft8_(char* msg, char* MyGrid, bool* bcontest, int* i3, int* n3, char* msgsent,
char ft8msgbits[], int itone[], fortran_charlen_t, fortran_charlen_t, char ft8msgbits[], int itone[], fortran_charlen_t, fortran_charlen_t,
fortran_charlen_t); fortran_charlen_t);
@ -3479,9 +3479,10 @@ void MainWindow::guiUpdate()
if(m_config.bFox() and ui->tabWidget->currentIndex()==2) { if(m_config.bFox() and ui->tabWidget->currentIndex()==2) {
foxTxSequencer(); foxTxSequencer();
} else { } else {
m_i3bit=0; m_i3=1; // Temporary!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
m_n3=0;
char ft8msgbits[75 + 12]; //packed 75 bit ft8 message plus 12-bit CRC char ft8msgbits[75 + 12]; //packed 75 bit ft8 message plus 12-bit CRC
genft8_(message, MyGrid, &bcontest, &m_i3bit, msgsent, const_cast<char *> (ft8msgbits), genft8_(message, MyGrid, &bcontest, &m_i3, &m_n3, msgsent, const_cast<char *> (ft8msgbits),
const_cast<int *> (itone), 22, 6, 22); const_cast<int *> (itone), 22, 6, 22);
if(m_config.bFox()) { if(m_config.bFox()) {
QString fm = QString::fromStdString(message).trimmed(); QString fm = QString::fromStdString(message).trimmed();

View File

@ -421,7 +421,8 @@ private:
qint32 m_nTx73; qint32 m_nTx73;
qint32 m_UTCdisk; qint32 m_UTCdisk;
qint32 m_wait; qint32 m_wait;
qint32 m_i3bit; qint32 m_i3;
qint32 m_n3;
qint32 m_isort; qint32 m_isort;
qint32 m_max_dB; qint32 m_max_dB;
qint32 m_nDXped=0; qint32 m_nDXped=0;