From d4c2d9a8712d28ba96df4ab5c149e67538ad736e Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Fri, 20 Jul 2018 23:09:17 -0400 Subject: [PATCH] Log directed FT8Call messages to PSKReporter --- mainwindow.cpp | 27 ++++++++++++++++++++++++--- mainwindow.h | 1 + 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 8416910..eef235f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -3270,6 +3270,13 @@ void MainWindow::readFromStdout() //readFromStdout cd.freq = decodedtext.frequencyOffset(); cd.utcTimestamp = d.utcTimestamp; m_callActivity[cd.call] = cd; + + int nsec=QDateTime::currentMSecsSinceEpoch()/1000-m_secBandChanged; + bool okToPost=(nsec>(4*m_TRperiod)/5); + if (okToPost){ + pskSetLocal(); + pskLogReport("FT8Call", d.freq, d.snr, d.from, ""); + } } } } @@ -3484,15 +3491,29 @@ void MainWindow::pskPost (DecodedText const& decodedtext) audioFrequency=decodedtext.string().mid(16,4).toInt(); } int snr = decodedtext.snr(); - Frequency frequency = m_freqNominal + audioFrequency; pskSetLocal (); if(grid.contains (grid_regexp)) { // qDebug() << "To PSKreporter:" << deCall << grid << frequency << msgmode << snr; - psk_Reporter->addRemoteStation(deCall,grid,QString::number(frequency),msgmode, - QString::number(snr),QString::number(QDateTime::currentDateTime().toTime_t())); +// psk_Reporter->addRemoteStation(deCall,grid,QString::number(frequency),msgmode, +// QString::number(snr),QString::number(QDateTime::currentDateTime().toTime_t())); + pskLogReport(msgmode, audioFrequency, snr, deCall, grid); } } +void MainWindow::pskLogReport(QString mode, int offset, int snr, QString callsign, QString grid){ + if(!m_config.spot_to_psk_reporter()) return; + + Frequency frequency = m_freqNominal + offset; + + psk_Reporter->addRemoteStation( + callsign, + grid, + QString::number(frequency), + mode, + QString::number(snr), + QString::number(QDateTime::currentDateTime().toTime_t())); +} + void MainWindow::killFile () { if (m_fnameWE.size () && diff --git a/mainwindow.h b/mainwindow.h index 47ccd41..fdf2cdc 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -754,6 +754,7 @@ private: void rigFailure (QString const& reason); void pskSetLocal (); void pskPost(DecodedText const& decodedtext); + void pskLogReport(QString mode, int offset, int snr, QString callsign, QString grid); void displayDialFrequency (); void transmitDisplay (bool); void processMessage(DecodedText const&, Qt::KeyboardModifiers = 0);