From bbcca3813946ad7974eac1b942315774c2d6db1a Mon Sep 17 00:00:00 2001 From: consti10 Date: Thu, 26 Oct 2023 15:22:18 +0200 Subject: [PATCH] add stbc / ldpc enable popup, improve UI --- QOpenHD.pro | 2 -- app/osd/altitudeladder.cpp | 4 +--- app/telemetry/models/fcmavlinksystem.h | 2 +- app/util/qopenhd.h | 2 +- qml/qml.qrc | 2 +- .../MavlinkOpenHDWBParamPanel2.qml | 8 +++++--- .../openhd_settings/PopupEnableSTBCLDPC.qml | 6 +++--- .../openhd_settings/PopupTxPowerEditor.qml | 20 +++++++++++++++++-- 8 files changed, 30 insertions(+), 16 deletions(-) diff --git a/QOpenHD.pro b/QOpenHD.pro index c245d9714..d7b0289ee 100755 --- a/QOpenHD.pro +++ b/QOpenHD.pro @@ -134,7 +134,6 @@ SOURCES += \ app/osd/altitudeladder.cpp \ app/osd/flightpathvector.cpp \ app/osd/aoagauge.cpp \ - app/osd/performancehorizonladder.cpp \ HEADERS += \ app/osd/headingladder.h \ @@ -144,7 +143,6 @@ HEADERS += \ app/osd/flightpathvector.h \ app/osd/debug_overdraw.hpp \ app/osd/aoagauge.h \ - app/osd/performancehorizonladder.h \ RESOURCES += qml/qml.qrc diff --git a/app/osd/altitudeladder.cpp b/app/osd/altitudeladder.cpp index 594935677..c6cf59981 100644 --- a/app/osd/altitudeladder.cpp +++ b/app/osd/altitudeladder.cpp @@ -19,8 +19,6 @@ void AltitudeLadder::paint(QPainter* painter) { setFillColor(QColor::fromRgb(0,255,0,128)); } - QFont font("sans-serif", 10, QFont::Bold, false); - painter->setFont(m_font); auto alt = m_altitude; @@ -121,6 +119,6 @@ void AltitudeLadder::setAltitudeRange(int altitudeRange) { void AltitudeLadder::setFontFamily(QString fontFamily) { m_fontFamily = fontFamily; emit fontFamilyChanged(m_fontFamily); - m_font = QFont(m_fontFamily, 11, QFont::Bold, false); + m_font = QFont(m_fontFamily, 13, QFont::Bold, false); update(); } diff --git a/app/telemetry/models/fcmavlinksystem.h b/app/telemetry/models/fcmavlinksystem.h index 3d7e35cd8..14d7a7455 100644 --- a/app/telemetry/models/fcmavlinksystem.h +++ b/app/telemetry/models/fcmavlinksystem.h @@ -87,7 +87,7 @@ class FCMavlinkSystem : public QObject // roll, pitch and yaw L_RO_PROP(double, pitch, set_pitch, 0) - L_RO_PROP(double, roll, set_roll, 0) + L_RO_PROP(double, roll, set_roll, 20) L_RO_PROP(double, yaw, set_yaw, 0) // mixed L_RO_PROP(double, throttle, set_throttle, 0) diff --git a/app/util/qopenhd.h b/app/util/qopenhd.h index 1e0c9b11b..f23826d4b 100644 --- a/app/util/qopenhd.h +++ b/app/util/qopenhd.h @@ -68,7 +68,7 @@ class QOpenHD : public QObject // Tries to mimic android toast as much as possible // Q_INVOKABLE void show_toast(QString message,bool long_toast=false); - L_RO_PROP(QString,version_string,set_version_string,"2.5.1-alpha"); + L_RO_PROP(QString,version_string,set_version_string,"2.5.2-alpha"); public: L_RO_PROP(QString,toast_text,set_toast_text,"NONE"); L_RO_PROP(bool,toast_visible,set_toast_visible,false); diff --git a/qml/qml.qrc b/qml/qml.qrc index ae881da86..2528562c8 100644 --- a/qml/qml.qrc +++ b/qml/qml.qrc @@ -187,7 +187,6 @@ video/ExpMainVideoAndroid.qml ui/elements/WorkaroundMessageBox.qml ui/elements/SettingBaseElement.qml - ui/widgets/PerformanceHorizonWidget.qml ui/widgets/WBLinkRateControlWidget.qml ui/widgets/BaseWidgetDefaultUiControlElements.qml resources/cursors/arrow_512_transparent.png @@ -259,5 +258,6 @@ ui/configpopup/status/StatusCardRow.qml ui/configpopup/connect/PaneConnectionMode.qml ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml + ui/widgets/PerformanceHorizonWidget2.qml diff --git a/qml/ui/configpopup/openhd_settings/MavlinkOpenHDWBParamPanel2.qml b/qml/ui/configpopup/openhd_settings/MavlinkOpenHDWBParamPanel2.qml index 04e3bb9ab..7a2f0617c 100644 --- a/qml/ui/configpopup/openhd_settings/MavlinkOpenHDWBParamPanel2.qml +++ b/qml/ui/configpopup/openhd_settings/MavlinkOpenHDWBParamPanel2.qml @@ -366,9 +366,10 @@ Rectangle{ Layout.columnSpan: 3 Text{ text:{ - "LOSS %:"+_ohdSystemGround.curr_rx_packet_loss_perc; + "LOSS %:"+_ohdSystemGround.curr_rx_packet_loss_perc } color: _ohdSystemGround.curr_rx_packet_loss_perc > 5 ? "red" : "black" + verticalAlignment: Qt.AlignVCenter } Text{ text: { @@ -479,8 +480,9 @@ Rectangle{ Layout.row: 2 Layout.column: 4 text: "EDIT"; - enabled: true //_ohdSystemAir.is_alive && _ohdSystemGround.is_alive && (_wbLinkSettingsHelper.ui_rebuild_models>=0) && - //(_ohdSystemGround.wb_stbc_enabled!=true || _ohdSystemGround.wb_lpdc_enabled!=true || _ohdSystemAir.wb_stbc_enabled!=true || _ohdSystemAir.wb_lpdc_enabled!=true); + //enabled: true + enabled: _ohdSystemAir.is_alive && _ohdSystemGround.is_alive && (_wbLinkSettingsHelper.ui_rebuild_models>=0) && + (_ohdSystemGround.wb_stbc_enabled!=true || _ohdSystemGround.wb_lpdc_enabled!=true || _ohdSystemAir.wb_stbc_enabled!=true || _ohdSystemAir.wb_lpdc_enabled!=true); onClicked: { popup_enable_stbc_ldpc.open() } diff --git a/qml/ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml b/qml/ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml index 1f295b6e1..f5e7f6e7b 100644 --- a/qml/ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml +++ b/qml/ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml @@ -126,7 +126,7 @@ Rectangle{ Layout.row: 3 Layout.column: 0 text: "ENABLE" - visible: comboBoxNAntennasAir.currentIndex==2 && comboBoxNAntennasGnd.currentIndex==2; + enabled: comboBoxNAntennasAir.currentIndex==2 && comboBoxNAntennasGnd.currentIndex==2; font.pixelSize: 14 onClicked: { if(_wbLinkSettingsHelper.set_param_stbc_ldpc_enable_air_ground()){ @@ -140,8 +140,8 @@ Rectangle{ Text{ Layout.row: 4 Layout.column: 0 - visible: !button_enable.visible - text: "CAN ONLY BE ENABLED IF BOTH AIR AND GN UNIT HAVE 2 RF PATHS / ANTENNAS"; + visible: !button_enable.enabled + text: "CAN ONLY BE ENABLED IF BOTH AIR AND GND UNIT HAVE 2 RF PATHS / ANTENNAS"; font.pixelSize: 14 } // ---------------- diff --git a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml index ff002798b..9ee38a2f5 100644 --- a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml +++ b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml @@ -303,10 +303,18 @@ Rectangle{ } font.pixelSize: 14 } + ButtonIconInfo{ + Layout.row: 2 + Layout.column: 3 + onClicked: { + _messageBoxInstance.set_text_and_show("TX Power applied when FC is disarmed"); + } + } + // FILLER Item{ Layout.row: 2 - Layout.column: 3 + Layout.column: 4 Layout.fillWidth: true } // ---------------- @@ -355,10 +363,18 @@ Rectangle{ } font.pixelSize: 14 } + ButtonIconInfo{ + Layout.row: 3 + Layout.column: 3 + onClicked: { + _messageBoxInstance.set_text_and_show("TX Power applied when FC is armed. By default, set to 0 (DISABLE) which means the same tx power (tx power disarmed) is applied regardless"+ + "if armed or not."); + } + } // FILLER Item{ Layout.row: 3 - Layout.column: 3 + Layout.column: 4 Layout.fillWidth: true } Text{