Fixed #76: added tone output to API

This commit is contained in:
Jordan Sherer 2019-02-23 09:50:02 -05:00
parent 84a3ef6046
commit a0dc7bc013
2 changed files with 21 additions and 1 deletions

View File

@ -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<char *> (ft8msgbits),
const_cast<int *> (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()){

View File

@ -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<QString, QVariant> &params);