From 56675b1e2fd5112c7ea74a5c5d4f5d662489c37c Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Sun, 3 Dec 2017 21:59:59 +0000 Subject: [PATCH] Remember time of last transmission. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8279 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 7 +++++++ mainwindow.h | 1 + 2 files changed, 8 insertions(+) diff --git a/mainwindow.cpp b/mainwindow.cpp index 3e092f8eb..cf3540a40 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2517,6 +2517,11 @@ void MainWindow::msgAvgDecode2() void MainWindow::decode() //decode() { + if( m_dateTimeLastTX.isValid () ) { + QDateTime now = QDateTime::currentDateTime(); + qint64 isecs_since_tx = m_dateTimeLastTX.secsTo(now); + qDebug("The last TX was %d seconds ago",isecs_since_tx); + } m_msec0=QDateTime::currentMSecsSinceEpoch(); if(!m_dataAvailable or m_TRperiod==0) return; ui->DecodeButton->setChecked (true); @@ -3161,6 +3166,8 @@ void MainWindow::guiUpdate() if(m_tune) m_bTxTime=true; //"Tune" takes precedence if(m_transmitting or m_auto or m_tune) { + m_dateTimeLastTX = QDateTime::currentDateTime (); + // Check for "txboth" (testing purposes only) QFile f(m_appDir + "/txboth"); if(f.exists() and diff --git a/mainwindow.h b/mainwindow.h index 4f7bc6a2b..c9f58c639 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -569,6 +569,7 @@ private: QSet m_sfx; QDateTime m_dateTimeQSOOn; + QDateTime m_dateTimeLastTX; QSharedMemory *mem_jt9; LogBook m_logBook;