diff --git a/lib/allsim.f90 b/lib/allsim.f90 index 591a584d6..2d948b64f 100644 --- a/lib/allsim.f90 +++ b/lib/allsim.f90 @@ -60,7 +60,8 @@ program allsim call gen4(message,0,msgsent,itone,itype) call addit(itone,11025,206,2520,1200,sig,dat) !JT4 - call genft8(message,mygrid,bcontest,msgsent,msgbits,itone) + i3bit=0 ! ### TEMPORARY ??? ### + call genft8(message,mygrid,bcontest,i3bit,msgsent,msgbits,itone) call addit(itone,12000,79,1920,1400,sig,dat) !FT8 call genqra64(message,0,msgsent,itone,itype) diff --git a/lib/fmeasure.f90 b/lib/fmeasure.f90 index 6613f301b..40f2fa201 100644 --- a/lib/fmeasure.f90 +++ b/lib/fmeasure.f90 @@ -27,7 +27,6 @@ program fmeasure parameter(NZ=1000) implicit real*8 (a-h,o-z) - real*8 fd(NZ),deltaf(NZ),r(NZ) character infile*50 character line*80 diff --git a/lib/fsk4hf/ft8apset.f90 b/lib/fsk4hf/ft8apset.f90 index 8f34aae2f..ca5e5a6da 100644 --- a/lib/fsk4hf/ft8apset.f90 +++ b/lib/fsk4hf/ft8apset.f90 @@ -23,7 +23,8 @@ subroutine ft8apset(mycall12,mygrid6,hiscall12,hisgrid6,bcontest,apsym,iaptype) ! if(len_trim(hisgrid).eq.0) hisgrid="EN50" if(index(hisgrid," ").eq.0) hisgrid="EN50" msg=mycall//' '//hiscall//' '//hisgrid - call genft8(msg,mygrid6,bcontest,msgsent,msgbits,itone) + i3bit=0 ! ### TEMPORARY ??? ### + call genft8(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone) apsym=2*msgbits-1 return diff --git a/lib/fsk4hf/ft8b.f90 b/lib/fsk4hf/ft8b.f90 index 22e67d671..9d620d61a 100644 --- a/lib/fsk4hf/ft8b.f90 +++ b/lib/fsk4hf/ft8b.f90 @@ -351,7 +351,7 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,napwid, & message=' ' xsnr=-99.0 if(count(cw.eq.0).eq.174) cycle !Reject the all-zero codeword - if(any(decoded(73:75).ne.0)) cycle !Reject if any of the 3 extra bits are nonzero +!### if(any(decoded(73:75).ne.0)) cycle !Reject if any of the 3 extra bits is nonzero if(nharderrors.ge.0 .and. nharderrors+dmin.lt.60.0 .and. & .not.(sync.lt.2.0 .and. nharderrors.gt.35) .and. & .not.(ipass.gt.2 .and. nharderrors.gt.39) .and. & @@ -362,9 +362,16 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,napwid, & nharderrors=-1 cycle endif +!### + i3bit=4*decoded(73) + 2*decoded(74) + decoded(75) +! if(nbadcrc.eq.0) write(*,3001) nharderrors,nbadcrc,i3bit +!3001 format('A',3i5) +!### if(nbadcrc.eq.0) then call extractmessage174(decoded,message,ncrcflag,recent_calls,nrecent) - call genft8(message,mygrid6,bcontest,msgsent,msgbits,itone) + call genft8(message,mygrid6,bcontest,i3bit,msgsent,msgbits,itone) + if(i3bit.eq.1) message(21:21)='1' + if(i3bit.eq.2) message(21:21)='2' if(lsubtract) call subtractft8(dd0,itone,f1,xdt2) xsig=0.0 xnoi=0.0 diff --git a/lib/fsk4hf/ft8sim.f90 b/lib/fsk4hf/ft8sim.f90 index 2801717d4..70d67a812 100644 --- a/lib/fsk4hf/ft8sim.f90 +++ b/lib/fsk4hf/ft8sim.f90 @@ -65,9 +65,10 @@ program ft8sim sig=sqrt(2*bandwidth_ratio) * 10.0**(0.05*snrdb) if(snrdb.gt.90.0) sig=1.0 txt=NN*NSPS/12000.0 + i3bit=0 ! ### TEMPORARY ??? ### ! Source-encode, then get itone() - call genft8(msg,mygrid6,bcontest,msgsent,msgbits,itone) + call genft8(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone) write(*,1000) f0,xdt,txt,snrdb,bw,msgsent 1000 format('f0:',f9.3,' DT:',f6.2,' TxT:',f6.1,' SNR:',f6.1, & ' BW:',f4.1,2x,a22) diff --git a/lib/fsk4hf/genft8.f90 b/lib/fsk4hf/genft8.f90 index 1b1352ea6..899dad3ef 100644 --- a/lib/fsk4hf/genft8.f90 +++ b/lib/fsk4hf/genft8.f90 @@ -1,4 +1,4 @@ -subroutine genft8(msg,mygrid,bcontest,msgsent,msgbits,itone) +subroutine genft8(msg,mygrid,bcontest,i3bit,msgsent,msgbits,itone) ! Encode an FT8 message, producing array itone(). @@ -19,7 +19,6 @@ subroutine genft8(msg,mygrid,bcontest,msgsent,msgbits,itone) call packmsg(msg,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent - i3bit=0 !### temporary ### write(cbits,1000) i4Msg6BitWords,32*i3bit 1000 format(12b6.6,b8.8) read(cbits,1001) i1Msg8BitBytes(1:10) diff --git a/lib/packjt.f90 b/lib/packjt.f90 index f732f9806..95ff5981b 100644 --- a/lib/packjt.f90 +++ b/lib/packjt.f90 @@ -506,8 +506,8 @@ subroutine packbits(dbits,nsymd,m0,sym) 20 continue if(itype.ne.6) itype=max(nv2a,nv2b) jt_itype=itype - jt_c1=c1 - jt_c2=c2 + jt_c1=c1(1:6) + jt_c2=c2(1:6) jt_c3=c3 jt_k1=k1 jt_k2=k2 diff --git a/mainwindow.cpp b/mainwindow.cpp index b57b77735..296a4dc5a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -76,7 +76,7 @@ extern "C" { int len1, int len2, int len3, int len4, int len5); // float s[], int* jh, char line[], char mygrid[], - void genft8_(char* msg, char* MyGrid, bool* bcontest, char* msgsent, + void genft8_(char* msg, char* MyGrid, bool* bcontest, int* i3bit, char* msgsent, char ft8msgbits[], int itone[], int len1, int len2, int len3); void gen4_(char* msg, int* ichk, char* msgsent, int itone[], @@ -2705,6 +2705,12 @@ void MainWindow::readFromStdout() //readFromStdout if(navg>1 or t.indexOf("f*")>0) bAvgMsg=true; } } + if(m_mode=="FT8") { + int i3bit=t.mid(44,1).toInt(); + t=t.mid(0,44) + " " + t.mid(45); + if(i3bit==1) t=t.mid(0,24) + "RR73 NOW " + t.mid(24); + if(i3bit==2) t=t.mid(0,24) + "NIL NOW " + t.mid(24); + } QFile f {m_config.writeable_data_dir ().absoluteFilePath ("ALL.TXT")}; if (f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) { QTextStream out(&f); @@ -3085,6 +3091,7 @@ void MainWindow::guiUpdate() if((g_iptt==1 && m_iptt0==0) || m_restart) { //---------------------------------------------------------------------- QByteArray ba; + QByteArray ba0; if(m_mode.startsWith ("WSPR")) { QString sdBm,msg0,msg1,msg2; @@ -3117,6 +3124,22 @@ void MainWindow::guiUpdate() if(m_ntx == 8) ba=ui->freeTextMsg->currentText().toLocal8Bit(); } + m_i3bit=0; + bool bDXped=true; + if(m_mode=="FT8" and bDXped) { + ba0=ba; + QString t=QString::fromUtf8(ba0); + if(t.startsWith("RR73 NOW ")) { + t=t.mid(9); + m_i3bit=1; + } + if(t.startsWith("NIL NOW ")) { + t=t.mid(8); + m_i3bit=2; + } + ba=t.toLocal8Bit(); + } + ba2msg(ba,message); int ichk=0; if (m_lastMessageSent != m_currentMessage @@ -3159,7 +3182,7 @@ void MainWindow::guiUpdate() } } if(m_modeTx=="FT8") { - genft8_(message, MyGrid, &bcontest, msgsent, const_cast (ft8msgbits), + genft8_(message, MyGrid, &bcontest, &m_i3bit, msgsent, const_cast (ft8msgbits), const_cast (itone), 22, 6, 22); } } @@ -3364,7 +3387,10 @@ void MainWindow::guiUpdate() if(m_mode=="Echo") { tx_status_label.setText("Tx: ECHO"); } else { - tx_status_label.setText(s); + QString t{QString::fromLatin1(s)}; + if(m_mode=="FT8" and m_i3bit==1) t="Tx: RR73 NOW " + t.mid(4); + if(m_mode=="FT8" and m_i3bit==2) t="Tx: NIL NOW " + t.mid(4); + tx_status_label.setText(t); } } } else if(m_monitoring) { @@ -4224,11 +4250,10 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) break; } } - if (hisCall.size () <= 10 && hisCall != hisBase + if (hisCall != hisBase + && m_config.type_2_msg_gen () != Configuration::type_2_msg_5_only && !eme_short_codes) { - // cfm we have his full call copied as we could not do this - // earlier, as this is a free text message we must be careful - // about the length + // cfm we have his full call copied as we could not do this earlier t = hisCall + " 73"; msgtype(t, ui->tx5->lineEdit ()); } @@ -4240,7 +4265,6 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) msgtype(t, ui->tx1); } else if (!eme_short_codes - && hisCall.size () <= 10 // avoid truncated free text message && ("MSK144" != m_mode || !m_bShMsgs)) { t=hisCall + " 73"; msgtype(t, ui->tx5->lineEdit ()); @@ -4944,7 +4968,6 @@ void MainWindow::on_actionMSK144_triggered() m_bFastMode=true; m_bFast9=false; m_TRperiod = ui->sbTR->value (); - m_fastGraph->setTRperiod (m_TRperiod); m_wideGraph->hide(); m_fastGraph->show(); ui->TxFreqSpinBox->setValue(1500); @@ -6169,7 +6192,7 @@ void MainWindow::replyToCQ (QTime time, qint32 snr, float delta_time, quint32 de .arg (snr, 3) .arg (delta_time, 4, 'f', 1) .arg (delta_frequency, 4) - .arg (mode, -2) + .arg (mode, 2) .arg (message_text); auto messages = ui->decodedTextBrowser->toPlainText (); auto position = messages.lastIndexOf (cqtext); @@ -6181,7 +6204,7 @@ void MainWindow::replyToCQ (QTime time, qint32 snr, float delta_time, quint32 de .arg (snr, 3) .arg ('-' + QString::number (delta_time, 'f', 1), 4) .arg (delta_frequency, 4) - .arg (mode, -2) + .arg (mode, 2) .arg (message_text)); } if (position >= 0) diff --git a/mainwindow.h b/mainwindow.h index 7c8d2028a..d5051b0d8 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -403,6 +403,7 @@ private: qint32 m_nTx73; qint32 m_UTCdisk; qint32 m_wait; + qint32 m_i3bit; bool m_btxok; //True if OK to transmit bool m_diskData;