From cd15a5e4d632d7a181c2e0536d0d9e759a68372d Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 9 Apr 2013 15:16:34 +0000 Subject: [PATCH] 1. Click on spectrum sets Rx freq; double-click also invokes narrow-band decoder at the new frequency. CTRL-click (or CTRL-double-click) sets both Rx and Tx freqs. 2. Amplitude at end of transmission is ramped down to prevent a "key click". git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3139 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/decoder.f90 | 24 +++++++++++++----------- mainwindow.cpp | 11 ++++++++--- plotter.cpp | 18 ++++++++++-------- plotter.h | 1 - soundout.cpp | 8 +++++++- 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 6a3241f01..95f10464f 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -29,18 +29,8 @@ subroutine decoder(ss,c0) newdat=1 nsynced=0 ndecoded=0 - limit=5000 - ccflim=4.0 - if(ndepth.ge.2) then - limit=50000 - ccflim=3.0 - endif - if(ndepth.ge.3) then - limit=200000 - ccflim=2.5 - endif - nsps=0 + if(ntrMinutes.eq.1) then nsps=6912 df3=1500.0/2048.0 @@ -69,6 +59,18 @@ subroutine decoder(ss,c0) idf=ntol/df3 + 0.999 do nqd=1,0,-1 + + limit=5000 + ccflim=4.0 + if(ndepth.ge.2) then + limit=50000 + ccflim=3.0 + endif + if(ndepth.ge.3 .or. nqd.eq.1) then + limit=200000 + ccflim=2.5 + endif + if(nqd.eq.1) then nfa1=nfqso-ntol nfb1=nfqso+ntol diff --git a/mainwindow.cpp b/mainwindow.cpp index 4790283d9..1b88706a4 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -760,7 +760,7 @@ void MainWindow::bumpFqso(int n) //bumpFqso() if(n==11) i--; if(n==12) i++; g_pWideGraph->setQSOfreq(i); - if(!ctrl) { + if(ctrl) { ui->TxFreqSpinBox->setValue(i); g_pWideGraph->setTxFreq(i); } @@ -1063,9 +1063,14 @@ void MainWindow::on_DecodeButton_clicked() //Decode request void MainWindow::freezeDecode(int n) //freezeDecode() { - if(n==1) { - bumpFqso(0); + qDebug() << "A" << n; + bool ctrl = (n>=100); + int i=g_pWideGraph->QSOfreq(); + if(ctrl) { + ui->TxFreqSpinBox->setValue(i); + g_pWideGraph->setTxFreq(i); } + if((n%100)==2) on_DecodeButton_clicked(); } void MainWindow::decode() //decode() diff --git a/plotter.cpp b/plotter.cpp index 649bda6c2..ca5c0ac3b 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -418,18 +418,20 @@ void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent int x=event->x(); setFQSO(x,false); // Wideband waterfall bool ctrl = (event->modifiers() & Qt::ControlModifier); - if(!ctrl) { - setTxFreq(m_fQSO); - emit freezeDecode1(1); //### ??? - } + int n=1; + if(ctrl) n+=100; + emit freezeDecode1(n); + if(ctrl) setTxFreq(m_fQSO); } void CPlotter::mouseDoubleClickEvent(QMouseEvent *event) //mouse2click { -// int h = (m_Size.height()-60)/2; - int x=event->x(); - setFQSO(x,false); - emit freezeDecode1(2); //### ??? +// int x=event->x(); +// setFQSO(x,false); + bool ctrl = (event->modifiers() & Qt::ControlModifier); + int n=2; + if(ctrl) n+=100; + emit freezeDecode1(n); } void CPlotter::setNSpan(int n) //setNSpan() diff --git a/plotter.h b/plotter.h index eeb5fb39b..2e08d5b26 100644 --- a/plotter.h +++ b/plotter.h @@ -65,7 +65,6 @@ public: void SetPercent2DScreen(int percent){m_Percent2DScreen=percent;} signals: - void freezeDecode0(int n); void freezeDecode1(int n); protected: diff --git a/soundout.cpp b/soundout.cpp index cddf84512..bb208f236 100644 --- a/soundout.cpp +++ b/soundout.cpp @@ -96,10 +96,15 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer, baud=12000.0/udata->nsps; freq=udata->ntxfreq + itone[isym]*baud; dphi=twopi*freq/48000.0; + double amp=32767.0; + int i0=84.983*4.0*udata->nsps; for(uint i=0 ; itwopi) phi -= twopi; - i2=32767.0*sin(phi); + if(ic>i0) { + amp=0.98*amp; + } + i2=amp*sin(phi); if(udata->txsnrdb < 0.0) { int i4=fac*(gran() + i2*snr/32768.0); if(i4>32767) i4=32767; @@ -113,6 +118,7 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer, #endif ic++; } + if(amp<1.0 and itone[0]>=0) return paComplete; return paContinue; }