From ae438466acd33888d2e8c7d1d69acfd3fe136048 Mon Sep 17 00:00:00 2001 From: Doug McLain Date: Sat, 27 Nov 2021 14:06:37 -0500 Subject: [PATCH] Fix MMDVM rx/tx offset settings, Add MMDVM protocol 2 support, add MMDVM baud setting, add M17 CAN setting for TX (still receives all CAN for now), twaek mic gain slider width, other code cleanups --- DroidStar.pro | 2 + MainTab.qml | 37 +++++++++---- SettingsTab.qml | 25 +++++++-- android/AndroidManifest.xml | 2 +- codec.h | 4 +- dcscodec.cpp | 2 +- dmrcodec.cpp | 4 +- droidstar.cpp | 23 +++++--- droidstar.h | 7 +++ m17codec.cpp | 29 +++++----- m17codec.h | 2 + main.qml | 16 +++++- refcodec.cpp | 2 +- serialmodem.cpp | 105 +++++++++++++++++++++++++----------- serialmodem.h | 10 +++- xrfcodec.cpp | 2 +- ysfcodec.cpp | 4 +- 17 files changed, 200 insertions(+), 76 deletions(-) diff --git a/DroidStar.pro b/DroidStar.pro index cdae746..97729fd 100644 --- a/DroidStar.pro +++ b/DroidStar.pro @@ -9,6 +9,7 @@ LIBS += -limbe_vocoder win32:QT += serialport win32:INCLUDEPATH += /mnt/data/src/mxe/usr/include win32:LIBS += -L/mnt/data/src/mxe/usr/lib64 +#win32:LIBS += -L/mnt/data/src/mxe/usr/lib -lws2_32 win32:QMAKE_LFLAGS += -static QMAKE_LFLAGS_WINDOWS += --enable-stdcall-fixup RC_ICONS = images/droidstar.ico @@ -24,6 +25,7 @@ VERSION_BUILD='$(shell cd $$PWD;git rev-parse --short HEAD)' DEFINES += VERSION_NUMBER=\"\\\"$${VERSION_BUILD}\\\"\" DEFINES += QT_DEPRECATED_WARNINGS #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 +DEFINES += VOCODER_PLUGIN #DEFINES += USE_FLITE HEADERS += \ diff --git a/MainTab.qml b/MainTab.qml index 22e90ec..8eb5cbd 100644 --- a/MainTab.qml +++ b/MainTab.qml @@ -23,8 +23,6 @@ import QtQuick.Controls 2.3 Item { id: mainTab - //property int rows: 18; - //property bool tts: false; property int rows: { if(USE_FLITE){ rows = 20; @@ -75,6 +73,7 @@ Item { property alias comboSlot: _comboSlot property alias comboCC: _comboCC property alias dmrtgidEdit: _dmrtgidEdit + property alias comboM17CAN: _comboM17CAN property alias privateBox: _privateBox property alias connectbutton: _connectbutton property alias sliderMicGain: _slidermicGain @@ -128,7 +127,6 @@ Item { } } } - ComboBox { id: _comboMode property bool loaded: false @@ -184,7 +182,6 @@ Item { } } - ComboBox { id: _comboCC x: (parent.width * 2 / 5 ) @@ -261,7 +258,7 @@ Item { droidstar.set_modemYSFTxLevel(settingsTab.modemYSFTXLevelEdit.text); droidstar.set_modemP25TxLevel(settingsTab.modemYSFTXLevelEdit.text); droidstar.set_modemNXDNTxLevel(settingsTab.modemNXDNTXLevelEdit.text); - + droidstar.set_modemBaud(settingsTab.modemBaudEdit.text); droidstar.process_connect(); } } @@ -322,7 +319,6 @@ Item { //console.log("screen size ", parent.width, " x ", parent.height); } } - TextField { id: _editIAXDTMF x: (parent.width / 4) @@ -360,7 +356,7 @@ Item { id: _dmrtgidEdit x: parent.width / 5 y: (parent.height / rows + 1) * 2 - width: parent.width /5 + width: parent.width / 5 height: parent.height / rows font.pixelSize: parent.height / 35 selectByMouse: true @@ -370,6 +366,27 @@ Item { droidstar.tgid_text_changed(dmrtgidEdit.text) } } + ComboBox { + visible: false + id: _comboM17CAN + x: parent.width / 5 + y: (parent.height / rows + 1) * 2 + width: parent.width / 5 + height: parent.height / rows; + font.pixelSize: parent.height / 35 + currentIndex: 0 + model: ["0", "1", "2", "3", "4", "5", "6", "7"] + contentItem: Text { + text: _comboM17CAN.displayText + font: _comboM17CAN.font + leftPadding: 10 + verticalAlignment: Text.AlignVCenter + color: _comboM17CAN.enabled ? "white" : "darkgrey" + } + onCurrentTextChanged: { + droidstar.set_modemM17CAN(_comboM17CAN.currentText); + } + } CheckBox { id: _swtxBox @@ -383,7 +400,6 @@ Item { droidstar.set_swtx(_swtxBox.checked) } } - CheckBox { id: _swrxBox x: (parent.width * 3 / 5) + 5 @@ -423,9 +439,9 @@ Item { Slider { visible: true id: _slidermicGain - x: parent.width / 4 + x: (parent.width / 4) + 10 y: (parent.height / rows + 1) * 3; - width: (parent.width * 3 / 4) - 10 + width: (parent.width * 3 / 4) - 20 height: parent.height / rows; value: 0.5 onValueChanged: { @@ -442,7 +458,6 @@ Item { color: "white" font.pixelSize: parent.height / 30; } - Text { id: _label2 x: 10 diff --git a/SettingsTab.qml b/SettingsTab.qml index 19cf1f0..ae2e63f 100644 --- a/SettingsTab.qml +++ b/SettingsTab.qml @@ -69,13 +69,14 @@ Item { property alias modemYSFTXLevelEdit: _modemYSFTXLevelEdit property alias modemP25TXLevelEdit: _modemP25TXLevelEdit property alias modemNXDNTXLevelEdit: _modemNXDNTXLevelEdit + property alias modemBaudEdit: _modemBaudEdit Flickable { id: flickable anchors.fill: parent contentWidth: parent.width - contentHeight: _modemNXDNTXLevelLabel.y + - _modemNXDNTXLevelLabel.height + 10 + contentHeight: _modemBaudLabel.y + + _modemBaudLabel.height + 10 flickableDirection: Flickable.VerticalFlick clip: true ScrollBar.vertical: ScrollBar {} @@ -1047,6 +1048,24 @@ Item { selectByMouse: true inputMethodHints: "ImhPreferNumbers" } - + Text { + id: _modemBaudLabel + x: 10 + y: 1330 + width: 100 + height: 25 + text: qsTr("Baud") + color: "white" + verticalAlignment: Text.AlignVCenter + } + TextField { + id: _modemBaudEdit + x: _modemBaudLabel.x + _modemBaudLabel.width + y: _modemBaudLabel.y + width: 60 + height: 25 + selectByMouse: true + inputMethodHints: "ImhPreferNumbers" + } } } diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index ee99e5a..7ff27ea 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,5 +1,5 @@ - +