From f7ba2480e463a3219bc7ecbdb326669483927517 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 27 Oct 2012 14:09:34 +0000 Subject: [PATCH] Add logic for erasing wsjtx_rx.log. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2697 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/decoder.f90 | 6 +++++- mainwindow.cpp | 6 +++--- mainwindow.h | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/decoder.f90 b/lib/decoder.f90 index e86f993da..ebcba23fa 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -1,4 +1,4 @@ -subroutine decoder(ntrSeconds,c0) +subroutine decoder(ntrSeconds,nRxLog,c0) ! Decoder for JT9. Can run stand-alone, reading data from *.wav files; ! or as the back end of wsjt-x, with data placed in a shared memory region. @@ -63,6 +63,10 @@ subroutine decoder(ntrSeconds,c0) open(14,file='wsjtx_rx.log',status='unknown',position='append') first=.false. endif + if(iand(nRxLog,2).ne.0) rewind 14 + if(iand(nRxLog,1).ne.0) then +! Write date and time to lu 14 + endif write(14,1010) nutc,nsync,nsnr,xdt,1000.0+fpk,width,msg call flush(14) diff --git a/mainwindow.cpp b/mainwindow.cpp index d2939f8cf..a76405581 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -859,7 +859,9 @@ void MainWindow::decode() //decode() jt9com_.nfqso=g_pWideGraph->QSOfreq(); m_tol=g_pWideGraph->Tol(); jt9com_.ntol=m_tol; - *future3 = QtConcurrent::run(decoder_, &m_TRperiod, &c0[0]); + if(jt9com_.nutc < m_nutc0) m_RxLog |= 1; //Date and Time to wsjtx_rx.log + m_nutc0=jt9com_.nutc; + *future3 = QtConcurrent::run(decoder_, &m_TRperiod, &m_RxLog, &c0[0]); watcher3->setFuture(*future3); } @@ -1342,7 +1344,6 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button f.close(); } -/* void MainWindow::on_actionErase_wsjtx_rx_log_triggered() //Erase Rx log { int ret = QMessageBox::warning(this, "Confirm Erase", @@ -1352,7 +1353,6 @@ void MainWindow::on_actionErase_wsjtx_rx_log_triggered() //Erase Rx log m_RxLog |= 2; // Rewind wsjtx_rx.log } } -*/ void MainWindow::on_actionErase_wsjtx_tx_log_triggered() //Erase Tx log { diff --git a/mainwindow.h b/mainwindow.h index 4cf8a89be..4beb80360 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -96,7 +96,7 @@ private slots: void on_genStdMsgsPushButton_clicked(); void bumpDF(int n); void on_logQSOButton_clicked(); -// void on_actionErase_wsjtx_rx_log_triggered(); + void on_actionErase_wsjtx_rx_log_triggered(); void on_actionErase_wsjtx_tx_log_triggered(); void on_actionAFMHot_triggered(); void on_actionBlue_triggered(); @@ -225,7 +225,7 @@ void symspec_(int* k, int* ntrperiod, int* nsps, int* nb, int* m_NBslider, void genjt9_(char* msg, char* msgsent, int itone[], int len1, int len2); -void decoder_(int* ntrperiod, float c0[]); +void decoder_(int* ntrperiod, int* mRxLog, float c0[]); int ptt_(int* nport, int* itx, int* iptt); }