From 7a4663e7428fcf5db29bb55e2cd957581e791b52 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Sat, 14 Dec 2019 22:53:34 -0500 Subject: [PATCH] Added SPEED to spots to JS8NET --- SpotClient.cpp | 6 ++++-- SpotClient.h | 4 ++-- mainwindow.cpp | 8 ++++---- mainwindow.h | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/SpotClient.cpp b/SpotClient.cpp index aec897d..612b189 100644 --- a/SpotClient.cpp +++ b/SpotClient.cpp @@ -69,7 +69,7 @@ void SpotClient::enqueueLocalSpot(QString callsign, QString grid, QString info, m_queue.enqueue(m.toJson()); } -void SpotClient::enqueueSpot(QString callsign, QString grid, int frequency, int snr){ +void SpotClient::enqueueSpot(QString callsign, QString grid, int submode, int frequency, int snr){ auto m = Message("RX.SPOT", "", { {"BY", QVariant(QMap{ {"CALLSIGN", QVariant(m_call)}, @@ -79,12 +79,13 @@ void SpotClient::enqueueSpot(QString callsign, QString grid, int frequency, int {"GRID", QVariant(grid)}, {"FREQ", QVariant(frequency)}, {"SNR", QVariant(snr)}, + {"SPEED", QVariant(submode)}, }); m_queue.enqueue(m.toJson()); } -void SpotClient::enqueueCmd(QString cmd, QString from, QString to, QString relayPath, QString text, QString grid, QString extra, int frequency, int snr){ +void SpotClient::enqueueCmd(QString cmd, QString from, QString to, QString relayPath, QString text, QString grid, QString extra, int submode, int frequency, int snr){ auto m = Message("RX.DIRECTED", "", { {"BY", QVariant(QMap{ {"CALLSIGN", QVariant(m_call)}, @@ -99,6 +100,7 @@ void SpotClient::enqueueCmd(QString cmd, QString from, QString to, QString relay {"EXTRA", QVariant(extra)}, {"FREQ", QVariant(frequency)}, {"SNR", QVariant(snr)}, + {"SPEED", QVariant(submode)}, }); m_queue.enqueue(m.toJson()); diff --git a/SpotClient.h b/SpotClient.h index d6095ff..992a3c5 100644 --- a/SpotClient.h +++ b/SpotClient.h @@ -17,8 +17,8 @@ public: void prepare(); void setLocalStation(QString callsign, QString grid, QString info, QString version); void enqueueLocalSpot(QString callsign, QString grid, QString info, QString version); - void enqueueCmd(QString cmd, QString from, QString to, QString relayPath, QString text, QString grid, QString extra, int frequency, int snr); - void enqueueSpot(QString callsign, QString grid, int frequency, int snr); + void enqueueCmd(QString cmd, QString from, QString to, QString relayPath, QString text, QString grid, QString extra, int submode, int frequency, int snr); + void enqueueSpot(QString callsign, QString grid, int submode, int frequency, int snr); void sendRawSpot(QByteArray payload); public slots: diff --git a/mainwindow.cpp b/mainwindow.cpp index 69a360e..784f7bf 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -5201,12 +5201,12 @@ QString MainWindow::lookupCallInCompoundCache(QString const &call){ return m_compoundCallCache.value(call, call); } -void MainWindow::spotReport(int offset, int snr, QString callsign, QString grid){ +void MainWindow::spotReport(int submode, int offset, int snr, QString callsign, QString grid){ if(!m_config.spot_to_reporting_networks()) return; Frequency frequency = m_freqNominal + offset; - m_spotClient->enqueueSpot(callsign, grid, frequency, snr); + m_spotClient->enqueueSpot(callsign, grid, submode, frequency, snr); } void MainWindow::spotCmd(CommandDetail cmd){ @@ -5217,7 +5217,7 @@ void MainWindow::spotCmd(CommandDetail cmd){ cmdStr = Varicode::lstrip(cmd.cmd); } - m_spotClient->enqueueCmd(cmdStr, cmd.from, cmd.to, cmd.relayPath, cmd.text, cmd.grid, cmd.extra, m_freqNominal + cmd.freq, cmd.snr); + m_spotClient->enqueueCmd(cmdStr, cmd.from, cmd.to, cmd.relayPath, cmd.text, cmd.grid, cmd.extra, cmd.submode, m_freqNominal + cmd.freq, cmd.snr); } void MainWindow::pskLogReport(QString mode, int offset, int snr, QString callsign, QString grid){ @@ -11678,7 +11678,7 @@ void MainWindow::processSpots() { qDebug() << "spotting call to reporting networks" << d.call << d.snr << d.freq; - spotReport(d.freq, d.snr, d.call, d.grid); + spotReport(d.submode, d.freq, d.snr, d.call, d.grid); pskLogReport("JS8", d.freq, d.snr, d.call, d.grid); sendNetworkMessage("RX.SPOT", "", { diff --git a/mainwindow.h b/mainwindow.h index 11f7857..fd4e1cf 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -954,7 +954,7 @@ private: void rigFailure (QString const& reason); void spotSetLocal(); void pskSetLocal (); - void spotReport(int offset, int snr, QString callsign, QString grid); + void spotReport(int submode, int offset, int snr, QString callsign, QString grid); void spotCmd(CommandDetail cmd); void pskLogReport(QString mode, int offset, int snr, QString callsign, QString grid); Radio::Frequency dialFrequency();