diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e2150897..1ab03ba23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -408,6 +408,7 @@ set (wsjt_FSRCS lib/move.f90 lib/msk144d.f90 lib/msk144_decode.f90 + lib/mskrtd.f90 lib/msk144sim.f90 lib/options.f90 lib/opdetmsk144.f90 diff --git a/Configuration.cpp b/Configuration.cpp index 2465a5be4..3a3c1d4f5 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -540,6 +540,7 @@ private: bool twoPass_; bool x2ToneSpacing_; bool contestMode_; + bool realTimeDecode_; bool offsetRxFreq_; QString udp_server_name_; port_type udp_server_port_; @@ -626,6 +627,7 @@ bool Configuration::single_decode () const {return m_->single_decode_;} bool Configuration::twoPass() const {return m_->twoPass_;} bool Configuration::x2ToneSpacing() const {return m_->x2ToneSpacing_;} bool Configuration::contestMode() const {return m_->contestMode_;} +bool Configuration::realTimeDecode() const {return m_->realTimeDecode_;} bool Configuration::offsetRxFreq () const {return m_->offsetRxFreq_;} bool Configuration::split_mode () const {return m_->split_mode ();} QString Configuration::udp_server_name () const {return m_->udp_server_name_;} @@ -1053,6 +1055,7 @@ void Configuration::impl::initialize_models () ui_->cbTwoPass->setChecked(twoPass_); ui_->cbx2ToneSpacing->setChecked(x2ToneSpacing_); ui_->cbContestMode->setChecked(contestMode_); + ui_->cbRealTime->setChecked(realTimeDecode_); ui_->offset_Rx_freq_check_box->setChecked(offsetRxFreq_); ui_->type_2_msg_gen_combo_box->setCurrentIndex (type_2_msg_gen_); ui_->rig_combo_box->setCurrentText (rig_params_.rig_name); @@ -1278,6 +1281,7 @@ void Configuration::impl::read_settings () twoPass_ = settings_->value("TwoPass",true).toBool (); x2ToneSpacing_ = settings_->value("x2ToneSpacing",false).toBool (); contestMode_ = settings_->value("ContestMode",false).toBool (); + realTimeDecode_ = settings_->value("RealTimeDecode",false).toBool (); offsetRxFreq_ = settings_->value("OffsetRx",false).toBool(); rig_params_.poll_interval = settings_->value ("Polling", 0).toInt (); rig_params_.split_mode = settings_->value ("SplitMode", QVariant::fromValue (TransceiverFactory::split_mode_none)).value (); @@ -1375,6 +1379,7 @@ void Configuration::impl::write_settings () settings_->setValue ("TwoPass", twoPass_); settings_->setValue ("x2ToneSpacing", x2ToneSpacing_); settings_->setValue ("ContestMode", contestMode_); + settings_->setValue ("RealTimeDecode", realTimeDecode_); settings_->setValue("OffsetRx",offsetRxFreq_); settings_->setValue ("UDPServer", udp_server_name_); settings_->setValue ("UDPServerPort", udp_server_port_); @@ -1768,6 +1773,7 @@ void Configuration::impl::accept () twoPass_ = ui_->cbTwoPass->isChecked (); x2ToneSpacing_ = ui_->cbx2ToneSpacing->isChecked (); contestMode_ = ui_->cbContestMode->isChecked (); + realTimeDecode_ = ui_->cbRealTime->isChecked (); offsetRxFreq_ = ui_->offset_Rx_freq_check_box->isChecked(); frequency_calibration_intercept_ = ui_->calibration_intercept_spin_box->value (); frequency_calibration_slope_ppm_ = ui_->calibration_slope_ppm_spin_box->value (); diff --git a/Configuration.hpp b/Configuration.hpp index 864608ee8..2b102fb6c 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -123,6 +123,7 @@ public: bool twoPass() const; bool x2ToneSpacing() const; bool contestMode() const; + bool realTimeDecode() const; bool MyDx() const; bool CQMyN() const; bool NDxG() const; diff --git a/Configuration.ui b/Configuration.ui index a77894f5e..d9c801554 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -2,6 +2,14 @@ configuration_dialog + + + 0 + 0 + 545 + 591 + + Settings @@ -2259,7 +2267,7 @@ Right click for insert and delete options. - + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> @@ -2269,6 +2277,19 @@ Right click for insert and delete options. + + + + false + + + <html><head/><body><p>Decode on-the-fly rather than at end of Rx sequence.</p></body></html> + + + MSK144 Realtime decode + + + @@ -2518,12 +2539,12 @@ soundcard changes - - + + diff --git a/lib/hspec.f90 b/lib/hspec.f90 index 5a45bc3ce..2c066e25f 100644 --- a/lib/hspec.f90 +++ b/lib/hspec.f90 @@ -1,4 +1,4 @@ -subroutine hspec(id2,k,ntrperiod,ingain,green,s,jh) +subroutine hspec(id2,k,nutc0,ntrperiod,ntol,bmsk144,ingain,green,s,jh,line1) ! Input: ! k pointer to the most recent new data @@ -9,7 +9,9 @@ subroutine hspec(id2,k,ntrperiod,ingain,green,s,jh) ! jh index of most recent data in green(), s() parameter (JZ=703) + character*80 line1 integer*2 id2(0:120*12000-1) + logical*1 bmsk144 real green(0:JZ-1) real s(0:63,0:JZ-1) real x(512) @@ -62,5 +64,14 @@ subroutine hspec(id2,k,ntrperiod,ingain,green,s,jh) enddo k0=k +!### + if(bmsk144) then + if(k.ge.7168) then + tsec=(k-3584)/12000.0 + call mskrtd(id2(k-7168+1:k),nutc0,tsec,ntol,line1) + endif + endif +!### + 900 return end subroutine hspec diff --git a/lib/tweak1.f90 b/lib/tweak1.f90 index 572b26ff3..ad4daf6c3 100644 --- a/lib/tweak1.f90 +++ b/lib/tweak1.f90 @@ -14,7 +14,8 @@ subroutine tweak1(ca,jz,f0,cb) wstep=cmplx(cos(dphi),sin(dphi)) do i=1,jz w=w*wstep - cb(i)=w*ca(i) + w4=w + cb(i)=w4*ca(i) enddo return diff --git a/mainwindow.cpp b/mainwindow.cpp index 730427180..d6033f4cb 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -67,8 +67,9 @@ extern "C" { void symspec_(struct dec_data *, int* k, int* ntrperiod, int* nsps, int* ingain, int* minw, float* px, float s[], float* df3, int* nhsym, int* npts8); - void hspec_(short int d2[], int* k, int* ntrperiod, int* ingain, - float green[], float s[], int* jh); + void hspec_(short int d2[], int* k, int* nutc0, int* ntrperiod, int* ntol, + bool* bmsk144, int* ingain, float green[], float s[], int* jh, + char line[], int len1); void gen4_(char* msg, int* ichk, char* msgsent, int itone[], int* itext, int len1, int len2); @@ -1261,17 +1262,42 @@ void MainWindow::fastSink(qint64 frames) m_bFastDecodeCalled=false; } - hspec_(dec_data.d2, &k, &m_TRperiod, &m_inGain, fast_green, fast_s, &fast_jh); + QDateTime tnow=QDateTime::currentDateTimeUtc(); + int ihr=tnow.toString("hh").toInt(); + int imin=tnow.toString("mm").toInt(); + int isec=tnow.toString("ss").toInt(); + isec=isec - isec%m_TRperiod; + int nutc0=10000*ihr + 100*imin + isec; + if(m_diskData) nutc0=m_UTCdisk; + char line[80]; + bool bmsk144=((m_mode=="MSK144") and (m_monitoring or m_diskData)); + bmsk144=bmsk144 && m_config.realTimeDecode(); + line[0]=0; + hspec_(dec_data.d2,&k,&nutc0,&m_TRperiod, &m_Ftol, &bmsk144,&m_inGain,fast_green, + fast_s,&fast_jh, &line[0],80); float px = fast_green[fast_jh]; QString t; t.sprintf(" Rx noise: %5.1f ",px); ui->signal_meter_widget->setValue(px); // Update thermometer m_fastGraph->plotSpec(m_diskData,m_UTCdisk); +//### + if(bmsk144 and (line[0]!=0)) { + QString message=QString::fromLatin1(line); + DecodedText decodedtext; + decodedtext=message.replace("\n",""); + ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(), + m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(), + m_config.color_NewCall()); + m_bDecoded=true; + } +//### + decodeNow=false; m_k0=k; if(m_diskData and m_k0 >= dec_data.params.kin - 7 * 512) decodeNow=true; if(!m_diskData and m_tRemaining<0.35 and !m_bFastDecodeCalled) decodeNow=true; + if(m_config.realTimeDecode()) decodeNow=false; if(decodeNow) { m_dataAvailable=true; @@ -2938,6 +2964,7 @@ void MainWindow::guiUpdate() //Once per second: if(nsec != m_sec0) { + qDebug() << m_config.contestMode() << m_config.realTimeDecode(); g_single_decode=m_config.single_decode(); if(m_auto and m_mode=="Echo" and m_bEchoTxOK) { progressBar.setMaximum(6);