diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 710c4844e..fa50decdb 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -188,11 +188,10 @@ subroutine multimode_decoder(ss,id2,params,nfsample) endif if(params%nmode.eq.240) then -! We're in FST240/FST240W mode +! We're in FST240 mode ndepth=iand(params%ndepth,3) iwspr=0 - if(iand(params%ndepth,128).ne.0) iwspr=2 -! if(iand(params%ndepth,128).ne.0) iwspr=1 + if(iand(params%ndepth,128).ne.0) iwspr=1 call timer('dec240 ',0) call my_fst240%decode(fst240_decoded,id2,params%nutc, & params%nQSOProgress,params%nfqso,params%nfa,params%nfb, & @@ -204,8 +203,23 @@ subroutine multimode_decoder(ss,id2,params,nfsample) go to 800 endif - rms=sqrt(dot_product(float(id2(300000:310000)), & - float(id2(300000:310000)))/10000.0) + if(params%nmode.eq.241) then +! We're in FST240W mode + ndepth=iand(params%ndepth,3) + iwspr=1 + call timer('dec240 ',0) + call my_fst240%decode(fst240_decoded,id2,params%nutc, & + params%nQSOProgress,params%nfqso,params%nfa,params%nfb, & + params%nsubmode,ndepth,params%ntr,params%nexp_decode, & + params%ntol,params%nzhsym,params%emedelay, & + logical(params%lapcqonly),params%napwid,mycall,hiscall, & + params%nfsplit,iwspr) + call timer('dec240 ',1) + go to 800 + endif + + rms=sqrt(dot_product(float(id2(60001:61000)), & + float(id2(60001:61000)))/1000.0) if(rms.lt.2.0) go to 800 ! Zap data at start that might come from T/R switching transient? diff --git a/lib/jt9.f90 b/lib/jt9.f90 index 679c2ef22..dcfbb07b6 100644 --- a/lib/jt9.f90 +++ b/lib/jt9.f90 @@ -26,7 +26,7 @@ program jt9 fhigh=4000,nrxfreq=1500,ndepth=1,nexp_decode=0,nQSOProg=0 logical :: read_files = .true., tx9 = .false., display_help = .false., & bLowSidelobes = .false. - type (option) :: long_options(28) = [ & + type (option) :: long_options(29) = [ & option ('help', .false., 'h', 'Display this help message', ''), & option ('shmem',.true.,'s','Use shared memory for sample data','KEY'), & option ('tr-period', .true., 'p', 'Tx/Rx period, default SECONDS=60', & @@ -55,6 +55,7 @@ program jt9 option ('ft4', .false., '5', 'FT4 mode', ''), & option ('jt65', .false.,'6', 'JT65 mode', ''), & option ('fst240', .false., '7', 'FST240 mode', ''), & + option ('fst240w', .false., 'W', 'FST240W mode', ''), & option ('ft8', .false., '8', 'FT8 mode', ''), & option ('jt9', .false., '9', 'JT9 mode', ''), & option ('qra64', .false., 'q', 'QRA64 mode', ''), & @@ -80,11 +81,12 @@ program jt9 common/decstats/ntry65a,ntry65b,n65a,n65b,num9,numfano data npatience/1/,nthreads/1/ + iwspr=0 nsubmode = 0 TRperiod=60.d0 do - call getopt('hs:e:a:b:r:m:p:d:f:w:t:987654qTL:S:H:c:G:x:g:X:Q:', & + call getopt('hs:e:a:b:r:m:p:d:f:w:t:987654WqTL:S:H:c:G:x:g:X:Q:', & long_options,c,optarg,arglen,stat,offset,remain,.true.) if (stat .ne. 0) then exit @@ -129,6 +131,7 @@ program jt9 if (mode.lt.65) mode = mode + 65 case ('7') mode = 240 + iwspr=0 case ('8') mode = 8 case ('9') @@ -137,6 +140,9 @@ program jt9 tx9 = .true. case ('w') read (optarg(:arglen), *) npatience + case ('W') + mode = 241 + iwspr=1 case ('c') read (optarg(:arglen), *) mycall case ('G') @@ -256,6 +262,7 @@ program jt9 shared_data%params%kin=64800 if(mode.eq.240) shared_data%params%kin=720000 !### 60 s periods ### shared_data%params%nzhsym=nhsym + if(mode.eq.240 .and. iwspr.eq.1) ndepth=ior(ndepth,128) shared_data%params%ndepth=ndepth shared_data%params%lft8apon=.true. shared_data%params%ljt65apon=.true. diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index eabece958..6b25770b8 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -429,7 +429,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->dxGridEntry->setValidator (new MaidenheadLocatorValidator {this}); ui->dxCallEntry->setValidator (new CallsignValidator {this}); ui->sbTR->values ({5, 10, 15, 30, 60, 120, 300}); - ui->sbTR_FST240W->values ({120, 300}); + ui->sbTR_FST240W->values ({15, 30, 60, 120, 300}); ui->decodedTextBrowser->set_configuration (&m_config, true); ui->decodedTextBrowser2->set_configuration (&m_config); @@ -1128,6 +1128,7 @@ void MainWindow::writeSettings() m_settings->setValue("NoOwnCall",ui->cbNoOwnCall->isChecked()); m_settings->setValue ("BandHopping", ui->band_hopping_group_box->isChecked ()); m_settings->setValue ("TRPeriod", ui->sbTR->value ()); + m_settings->setValue ("TRPeriod_FST240W", ui->sbTR_FST240W->value ()); m_settings->setValue("FastMode",m_bFastMode); m_settings->setValue("Fast9",m_bFast9); m_settings->setValue ("CQTxfreq", ui->sbCQTxFreq->value ()); @@ -1200,6 +1201,7 @@ void MainWindow::readSettings() m_bFast9=m_settings->value("Fast9",false).toBool(); m_bFastMode=m_settings->value("FastMode",false).toBool(); ui->sbTR->setValue (m_settings->value ("TRPeriod", 15).toInt()); + ui->sbTR_FST240W->setValue (m_settings->value ("TRPeriod_FST240W", 15).toInt()); m_lastMonitoredFrequency = m_settings->value ("DialFreq", QVariant::fromValue (default_frequency)).value (); ui->WSPRfreqSpinBox->setValue(0); // ensure a change is signaled @@ -2971,6 +2973,7 @@ void MainWindow::decode() //decode() m_BestCQpriority=""; } if(m_mode=="FST240") dec_data.params.nmode=240; + if(m_mode=="FST240W") dec_data.params.nmode=241; dec_data.params.ntrperiod=m_TRperiod; dec_data.params.nsubmode=m_nSubMode; if(m_mode=="QRA64") dec_data.params.nsubmode=100 + m_nSubMode; @@ -3749,25 +3752,7 @@ void MainWindow::guiUpdate() QByteArray ba0; if(m_mode.startsWith ("WSPR")) { - QString sdBm,msg0,msg1,msg2; - sdBm = sdBm.asprintf(" %d",m_dBm); - m_tx=1-m_tx; - int i2=m_config.my_callsign().indexOf("/"); - if(i2>0 - || (6 == m_config.my_grid ().size () - && !ui->WSPR_prefer_type_1_check_box->isChecked ())) { - if(i2<0) { // "Type 2" WSPR message - msg1=m_config.my_callsign() + " " + m_config.my_grid().mid(0,4) + sdBm; - } else { - msg1=m_config.my_callsign() + sdBm; - } - msg0="<" + m_config.my_callsign() + "> " + m_config.my_grid()+ sdBm; - if(m_tx==0) msg2=msg0; - if(m_tx==1) msg2=msg1; - } else { - msg2=m_config.my_callsign() + " " + m_config.my_grid().mid(0,4) + sdBm; // Normal WSPR message - } - ba=msg2.toLatin1(); + ba=WSPR_message().toLatin1(); } else { if(SpecOp::HOUND == m_config.special_op_id() and m_ntx!=3) { //Hound transmits only Tx1 or Tx3 m_ntx=1; @@ -3881,6 +3866,10 @@ void MainWindow::guiUpdate() int ichk=0; int iwspr=0; char fst240msgbits[101]; + if(m_mode=="FST240W") { + ba=WSPR_message().toLatin1(); + ba2msg(ba,message); + } genfst240_(message,&ichk,msgsent,const_cast (fst240msgbits), const_cast(itone), &iwspr, 37, 37); int hmod=int(pow(2.0,double(m_nSubMode))); @@ -5841,6 +5830,7 @@ void MainWindow::on_actionFST240_triggered() void MainWindow::on_actionFST240W_triggered() { + on_actionFST240_triggered(); m_mode="FST240W"; m_modeTx="FST240W"; WSPR_config(true); @@ -5851,8 +5841,8 @@ void MainWindow::on_actionFST240W_triggered() setup_status_bar (bVHF); m_TRperiod = ui->sbTR->value (); ui->band_hopping_group_box->setVisible(false); - ui->sbTR->setMinimum(120); - ui->sbTR->setMaximum(300); + ui->sbTR_FST240W->setMinimum(15); //### 120 ?? ### + ui->sbTR_FST240W->setMaximum(300); ui->sbSubmode->setMaximum(3); m_wideGraph->setMode(m_mode); m_wideGraph->setModeTx(m_modeTx); @@ -7450,6 +7440,11 @@ void MainWindow::on_sbTR_valueChanged(int value) statusUpdate (); } +void MainWindow::on_sbTR_FST240W_valueChanged(int value) +{ + on_sbTR_valueChanged(value); +} + QChar MainWindow::current_submode () const { QChar submode {0}; @@ -9106,3 +9101,26 @@ void MainWindow::remote_configure (QString const& mode, quint32 frequency_tolera tx_watchdog (false); QApplication::alert (this); } + +QString MainWindow::WSPR_message() +{ + QString sdBm,msg0,msg1,msg2; + sdBm = sdBm.asprintf(" %d",m_dBm); + m_tx=1-m_tx; + int i2=m_config.my_callsign().indexOf("/"); + if(i2>0 + || (6 == m_config.my_grid ().size () + && !ui->WSPR_prefer_type_1_check_box->isChecked ())) { + if(i2<0) { // "Type 2" WSPR message + msg1=m_config.my_callsign() + " " + m_config.my_grid().mid(0,4) + sdBm; + } else { + msg1=m_config.my_callsign() + sdBm; + } + msg0="<" + m_config.my_callsign() + "> " + m_config.my_grid()+ sdBm; + if(m_tx==0) msg2=msg0; + if(m_tx==1) msg2=msg1; + } else { + msg2=m_config.my_callsign() + " " + m_config.my_grid().mid(0,4) + sdBm; // Normal WSPR message + } + return msg2; +} diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h index b3b297c85..3e5d80747 100644 --- a/widgets/mainwindow.h +++ b/widgets/mainwindow.h @@ -299,6 +299,7 @@ private slots: void on_actionErase_reference_spectrum_triggered(); void on_actionMeasure_phase_response_triggered(); void on_sbTR_valueChanged (int); + void on_sbTR_FST240W_valueChanged (int); void on_sbFtol_valueChanged (int); void on_cbFast9_clicked(bool b); void on_sbCQTxFreq_valueChanged(int n); @@ -729,6 +730,7 @@ private: void setRig (Frequency = 0); // zero frequency means no change void WSPR_history(Frequency dialFreq, int ndecodes); QString WSPR_hhmm(int n); + QString WSPR_message(); void fast_config(bool b); void CQTxFreq(); void useNextCall(); diff --git a/widgets/plotter.cpp b/widgets/plotter.cpp index 5ac16038c..26f412448 100644 --- a/widgets/plotter.cpp +++ b/widgets/plotter.cpp @@ -184,7 +184,6 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) if (swide[i]<1.e29) painter1.setPen(g_ColorTbl[y1]); painter1.drawPoint(i,m_j); } - m_line++; float y2min=1.e30; @@ -414,7 +413,7 @@ void CPlotter::DrawOverlay() //DrawOverlay() float bw=9.0*12000.0/m_nsps; //JT9 if(m_mode=="FT4") bw=3*12000.0/576.0; //FT4 ### (3x, or 4x???) ### if(m_mode=="FT8") bw=7*12000.0/1920.0; //FT8 - if(m_mode=="FST240") { + if(m_mode.startsWith("FST240")) { int h=int(pow(2.0,m_nSubMode)); int nsps=800; if(m_TRperiod==30) nsps=1680; @@ -500,7 +499,8 @@ void CPlotter::DrawOverlay() //DrawOverlay() int yTxTop=12; int yRxBottom=yTxTop + 2*yh + 4; if(m_mode=="JT9" or m_mode=="JT65" or m_mode=="JT9+JT65" - or m_mode=="QRA64" or m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST240") { + or m_mode=="QRA64" or m_mode=="FT8" or m_mode=="FT4" + or m_mode.startsWith("FST240")) { if(m_mode=="QRA64" or (m_mode=="JT65" and m_bVHF)) { painter0.setPen(penGreen); @@ -531,18 +531,17 @@ void CPlotter::DrawOverlay() //DrawOverlay() painter0.drawLine(x1,yRxBottom-yh,x1,yRxBottom); painter0.drawLine(x1,yRxBottom,x2,yRxBottom); painter0.drawLine(x2,yRxBottom-yh,x2,yRxBottom); - if(m_mode=="FST240") { + if(m_mode.startsWith("FST240")) { x1=XfromFreq(m_rxFreq-m_tol); x2=XfromFreq(m_rxFreq+m_tol); painter0.drawLine(x1,26,x2,26); // Mark the Tol range } - } } if(m_mode=="JT9" or m_mode=="JT65" or m_mode=="JT9+JT65" or m_mode.mid(0,4)=="WSPR" or m_mode=="QRA64" or m_mode=="FT8" - or m_mode=="FT4" or m_mode=="FST240") { + or m_mode=="FT4" or m_mode.startsWith("FST240")) { painter0.setPen(penRed); x1=XfromFreq(m_txFreq); x2=XfromFreq(m_txFreq+bw); @@ -551,11 +550,6 @@ void CPlotter::DrawOverlay() //DrawOverlay() x1=XfromFreq(m_txFreq-0.5*bw); x2=XfromFreq(m_txFreq+0.5*bw); } - if(m_mode=="WSPR-LF") { - bw=3*12000.0/8640.0; //WSPR-LF - x1=XfromFreq(m_txFreq-0.5*bw); - x2=XfromFreq(m_txFreq+0.5*bw); - } // Draw the red "goal post" painter0.drawLine(x1,yTxTop,x1,yTxTop+yh); painter0.drawLine(x1,yTxTop,x2,yTxTop);