Add "Clear reference spectrum" to the File menu.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7426 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-12-24 20:05:28 +00:00
parent 4f8bf753e6
commit e40d1399c3
4 changed files with 22 additions and 7 deletions

View File

@ -1,4 +1,4 @@
subroutine refspectrum(id2,brefspec,buseref,fname)
subroutine refspectrum(id2,bclear,brefspec,buseref,fname)
! Input:
! id2 i*2 Raw 16-bit integer data, 12000 Hz sample rate
@ -6,7 +6,7 @@ subroutine refspectrum(id2,brefspec,buseref,fname)
parameter (NFFT=6912,NH=NFFT/2)
integer*2 id2(NFFT)
logical*1 brefspec,buseref
logical*1 bclear,brefspec,buseref
real x0(0:NH-1) !Input samples
real x1(0:NH-1) !Output samples (delayed by one block)
@ -37,6 +37,7 @@ subroutine refspectrum(id2,brefspec,buseref,fname)
x1s=0.
first=.false.
endif
if(bclear) s=0.
if(brefspec) then
x(0:NH-1)=0.001*id2(1:NH)
@ -96,7 +97,6 @@ subroutine refspectrum(id2,brefspec,buseref,fname)
if(s(i).gt.0.0) filter(i)=20.0*log10(fil(i))
enddo
! open(16,file='refspec.dat',status='unknown')
open(16,file=fname,status='unknown')
do i=1,NH
freq=i*df
@ -111,7 +111,6 @@ subroutine refspectrum(id2,brefspec,buseref,fname)
if(buseref) then
if(firstuse) then
! open(16,file='refspec.dat',status='unknown')
fil=1.0
open(16,file=fname,status='old',err=10)
do i=1,NH

View File

@ -113,8 +113,8 @@ extern "C" {
int len1, int len2, int len3);
void degrade_snr_(short d2[], int* n, float* db, float* bandwidth);
void wav12_(short d2[], short d1[], int* nbytes, short* nbitsam2);
void refspectrum_(short int d2[], bool* brefspec, bool* buseref,
const char* c_fname, int len);
void refspectrum_(short int d2[], bool* bclearrefspec, bool* brefspec,
bool* buseref, const char* c_fname, int len);
}
int volatile itone[NUM_ISCAT_SYMBOLS]; //Audio tones for all Tx symbols
@ -248,6 +248,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_bFastDecodeCalled {false},
m_bDoubleClickAfterCQnnn {false},
m_bRefSpec {false},
m_bClearRefSpec {false},
m_ihsym {0},
m_nzap {0},
m_px {0.0},
@ -1091,7 +1092,9 @@ void MainWindow::dataSink(qint64 frames)
}
m_bUseRef=m_wideGraph->useRef();
refspectrum_(&dec_data.d2[k-m_nsps/2],&m_bRefSpec,&m_bUseRef,c_fname,len);
refspectrum_(&dec_data.d2[k-m_nsps/2],&m_bClearRefSpec,&m_bRefSpec,
&m_bUseRef,c_fname,len);
m_bClearRefSpec=false;
// Get power, spectrum, and ihsym
int trmin=m_TRperiod/60;
@ -5874,6 +5877,11 @@ void MainWindow::on_actionSave_reference_spectrum_triggered()
m_bRefSpec=true;
}
void MainWindow::on_actionClear_reference_spectrum_triggered()
{
m_bClearRefSpec=true;
}
void MainWindow::on_sbCQTxFreq_valueChanged(int)
{
setXIT (ui->TxFreqSpinBox->value ());

View File

@ -241,6 +241,7 @@ private slots:
void on_actionFast_Graph_triggered();
void fast_decode_done();
void on_actionSave_reference_spectrum_triggered();
void on_actionClear_reference_spectrum_triggered();
void on_sbTR_valueChanged(int index);
void on_sbFtol_valueChanged(int index);
void on_cbFast9_clicked(bool b);
@ -414,6 +415,7 @@ private:
bool m_bFastDecodeCalled;
bool m_bDoubleClickAfterCQnnn;
bool m_bRefSpec;
bool m_bClearRefSpec;
bool m_bUseRef;
bool m_bFastDone;
bool m_bAltV;

View File

@ -2337,6 +2337,7 @@ QPushButton[state="ok"] {
<addaction name="actionDecode_remaining_files_in_directory"/>
<addaction name="separator"/>
<addaction name="actionSave_reference_spectrum"/>
<addaction name="actionClear_reference_spectrum"/>
<addaction name="separator"/>
<addaction name="actionDelete_all_wav_files_in_SaveDir"/>
<addaction name="actionErase_ALL_TXT"/>
@ -2893,6 +2894,11 @@ QPushButton[state=&quot;ok&quot;] {
<string/>
</property>
</action>
<action name="actionClear_reference_spectrum">
<property name="text">
<string>Clear reference spectrum</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>