Added SPEED to spots to JS8NET

This commit is contained in:
Jordan Sherer 2019-12-14 22:53:34 -05:00
parent 7728483481
commit 7a4663e742
4 changed files with 11 additions and 9 deletions

View File

@ -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<QString, QVariant>{
{"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<QString, QVariant>{
{"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());

View File

@ -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:

View File

@ -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", "", {

View File

@ -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();