From a0dc7bc01315aca74452b7783a5385ac1c4d8d8f Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Sat, 23 Feb 2019 09:50:02 -0500 Subject: [PATCH] Fixed #76: added tone output to API --- mainwindow.cpp | 21 ++++++++++++++++++++- mainwindow.h | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 73b9766..fa84737 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -4753,12 +4753,15 @@ void MainWindow::guiUpdate() char ft8msgbits[75 + 12]; //packed 75 bit ft8 message plus 12-bit CRC genft8_(message, MyGrid, &bcontest, &m_i3bit, msgsent, const_cast (ft8msgbits), const_cast (itone), 22, 6, 22); + msgibits = m_i3bit; msgsent[22]=0; - m_currentMessage = QString::fromLatin1(msgsent); + m_currentMessage = QString::fromLatin1(msgsent).trimmed(); m_currentMessageBits = msgibits; + emitTones(); + #if TEST_FOX_WAVE_GEN if(ui->turboButton->isChecked()) { @@ -11326,6 +11329,22 @@ void MainWindow::emitPTT(bool on){ }); } +void MainWindow::emitTones(){ + if(!m_config.udpEnabled()){ + return; + } + + // emit tone numbers to network + QVariantList t; + for(int i = 0; i < NUM_FT8_SYMBOLS; i++){ + t.append(QVariant((int)itone[i])); + } + + sendNetworkMessage("TX.FRAME", "", { + {"TONES", t} + }); +} + void MainWindow::networkMessage(Message const &message) { if(!m_config.udpEnabled()){ diff --git a/mainwindow.h b/mainwindow.h index 98658f1..bba004a 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -383,6 +383,7 @@ private slots: void on_cbFirst_toggled(bool b); void on_cbAutoSeq_toggled(bool b); void emitPTT(bool on); + void emitTones(); void networkMessage(Message const &message); void sendNetworkMessage(QString const &type, QString const &message); void sendNetworkMessage(QString const &type, QString const &message, const QMap ¶ms);