diff --git a/commons.h b/commons.h index d0eef792a..a40607174 100644 --- a/commons.h +++ b/commons.h @@ -81,6 +81,8 @@ extern struct { extern struct { float wave[606720]; + int nslots; + char cmsg[5][32]; } foxcom_; #ifdef __cplusplus diff --git a/lib/ft8/foxgen.f90 b/lib/ft8/foxgen.f90 index b2f82af0d..9a483a969 100644 --- a/lib/ft8/foxgen.f90 +++ b/lib/ft8/foxgen.f90 @@ -1,8 +1,9 @@ -subroutine foxgen(mycall,mygrid6,nslots,t) +subroutine foxgen(mycall,mygrid6,t) parameter (NN=79,KK=87,NSPS=4*1920) parameter (NWAVE=NN*NSPS,NFFT=614400,NH=NFFT/2) character*(*) t + character*32 cmsg character*22 msg,msgsent character*12 t1 character*6 mycall,mygrid6,mygrid,call1,call2 @@ -10,15 +11,14 @@ subroutine foxgen(mycall,mygrid6,nslots,t) integer itone(NN) integer*1 msgbits(KK) integer*8 count0,count1,clkfreq - real wave(NWAVE) real x(NFFT),y(NFFT) real*8 dt,twopi,f0,fstep,dfreq,phi,dphi complex cx(0:NH),cy(0:NH) - common/foxcom/wave + common/foxcom/wave(NWAVE),nslots,cmsg(5) equivalence (x,cx),(y,cy) mygrid=mygrid6(1:4)//' ' - print*,mycall,' ',mygrid6,' ',nslots,len(t),t +! print*,mycall,' ',mygrid6,' ',nslots,len(t),t call system_clock(count0,clkfreq) bcontest=.false. i3bit=0 @@ -38,7 +38,7 @@ subroutine foxgen(mycall,mygrid6,nslots,t) endif call2=t(ia+11:ia+16) read(t(ia+18:ia+21),*) irpt2 - print*,n,call1,irpt1,call2,irpt2 +! print*,n,call1,irpt1,call2,irpt2 call genft8(msg,mygrid,bcontest,i3bit,msgsent,msgbits,itone) diff --git a/mainwindow.cpp b/mainwindow.cpp index 537de1dad..6d9258b08 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -135,7 +135,7 @@ extern "C" { void calibrate_(char data_dir[], int* iz, double* a, double* b, double* rms, double* sigmaa, double* sigmab, int* irc, int len1); - void foxgen_(char* mycall, char* mygrid, int* nslots, char* tb3, int len1, int len2, int len3); + void foxgen_(char* mycall, char* mygrid, char* tb3, int len1, int len2, int len3); } int volatile itone[NUM_ISCAT_SYMBOLS]; //Audio tones for all Tx symbols @@ -1159,6 +1159,10 @@ void MainWindow::setDecodedTextFont (QFont const& font) ui->decodedTextBrowser2->setContentFont (font); ui->textBrowser3->setContentFont(font); ui->textBrowser4->setContentFont(font); + ui->textBrowser3->displayFoxToBeCalled(" ","#ffffff"); + ui->textBrowser4->displayFoxToBeCalled(" ","#ffffff"); + ui->textBrowser3->setText(""); + ui->textBrowser4->setText(""); auto style_sheet = "QLabel {" + font_as_stylesheet (font) + '}'; ui->decodedTextLabel->setStyleSheet (ui->decodedTextLabel->styleSheet () + style_sheet); ui->decodedTextLabel2->setStyleSheet (ui->decodedTextLabel2->styleSheet () + style_sheet); @@ -1719,18 +1723,6 @@ void MainWindow::keyPressEvent (QKeyEvent * e) { if(m_config.bFox()) { switch (e->key()) { - case Qt::Key_7: - if(m_isort>-4) m_isort--; - return; - case Qt::Key_8: - if(m_isort<4) m_isort++; - return; - case Qt::Key_9: - if(m_max_dB > -15) m_max_dB--; - return; - case Qt::Key_0: - if(m_max_dB < 30) m_max_dB++; - return; case Qt::Key_Return: doubleClickOnCall2(Qt::KeyboardModifier(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier)); return; @@ -1738,7 +1730,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) doubleClickOnCall2(Qt::KeyboardModifier(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier)); return; case Qt::Key_Backspace: - qDebug() << "a" << m_toBeCalled; + qDebug() << "Key Backspace" << m_toBeCalled; return; } QMainWindow::keyPressEvent (e); @@ -2756,7 +2748,6 @@ void MainWindow::decodeDone () QFile f(m_config.temp_dir().absoluteFilePath("foxcalls.txt")); if(f.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream s(&f); -// QString t=s.readAll(); QString t=""; QString t0; QString c2; @@ -2767,7 +2758,7 @@ void MainWindow::decodeDone () b=false; if(ui->textBrowser3->toPlainText().indexOf(c2) >= 0) b=true; if(ui->textBrowser4->toPlainText().indexOf(c2) >= 0) b=true; - if(!b) t += (t0 + "\n"); //Don't include calls already in the queue + if(!b) t += (t0 + "\n"); //Don't list calls already in QSO or in the stack } if(t.length()>30) { m_isort=ui->comboBoxFoxSort->currentIndex(); @@ -2812,14 +2803,7 @@ void MainWindow::readFromStdout() //readFromStdout if(navg>1 or t.indexOf("f*")>0) bAvgMsg=true; } } - /* - if(m_mode=="FT8" and m_bDXped) { - 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); @@ -2849,25 +2833,28 @@ void MainWindow::readFromStdout() //readFromStdout DecodedText decodedtext {QString::fromUtf8 (t.constData ()).remove (QRegularExpression {"\r|\n"}), "FT8" == m_mode && ui->cbVHFcontest->isChecked(), m_config.my_grid ()}; - QString c2,g2; - decodedtext.deCallAndGrid(/*out*/c2,g2); - if(g2.mid(0,2)=="R+" or g2.mid(0,2)=="R-") { - QString a=ui->textBrowser3->toPlainText(); - int i0=a.indexOf(c2); - if(i0 >= 0) { - QString b=a.mid(i0); - QStringList c=a.split("\n"); - ui->textBrowser3->setText(""); - for (int i=0; itextBrowser3->displayFoxToBeCalled(d,"#ffffff"); - } else { - if(d.indexOf("RR73")<0) { - int i1=qMax(d.indexOf("+"),d.indexOf("-")); - d=d.mid(0,i1-1) + " RR73"; + + if(m_mode=="FT8" and m_config.bFox()) { + QString c2,g2; + decodedtext.deCallAndGrid(/*out*/c2,g2); + if(g2.mid(0,2)=="R+" or g2.mid(0,2)=="R-") { + QString a=ui->textBrowser3->toPlainText(); + int i0=a.indexOf(c2); + if(i0 >= 0) { + QString b=a.mid(i0); + QStringList c=a.split("\n"); + ui->textBrowser3->setText(""); + for (int i=0; itextBrowser3->displayFoxToBeCalled(d,"#ffffff"); + } else { + if(d.indexOf("RR73")<0) { + int i1=qMax(d.indexOf("+"),d.indexOf("-")); + d=d.mid(0,i1-1) + " RR73"; + } + ui->textBrowser3->displayFoxToBeCalled(d,"#ff99ff"); } - ui->textBrowser3->displayFoxToBeCalled(d,"#ff99ff"); } } } @@ -3231,6 +3218,7 @@ void MainWindow::guiUpdate() } } + // Calculate Tx tones when needed if((g_iptt==1 && m_iptt0==0) || m_restart) { //---------------------------------------------------------------------- @@ -3268,21 +3256,6 @@ void MainWindow::guiUpdate() if(m_ntx == 8) ba=ui->freeTextMsg->currentText().toLocal8Bit(); } - m_i3bit=0; - if(m_mode=="FT8" and m_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 @@ -3328,20 +3301,28 @@ void MainWindow::guiUpdate() } if(m_modeTx=="FT8") { if(m_config.bFox()) { + int islots=0; + QString msg[5]; QString t1=""; QString t3=ui->textBrowser3->toPlainText() + "\n"; QString t4=ui->textBrowser4->toPlainText() + "\n"; - int nslots=ui->sbNslots->value(); - for(int i=0; i (t1.toLatin1().constData()),6,6,len3); +// qDebug() << "aa" << len3 << t1; + foxcom_.nslots=islots; + if(len3>10) { + foxgen_(MyCall, MyGrid, const_cast (t1.toLatin1().constData()),6,6,len3); + } } else { genft8_(message, MyGrid, &bcontest, &m_i3bit, msgsent, const_cast (ft8msgbits), const_cast (itone), 22, 6, 22); @@ -7187,3 +7168,12 @@ void MainWindow::on_sbMax_dB_valueChanged(int n) { m_max_dB=n; } + +void MainWindow::on_pbFoxReset_clicked() +{ + QString t=""; + for(int i=0; icomboBoxCQ->currentText() + "\n"; + } + ui->textBrowser3->setText(t); +} diff --git a/mainwindow.h b/mainwindow.h index 0c04835e9..f941e259e 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -285,6 +285,7 @@ private slots: void on_sbNsig_valueChanged(int n); void on_sbNslots_valueChanged(int n); void on_sbMax_dB_valueChanged(int n); + void on_pbFoxReset_clicked(); private: Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo, diff --git a/mainwindow.ui b/mainwindow.ui index 9db976466..c4402186b 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -1628,32 +1628,98 @@ list. The list can be maintained in Settings (F2). - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - N Sigs - - - 5 - - - 100 - - - 12 - + + + + + CQ + + + + + CQ AF + + + + + CQ AN + + + + + CQ AS + + + + + CQ EU + + + + + CQ NA + + + + + CQ OC + + + + + CQ SA + + + + + CQ 0 + + + + + CQ 1 + + + + + CQ 2 + + + + + CQ 3 + + + + + CQ 4 + + + + + CQ 5 + + + + + CQ 6 + + + + + CQ 7 + + + + + CQ 8 + + + + + CQ 9 + + @@ -1759,6 +1825,47 @@ list. The list can be maintained in Settings (F2). + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + N Sigs + + + 5 + + + 100 + + + 12 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -1790,18 +1897,12 @@ list. The list can be maintained in Settings (F2). - - - - Qt::Vertical + + + + Reset - - - 20 - 40 - - - +