M17 mod: APRS: alternate status and position messages when insert location button is engaged

pull/1344/head
f4exb 2022-07-03 21:55:16 +02:00
rodzic 3cf3938757
commit 71c486310a
5 zmienionych plików z 23 dodań i 5 usunięć

Wyświetl plik

@ -732,7 +732,7 @@
<enum>QTabWidget::East</enum>
</property>
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="settingsTab">
<property name="toolTip">

Wyświetl plik

@ -1112,7 +1112,7 @@
<item>
<widget class="ButtonSwitch" name="aprsInsertPosition">
<property name="toolTip">
<string>Insert position (latitude and longitude)</string>
<string>Alternate status and position (latitude and longitude) packets</string>
</property>
<property name="text">
<string>...</string>

Wyświetl plik

@ -66,9 +66,18 @@ bool M17ModProcessor::handleMessage(const Message& cmd)
M17ModAX25 modAX25;
QString strData;
if (notif.getInsertPosition()) {
strData += "!" + formatAPRSPosition();
} else {
if (notif.getInsertPosition())
{
if (m_insertPositionToggle) {
strData += "!" + formatAPRSPosition();
} else {
strData = notif.getData();
}
m_insertPositionToggle = !m_insertPositionToggle;
}
else
{
strData = notif.getData();
}

Wyświetl plik

@ -188,6 +188,7 @@ public:
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
M17ModFIFO *getBasebandFifo() { return &m_basebandFifo; }
void resetInsertPositionToggle() { m_insertPositionToggle = true; }
private:
MessageQueue m_inputMessageQueue;
@ -202,6 +203,7 @@ private:
int m_audioFrameIndex;
uint16_t m_audioFrameNumber;
struct CODEC2 *m_codec2;
bool m_insertPositionToggle;
bool handleMessage(const Message& cmd);
void processPacket(const QString& sourceCall, const QString& destCall, uint8_t can, const QByteArray& packetBytes);

Wyświetl plik

@ -523,6 +523,13 @@ void M17ModSource::applySettings(const M17ModSettings& settings, bool force)
}
}
if ((settings.m_insertPosition != m_settings.m_insertPosition) || force)
{
if (settings.m_insertPosition) {
m_processor->resetInsertPositionToggle();
}
}
m_settings = settings;
}