From 211f8ba2912b4e5f97b3cd101df24f0d4f914378 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 12 Jul 2016 15:45:27 +0000 Subject: [PATCH] Save/Restore status of Sh box. Limit range of auto-generated short-message reports to -4 to +10 dB. Include +/- sign in all reports. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6907 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/detectmsk32.f90 | 25 +++++++++++++++++++------ lib/genmsk32.f90 | 8 ++++---- mainwindow.cpp | 17 ++++++++++++----- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/lib/detectmsk32.f90 b/lib/detectmsk32.f90 index a7d2a1452..18774504e 100644 --- a/lib/detectmsk32.f90 +++ b/lib/detectmsk32.f90 @@ -48,10 +48,10 @@ subroutine detectmsk32(cbig,n,mycall,partnercall,lines,nmessages,nutc,ntol) data first/.true./ data s8/0,1,1,1,0,0,1,0/ data s8r/1,0,1,1,0,0,0,1/ - data rpt /'-04 ','-03 ','-02 ','-01 ','00 ','01 ','02 ','03 ','04 ', & - '05 ','06 ','07 ','08 ','09 ','10 ', & - 'R-04','R-03','R-02','R-01','R00','R01','R02','R03','R04', & - 'R05','R06','R07','R08','R09','R10', & + data rpt /'-04 ','-03 ','-02 ','-01 ','+00 ','+01 ','+02 ','+03 ','+04 ', & + '+05 ','+06 ','+07 ','+08 ','+09 ','+10 ', & + 'R-04','R-03','R-02','R-01','R+00','R+01','R+02','R+03','R+04', & + 'R+05','R+06','R+07','R+08','R+09','R10', & 'RRR ','73 '/ save df,first,cb,cbr,fs,pi,twopi,dt,s8,rcw,pp,nmatchedfilter,ig24 @@ -431,7 +431,20 @@ subroutine detectmsk32(cbig,n,mycall,partnercall,lines,nmessages,nutc,ntol) call fmtmsg(hashmsg,iz) call hash(hashmsg,22,ihash) ihash=iand(ihash,127) - if( nrxhash .eq. ihash ) then + +!### +!Temporarily, check for short messages sent with positive dB and no + sign. + ihash2=-1 + i1=index(hashmsg,'+') + if(i1.gt.0) then + hashmsg=hashmsg(1:i1-1)//hashmsg(i1+1:22)//' ' + call hash(hashmsg,22,ihash2) + ihash2=iand(ihash2,127) + endif + if(nrxhash.eq.ihash .or. nrxhash.eq.ihash2) then +!### +! if( nrxhash .eq. ihash ) then + nmessages=1 write(msgreceived,'(a1,a,1x,a,a1,1x,a4)') "<",trim(mycall),trim(partnercall),">",rpt(nrxrpt) write(lines(nmessages),1020) nutc,nsnr,t0,nint(fest),msgreceived @@ -440,9 +453,9 @@ subroutine detectmsk32(cbig,n,mycall,partnercall,lines,nmessages,nutc,ntol) ! write(*,1022) nutc,ipbest,times(ipbest),snrs(ipbest),fest,nrxrpt,nrxhash, & ! rpt(nrxrpt),imessage,ig24(imessage),nhammdbest, & ! cdbest,cdratbest,cdrat2best,nbadsyncbest,ipkbest,idbest,idfbest,iavbest,iphabest +!1022 format(i4.4,2x,i4,f8.3,f8.2,f8.2,i6,i6,a6,i8,i10,i4,f8.3,f8.2,f8.2,i5,i5,i5,i5,i5,i5) endif endif endif -1022 format(i4.4,2x,i4,f8.3,f8.2,f8.2,i6,i6,a6,i8,i10,i4,f8.3,f8.2,f8.2,i5,i5,i5,i5,i5,i5) return end subroutine detectmsk32 diff --git a/lib/genmsk32.f90 b/lib/genmsk32.f90 index 229a19eaf..53fb95035 100644 --- a/lib/genmsk32.f90 +++ b/lib/genmsk32.f90 @@ -9,10 +9,10 @@ subroutine genmsk32(msg,msgsent,ichk,itone,itype) integer*1 codeword(24),bitseq(32) integer*1 s8r(8) data s8r/1,0,1,1,0,0,0,1/ - data rpt /'-04 ','-03 ','-02 ','-01 ','00 ','01 ','02 ','03 ','04 ', & - '05 ','06 ','07 ','08 ','09 ','10 ', & - 'R-04','R-03','R-02','R-01','R00','R01','R02','R03','R04', & - 'R05','R06','R07','R08','R09','R10', & + data rpt /'-04 ','-03 ','-02 ','-01 ','+00 ','+01 ','+02 ','+03 ','+04 ', & + '+05 ','+06 ','+07 ','+08 ','+09 ','+10 ', & + 'R-04','R-03','R-02','R-01','R+00','R+01','R+02','R+03','R+04', & + 'R+05','R+06','R+07','R+08','R+09','R+10', & 'RRR ','73 '/ data first/.true./ diff --git a/mainwindow.cpp b/mainwindow.cpp index c19029716..5b0dc264e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -664,7 +664,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->decodedTextLabel2->setText(t); readSettings(); //Restore user's setup params - createStatusBar(); m_audioThread.start (m_audioThreadPriority); @@ -768,6 +767,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->sbFtol->setValue(m_FtolIndex); on_sbFtol_valueChanged(m_FtolIndex); ui->cbEME->setChecked(m_bEME); + ui->cbShMsgs->setChecked(m_bShMsgs); ui->cbFast9->setChecked(m_bFast9); if(m_bFast9) m_bFastMode=true; @@ -931,6 +931,7 @@ void MainWindow::writeSettings() m_settings->setValue("FtolIndex",m_FtolIndex); m_settings->setValue("MinSync",m_minSync); m_settings->setValue("EME",m_bEME); + m_settings->setValue("ShMsgs",m_bShMsgs); m_settings->setValue ("DialFreq", QVariant::fromValue(m_lastMonitoredFrequency)); m_settings->setValue("InGain",m_inGain); m_settings->setValue("OutAttenuation", ui->outAttenuation->value ()); @@ -984,6 +985,7 @@ void MainWindow::readSettings() // ui->FTol_combo_box->setCurrentText(m_settings->value("FTol","500").toString ()); ui->syncSpinBox->setValue(m_settings->value("MinSync",0).toInt()); m_bEME=m_settings->value("EME",false).toBool(); + m_bShMsgs=m_settings->value("ShMsgs",false).toBool(); m_bFast9=m_settings->value("Fast9",false).toBool(); m_bFastMode=m_settings->value("FastMode",false).toBool(); m_TRindex=m_settings->value("TRindex",0).toInt(); @@ -3298,12 +3300,17 @@ void MainWindow::processMessage(QString const& messages, int position, bool ctrl QString rpt = decodedtext.report(); int n=rpt.toInt(); - if((m_mode=="JTMSK" or m_mode=="MSK144") and m_bShMsgs) { + if(m_mode=="JTMSK" and m_bShMsgs) { n=26; if(rpt.toInt()>4) n=27; if(rpt.toInt()>8) n=28; rpt=QString::number(n); } + if(m_mode=="MSK144" and m_bShMsgs) { + if(rpt.toInt()<-4) n=-4; + if(rpt.toInt()>10) n=10; + rpt=QString::number(n); + } ui->rptSpinBox->setValue(n); genStdMsgs(rpt); @@ -3450,15 +3457,16 @@ void MainWindow::genStdMsgs(QString rpt) msgtype("73", ui->tx5->lineEdit ()); } else { int n=rpt.toInt(); - rpt.sprintf("%+2.2d",n); if((m_mode=="JTMSK" or m_mode=="MSK144") and m_bShMsgs) { int i=t0.length()-1; t0="<" + t0.mid(0,i) + "> "; if(m_mode=="JTMSK") { if(n<26) n=26; if(n>28) n=28; + rpt.sprintf("%2.2d",n); //In JTMSK mode, "26" not "+26" + } else { + rpt.sprintf("%+2.2d",n); } - rpt.sprintf("%2.2d",n); } t=t0 + rpt; msgtype(t, ui->tx2); @@ -3954,7 +3962,6 @@ void MainWindow::on_actionMSK144_triggered() Q_EMIT FFTSize (m_FFTSize); setup_status_bar (true); m_toneSpacing=0.0; - ui->cbShMsgs->setChecked(false); ui->cbShMsgs->setVisible(true); ui->actionMSK144->setChecked(true); }