Browse Source

JSON UDP checkbox GUI added

chirpmodem-v8.0.0
jvn314 7 months ago
parent
commit
2306bb08d0
  1. 9
      FIXME-notes.md
  2. 9
      plugins/channelrx/demodmeshtastic/meshtasticdemodgui.cpp
  3. 1
      plugins/channelrx/demodmeshtastic/meshtasticdemodgui.h
  4. 13
      plugins/channelrx/demodmeshtastic/meshtasticdemodgui.ui

9
FIXME-notes.md

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
## meshtasticdemodwebapiadapter.cpp:35
Initializes SWGChirpChatDemodSettings instead of SWGMeshtasticDemodSettings.
Copy-paste artifact from ChirpChat plugin. Fix separately in its own commit.
Branch: feature-meshtastic-more-udp or open a dedicated bug-fix branch.
## meshtasticdemodgui.cpp - checkbox signal pattern
All checkboxes currently use stateChanged(int) pattern.
Consider refactoring all to clicked(bool) for simplicity in a future cleanup commit.
Affects: sendViaUDP, sendJsonViaUDP, and likely other checkboxes in the same file.

9
plugins/channelrx/demodmeshtastic/meshtasticdemodgui.cpp

@ -343,6 +343,12 @@ void MeshtasticDemodGUI::on_udpSend_stateChanged(int state) @@ -343,6 +343,12 @@ void MeshtasticDemodGUI::on_udpSend_stateChanged(int state)
applySettings();
}
void MeshtasticDemodGUI::on_udpSendJson_stateChanged(int state)
{
m_settings.m_sendJsonViaUDP = (state == Qt::Checked);
applySettings();
}
void MeshtasticDemodGUI::on_udpAddress_editingFinished()
{
m_settings.m_udpAddress = ui->udpAddress->text();
@ -2009,6 +2015,7 @@ void MeshtasticDemodGUI::displaySettings() @@ -2009,6 +2015,7 @@ void MeshtasticDemodGUI::displaySettings()
ui->messageLengthText->setText(tr("%1").arg(m_settings.m_nbSymbolsMax));
ui->messageLength->setValue(m_settings.m_nbSymbolsMax);
ui->udpSend->setChecked(m_settings.m_sendViaUDP);
ui->udpSendJson->setChecked(m_settings.m_sendJsonViaUDP);
ui->udpAddress->setText(m_settings.m_udpAddress);
ui->udpPort->setText(tr("%1").arg(m_settings.m_udpPort));
ui->invertRamps->setChecked(s.m_invertRamps);
@ -3345,8 +3352,10 @@ void MeshtasticDemodGUI::makeUIConnections() @@ -3345,8 +3352,10 @@ void MeshtasticDemodGUI::makeUIConnections()
QObject::connect(ui->messageLength, &QDial::valueChanged, this, &MeshtasticDemodGUI::on_messageLength_valueChanged);
#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
QObject::connect(ui->udpSend, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state){ on_udpSend_stateChanged(static_cast<int>(state)); });
QObject::connect(ui->udpSendJson, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state){ on_udpSendJson_stateChanged(static_cast<int>(state)); });
#else
QObject::connect(ui->udpSend, &QCheckBox::stateChanged, this, &MeshtasticDemodGUI::on_udpSend_stateChanged);
QObject::connect(ui->udpSendJson, &QCheckBox::stateChanged, this, &MeshtasticDemodGUI::on_udpSendJson_stateChanged);
#endif
QObject::connect(ui->udpAddress, &QLineEdit::editingFinished, this, &MeshtasticDemodGUI::on_udpAddress_editingFinished);
QObject::connect(ui->udpPort, &QLineEdit::editingFinished, this, &MeshtasticDemodGUI::on_udpPort_editingFinished);

1
plugins/channelrx/demodmeshtastic/meshtasticdemodgui.h

@ -84,6 +84,7 @@ private slots: @@ -84,6 +84,7 @@ private slots:
void on_eomSquelch_valueChanged(int value);
void on_messageLength_valueChanged(int value);
void on_udpSend_stateChanged(int state);
void on_udpSendJson_stateChanged(int state);
void on_udpAddress_editingFinished();
void on_udpPort_editingFinished();
void on_invertRamps_stateChanged(int state);

13
plugins/channelrx/demodmeshtastic/meshtasticdemodgui.ui

@ -1380,6 +1380,19 @@ @@ -1380,6 +1380,19 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="udpSendJson">
<property name="toolTip">
<string>Send decoded message as JSON via UDP</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>JSON</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">

Loading…
Cancel
Save