kopia lustrzana https://github.com/f4exb/sdrangel
M17 mod: APRS: alternate status and position messages when insert location button is engaged
rodzic
3cf3938757
commit
71c486310a
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue