diff --git a/CMakeLists.txt b/CMakeLists.txt index cc2cfa6c7..bfcd3d39b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -547,6 +547,7 @@ set (wsjt_FSRCS lib/ft8/osd174_91.f90 lib/fsk4hf/osd300.f90 lib/fsk4hf/osd204.f90 + lib/77bit/parse77.f90 lib/pctile.f90 lib/peakdt9.f90 lib/peakup.f90 diff --git a/lib/77bit/NewCode.txt b/lib/77bit/NewCode.txt index bf232d202..99b3603e0 100644 --- a/lib/77bit/NewCode.txt +++ b/lib/77bit/NewCode.txt @@ -20,8 +20,8 @@ i3 n3 isync Operating activity, Message Type A. Required GUI Additions (after July 3): 1. Entry widgets for fixed parts of contest exchanges: comboBoxes - for ARRL section, US State/Canadian Province, Field Day - #transmitters and Class. + for ARRL section, US State/Canadian Province, number of + transmitters and entry Class for Field Day. 2. Spinner control for serial numbers: used for EU_VHF_Contest, and for DX stations in RTTYroundup. @@ -41,7 +41,7 @@ C. Code just before calling genft8_(): 3. if msg is not an old-style standard msg, see if it's valid as a 77-bit msg 4. if NO: transmit as Free Text - if YES: set i3 and n3 accordingly + if YES: set i3, n3, and isync=2 D. Auto-sequencer code diff --git a/lib/77bit/messages.txt b/lib/77bit/messages.txt index 0f545c956..dc7cbb84d 100644 --- a/lib/77bit/messages.txt +++ b/lib/77bit/messages.txt @@ -63,3 +63,8 @@ W9XYZ K1ABC -11 K1ABC W9XYZ R-09 W9XYZ RRR W9XYZ 73 +9. Other stuff +----------------------------------------------------------- +TNX BOB 73 GL +free text msg +123456789ABCD diff --git a/lib/77bit/packjt77.f90 b/lib/77bit/packjt77.f90 index 4aab5c495..1d847f5a3 100644 --- a/lib/77bit/packjt77.f90 +++ b/lib/77bit/packjt77.f90 @@ -959,6 +959,7 @@ subroutine pack77_3(nwords,w,i3,n3,c77) if(trim(w(1)).eq.'TU;') i1=2 call chkcall(w(i1),bcall_1,ok1) call chkcall(w(i1+1),bcall_2,ok2) + if(.not.ok1 .or. .not.ok2) go to 900 crpt=w(nwords-1)(1:3) if(crpt(1:1).eq.'5' .and. crpt(2:2).ge.'2' .and. crpt(2:2).le.'9' .and. & crpt(3:3).eq.'9') then @@ -999,7 +1000,7 @@ subroutine pack77_3(nwords,w,i3,n3,c77) endif endif - return +900 return end subroutine pack77_3 diff --git a/lib/77bit/parse77.f90 b/lib/77bit/parse77.f90 new file mode 100644 index 000000000..62c3cc785 --- /dev/null +++ b/lib/77bit/parse77.f90 @@ -0,0 +1,8 @@ +subroutine parse77(msg,i3,n3) + + use packjt77 + character msg*37,c77*77 + call pack77(msg,i3,n3,c77) + + return +end subroutine parse77 diff --git a/mainwindow.cpp b/mainwindow.cpp index dda0e23e8..2c292b6ef 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -75,12 +75,13 @@ extern "C" { float s[], int* jh, float *pxmax, float *rmsNoGain, char line[], char mygrid[], fortran_charlen_t, fortran_charlen_t, fortran_charlen_t, fortran_charlen_t, fortran_charlen_t); -// float s[], int* jh, char line[], char mygrid[], void genft8_(char* msg, char* MyGrid, bool* bcontest, int* i3, int* n3, int* isync, char* msgsent, char ft8msgbits[], int itone[], fortran_charlen_t, fortran_charlen_t, fortran_charlen_t); + void parse77_(char* msg, int* i3, int* n3, fortran_charlen_t); + void gen4_(char* msg, int* ichk, char* msgsent, int itone[], int* itext, fortran_charlen_t, fortran_charlen_t); @@ -163,7 +164,7 @@ QVector g_ColorTbl; namespace { Radio::Frequency constexpr default_frequency {14076000}; - QRegExp message_alphabet {"[- @A-Za-z0-9+./?#<>]*"}; + QRegExp message_alphabet {"[- @A-Za-z0-9+./?#<>;]*"}; // grid exact match excluding RR73 QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; @@ -3187,8 +3188,8 @@ void MainWindow::decodeBusy(bool b) //decodeBusy() //------------------------------------------------------------- //guiUpdate() void MainWindow::guiUpdate() { - static char message[29]; - static char msgsent[29]; + static char message[38]; + static char msgsent[38]; double txDuration; QString rt; @@ -3481,19 +3482,29 @@ void MainWindow::guiUpdate() if(m_config.bFox() and ui->tabWidget->currentIndex()==2) { foxTxSequencer(); } else { - m_i3=0; // Temporary!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - m_n3=0; + parse77_(message, &m_i3, &m_n3, 37); + int ichk=1,itype=-1; + gen65_(message,&ichk,msgsent,const_cast(itone),&itype,22,22); + /* + * itype: + * 1 Std msg + * 2 Type 1 prefix + * 3 Type 1 suffix + * 4 Type 2 prefix + * 5 Type 2 suffix + * 6 Free Text + * 7 Hashed calls (MSK144 short format) + */ m_isync=1; -// if(m_config.bGenerate77()) m_isync=2; + if(!m_config.bGenerate77() and itype == 6 and (m_i3>0 or m_n3>0)) m_isync=2; + if(m_config.bGenerate77()) m_isync=2; + qDebug() << "itype=" << itype << "i3, n3:"<< m_i3 << m_n3 << "isync="<< m_isync << ui->tx6->text(); char ft8msgbits[75 + 12]; //packed 75 bit ft8 message plus 12-bit CRC -// TEMPORARY - for now, just copy 22-bit message to 37-bit messageft8 - char messageft8[38]; - char msgsentft8[38]; // Only need to send the first 37 chars to Fortran, right? - strncpy(&messageft8[0],&message[0],22); - genft8_(messageft8, MyGrid, &bcontest, &m_i3, &m_n3, &m_isync, msgsentft8, + genft8_(message, MyGrid, &bcontest, &m_i3, &m_n3, &m_isync, msgsent, const_cast (ft8msgbits), const_cast (itone), 37, 6, 37); - strncpy(&msgsent[0],&msgsentft8[0],22); + if(m_config.bFox()) { + //Fox must generate the full Tx waveform, not just an itone[] array. QString fm = QString::fromStdString(message).trimmed(); foxGenWaveform(0,fm); foxcom_.nslots=1; @@ -3506,7 +3517,8 @@ void MainWindow::guiUpdate() } } } - msgsent[22]=0; + if(m_isync==1) msgsent[22]=0; + if(m_isync==2) msgsent[37]=0; } } @@ -3611,9 +3623,6 @@ void MainWindow::guiUpdate() m_QSOProgress = CALLING; m_gen_message_is_cq = true; ui->rbGenMsg->setChecked(true); - } else { -//JHT 11/29/2015 m_ntx=6; -// ui->txrb6->setChecked(true); } } } @@ -3834,14 +3843,14 @@ void MainWindow::stopTx2() void MainWindow::ba2msg(QByteArray ba, char message[]) //ba2msg() { int iz=ba.length(); - for(int i=0;i<28; i++) { + for(int i=0; i<37; i++) { if(i