Now able to generate 72-bit or 77-bit messages.

This commit is contained in:
Joe Taylor 2018-07-06 12:52:39 -04:00
parent dba85595bd
commit c5d61f4cf4
6 changed files with 51 additions and 27 deletions

View File

@ -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

View File

@ -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

View File

@ -63,3 +63,8 @@ W9XYZ K1ABC -11
K1ABC W9XYZ R-09
W9XYZ <PJ4/K1ABC> RRR
<PJ4/K1ABC> W9XYZ 73
9. Other stuff
-----------------------------------------------------------
TNX BOB 73 GL
free text msg
123456789ABCD

View File

@ -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

8
lib/77bit/parse77.f90 Normal file
View File

@ -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

View File

@ -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<QColor> 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<int *>(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<char *> (ft8msgbits), const_cast<int *> (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<iz) {
message[i]=ba[i];
} else {
message[i]=32;
}
}
message[28]=0;
message[37]=0;
}
void MainWindow::on_txFirstCheckBox_stateChanged(int nstate) //TxFirst
@ -4804,14 +4813,14 @@ void MainWindow::on_addButton_clicked() //Add button
void MainWindow::msgtype(QString t, QLineEdit* tx) //msgtype()
{
char message[29];
char msgsent[29];
// Set background colors of the Tx message boxes, depending on message type
char message[38];
char msgsent[38];
int itone0[NUM_ISCAT_SYMBOLS]; //Dummy array, data not used
int len1=22;
QByteArray s=t.toUpper().toLocal8Bit();
ba2msg(s,message);
int ichk=1,itype=0;
gen65_(message,&ichk,msgsent,itone0,&itype,len1,len1);
gen65_(message,&ichk,msgsent,itone0,&itype,22,22);
msgsent[22]=0;
bool text=false;
bool shortMsg=false;