From 98824a240e5037376333c4efe3d29aba641b0902 Mon Sep 17 00:00:00 2001 From: consti10 Date: Wed, 8 Nov 2023 14:00:24 +0100 Subject: [PATCH 01/16] tx power - reset the selection model(s) to fix bug @Ivan --- qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml | 5 +++++ .../configpopup/qopenhd_settings/AppWidgetSettingsView.qml | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml index 2106a5856..8434f0eb7 100644 --- a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml +++ b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml @@ -39,6 +39,11 @@ Rectangle{ _messageBoxInstance.set_text_and_show("Changing tx power is only possible on openhd supported cards."); return; } + // The user has to enter the card type every time - otherwise, we have issues with air and ground + comboBoxCardSelectManufacturer.currentIndex=0; + combo_box_txpower_disarmed.currentIndex=0; + combo_box_txpower_armed.currentIndex=0; + m_user_selected_card_manufacturer=-1; visible=true; enabled=true; } diff --git a/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml index 22a0d4fca..3db130e67 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml @@ -1189,7 +1189,7 @@ ScrollView { width: parent.width height: rowHeight color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - + enabled: false // Not yet functional Text { text: qsTr("Show Sidebar ProofOfConcept") font.weight: Font.Bold @@ -1247,6 +1247,7 @@ ScrollView { width: parent.width height: rowHeight color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + enabled: false // Not yet functional Text { text: qsTr("Show GPIO") From e884881cc0f672b1d12edad8631d9b2bcd67e0cb Mon Sep 17 00:00:00 2001 From: consti10 Date: Fri, 10 Nov 2023 15:32:26 +0100 Subject: [PATCH 02/16] tx power - whitelist for less confusion, add 720p60 16:9 to drop down selector @Ivan --- app/telemetry/settings/documentedparam.cpp | 10 + .../openhd_settings/PopupTxPowerEditor.qml | 282 +++++++++--------- qml/ui/widgets/VideoBitrateWidgetGeneric.qml | 16 +- 3 files changed, 156 insertions(+), 152 deletions(-) diff --git a/app/telemetry/settings/documentedparam.cpp b/app/telemetry/settings/documentedparam.cpp index 59b0a48ca..f4fb3fda1 100644 --- a/app/telemetry/settings/documentedparam.cpp +++ b/app/telemetry/settings/documentedparam.cpp @@ -707,6 +707,16 @@ static std::map get_whitelisted_params() ret["CONFIG_BOOT_AIR"]=nullptr; ret[openhd::WB_MAX_FEC_BLOCK_SIZE_FOR_PLATFORM]=nullptr; ret[openhd::WB_DEV_AIR_SET_HIGH_RETRANSMIT_COUNT]=nullptr; + // TX POWER Whitelisted, since they should be changed from the quick wizzard + ret[openhd::WB_TX_POWER_MILLI_WATT]=nullptr; + ret[openhd::WB_TX_POWER_MILLI_WATT_ARMED]=nullptr; + ret[openhd::WB_RTL8812AU_TX_PWR_IDX_OVERRIDE]=nullptr; + ret[openhd::WB_RTL8812AU_TX_PWR_IDX_ARMED]=nullptr; + // STBC / LDPC - Whitelisted, since they should be changed from the quick wizzard + ret[openhd::WB_ENABLE_LDPC]=nullptr; + ret[openhd::WB_ENABLE_STBC]=nullptr; + // Whitelisted since normally it should not be changed / has no effect anyways + ret[openhd::WB_ENABLE_SHORT_GUARD]=nullptr; //ret[""]=nullptr; return ret; } diff --git a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml index 8434f0eb7..4a23d3ac3 100644 --- a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml +++ b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml @@ -72,7 +72,7 @@ Rectangle{ // Should never show up ! ListModel{ id: model_error - ListElement {title: "ERROR"; value: -1} + ListElement {title: "PLEASE SELECT MANUFACTURER"; value: -1} } ListModel{ @@ -221,7 +221,7 @@ Rectangle{ return _wifi_card_gnd0.tx_power_unit; } - GridLayout{ + ColumnLayout{ id: main_row_layout anchors.fill: parent anchors.leftMargin: m_margin @@ -256,156 +256,157 @@ Rectangle{ } } } - // - Text{ - Layout.row: 1 - Layout.column: 0 - text: "RF CHIP:\n" +get_card_chipset_str() - horizontalAlignment: Qt.AlignHCenter - font.pixelSize: 14 - } - ComboBox { - Layout.row: 1 - Layout.column: 1 - id: comboBoxCardSelectManufacturer - Layout.minimumWidth: 100 - Layout.preferredWidth: 350 - model: get_model_manufacturer_for_chip_type() - textRole: "title" - onCurrentIndexChanged: { - var manufacturer=comboBoxCardSelectManufacturer.model.get(comboBoxCardSelectManufacturer.currentIndex).value; - m_user_selected_card_manufacturer=manufacturer; - } - font.pixelSize: 14 - } - // FILLER - Item{ - Layout.row: 1 - Layout.column: 3 + RowLayout{ Layout.fillWidth: true + Text{ + Layout.minimumWidth: 100 + Layout.preferredWidth: 250 + text: "RF CHIP:\n" +get_card_chipset_str() + horizontalAlignment: Qt.AlignHCenter + font.pixelSize: 14 + } + ComboBox { + id: comboBoxCardSelectManufacturer + Layout.minimumWidth: 100 + Layout.preferredWidth: 350 + model: get_model_manufacturer_for_chip_type() + textRole: "title" + onCurrentIndexChanged: { + var manufacturer=comboBoxCardSelectManufacturer.model.get(comboBoxCardSelectManufacturer.currentIndex).value; + m_user_selected_card_manufacturer=manufacturer; + } + font.pixelSize: 14 + } + // FILLER + Item{ + Layout.row: 1 + Layout.column: 3 + Layout.fillWidth: true + } } - // ---------------- - Text{ - Layout.row: 2 - Layout.column: 0 - text: "DISARMED:\n"+get_current_tx_power_int(1)+" "+get_tx_power_unit(); - Layout.fillWidth: true - horizontalAlignment: Qt.AlignHCenter - font.pixelSize: 14 - } - ComboBox { - Layout.row: 2 - Layout.column: 1 + RowLayout{ Layout.fillWidth: true - Layout.minimumWidth: 100 - Layout.preferredWidth: 350 - id: combo_box_txpower_disarmed - model: get_model_txpower_for_chip_type_manufacturer(false) - textRole: "title" - enabled: m_user_selected_card_manufacturer>=0; - font.pixelSize: 14 - } - Button{ - Layout.row: 2 - Layout.column: 2 - text: "SAVE" - enabled: m_user_selected_card_manufacturer>=0; - onClicked: { - var tx_power_index_or_mw = combo_box_txpower_disarmed.model.get(combo_box_txpower_disarmed.currentIndex).value; - if(tx_power_index_or_mw<0){ - _qopenhd.show_toast("Please select a valid tx power",false); - return; + Text{ + Layout.minimumWidth: 100 + Layout.preferredWidth: 250 + text: "DISARMED:\n"+get_current_tx_power_int(1)+" "+get_tx_power_unit(); + horizontalAlignment: Qt.AlignHCenter + font.pixelSize: 14 + } + ComboBox { + Layout.minimumWidth: 100 + Layout.preferredWidth: 350 + id: combo_box_txpower_disarmed + model: get_model_txpower_for_chip_type_manufacturer(false) + textRole: "title" + enabled: m_user_selected_card_manufacturer>=0; + font.pixelSize: 14 + onActivated: { + console.log("onActivated: index:"+currentIndex+ " level:"+currentValue); } - var is_tx_power_index_unit = get_chipset_type()==0; - var success = _wbLinkSettingsHelper.set_param_tx_power(!m_is_air,is_tx_power_index_unit,false,tx_power_index_or_mw) - if(success==true){ - _qopenhd.show_toast("SUCCESS"); - }else{ - _qopenhd.show_toast("Cannot change TX power, please try again",true); + } + Button{ + text: "SAVE" + enabled: m_user_selected_card_manufacturer>=0; + onClicked: { + var tx_power_index_or_mw = combo_box_txpower_disarmed.model.get(combo_box_txpower_disarmed.currentIndex).value; + if(tx_power_index_or_mw<0){ + _qopenhd.show_toast("Please select a valid tx power",false); + return; + } + var is_tx_power_index_unit = get_chipset_type()==0; + var success = _wbLinkSettingsHelper.set_param_tx_power(!m_is_air,is_tx_power_index_unit,false,tx_power_index_or_mw) + if(success==true){ + _qopenhd.show_toast("SUCCESS"); + }else{ + _qopenhd.show_toast("Cannot change TX power, please try again",true); + } } + font.pixelSize: 14 } - font.pixelSize: 14 - } - ButtonIconInfo{ - Layout.row: 2 - Layout.column: 3 - onClicked: { - _messageBoxInstance.set_text_and_show("TX Power applied when FC is disarmed"); + ButtonIconInfo{ + onClicked: { + _messageBoxInstance.set_text_and_show("TX Power applied when FC is disarmed"); + } } - } - // FILLER - Item{ - Layout.row: 2 - Layout.column: 4 - Layout.fillWidth: true - } - // ---------------- - Text{ - Layout.row: 3 - Layout.column: 0 - text: { - var power_int=get_current_tx_power_int(2); - if(power_int==0) return "ARMED:\nDISABLED"; - return "ARMED:\n"+get_current_tx_power_int(2)+" "+get_tx_power_unit(); + // FILLER + Item{ + Layout.row: 2 + Layout.column: 4 + Layout.fillWidth: true } - Layout.fillWidth: true - horizontalAlignment: Qt.AlignHCenter - font.pixelSize: 14 } - ComboBox { - Layout.row: 3 - Layout.column: 1 + + RowLayout{ Layout.fillWidth: true - Layout.minimumWidth: 100 - Layout.preferredWidth: 350 - id: combo_box_txpower_armed - model: get_model_txpower_for_chip_type_manufacturer(true) - textRole: "title" - enabled: m_user_selected_card_manufacturer>=0; - font.pixelSize: 14 - } - Button{ - Layout.row: 3 - Layout.column: 2 - text: "SAVE" - enabled: m_user_selected_card_manufacturer>=0; - onClicked: { - var tx_power_index_or_mw = combo_box_txpower_armed.model.get(combo_box_txpower_armed.currentIndex).value; - if(tx_power_index_or_mw<0){ - _qopenhd.show_toast("Please select a valid tx power",false); - return; + Text{ + Layout.minimumWidth: 100 + Layout.preferredWidth: 250 + text: { + var power_int=get_current_tx_power_int(2); + if(power_int==0) return "ARMED:\nDISABLED"; + return "ARMED:\n"+get_current_tx_power_int(2)+" "+get_tx_power_unit(); } - var is_tx_power_index_unit = get_chipset_type()==0; - var success = _wbLinkSettingsHelper.set_param_tx_power(!m_is_air,is_tx_power_index_unit,true,tx_power_index_or_mw) - if(success==true){ - _qopenhd.show_toast("SUCCESS"); - }else{ - _qopenhd.show_toast("Cannot change TX power, please try again",true); + horizontalAlignment: Qt.AlignHCenter + font.pixelSize: 14 + } + ComboBox { + Layout.minimumWidth: 100 + Layout.preferredWidth: 350 + id: combo_box_txpower_armed + model: get_model_txpower_for_chip_type_manufacturer(true) + textRole: "title" + enabled: m_user_selected_card_manufacturer>=0; + font.pixelSize: 14 + } + Button{ + Layout.row: 3 + Layout.column: 2 + text: "SAVE" + enabled: m_user_selected_card_manufacturer>=0; + onClicked: { + var tx_power_index_or_mw = combo_box_txpower_armed.model.get(combo_box_txpower_armed.currentIndex).value; + if(tx_power_index_or_mw<0){ + _qopenhd.show_toast("Please select a valid tx power",false); + return; + } + var is_tx_power_index_unit = get_chipset_type()==0; + var success = _wbLinkSettingsHelper.set_param_tx_power(!m_is_air,is_tx_power_index_unit,true,tx_power_index_or_mw) + if(success==true){ + _qopenhd.show_toast("SUCCESS"); + }else{ + _qopenhd.show_toast("Cannot change TX power, please try again",true); + } } + font.pixelSize: 14 } - 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."); + 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."); + } } } + Text{ - Layout.row: 4 - Layout.column: 0 - text: "CURRENT:\n"+get_current_tx_power_int(0)+" "+get_tx_power_unit(); + Layout.fillWidth: true + Layout.minimumHeight: 50 + text: "WARNING: Selecting the wrong manufacturer and applying a tx power\n can destroy your card !\n"; + color: "red" + //style: Text.Outline + //styleColor: "black" + wrapMode: Text.WordWrap + font.pixelSize: 18 + verticalAlignment: Qt.AlignVCenter horizontalAlignment: Qt.AlignHCenter - font.pixelSize: 14 } Text{ - Layout.row: 4 - Layout.column: 1 - Layout.columnSpan: 2 + Layout.fillWidth: true text: "WARNING: ARMING WILL REDUCE YOUR TX POWER" + //visible: true visible: { var txpower_disarmed=get_current_tx_power_int(1); var txpower_armed=get_current_tx_power_int(2); @@ -413,22 +414,13 @@ Rectangle{ return txpower_armed Date: Mon, 13 Nov 2023 17:18:37 +0100 Subject: [PATCH 03/16] Always disable Qt::AA_DisableHighDpiScaling, vertical speed: fix arrow, style: add @Norbert green --- app/main.cpp | 5 +- qml/qml.qrc | 19 +- qml/ui/configpopup/ConfigPopup.qml | 19 +- .../MavlinkAllSettingsPanel.qml | 1 + .../openhd_settings/OpenHDQuickPanel.qml | 317 ++++++++++++++++++ .../AppWidgetStyleSettingsView.qml | 52 ++- qml/ui/widgets/VerticalSpeedSimpleWidget.qml | 26 +- 7 files changed, 398 insertions(+), 41 deletions(-) create mode 100644 qml/ui/configpopup/openhd_settings/OpenHDQuickPanel.qml diff --git a/app/main.cpp b/app/main.cpp index f3741c4f4..8062b3f3c 100755 --- a/app/main.cpp +++ b/app/main.cpp @@ -195,15 +195,16 @@ int main(int argc, char *argv[]) { QSettings settings; - const int screen_custom_font_dpi = settings.value("screen_custom_font_dpi").toInt(); + /*const int screen_custom_font_dpi = settings.value("screen_custom_font_dpi").toInt(); if (screen_custom_font_dpi) { QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); const std::string font_dpi_s = std::to_string(screen_custom_font_dpi); qputenv("QT_FONT_DPI", QByteArray(font_dpi_s.c_str(), font_dpi_s.length())); } else { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - } + }*/ //QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); + QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); // From https://stackoverflow.com/questions/63473541/how-to-dynamically-toggle-vsync-in-a-qt-application-at-runtime // Get rid of VSYNC if possible. Might / might not work. On my ubuntu nvidia & intel laptop, this at least seems to diff --git a/qml/qml.qrc b/qml/qml.qrc index 09d76a5bc..a55592295 100644 --- a/qml/qml.qrc +++ b/qml/qml.qrc @@ -1,33 +1,33 @@ - + ../translations/QOpenHD_en.qm resources/cursors/arrow_512_green.png resources/cursors/arrow_512_transparent.png resources/cursors/arrow_512_white.png resources/cursors/hand_white.png - + ../translations/QOpenHD_de.qm - + ../translations/QOpenHD_ru.qm - + ../translations/QOpenHD_es.qm - + ../translations/QOpenHD_fr.qm - + ../translations/QOpenHD_nl.qm - + ../translations/QOpenHD_ro.qm - + ../translations/QOpenHD_it.qm - + ../translations/QOpenHD_zh.qm @@ -261,5 +261,6 @@ video/SecondaryVideoGstreamerPane.qml ui/elements/SettingsHeaderElement.qml ui/configpopup/qopenhd_settings/AppWidgetStyleSettingsView.qml + ui/configpopup/openhd_settings/OpenHDQuickPanel.qml diff --git a/qml/ui/configpopup/ConfigPopup.qml b/qml/ui/configpopup/ConfigPopup.qml index cdc9f3175..0c8ad91ca 100644 --- a/qml/ui/configpopup/ConfigPopup.qml +++ b/qml/ui/configpopup/ConfigPopup.qml @@ -19,9 +19,13 @@ import "status" // Contains the selector on the left and a stack view for the panels on the right Rectangle { id: settings_form - - // The connect is only needed when qopenhd is not running on the ground system itself (e.g. android) - property bool m_show_connect_option: true // _qopenhd.is_android() + //width: 1280 + //height: 720 + anchors.fill: parent + //width: parent.width * settings.screen_settings_overlay_size_percent / 100; + //height: parent.height * settings.screen_settings_overlay_size_percent / 100; + z: 4.0 + color: "transparent" // size of the elements in the left bar - e.g. what allows switching between all the tabs property int left_sidebar_elements_height: 46 @@ -64,14 +68,6 @@ Rectangle { } }*/ - //anchors.fill: parent - width: parent.width * settings.screen_settings_overlay_size_percent / 100; - height: parent.height * settings.screen_settings_overlay_size_percent / 100; - - z: 4.0 - - color: "transparent" - Rectangle { id: spacerTopSpacer width: 132 @@ -210,7 +206,6 @@ Rectangle { // We only need the connect panel on android (external device) // On localhost, QOpenHD "automatically" connects due to udp localhost method ConfigPopupSidebarButton{ - visible: m_show_connect_option id: connect_button m_icon_text: "\uf6ff" m_description_text: "Connect" diff --git a/qml/ui/configpopup/openhd_settings/MavlinkAllSettingsPanel.qml b/qml/ui/configpopup/openhd_settings/MavlinkAllSettingsPanel.qml index 00b63a38e..71eef0109 100644 --- a/qml/ui/configpopup/openhd_settings/MavlinkAllSettingsPanel.qml +++ b/qml/ui/configpopup/openhd_settings/MavlinkAllSettingsPanel.qml @@ -64,6 +64,7 @@ Rectangle { currentIndex: selectItemInStackLayoutBar.currentIndex MavlinkOpenHDWBParamPanel{ + //OpenHDQuickPanel{ id: mavlink_openhd_wb_param_panel } MavlinkParamPanel{ diff --git a/qml/ui/configpopup/openhd_settings/OpenHDQuickPanel.qml b/qml/ui/configpopup/openhd_settings/OpenHDQuickPanel.qml new file mode 100644 index 000000000..edf497fba --- /dev/null +++ b/qml/ui/configpopup/openhd_settings/OpenHDQuickPanel.qml @@ -0,0 +1,317 @@ +import QtQuick 2.0 + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.12 +import QtQuick.Dialogs 1.0 +import QtQuick.Controls.Material 2.12 +import QtQuick.Controls.Styles 1.4 + +import Qt.labs.settings 1.0 + +import OpenHD 1.0 + +import "../../../ui" as Ui +import "../../elements" + +import QtCharts 2.0 + +// This is an extra screen for changing the frequency / channel width - +// They both need to match ! +Rectangle{ + id: main_background + width: parent.width + height: parent.height + //property color m_background_color: "#8cbfd7f3" + //property color m_background_color: "#ADD8E6" + property color m_background_color: "#8cbfd7f3" + + property int m_small_width: 200 + + function user_quidance_animate_channel_scan(){ + console.log("User guidance animate channel scan"); + anim_find_air_unit.start() + } + + // https://stackoverflow.com/questions/41991438/how-do-i-find-a-particular-listelement-inside-a-listmodel-in-qml + // For the models above (model with value) try to find the index of the first item where model[i].value===value + function find_index(model,value){ + for(var i = 0; i < model.count; ++i) if (model.get(i).value===value) return i + return -1 + } + + function fc_is_armed(){ + return _fcMavlinkSystem.armed + } + + ListModel{ + id: frequencies_model_all + ListElement {title: "Unknown"; value_frequency_mhz:-1} + } + ListModel{ + id: frequencies_model_openhd_channels_only + ListElement {title: "Unknown"; value_frequency_mhz:-1} + } + + function create_list_models_frequency(){ + frequencies_model_all.clear(); + const frequencies_all=_frequencyHelper.get_frequencies(false); + for(var i=0;i0){ + var index=find_index(comboBoxFreq.model,_wbLinkSettingsHelper.curr_channel_mhz); + if(index>=0){ + comboBoxFreq.currentIndex=index; + }else{ + comboBoxFreq.currentIndex=0; + console.log("Seems not to be a valid channel "+_wbLinkSettingsHelper.curr_channel_mhz) + } + }else{ + comboBoxFreq.currentIndex=-1; + } + } + + // We get notified every time we should re-build the model(s) and their current selection + property int m_ui_rebuild_models : _wbLinkSettingsHelper.ui_rebuild_models + onM_ui_rebuild_modelsChanged: { + console.log(" onM_ui_rebuild_modelsChanged: "+_wbLinkSettingsHelper.ui_rebuild_models); + function_rebuild_ui() + } + + function function_rebuild_ui(){ + update_frequency_combobox(); + console.log("function_rebuild_ui:"+_wbLinkSettingsHelper.ui_rebuild_models); + if(_wbLinkSettingsHelper.ui_rebuild_models<=0)return + popup_analyze_channels.update(); + } + + // + function close_all_dialoques(){ + popup_analyze_channels.close() + popup_scan_channels.close(); + popup_change_tx_power.close(); + dialoqueFreqChangeGndOnly.close(); + dialoqueFreqChangeAirGnd.close(); + popup_enable_stbc_ldpc.close(); + } + + function get_text_stbc_ldpc(air){ + if(air){ + if(!_ohdSystemAir.is_alive)return "N/A"; + return ""+(_ohdSystemAir.wb_stbc_enabled ? "YES" : "NO")+"/"+(_ohdSystemAir.wb_lpdc_enabled ? "YES" : "NO"); + } + if(!_ohdSystemGround.is_alive)return "N/A"; + return ""+(_ohdSystemGround.wb_stbc_enabled ? "YES" : "NO")+"/"+(_ohdSystemGround.wb_lpdc_enabled ? "YES" : "NO"); + } + + Component.onCompleted: { + close_all_dialoques(); + create_list_models_frequency(); + update_frequency_combobox(); + } + + function get_text_wifi_tx_power(air){ + if(air){ + if(!_wifi_card_air.alive) return "N/A"; + return ""+_wifi_card_air.tx_power+" "+_wifi_card_air.tx_power_unit; + } + if(!_wifi_card_gnd0.alive) return "N/A"; + return ""+_wifi_card_gnd0.tx_power+" "+_wifi_card_gnd0.tx_power_unit; + } + + ScrollView { + id: main_scroll_view + width: parent.width + height: parent.height + anchors.centerIn: parent + contentHeight: main_column_layout.height + //contentWidth: main_column_layout.width + //ScrollBar.vertical.policy: ScrollBar.AlwaysOn + ScrollBar.vertical.interactive: true + visible: (!popup_analyze_channels.visible && !popup_enable_stbc_ldpc.visible && !popup_change_tx_power.visible && !popup_scan_channels.visible) + + Column{ + width: parent.width + height: 900 + id: main_column_layout + + Text{ + width: parent.width + height: 50 + text: "FREQUENCY / TOOLKIT" + font.bold: true + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + } + + Row{ + width: parent.width + height: 50 + ComboBox { + id: comboBoxFreq + //model: supported_frequencies_model + //model: frequencies_model_openhd_channels_only + textRole: "title" + implicitWidth: elementComboBoxWidth + currentIndex: 0 + delegate: ItemDelegate { + width: comboBoxFreq.width + contentItem: FreqComboBoxRow{ + m_main_text: title + m_selection_tpye: (value_frequency_mhz===_wbLinkSettingsHelper.curr_channel_mhz) ? 1 : 0 + m_is_2G: value_frequency_mhz < 3000 && value_frequency_mhz > 100 + m_show_radar: _frequencyHelper.get_frequency_radar(value_frequency_mhz) + m_openhd_race_band: _frequencyHelper.get_frequency_openhd_race_band(value_frequency_mhz) + m_pollution_pps: _pollutionHelper.pollution_get_last_scan_pollution_for_frequency(value_frequency_mhz) + } + highlighted: comboBoxFreq.highlightedIndex === index + } + Layout.row: 1 + Layout.column: 0 + displayText: { + if(!_ohdSystemGround.is_alive)return "NO FREQUENCY"; // GND NOT ALIVE + if(_ohdSystemGround.wb_gnd_operating_mode==1){ + return "SCANNING"; + } + if(_ohdSystemGround.wb_gnd_operating_mode==2){ + return "ANALYZING"; + } + if(!_ohdSystemAir.is_alive){ + return _wbLinkSettingsHelper.curr_channel_mhz+"@"+"N/A"+" Mhz (NO AIR)"; + } + return _wbLinkSettingsHelper.curr_channel_mhz+"@"+_wbLinkSettingsHelper.curr_channel_width_mhz+" Mhz"; + } + onActivated: { + console.log("onActivated:"+currentIndex); + if(currentIndex<0)return; + const frequency_mhz=comboBoxFreq.model.get(currentIndex).value_frequency_mhz + console.log("Selected frequency: "+frequency_mhz); + if(!_frequencyHelper.hw_supports_frequency_threadsafe(frequency_mhz)){ + _qopenhd.show_toast("your HW does not support "+frequency_mhz+" Mhz"); + return; + } + if(_wbLinkSettingsHelper.curr_channel_mhz==frequency_mhz){ + console.log("Already at frequency "+frequency_mhz); + return; + } + if(!_ohdSystemAir.is_alive){ + var error_message_not_alive="AIR Unit not alive -" + dialoqueFreqChangeGndOnly.initialize_and_show_frequency(frequency_mhz,error_message_not_alive); + return; + } + // Change the freuquency + dialoqueFreqChangeAirGnd.initialize_and_show_frequency(frequency_mhz); + } + enabled: _ohdSystemGround.is_alive && _ohdSystemGround.wb_gnd_operating_mode==0; + } + Switch{ + Layout.row: 1 + Layout.column: 1 + Layout.columnSpan: 1 + text: "SIMPLIFY" + checked: true + onCheckedChanged: { + if(m_simplify_enable!=checked){ + m_simplify_enable=checked; + function_rebuild_ui(); + } + } + } + } + + Row{ + width: parent.width + height: 50 + Button{ + Layout.preferredWidth: 150 + id: b_find_air_unit + text: "SCAN" + enabled: _ohdSystemGround.is_alive + onClicked: { + close_all_dialoques(); + popup_scan_channels.open() + } + SequentialAnimation { + running: false + loops: 4 + id: anim_find_air_unit + // Expand the button + PropertyAnimation { + target: b_find_air_unit + property: "scale" + to: 1.5 + duration: 200 + easing.type: Easing.InOutQuad + } + // Shrink back to normal + PropertyAnimation { + target: b_find_air_unit + property: "scale" + to: 1.0 + duration: 200 + easing.type: Easing.InOutQuad + } + } + } + Button{ + Layout.preferredWidth: 150 + text: "ANALYZE" + enabled: _ohdSystemGround.is_alive + onClicked: { + close_all_dialoques(); + popup_analyze_channels.open() + } + } + } + + Row{ + width: parent.width + height: 50 + Text{ + text: "TX POWER AIR" + } + } + } + } + + PopupAnalyzeChannels{ + id: popup_analyze_channels + } + + PopupScanChannels{ + id: popup_scan_channels + } + + PopupTxPowerEditor{ + id: popup_change_tx_power + } + PopupEnableSTBCLDPC{ + id: popup_enable_stbc_ldpc + } + + DialoqueFreqChangeGndOnly{ + id: dialoqueFreqChangeGndOnly + } + DialoqueFreqChangeAirGnd{ + id: dialoqueFreqChangeAirGnd + } +} diff --git a/qml/ui/configpopup/qopenhd_settings/AppWidgetStyleSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppWidgetStyleSettingsView.qml index 41f9bc24f..51fa05f76 100644 --- a/qml/ui/configpopup/qopenhd_settings/AppWidgetStyleSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppWidgetStyleSettingsView.qml @@ -28,6 +28,56 @@ ScrollView { anchors.left: parent.left anchors.right: parent.right + //SettingBaseElement + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + RowLayout{ + anchors.fill: parent + anchors.leftMargin: 8 + anchors.rightMargin: 8 + Text{ + Layout.alignment: Qt.AlignLeft + text: "PRESETS\nColor/Font" + font.weight: Font.Bold + font.pixelSize: 13 + } + Item{ // filler + Layout.fillWidth: true + Layout.fillHeight: true + } + Button{ + text: "GREEN\n@Norbert" + Layout.alignment: Qt.AlignRight + Layout.leftMargin: 10 + Layout.rightMargin: 10 + onClicked: { + settings.color_caution="yellow" + settings.color_glow="black" + settings.color_shape="#ff14ff00" + settings.color_text="#ff05ff00" + settings.color_warn="red" + //settings.font_text="Quicksand" + } + } + Button{ + text: "RESET" + Layout.alignment: Qt.AlignRight + Layout.leftMargin: 10 + Layout.rightMargin: 10 + onClicked: { + settings.color_shape="white" + settings.color_text= "white" + settings.color_glow= "black" + settings.color_warn= "red" + settings.color_caution= "yellow" + settings.font_text= "Sans Serif" + } + } + } + } + Rectangle { width: parent.width height: rowHeight @@ -181,7 +231,7 @@ ScrollView { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizonatalCenter } - } + } } } } diff --git a/qml/ui/widgets/VerticalSpeedSimpleWidget.qml b/qml/ui/widgets/VerticalSpeedSimpleWidget.qml index 207013fe0..9576654f0 100644 --- a/qml/ui/widgets/VerticalSpeedSimpleWidget.qml +++ b/qml/ui/widgets/VerticalSpeedSimpleWidget.qml @@ -136,6 +136,7 @@ BaseWidget { id: widgetInner anchors.fill: parent opacity: bw_current_opacity + scale: bw_current_scale Text { id: speedtext @@ -144,32 +145,23 @@ BaseWidget { color: settings.color_text font.pixelSize: 14 font.family: settings.font_text - transform: Scale { - origin.x: 12 - origin.y: 12 - xScale: bw_current_scale - yScale: bw_current_scale - } - text: get_text_vertical_speed() + text: get_text_vertical_speed(); horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter style: Text.Outline styleColor: settings.color_glow } + // This is an 'icon' indication movement up / down Text{ + height: parent.height + width: parent.width / 3; anchors.right: speedtext.left anchors.bottom: speedtext.bottom - color: settings.color_text - font.pixelSize: 28 - font.family: settings.font_text - transform: Scale { - origin.x: 12 - origin.y: 12 - xScale: bw_current_scale - yScale: bw_current_scale - } + color: settings.color_shape + font.pixelSize: 14 + font.family: "Font Awesome 5 Free" text: get_text_icon_vertical_speed() - horizontalAlignment: Text.AlignHCenter + horizontalAlignment: Text.AlignRight verticalAlignment: Text.AlignVCenter style: Text.Outline styleColor: settings.color_glow From 6ef727202cc20ae1c7e3db395257a7a9e5579247 Mon Sep 17 00:00:00 2001 From: consti10 Date: Tue, 14 Nov 2023 01:32:16 +0100 Subject: [PATCH 04/16] status: fill width, openhd quick: center elements (fix usability on low res screens) --- qml/qml.qrc | 22 +- .../MavlinkOpenHDWBParamPanel.qml | 553 +++++++++--------- .../openhd_settings/OpenHDQuickPanel.qml | 62 +- .../status/FooterRebootShutdownWarning.qml | 11 +- qml/ui/configpopup/status/PanelStatus.qml | 31 +- .../configpopup/status/StatusCardsColumn.qml | 6 +- qml/ui/elements/BaseHeaderItem.qml | 28 + qml/ui/elements/ButtonIconConnect.qml | 13 + qml/ui/elements/ButtonIconInfo2.qml | 12 + qml/ui/elements/CardBasic.qml | 8 + 10 files changed, 422 insertions(+), 324 deletions(-) create mode 100644 qml/ui/elements/BaseHeaderItem.qml create mode 100644 qml/ui/elements/ButtonIconConnect.qml create mode 100644 qml/ui/elements/ButtonIconInfo2.qml create mode 100644 qml/ui/elements/CardBasic.qml diff --git a/qml/qml.qrc b/qml/qml.qrc index a55592295..6a259d6c2 100644 --- a/qml/qml.qrc +++ b/qml/qml.qrc @@ -1,33 +1,33 @@ - + ../translations/QOpenHD_en.qm resources/cursors/arrow_512_green.png resources/cursors/arrow_512_transparent.png resources/cursors/arrow_512_white.png resources/cursors/hand_white.png - + ../translations/QOpenHD_de.qm - + ../translations/QOpenHD_ru.qm - + ../translations/QOpenHD_es.qm - + ../translations/QOpenHD_fr.qm - + ../translations/QOpenHD_nl.qm - + ../translations/QOpenHD_ro.qm - + ../translations/QOpenHD_it.qm - + ../translations/QOpenHD_zh.qm @@ -262,5 +262,9 @@ ui/elements/SettingsHeaderElement.qml ui/configpopup/qopenhd_settings/AppWidgetStyleSettingsView.qml ui/configpopup/openhd_settings/OpenHDQuickPanel.qml + ui/elements/BaseHeaderItem.qml + ui/elements/ButtonIconInfo2.qml + ui/elements/CardBasic.qml + ui/elements/ButtonIconConnect.qml diff --git a/qml/ui/configpopup/openhd_settings/MavlinkOpenHDWBParamPanel.qml b/qml/ui/configpopup/openhd_settings/MavlinkOpenHDWBParamPanel.qml index 17bd50434..b81f2a540 100644 --- a/qml/ui/configpopup/openhd_settings/MavlinkOpenHDWBParamPanel.qml +++ b/qml/ui/configpopup/openhd_settings/MavlinkOpenHDWBParamPanel.qml @@ -144,340 +144,317 @@ Rectangle{ height: parent.height anchors.centerIn: parent contentHeight: main_column_layout.height - contentWidth: main_column_layout.width + //contentWidth: main_column_layout.width //ScrollBar.vertical.policy: ScrollBar.AlwaysOn ScrollBar.vertical.interactive: true visible: (!popup_analyze_channels.visible && !popup_enable_stbc_ldpc.visible && !popup_change_tx_power.visible && !popup_scan_channels.visible) ColumnLayout{ - Layout.fillWidth: true - Layout.fillHeight: true + width: main_scroll_view.width id: main_column_layout + Layout.margins: 10 + BaseHeaderItem{ + m_text: "FREQUENCY / TOOLKIT" + } - Rectangle { - id: frequency_area_layout_background - color: m_background_color - implicitWidth: main_scroll_view.width - implicitHeight: frequency_area_layout.implicitHeight+5 - radius: 10 - - ColumnLayout { - id: frequency_area_layout + RowLayout{ + Layout.fillWidth: true + Item{ // FILLER Layout.fillWidth: true - Layout.fillHeight: true - Layout.margins: 10 - - Text{ - Layout.row: 0 - Layout.column: 0 - text: "FREQUENCY / TOOLKIT" - font.bold: true + } + ComboBox { + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: elementComboBoxWidth + id: comboBoxFreq + //model: supported_frequencies_model + //model: frequencies_model_openhd_channels_only + textRole: "title" + implicitWidth: elementComboBoxWidth + currentIndex: 0 + delegate: ItemDelegate { + width: comboBoxFreq.width + contentItem: FreqComboBoxRow{ + m_main_text: title + m_selection_tpye: (value_frequency_mhz===_wbLinkSettingsHelper.curr_channel_mhz) ? 1 : 0 + m_is_2G: value_frequency_mhz < 3000 && value_frequency_mhz > 100 + m_show_radar: _frequencyHelper.get_frequency_radar(value_frequency_mhz) + m_openhd_race_band: _frequencyHelper.get_frequency_openhd_race_band(value_frequency_mhz) + m_pollution_pps: _pollutionHelper.pollution_get_last_scan_pollution_for_frequency(value_frequency_mhz) + } + highlighted: comboBoxFreq.highlightedIndex === index } - - RowLayout{ - ComboBox { - id: comboBoxFreq - //model: supported_frequencies_model - //model: frequencies_model_openhd_channels_only - textRole: "title" - implicitWidth: elementComboBoxWidth - currentIndex: 0 - delegate: ItemDelegate { - width: comboBoxFreq.width - contentItem: FreqComboBoxRow{ - m_main_text: title - m_selection_tpye: (value_frequency_mhz===_wbLinkSettingsHelper.curr_channel_mhz) ? 1 : 0 - m_is_2G: value_frequency_mhz < 3000 && value_frequency_mhz > 100 - m_show_radar: _frequencyHelper.get_frequency_radar(value_frequency_mhz) - m_openhd_race_band: _frequencyHelper.get_frequency_openhd_race_band(value_frequency_mhz) - m_pollution_pps: _pollutionHelper.pollution_get_last_scan_pollution_for_frequency(value_frequency_mhz) - } - highlighted: comboBoxFreq.highlightedIndex === index - } - Layout.row: 1 - Layout.column: 0 - displayText: { - if(!_ohdSystemGround.is_alive)return "GND NOT ALIVE"; - if(_ohdSystemGround.wb_gnd_operating_mode==1){ - return "SCANNING"; - } - if(_ohdSystemGround.wb_gnd_operating_mode==2){ - return "ANALYZING"; - } - if(!_ohdSystemAir.is_alive){ - return _wbLinkSettingsHelper.curr_channel_mhz+"@"+"N/A"+" Mhz (NO AIR)"; - } - return _wbLinkSettingsHelper.curr_channel_mhz+"@"+_wbLinkSettingsHelper.curr_channel_width_mhz+" Mhz"; - } - onActivated: { - console.log("onActivated:"+currentIndex); - if(currentIndex<0)return; - const frequency_mhz=comboBoxFreq.model.get(currentIndex).value_frequency_mhz - console.log("Selected frequency: "+frequency_mhz); - if(!_frequencyHelper.hw_supports_frequency_threadsafe(frequency_mhz)){ - _qopenhd.show_toast("your HW does not support "+frequency_mhz+" Mhz"); - return; - } - if(_wbLinkSettingsHelper.curr_channel_mhz==frequency_mhz){ - console.log("Already at frequency "+frequency_mhz); - return; - } - if(!_ohdSystemAir.is_alive){ - var error_message_not_alive="AIR Unit not alive -" - dialoqueFreqChangeGndOnly.initialize_and_show_frequency(frequency_mhz,error_message_not_alive); - return; - } - // Change the freuquency - dialoqueFreqChangeAirGnd.initialize_and_show_frequency(frequency_mhz); - } - enabled: _ohdSystemGround.is_alive && _ohdSystemGround.wb_gnd_operating_mode==0; + displayText: { + if(!_ohdSystemGround.is_alive)return "GND NOT ALIVE"; + if(_ohdSystemGround.wb_gnd_operating_mode==1){ + return "SCANNING"; } - Switch{ - Layout.row: 1 - Layout.column: 1 - Layout.columnSpan: 1 - text: "SIMPLIFY" - checked: true - onCheckedChanged: { - if(m_simplify_enable!=checked){ - m_simplify_enable=checked; - function_rebuild_ui(); - } - } + if(_ohdSystemGround.wb_gnd_operating_mode==2){ + return "ANALYZING"; } - ButtonIconInfo{ - Layout.row: 1 - Layout.column: 2 - onClicked: { - var text="Please select a channel / frequency free of noise and interference. The current loss / pollution / throttle stats below can help,"+ - "as well as the analyze channels feature or a frequency analyzer on your phone. SIMPLIFY: Show OpenHD standard channels [1-5] only - they "+ - " often are free of wifi pollution and should be used. Only disable SIMPLIFY if you know exactly why." - _messageBoxInstance.set_text_and_show(text) - } + if(!_ohdSystemAir.is_alive){ + return _wbLinkSettingsHelper.curr_channel_mhz+"@"+"N/A"+" Mhz (NO AIR)"; } + return _wbLinkSettingsHelper.curr_channel_mhz+"@"+_wbLinkSettingsHelper.curr_channel_width_mhz+" Mhz"; } - - - - RowLayout{ - Layout.row: 2 - Layout.column: 0 - Layout.columnSpan: 3 - Item{ // FILLER - Layout.preferredWidth: 30 - Layout.minimumWidth: 0 + onActivated: { + console.log("onActivated:"+currentIndex); + if(currentIndex<0)return; + const frequency_mhz=comboBoxFreq.model.get(currentIndex).value_frequency_mhz + console.log("Selected frequency: "+frequency_mhz); + if(!_frequencyHelper.hw_supports_frequency_threadsafe(frequency_mhz)){ + _qopenhd.show_toast("your HW does not support "+frequency_mhz+" Mhz"); + return; } - Button{ - Layout.preferredWidth: 150 - id: b_find_air_unit - text: "SCAN" - enabled: _ohdSystemGround.is_alive - onClicked: { - close_all_dialoques(); - popup_scan_channels.open() - } - SequentialAnimation { - running: false - loops: 4 - id: anim_find_air_unit - // Expand the button - PropertyAnimation { - target: b_find_air_unit - property: "scale" - to: 1.5 - duration: 200 - easing.type: Easing.InOutQuad - } - // Shrink back to normal - PropertyAnimation { - target: b_find_air_unit - property: "scale" - to: 1.0 - duration: 200 - easing.type: Easing.InOutQuad - } - } + if(_wbLinkSettingsHelper.curr_channel_mhz==frequency_mhz){ + console.log("Already at frequency "+frequency_mhz); + return; } - Item{ // FILLER - Layout.preferredWidth: 30 - Layout.minimumWidth: 0 + if(!_ohdSystemAir.is_alive){ + var error_message_not_alive="AIR Unit not alive -" + dialoqueFreqChangeGndOnly.initialize_and_show_frequency(frequency_mhz,error_message_not_alive); + return; } - Button{ - Layout.preferredWidth: 150 - text: "ANALYZE" - enabled: _ohdSystemGround.is_alive - onClicked: { - close_all_dialoques(); - popup_analyze_channels.open() - } + // Change the freuquency + dialoqueFreqChangeAirGnd.initialize_and_show_frequency(frequency_mhz); + } + enabled: _ohdSystemGround.is_alive && _ohdSystemGround.wb_gnd_operating_mode==0; + } + Switch{ + Layout.alignment: Qt.AlignCenter + text: "SIMPLIFY" + checked: true + onCheckedChanged: { + if(m_simplify_enable!=checked){ + m_simplify_enable=checked; + function_rebuild_ui(); + } + } + } + Item{ // FILLER + Layout.fillWidth: true + } + ButtonIconInfo2{ + Layout.alignment: Qt.AlignRight + onClicked: { + var text="Please select a channel / frequency free of noise and interference. The current loss / pollution / throttle stats below can help,"+ + "as well as the analyze channels feature or a frequency analyzer on your phone. SIMPLIFY: Show OpenHD standard channels [1-5] only - they "+ + " often are free of wifi pollution and should be used. Only disable SIMPLIFY if you know exactly why." + _messageBoxInstance.set_text_and_show(text) + } + } + } + + RowLayout{ + Layout.fillWidth: true + Item{ // FILLER + Layout.fillWidth: true + } + Button{ + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: 150 + id: b_find_air_unit + text: "SCAN" + enabled: _ohdSystemGround.is_alive + onClicked: { + close_all_dialoques(); + popup_scan_channels.open() + } + SequentialAnimation { + running: false + loops: 4 + id: anim_find_air_unit + // Expand the button + PropertyAnimation { + target: b_find_air_unit + property: "scale" + to: 1.5 + duration: 200 + easing.type: Easing.InOutQuad } - Item{ // FILLER - Layout.preferredWidth: 30 - Layout.minimumWidth: 0 + // Shrink back to normal + PropertyAnimation { + target: b_find_air_unit + property: "scale" + to: 1.0 + duration: 200 + easing.type: Easing.InOutQuad } - ButtonIconInfo{ + } + } + Button{ + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: 150 + text: "ANALYZE" + enabled: _ohdSystemGround.is_alive + onClicked: { + close_all_dialoques(); + popup_analyze_channels.open() + } + } + Item{ // FILLER + Layout.fillWidth: true + } + /*ButtonIconInfo{ onClicked: { var text="SCAN: Similar to analoque channel scan, find a running air unit by checking all possible channels (frequencies).\n\n"+ "ANALYZE: Analyze channels for WiFi pollution. Read the wiki for more info."; _messageBoxInstance.set_text_and_show(text) } - } + }*/ + } + RowLayout{ + Layout.fillWidth: true + Item{ // FILLER + Layout.fillWidth: true + } + Text{ + Layout.preferredHeight: 50 + Layout.preferredWidth: 120 + text:{ + "LOSS:\n"+_ohdSystemGround.curr_rx_packet_loss_perc+"%" } - RowLayout{ - Text{ - Layout.preferredHeight: 50 - Layout.preferredWidth: 120 - text:{ - "LOSS:\n"+_ohdSystemGround.curr_rx_packet_loss_perc+"%" - } - color: _ohdSystemGround.curr_rx_packet_loss_perc > 5 ? "red" : "black" - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: true - } - Text{ - Layout.preferredHeight: 50 - Layout.preferredWidth: 120 - text: { - return "POLLUTION:\n"+_ohdSystemGround.wb_link_curr_foreign_pps+"pps" - } - color: _ohdSystemGround.wb_link_curr_foreign_pps > 20 ? "red" : "black" - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: true - } - Text{ - Layout.preferredHeight: 50 - Layout.preferredWidth: 120 - text: { - return "THROTTLE:\n"+_ohdSystemAir.curr_n_rate_adjustments - } - color: _ohdSystemAir.curr_n_rate_adjustments > 0 ? "red" : "black" - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: true - } - ButtonIconInfo{ + color: _ohdSystemGround.curr_rx_packet_loss_perc > 5 ? "red" : "black" + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: true + } + Text{ + Layout.preferredHeight: 50 + Layout.preferredWidth: 120 + text: { + return "POLLUTION:\n"+_ohdSystemGround.wb_link_curr_foreign_pps+"pps" + } + color: _ohdSystemGround.wb_link_curr_foreign_pps > 20 ? "red" : "black" + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: true + } + Text{ + Layout.preferredHeight: 50 + Layout.preferredWidth: 120 + text: { + return "THROTTLE:\n"+_ohdSystemAir.curr_n_rate_adjustments + } + color: _ohdSystemAir.curr_n_rate_adjustments > 0 ? "red" : "black" + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: true + } + Item{ // FILLER + Layout.fillWidth: true + } + /*ButtonIconInfo{ onClicked: { var text="High Loss / Pollution / active throttle hint at a polluted channel." _messageBoxInstance.set_text_and_show(text) } } ButtonIconWarning{ - visible: /*_ohdSystemAir.is_alive &&*/ (_ohdSystemGround.curr_rx_packet_loss_perc > 5 || _ohdSystemGround.wb_link_curr_foreign_pps > 20 || _ohdSystemAir.curr_n_rate_adjustments > 0) + visible: (_ohdSystemGround.curr_rx_packet_loss_perc > 5 || _ohdSystemGround.wb_link_curr_foreign_pps > 20 || _ohdSystemAir.curr_n_rate_adjustments > 0) onClicked: { var text="On the bench, if you encounter issues like a high loss , high pollution or throttling, make sure:\n"+ "1) You are using a channel free of noise and interference (OHD channel 1-5 are a good bet)\n"+ "2) (RARELY,RTL8812AU only): Your TX card(s) aren't overamplifying the signal and have adequate cooling."; _messageBoxInstance.set_text_and_show(text) } - } - } - } + }*/ + } + + BaseHeaderItem{ + m_text: "TX POWER" } - Rectangle { - implicitWidth: main_scroll_view.width - implicitHeight: tx_power_layout.implicitHeight - id: tx_power_layout_background - color: m_background_color - radius: 10 - - RowLayout { - id: tx_power_layout + + RowLayout { + id: tx_power_layout + Layout.fillWidth: true + Layout.fillHeight: true + + Item{ // FILLER Layout.fillWidth: true - Layout.fillHeight: true - Text{ - text: "TX POWER" - font.bold: true - } - Text{ - Layout.preferredWidth: 120 - text: "AIR:\n "+get_text_wifi_tx_power(true) - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: true - } - Button{ - text: "EDIT" - enabled: _ohdSystemAir.is_alive - onClicked: { - close_all_dialoques(); - popup_change_tx_power.m_is_air=true; - popup_change_tx_power.open() - } - } - Text{ - Layout.preferredWidth: 120 - text: "GND:\n"+get_text_wifi_tx_power(false) - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: true + } + Text{ + Layout.preferredWidth: 120 + text: "AIR:\n "+get_text_wifi_tx_power(true) + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: true + } + Button{ + text: "EDIT" + enabled: _ohdSystemAir.is_alive + onClicked: { + close_all_dialoques(); + popup_change_tx_power.m_is_air=true; + popup_change_tx_power.open() } - Button{ - text: "EDIT" - enabled: _ohdSystemGround.is_alive - onClicked: { - close_all_dialoques(); - popup_change_tx_power.m_is_air=false; - popup_change_tx_power.open() - } + } + Text{ + Layout.preferredWidth: 120 + text: "GND:\n"+get_text_wifi_tx_power(false) + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: true + } + Button{ + text: "EDIT" + enabled: _ohdSystemGround.is_alive + onClicked: { + close_all_dialoques(); + popup_change_tx_power.m_is_air=false; + popup_change_tx_power.open() } } - } - Rectangle { - implicitWidth: main_scroll_view.width - implicitHeight: stbc_ldpc_layout.implicitHeight - id: stbc_ldpc_background - color: m_background_color - radius: 10 - - RowLayout { - id: stbc_ldpc_layout + Item{ // FILLER Layout.fillWidth: true - Layout.fillHeight: true - // STBC / LDPC - Text{ - width: 200 - text: "ADVANCED (STBC,LDPC)" - font.bold: true - horizontalAlignment: Qt.AlignHCenter - } - Text{ - Layout.preferredWidth: 120 - text: "AIR:\n"+get_text_stbc_ldpc(true); - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: true - } - Text{ - Layout.preferredWidth: 120 - text: "GND:\n"+get_text_stbc_ldpc(false); - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: true - } + } + } - Button{ - text: "EDIT"; - //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: { - close_all_dialoques(); - popup_enable_stbc_ldpc.open() - } - } - ButtonIconInfo{ - Layout.row: 1 - Layout.column: 4 - onClicked: { - _messageBoxInstance.set_text_and_show("STBC / LDPC : Greatly increases range, but requires 2 RF paths (2 Antennas) on BOTH your air and ground station."+ - "WARNING: Enabling STBC with the wrong hardware (only 1 antenna / only one rf path) results in no connectivity "+ - "and you need to re-flash your air / ground unit to recover !"); - } + BaseHeaderItem{ + m_text: "ADVANCED (STBC,LDPC)" + } + + RowLayout { + id: stbc_ldpc_layout + Layout.fillWidth: true + Layout.fillHeight: true + Item{ // FILLER + Layout.fillWidth: true + } + Text{ + Layout.preferredWidth: 120 + text: "AIR:\n"+get_text_stbc_ldpc(true); + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: true + } + Text{ + Layout.preferredWidth: 120 + text: "GND:\n"+get_text_stbc_ldpc(false); + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: true + } + Button{ + text: "EDIT"; + //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: { + close_all_dialoques(); + popup_enable_stbc_ldpc.open() } } + Item{ // FILLER + Layout.fillWidth: true + } + /*ButtonIconInfo{ + onClicked: { + _messageBoxInstance.set_text_and_show("STBC / LDPC : Greatly increases range, but requires 2 RF paths (2 Antennas) on BOTH your air and ground station."+ + "WARNING: Enabling STBC with the wrong hardware (only 1 antenna / only one rf path) results in no connectivity "+ + "and you need to re-flash your air / ground unit to recover !"); + } + }*/ } } } diff --git a/qml/ui/configpopup/openhd_settings/OpenHDQuickPanel.qml b/qml/ui/configpopup/openhd_settings/OpenHDQuickPanel.qml index edf497fba..327fc3281 100644 --- a/qml/ui/configpopup/openhd_settings/OpenHDQuickPanel.qml +++ b/qml/ui/configpopup/openhd_settings/OpenHDQuickPanel.qml @@ -149,23 +149,23 @@ Rectangle{ ScrollBar.vertical.interactive: true visible: (!popup_analyze_channels.visible && !popup_enable_stbc_ldpc.visible && !popup_change_tx_power.visible && !popup_scan_channels.visible) - Column{ - width: parent.width - height: 900 - id: main_column_layout + Column{ + spacing: 0 + anchors.left: parent.left + anchors.right: parent.right + id: main_colum_layout Text{ width: parent.width - height: 50 + height: rowHeight text: "FREQUENCY / TOOLKIT" font.bold: true horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter } - Row{ width: parent.width - height: 50 + height: rowHeight ComboBox { id: comboBoxFreq //model: supported_frequencies_model @@ -188,7 +188,7 @@ Rectangle{ Layout.row: 1 Layout.column: 0 displayText: { - if(!_ohdSystemGround.is_alive)return "NO FREQUENCY"; // GND NOT ALIVE + if(!_ohdSystemGround.is_alive)return "GND NOT ALIVE"; if(_ohdSystemGround.wb_gnd_operating_mode==1){ return "SCANNING"; } @@ -237,10 +237,9 @@ Rectangle{ } } } - Row{ width: parent.width - height: 50 + height: rowHeight Button{ Layout.preferredWidth: 150 id: b_find_air_unit @@ -282,14 +281,51 @@ Rectangle{ } } } - + Text{ + width: parent.width + height: rowHeight + text: "TX POWER" + font.bold: true + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + } Row{ width: parent.width - height: 50 + height: rowHeight Text{ - text: "TX POWER AIR" + Layout.preferredWidth: 120 + text: "AIR:\n "+get_text_wifi_tx_power(true) + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: true + } + Button{ + text: "EDIT" + enabled: _ohdSystemAir.is_alive + onClicked: { + close_all_dialoques(); + popup_change_tx_power.m_is_air=true; + popup_change_tx_power.open() + } + } + Text{ + Layout.preferredWidth: 120 + text: "GND:\n"+get_text_wifi_tx_power(false) + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: true + } + Button{ + text: "EDIT" + enabled: _ohdSystemGround.is_alive + onClicked: { + close_all_dialoques(); + popup_change_tx_power.m_is_air=false; + popup_change_tx_power.open() + } } } + } } diff --git a/qml/ui/configpopup/status/FooterRebootShutdownWarning.qml b/qml/ui/configpopup/status/FooterRebootShutdownWarning.qml index 897803c6a..8a6d582b8 100644 --- a/qml/ui/configpopup/status/FooterRebootShutdownWarning.qml +++ b/qml/ui/configpopup/status/FooterRebootShutdownWarning.qml @@ -68,7 +68,8 @@ Item { open_power_action_dialoque(m_type,false) } } - ButtonIconWarning{ + ButtonIconConnect{ + m_type_wired: m_type==0 ? true : false; visible: !get_show_power_actions() Layout.alignment: Qt.AlignCenter height:12 @@ -76,5 +77,13 @@ Item { open_warning(); } } + /*ButtonIconWarning{ + visible: !get_show_power_actions() + Layout.alignment: Qt.AlignCenter + height:12 + onPressed: { + open_warning(); + } + }*/ } } diff --git a/qml/ui/configpopup/status/PanelStatus.qml b/qml/ui/configpopup/status/PanelStatus.qml index 45fbd54f3..79b8aa87b 100644 --- a/qml/ui/configpopup/status/PanelStatus.qml +++ b/qml/ui/configpopup/status/PanelStatus.qml @@ -30,25 +30,37 @@ Rectangle { powerDialog.open_dialoque(system,reboot) } + TabBar { + // This screen doesn't tab, but we use the tab bar element for a consistent style + id: selectItemInStackLayoutBar + width: parent.width + TabButton { + text: qsTr("SYSTEM STATUS") + } + } + ScrollView { - id:mavlinkExtraWBParamPanel + /*id:mavlinkExtraWBParamPanel width: parent.width height: parent.height contentHeight: mainItem.height contentWidth: mainItem.width clip: true //ScrollBar.vertical.policy: ScrollBar.AlwaysOn + ScrollBar.vertical.interactive: true*/ + width: parent.width + anchors.top: selectItemInStackLayoutBar.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + clip: true ScrollBar.vertical.interactive: true + contentHeight: mainItem.height Item{ id: mainItem - width: 800 - height: 40+350+80 - - QOpenHDVersionCard{ - id: qopenhdversioncard - height: 40 - } + width: mainRect.width + height: 350+80 // The 3 status cards (OpenHD AIR & GND, FC) // next to each other @@ -57,12 +69,11 @@ Rectangle { width: parent.width height: 350 - anchors.leftMargin: 4 anchors.topMargin: 4 anchors.left: parent.left - anchors.top: qopenhdversioncard.bottom + // anchors.top: qopenhdversioncard.bottom } diff --git a/qml/ui/configpopup/status/StatusCardsColumn.qml b/qml/ui/configpopup/status/StatusCardsColumn.qml index a9b110cfc..1de4f7c6d 100644 --- a/qml/ui/configpopup/status/StatusCardsColumn.qml +++ b/qml/ui/configpopup/status/StatusCardsColumn.qml @@ -13,13 +13,13 @@ import "../../elements" // // The 3 status cards (OpenHD AIR & GND, FC) // next to each other -RowLayout{ +Row{ width: parent.width height: parent.height - property int m_card_width: parent.width/3; + property int m_card_width: parent.width/3-3; property int m_card_height: 350 - + padding: 3 Card { width: m_card_width height:m_card_height diff --git a/qml/ui/elements/BaseHeaderItem.qml b/qml/ui/elements/BaseHeaderItem.qml new file mode 100644 index 000000000..15867b6f6 --- /dev/null +++ b/qml/ui/elements/BaseHeaderItem.qml @@ -0,0 +1,28 @@ +import QtQuick 2.12 +import QtQuick.Layouts 1.12 + +Item { + Layout.fillWidth: true + Layout.preferredHeight: 32 + + property string m_text: "FILL ME" + + Rectangle{ + width: parent.width + height: 2 + color: "black" + anchors.bottom: parent.bottom + } + + Text{ + text: qsTr(m_text) + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + anchors.rightMargin: 8 + anchors.fill: parent + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } + +} diff --git a/qml/ui/elements/ButtonIconConnect.qml b/qml/ui/elements/ButtonIconConnect.qml new file mode 100644 index 000000000..480fa55bd --- /dev/null +++ b/qml/ui/elements/ButtonIconConnect.qml @@ -0,0 +1,13 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Dialogs 1.0 +import QtQuick.Controls.Material 2.12 + +// Connect - either wired (wired icon) or wireless (wireless icon) +Button { + property bool m_type_wired: false + text: m_type_wired ? "\uf6ff" : "\uf1eb" + font.family: "Font Awesome 5 Free" + font.pixelSize: 14 + //highlighted: true +} diff --git a/qml/ui/elements/ButtonIconInfo2.qml b/qml/ui/elements/ButtonIconInfo2.qml new file mode 100644 index 000000000..8c416e53b --- /dev/null +++ b/qml/ui/elements/ButtonIconInfo2.qml @@ -0,0 +1,12 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Dialogs 1.0 +import QtQuick.Controls.Material 2.12 + +// Info icon, no blue color +Button { + //text: "INFO" + text: "\uf05a" + font.family: "Font Awesome 5 Free" + //highlighted: true +} diff --git a/qml/ui/elements/CardBasic.qml b/qml/ui/elements/CardBasic.qml new file mode 100644 index 000000000..4593aa0f8 --- /dev/null +++ b/qml/ui/elements/CardBasic.qml @@ -0,0 +1,8 @@ +import QtQuick 2.12 + +Rectangle { + radius: 6 + color: "white" + border.width: 1 + border.color: "#3a000000" +} From 92ecd9853bab0bd0c4199ce5a38c5827c7a71f46 Mon Sep 17 00:00:00 2001 From: consti10 Date: Tue, 14 Nov 2023 11:33:07 +0100 Subject: [PATCH 05/16] finalize: Everything is usable up to minimum resolution (480p 16:9) --- app/main.cpp | 16 ++++-- app/telemetry/settings/frequencyhelper.cpp | 14 ++++- app/telemetry/settings/frequencyhelper.h | 4 +- app/util/qrenderstats.cpp | 8 +-- app/util/qrenderstats.h | 7 ++- qml/main.qml | 7 +++ .../dev/AppDeveloperStatsPanel.qml | 45 ++++++++------- .../MavlinkOpenHDWBParamPanel.qml | 57 +++++++++++-------- .../openhd_settings/PopupAnalyzeChannels.qml | 2 +- .../openhd_settings/PopupTxPowerEditor.qml | 26 +++------ qml/ui/configpopup/status/PanelStatus.qml | 14 +---- .../status/StatusCardBodyOpenHD.qml | 2 +- .../configpopup/status/StatusCardsColumn.qml | 12 ++-- qml/ui/elements/AppSettings.qml | 2 + qml/ui/elements/BaseHeaderItem.qml | 5 ++ 15 files changed, 122 insertions(+), 99 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 8062b3f3c..bfec3a8b9 100755 --- a/app/main.cpp +++ b/app/main.cpp @@ -186,6 +186,15 @@ static void android_check_permissions(){ #endif } +static void write_screen_resolutions(QApplication& app){ + const auto actual_size=QGuiApplication::primaryScreen()->size(); + QRenderStats::instance().set_screen_width_height(actual_size.width(),actual_size.height()); + // This includes dpi adjustment + QScreen* screen=app.primaryScreen(); + if(screen){ + QRenderStats::instance().set_display_width_height(screen->size().width(),screen->size().height()); + } +} int main(int argc, char *argv[]) { @@ -238,12 +247,7 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); // Customize cursor if needed QOpenHD::instance().customize_cursor_from_settings(); - { - QScreen* screen=app.primaryScreen(); - if(screen){ - QRenderStats::instance().set_display_width_height(screen->size().width(),screen->size().height()); - } - } + write_screen_resolutions(app); QOpenHDVideoHelper::reset_qopenhd_switch_primary_secondary(); #if defined(__ios__) diff --git a/app/telemetry/settings/frequencyhelper.cpp b/app/telemetry/settings/frequencyhelper.cpp index 22928cb97..543a798dc 100644 --- a/app/telemetry/settings/frequencyhelper.cpp +++ b/app/telemetry/settings/frequencyhelper.cpp @@ -12,10 +12,10 @@ FrequencyHelper &FrequencyHelper::instance() return instance; } -QList FrequencyHelper::get_frequencies(bool openhd_bands_only) +QList FrequencyHelper::get_frequencies(int filter) { QList ret; - if(openhd_bands_only){ + if(filter==0){ auto tmp=openhd::get_openhd_channels_1_to_5(); for(auto& channel:tmp){ ret.push_back(channel.frequency); @@ -24,7 +24,15 @@ QList FrequencyHelper::get_frequencies(bool openhd_bands_only) const auto frequency_items=openhd::get_all_channels_2G_5G(); for(auto& item:frequency_items){ if(item.is_legal_at_least_one_country){ - ret.push_back(item.frequency); + if(filter==1){ + if(item.frequency<3000){ + ret.push_back(item.frequency); + } + }else{ + if(item.frequency>3000){ + ret.push_back(item.frequency); + } + } } } } diff --git a/app/telemetry/settings/frequencyhelper.h b/app/telemetry/settings/frequencyhelper.h index 20d8fc5a2..ce30d5f28 100644 --- a/app/telemetry/settings/frequencyhelper.h +++ b/app/telemetry/settings/frequencyhelper.h @@ -14,8 +14,8 @@ class FrequencyHelper : public QObject public: explicit FrequencyHelper(QObject *parent = nullptr); static FrequencyHelper &instance(); - - Q_INVOKABLE QList get_frequencies(bool openhd_bands_only); + // Filter: 0 - OpenHD 1-5 only, 1= all 2.4G freq, 2 = all 5.8G freq + Q_INVOKABLE QList get_frequencies(int filter); Q_INVOKABLE QList get_frequencies_all_40Mhz(); Q_INVOKABLE bool get_frequency_radar(int frequency_mhz); diff --git a/app/util/qrenderstats.cpp b/app/util/qrenderstats.cpp index 05813d729..5b96cea1c 100644 --- a/app/util/qrenderstats.cpp +++ b/app/util/qrenderstats.cpp @@ -33,18 +33,18 @@ void QRenderStats::registerOnWindow(QQuickWindow *window) connect(window, &QQuickWindow::afterRenderPassRecording, this, &QRenderStats::m_QQuickWindow_afterRenderPassRecording, Qt::DirectConnection); } -void QRenderStats::set_display_width_height(int width, int height) +void QRenderStats::set_screen_width_height(int width, int height) { std::stringstream ss; ss<0){ var index=find_index(comboBoxFreq.model,_wbLinkSettingsHelper.curr_channel_mhz); if(index>=0){ @@ -148,6 +134,7 @@ Rectangle{ //ScrollBar.vertical.policy: ScrollBar.AlwaysOn ScrollBar.vertical.interactive: true visible: (!popup_analyze_channels.visible && !popup_enable_stbc_ldpc.visible && !popup_change_tx_power.visible && !popup_scan_channels.visible) + clip: true ColumnLayout{ width: main_scroll_view.width @@ -167,8 +154,7 @@ Rectangle{ Layout.alignment: Qt.AlignCenter Layout.preferredWidth: elementComboBoxWidth id: comboBoxFreq - //model: supported_frequencies_model - //model: frequencies_model_openhd_channels_only + model: frequencies_model textRole: "title" implicitWidth: elementComboBoxWidth currentIndex: 0 @@ -220,7 +206,7 @@ Rectangle{ } enabled: _ohdSystemGround.is_alive && _ohdSystemGround.wb_gnd_operating_mode==0; } - Switch{ + /*Switch{ Layout.alignment: Qt.AlignCenter text: "SIMPLIFY" checked: true @@ -230,6 +216,29 @@ Rectangle{ function_rebuild_ui(); } } + }*/ + TabBar{ + id: filter_tab_bar + Layout.preferredWidth: 200 + currentIndex: settings.qopenhd_frequency_filter_selection + onCurrentIndexChanged: { + if(currentIndex!=settings.qopenhd_frequency_filter_selection){ + settings.qopenhd_frequency_filter_selection=currentIndex; + function_rebuild_ui(); + if(currentIndex==1 || currentIndex==2){ + _qopenhd.show_toast("Please watch out for wifi pollution"); + } + } + } + TabButton{ + text: "1-5" + } + TabButton{ + text: "2.4G" + } + TabButton{ + text: "5.8G" + } } Item{ // FILLER Layout.fillWidth: true diff --git a/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml b/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml index 223fa488f..ce1887729 100644 --- a/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml +++ b/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml @@ -29,7 +29,7 @@ Rectangle{ property bool m_normalize_data: false; property int m_chart_view_minimum_width: 1280; - property int m_chart_view_minimum_width2: 640; + property int m_chart_view_minimum_width2: 1280; property bool m_chart_enlarged: false; diff --git a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml index 4a23d3ac3..763f0256e 100644 --- a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml +++ b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml @@ -29,6 +29,8 @@ Rectangle{ property bool m_is_air: false property int m_user_selected_card_manufacturer: -1; + property int left_text_minimum_width: 100 + property int left_text_preferred_width: 100 function open(){ if(_fcMavlinkSystem.is_alive && _fcMavlinkSystem.armed){ @@ -234,9 +236,6 @@ Rectangle{ //Layout.preferredWidth: 600 Item{ - Layout.row: 0 - Layout.column: 0 - Layout.columnSpan: 4 Layout.fillWidth: true Layout.preferredHeight: 80 Text{ // TITLE @@ -259,8 +258,8 @@ Rectangle{ RowLayout{ Layout.fillWidth: true Text{ - Layout.minimumWidth: 100 - Layout.preferredWidth: 250 + Layout.minimumWidth: left_text_minimum_width + Layout.preferredWidth: left_text_preferred_width text: "RF CHIP:\n" +get_card_chipset_str() horizontalAlignment: Qt.AlignHCenter font.pixelSize: 14 @@ -279,16 +278,14 @@ Rectangle{ } // FILLER Item{ - Layout.row: 1 - Layout.column: 3 Layout.fillWidth: true } } RowLayout{ Layout.fillWidth: true Text{ - Layout.minimumWidth: 100 - Layout.preferredWidth: 250 + Layout.minimumWidth: left_text_minimum_width + Layout.preferredWidth: left_text_preferred_width text: "DISARMED:\n"+get_current_tx_power_int(1)+" "+get_tx_power_unit(); horizontalAlignment: Qt.AlignHCenter font.pixelSize: 14 @@ -329,11 +326,8 @@ Rectangle{ _messageBoxInstance.set_text_and_show("TX Power applied when FC is disarmed"); } } - // FILLER Item{ - Layout.row: 2 - Layout.column: 4 Layout.fillWidth: true } } @@ -341,8 +335,8 @@ Rectangle{ RowLayout{ Layout.fillWidth: true Text{ - Layout.minimumWidth: 100 - Layout.preferredWidth: 250 + Layout.minimumWidth: left_text_minimum_width + Layout.preferredWidth: left_text_preferred_width text: { var power_int=get_current_tx_power_int(2); if(power_int==0) return "ARMED:\nDISABLED"; @@ -361,8 +355,6 @@ Rectangle{ font.pixelSize: 14 } Button{ - Layout.row: 3 - Layout.column: 2 text: "SAVE" enabled: m_user_selected_card_manufacturer>=0; onClicked: { @@ -382,8 +374,6 @@ 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."); diff --git a/qml/ui/configpopup/status/PanelStatus.qml b/qml/ui/configpopup/status/PanelStatus.qml index 79b8aa87b..b0cbca935 100644 --- a/qml/ui/configpopup/status/PanelStatus.qml +++ b/qml/ui/configpopup/status/PanelStatus.qml @@ -40,14 +40,6 @@ Rectangle { } ScrollView { - /*id:mavlinkExtraWBParamPanel - width: parent.width - height: parent.height - contentHeight: mainItem.height - contentWidth: mainItem.width - clip: true - //ScrollBar.vertical.policy: ScrollBar.AlwaysOn - ScrollBar.vertical.interactive: true*/ width: parent.width anchors.top: selectItemInStackLayoutBar.bottom anchors.left: parent.left @@ -68,21 +60,19 @@ Rectangle { id: statuscardscolumn width: parent.width height: 350 - anchors.leftMargin: 4 anchors.topMargin: 4 - + anchors.rightMargin: 4 anchors.left: parent.left + anchors.right: parent.right // anchors.top: qopenhdversioncard.bottom } - PingUtilColumn { id:actionsButtonMenu width: parent.width height: 80 anchors.top: statuscardscolumn.bottom - } } } diff --git a/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml b/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml index 9e05c3f79..8e42b7365 100644 --- a/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml +++ b/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml @@ -11,7 +11,7 @@ import OpenHD 1.0 import "../../../ui" as Ui import "../../elements" -ColumnLayout { +Column { //Layout.fillWidth: true //Layout.fillHeight: true // from https://doc.qt.io/qt-6/qml-qtquick-layouts-rowlayout.html diff --git a/qml/ui/configpopup/status/StatusCardsColumn.qml b/qml/ui/configpopup/status/StatusCardsColumn.qml index 1de4f7c6d..9768c5c75 100644 --- a/qml/ui/configpopup/status/StatusCardsColumn.qml +++ b/qml/ui/configpopup/status/StatusCardsColumn.qml @@ -14,12 +14,14 @@ import "../../elements" // The 3 status cards (OpenHD AIR & GND, FC) // next to each other Row{ - width: parent.width - height: parent.height + id: status_cards_row + property int m_spacing_px: 3 + + property int m_card_width: (parent.width-4*m_spacing_px)/3; + property int m_card_height: status_cards_row.height + + spacing: m_spacing_px - property int m_card_width: parent.width/3-3; - property int m_card_height: 350 - padding: 3 Card { width: m_card_width height:m_card_height diff --git a/qml/ui/elements/AppSettings.qml b/qml/ui/elements/AppSettings.qml index 52daf95fb..f40ca06ce 100644 --- a/qml/ui/elements/AppSettings.qml +++ b/qml/ui/elements/AppSettings.qml @@ -407,4 +407,6 @@ Settings { property int qopenhd_mavlink_connection_mode: 0; property string qopenhd_mavlink_connection_manual_tcp_ip: "192.168.178.36" + + property int qopenhd_frequency_filter_selection: 0; } diff --git a/qml/ui/elements/BaseHeaderItem.qml b/qml/ui/elements/BaseHeaderItem.qml index 15867b6f6..a8c3eee66 100644 --- a/qml/ui/elements/BaseHeaderItem.qml +++ b/qml/ui/elements/BaseHeaderItem.qml @@ -7,6 +7,11 @@ Item { property string m_text: "FILL ME" + Rectangle{ + anchors.fill: parent + color: "#8cbfd7f3" + } + Rectangle{ width: parent.width height: 2 From 9dc6628d78582cf8449d78821258f43aaad100ab Mon Sep 17 00:00:00 2001 From: consti10 Date: Tue, 14 Nov 2023 11:51:48 +0100 Subject: [PATCH 06/16] exp for android - re-enable high dpi scaling --- app/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index bfec3a8b9..1331cfad6 100755 --- a/app/main.cpp +++ b/app/main.cpp @@ -204,16 +204,16 @@ int main(int argc, char *argv[]) { QSettings settings; - /*const int screen_custom_font_dpi = settings.value("screen_custom_font_dpi").toInt(); + const int screen_custom_font_dpi = settings.value("screen_custom_font_dpi").toInt(); if (screen_custom_font_dpi) { QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); const std::string font_dpi_s = std::to_string(screen_custom_font_dpi); qputenv("QT_FONT_DPI", QByteArray(font_dpi_s.c_str(), font_dpi_s.length())); } else { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - }*/ + } //QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); - QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + //QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); // From https://stackoverflow.com/questions/63473541/how-to-dynamically-toggle-vsync-in-a-qt-application-at-runtime // Get rid of VSYNC if possible. Might / might not work. On my ubuntu nvidia & intel laptop, this at least seems to From a66db5bd78cb55371c8c7419e9b9de793b13b5df Mon Sep 17 00:00:00 2001 From: consti10 Date: Tue, 14 Nov 2023 12:50:59 +0100 Subject: [PATCH 07/16] exp -set before writing the AA flag / screen scale --- app/main.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 1331cfad6..cb70badb7 100755 --- a/app/main.cpp +++ b/app/main.cpp @@ -186,21 +186,18 @@ static void android_check_permissions(){ #endif } -static void write_screen_resolutions(QApplication& app){ - const auto actual_size=QGuiApplication::primaryScreen()->size(); - QRenderStats::instance().set_screen_width_height(actual_size.width(),actual_size.height()); - // This includes dpi adjustment - QScreen* screen=app.primaryScreen(); - if(screen){ - QRenderStats::instance().set_display_width_height(screen->size().width(),screen->size().height()); - } -} - int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("OpenHD"); QCoreApplication::setOrganizationDomain("openhd"); QCoreApplication::setApplicationName("QOpenHD"); + {// Original screen resoluton before setting anything + const auto screen=QGuiApplication::primaryScreen(); + if(screen){ + const auto actual_size=screen->size(); + QRenderStats::instance().set_screen_width_height(actual_size.width(),actual_size.height()); + } + } QSettings settings; @@ -247,7 +244,12 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); // Customize cursor if needed QOpenHD::instance().customize_cursor_from_settings(); - write_screen_resolutions(app); + { // This includes dpi adjustment + QScreen* screen=app.primaryScreen(); + if(screen){ + QRenderStats::instance().set_display_width_height(screen->size().width(),screen->size().height()); + } + } QOpenHDVideoHelper::reset_qopenhd_switch_primary_secondary(); #if defined(__ios__) From 683bf9eb967ad695cf1a09fe55953d054049891c Mon Sep 17 00:00:00 2001 From: consti10 Date: Tue, 14 Nov 2023 12:55:32 +0100 Subject: [PATCH 08/16] exp -set before writing the AA flag / screen scale --- app/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/main.cpp b/app/main.cpp index cb70badb7..690d7a88e 100755 --- a/app/main.cpp +++ b/app/main.cpp @@ -192,11 +192,13 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationDomain("openhd"); QCoreApplication::setApplicationName("QOpenHD"); {// Original screen resoluton before setting anything + QApplication a(argc, argv); const auto screen=QGuiApplication::primaryScreen(); if(screen){ const auto actual_size=screen->size(); QRenderStats::instance().set_screen_width_height(actual_size.width(),actual_size.height()); } + // a is deleted again } QSettings settings; From 07fa49d3b10205215786e2b24c2d11923db358be Mon Sep 17 00:00:00 2001 From: consti10 Date: Tue, 14 Nov 2023 16:02:05 +0100 Subject: [PATCH 09/16] wb link rate widget - use combobox instead of buttons --- app/main.cpp | 2 +- qml/qml.qrc | 1 + .../AppScreenSettingsView.qml | 8 +- qml/ui/elements/SmallHeaderInfoRow.qml | 27 ++ qml/ui/widgets/VideoBitrateWidgetGeneric.qml | 2 +- qml/ui/widgets/WBLinkRateControlWidget.qml | 332 ++++++------------ 6 files changed, 146 insertions(+), 226 deletions(-) create mode 100644 qml/ui/elements/SmallHeaderInfoRow.qml diff --git a/app/main.cpp b/app/main.cpp index 690d7a88e..9aded53b7 100755 --- a/app/main.cpp +++ b/app/main.cpp @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationDomain("openhd"); QCoreApplication::setApplicationName("QOpenHD"); {// Original screen resoluton before setting anything - QApplication a(argc, argv); + //QApplication a(argc, argv); const auto screen=QGuiApplication::primaryScreen(); if(screen){ const auto actual_size=screen->size(); diff --git a/qml/qml.qrc b/qml/qml.qrc index 6a259d6c2..366439aba 100644 --- a/qml/qml.qrc +++ b/qml/qml.qrc @@ -266,5 +266,6 @@ ui/elements/ButtonIconInfo2.qml ui/elements/CardBasic.qml ui/elements/ButtonIconConnect.qml + ui/elements/SmallHeaderInfoRow.qml diff --git a/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml index 60915821b..f7446c79c 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml @@ -51,18 +51,18 @@ ScrollView { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter from : 0.3 - to : 2.0 + to : 2.5 // Important: Looks as without .1 steps, we can get rendering artfacts stepSize: .1 anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 value: settings.global_scale - // @disable-check M223 onValueChanged: { - // @disable-check M222 + if(settings.global_scale != value){ + _restartqopenhdmessagebox.show(); + } settings.global_scale = value - //_messageBoxInstance.set_text_and_show("Please restart QOpenHD !") } } } diff --git a/qml/ui/elements/SmallHeaderInfoRow.qml b/qml/ui/elements/SmallHeaderInfoRow.qml new file mode 100644 index 000000000..0bda70f74 --- /dev/null +++ b/qml/ui/elements/SmallHeaderInfoRow.qml @@ -0,0 +1,27 @@ +import QtQuick 2.12 + +Item { + width: parent.width + height: 40 + + property string m_text: "FILL ME" + property string m_info_text: "FILL ME" + + Text{ + anchors.fill: parent + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignLeft + text: m_text + font.pixelSize: 18 + font.bold: true + color: "white" + } + ButtonIconInfo{ + anchors.right: parent.right + width: parent.height + height: parent.height + onClicked: { + _messageBoxInstance.set_text_and_show(m_info_text) + } + } +} diff --git a/qml/ui/widgets/VideoBitrateWidgetGeneric.qml b/qml/ui/widgets/VideoBitrateWidgetGeneric.qml index d9cec249a..d82eefc8d 100644 --- a/qml/ui/widgets/VideoBitrateWidgetGeneric.qml +++ b/qml/ui/widgets/VideoBitrateWidgetGeneric.qml @@ -196,7 +196,7 @@ BaseWidget { Layout.preferredWidth: 200 Layout.minimumWidth: 200 height: 50 - currentIndex: 0 + currentIndex: -1 displayText: { if(!_ohdSystemAir.is_alive)return "Res@fps N/A"; return m_curr_video_format; diff --git a/qml/ui/widgets/WBLinkRateControlWidget.qml b/qml/ui/widgets/WBLinkRateControlWidget.qml index 8c785068b..4c98404ec 100644 --- a/qml/ui/widgets/WBLinkRateControlWidget.qml +++ b/qml/ui/widgets/WBLinkRateControlWidget.qml @@ -48,6 +48,24 @@ BaseWidget { //property bool m_is_armed: true property bool m_is_armed: _fcMavlinkSystem.armed + property int m_row_height: 50 + + + ListModel{ + id: mcs_model + ListElement {title: "MCS0 "; value: 0} + ListElement {title: "MCS1 "; value: 1} + ListElement {title: "MCS2 (DEFAULT)"; value: 2} + ListElement {title: "MCS3 (EXPERIMENTAL)"; value: 3} + ListElement {title: "MCS4 (EXPERIMENTAL)"; value: 4} + } + ListModel{ + id: stability_model + ListElement {title: "30%:2 POLLUTED"; value_fec: 30; value_keyframe: 2} + ListElement {title: "30%:3 CITY"; value_fec: 30; value_keyframe: 3} + ListElement {title: "20%:5 DEFAULT"; value_fec: 20; value_keyframe: 5} + //ListElement {title: "10%:5 DESERT"; value_fec: 10; value_keyframe: 5} + } function get_text_channel(){ if(!settings.wb_link_rate_control_widget_show_frequency){ @@ -142,6 +160,34 @@ BaseWidget { } _wbLinkSettingsHelper.change_param_air_channel_width_async(channel_width_mhz,true); } + function get_rate_for_mcs(mcs,is_40mhz){ + if(is_40mhz){ + if(mcs==0) return 7.4; + if(mcs==1) return 15.3; + if(mcs==2) return 22.6; + if(mcs==3) return 25; + if(mcs==4) return 30; + } + if(mcs==0) return 4.7; + if(mcs==1) return 9.8; + if(mcs==2) return 13; + if(mcs==3) return 16.2; + if(mcs==4) return 20; + return -1; + } + function get_mcs_combobox_text(mcs){ + for(var i = 0; i < mcs_model.count; ++i) { + if (mcs_model.get(i).value==mcs) return mcs_model.get(i).title + } + return "MCS "+m_curr_mcs_index; + } + + function get_fec_keyframe_combobox_text(fec,keyframe){ + for(var i = 0; i < stability_model.count; ++i) { + if (stability_model.get(i).value_fec==fec && stability_model.get(i).value_keyframe==keyframe) return stability_model.get(i).title + } + return "FEC:"+fec+"% : KEY:"+keyframe+" ?"; + } property string m_DESCRIPTION_CHANNEL_WIDTH: " A higher bandwidth / 40Mhz channel width increases the bitrate significantly, but also increases interference and reduces the maximum range."+ @@ -264,237 +310,83 @@ Make the video more stable (less microfreezes) on the cost of less image quality width: parent.width height: parent.height - ColumnLayout { - width: m_widget_action_w -32 - height: m_widget_action_h-32 - spacing: 20 + Column { + width: m_widget_action_w-32 + //height: m_widget_action_h + //spacing: 20 - Rectangle{ + SmallHeaderInfoRow{ + m_text: "Range vs Bitrate" + m_info_text: m_DESCRIPTION_CHANNEL_WIDTH + } + Row{ width: parent.width - height: 50 - Layout.fillWidth: true - //color: "#13142e" - //border.width: 5 - //radius: 10 - //color: "green" - color: "black" - ColumnLayout{ - width: parent.width - height: parent.height - spacing: 1 - Rectangle { - height: 32 - width: parent.width - id: itemDescriptionRangeQuality - //color: "green" - color: "black" - Text { - id: simpleDescriptionRangeQuality - text: "Trade range/image quality" - color: "white" - font.bold: true - font.pixelSize: detailPanelFontPixels - anchors.left: parent.left - } - Button{ - height: 32 - width: 32 - text: "\uf05a" - anchors.left: simpleDescriptionRangeQuality.right - anchors.top: simpleDescriptionRangeQuality.top - Material.background:Material.LightBlue - anchors.leftMargin: 5 - onClicked: { - _messageBoxInstance.set_text_and_show(m_DESCRIPTION_CHANNEL_WIDTH) - } - } + height: m_row_height + spacing: 20 + enabled: _ohdSystemAir.is_alive; + Button{ + text: "20Mhz" + onClicked: { + set_channel_width_async(20) } - Item{ - width: parent.width - height: 20 - GridLayout{ - width: parent.width - height: parent.height - rows: 2 - columns: 2 - Button{ - text: "20Mhz" - onClicked: { - set_channel_width_async(20) - } - highlighted: m_curr_channel_width==20 - } - Button{ - text: "40Mhz" - onClicked: { - set_channel_width_async(40) - } - highlighted: m_curr_channel_width==40 - } - } + highlighted: m_curr_channel_width==20 + } + Button{ + text: "40Mhz" + onClicked: { + set_channel_width_async(40) } + highlighted: m_curr_channel_width==40 } } - - Rectangle{ - id: areaMCS + SmallHeaderInfoRow{ + m_text: "Range vs Bitrate" + m_info_text: m_DESCRIPTION_MCS + } + ComboBox{ width: parent.width - height: parent.height /3; - //color: "red" - color: "black" - ColumnLayout{ - width: parent.width - height: parent.height - spacing: 1 - Item { - height: 32 - width: parent.width - id: itemDescriptionMCS - Text { - id: simpleDescription - text: "Trade range/image quality" - color: "white" - font.bold: true - font.pixelSize: detailPanelFontPixels - anchors.left: parent.left - } - Button{ - height: 32 - width: 32 - text: "\uf05a" - anchors.left: simpleDescription.right - anchors.top: simpleDescription.top - Material.background:Material.LightBlue - anchors.leftMargin: 5 - onClicked: { - _messageBoxInstance.set_text_and_show(m_DESCRIPTION_MCS) - } - } - } - - Rectangle{ - width: parent.width - height: 100; - id: itemMcsChoices - //color: "green" - color: "black" - GridLayout{ - width: parent.width - height: parent.height - rows: 3 - columns: 2 - Button{ - text: "MCS0" - onClicked: { - set_air_only_mcs(0) - } - highlighted: m_curr_mcs_index==0 - } - Button{ - text: "MCS1" - onClicked: { - set_air_only_mcs(1) - } - highlighted: m_curr_mcs_index==1 - } - Button{ - text: "MCS2\n(DEFAULT)" - onClicked: { - set_air_only_mcs(2) - } - highlighted: m_curr_mcs_index==2 - } - Button{ - text: "MCS3" - onClicked: { - set_air_only_mcs(3) - } - highlighted: m_curr_mcs_index==3 - } - } - } + height: m_row_height + id: mcs_cb + model: mcs_model + textRole: "title" + currentIndex: -1 + displayText: { + if(!_ohdSystemAir.is_alive)return "AIR NOT ALIVE"; + return get_mcs_combobox_text(m_curr_mcs_index); + //return "MCS "+m_curr_mcs_index+" / "+get_rate_for_mcs(m_curr_mcs_index,m_curr_channel_width==40)+" MBit/s" } + onActivated: { + console.log("onActivated:"+currentIndex); + if(currentIndex<0)return; + const mcs=model.get(currentIndex).value + set_air_only_mcs(mcs) + } + enabled: _ohdSystemAir.is_alive; + } + SmallHeaderInfoRow{ + m_text: "Stability vs Bitrate" + m_info_text:m_DESCRIPTION_STABILITY } - Rectangle{ - id: areaKeyframe + ComboBox{ width: parent.width - height: parent.height /3; - //color: "green" - color: "black" - ColumnLayout{ - width: parent.width - height: parent.height - spacing: 5 - Item { - height: 32 - width: parent.width - id: itemDescriptionKeyframe - //anchors.top: itemMcsChoices.bottom - Text { - id: simpleDescriptionKeyframe - text: "Trade Quality/Stability" - color: "white" - font.bold: true - font.pixelSize: detailPanelFontPixels - anchors.left: parent.left - } - Button{ - height: 32 - width: 32 - text: "\uf05a" - anchors.left: simpleDescriptionKeyframe.right - anchors.top: simpleDescriptionKeyframe.top - Material.background:Material.LightBlue - anchors.leftMargin: 5 - onClicked: { - _messageBoxInstance.set_text_and_show(m_DESCRIPTION_STABILITY) - } - } - } - Item{ - width: parent.width - height: parent.height -32; - //color: "green" - GridLayout{ - width: parent.width - height: parent.height - rows: 2 - columns: 2 - Button{ - text: "POLLUTED" - onClicked: { - set_keyframe_interval(2) - set_fec_percentage(30) - } - highlighted: m_curr_keyframe_i == 2 && m_curr_fec_perc==30 - } - Button{ - text: "CITY" - onClicked: { - set_keyframe_interval(3) - set_fec_percentage(20) - } - highlighted: m_curr_keyframe_i == 3 && m_curr_fec_perc==20 - } - Button{ - text: "DEFAULT" - onClicked: { - set_keyframe_interval(5) - set_fec_percentage(20) - } - highlighted: m_curr_keyframe_i == 5 && m_curr_fec_perc==20 - } - Button{ - text: "DESERT" - onClicked: { - set_keyframe_interval(5) - set_fec_percentage(10) - } - highlighted: m_curr_keyframe_i == 5 && m_curr_fec_perc==10 - } - } - } + height: m_row_height + id: pollution_cb + model: stability_model + textRole: "title" + currentIndex: -1 + displayText: { + if(!_ohdSystemAir.is_alive)return "AIR NOT ALIVE"; + return get_fec_keyframe_combobox_text(m_curr_fec_perc,m_curr_keyframe_i) + } + onActivated: { + console.log("onActivated:"+currentIndex); + if(currentIndex<0)return; + const fec=model.get(currentIndex).value_fec + const key=model.get(currentIndex).value_keyframe + set_fec_percentage(fec) + set_keyframe_interval(key) } + enabled: _ohdSystemAir.is_alive; } } } From 54576da20bfc898cec5ff0d090b09269c8247213 Mon Sep 17 00:00:00 2001 From: consti10 Date: Tue, 14 Nov 2023 16:44:06 +0100 Subject: [PATCH 10/16] slightly decrease the default size of the artificial horizon --- qml/ui/widgets/HorizonWidget.qml | 4 ++-- qml/ui/widgets/WBLinkRateControlWidget.qml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qml/ui/widgets/HorizonWidget.qml b/qml/ui/widgets/HorizonWidget.qml index 9072afc32..c697546d5 100644 --- a/qml/ui/widgets/HorizonWidget.qml +++ b/qml/ui/widgets/HorizonWidget.qml @@ -372,8 +372,8 @@ BaseWidget { // Note: By the width / height we also controll the clipping area (since the horizon is double drawn, into a texture, then onto the screen). // Ideally, we want to reduce the "overdraw" to save GPU resources, e.g. make this area as small as possible / as less pixels as possible. - width: 600 * settings.horizon_clip_area_scale - height: 600 * settings.horizon_clip_area_scale + width: 400 * settings.horizon_clip_area_scale + height: 400 * settings.horizon_clip_area_scale //width: applicationWindow.width *0.8 * settings.horizon_clip_area_scale //height: applicationWindow.height *0.8 * settings.horizon_clip_area_scale clip: false diff --git a/qml/ui/widgets/WBLinkRateControlWidget.qml b/qml/ui/widgets/WBLinkRateControlWidget.qml index 4c98404ec..3aaef3a72 100644 --- a/qml/ui/widgets/WBLinkRateControlWidget.qml +++ b/qml/ui/widgets/WBLinkRateControlWidget.qml @@ -53,8 +53,8 @@ BaseWidget { ListModel{ id: mcs_model - ListElement {title: "MCS0 "; value: 0} - ListElement {title: "MCS1 "; value: 1} + ListElement {title: "MCS0 (LONG RANGE)"; value: 0} + ListElement {title: "MCS1 (RANGE)"; value: 1} ListElement {title: "MCS2 (DEFAULT)"; value: 2} ListElement {title: "MCS3 (EXPERIMENTAL)"; value: 3} ListElement {title: "MCS4 (EXPERIMENTAL)"; value: 4} From 38b32439ff6e0de0ddd783928b0f8d3734bb2d23 Mon Sep 17 00:00:00 2001 From: consti10 Date: Wed, 15 Nov 2023 00:45:17 +0100 Subject: [PATCH 11/16] horizon ladder - scale home icon, restart qopenhd box - decrease size, status - slightly smaller text / ratio (OK on 480p), video / wb link rate widget style improvments neccessary due to change to ComboBox --- app/main.cpp | 23 +++-- app/osd/horizonladder.cpp | 4 +- app/osd/horizonladder.h | 2 +- app/util/qopenhd.cpp | 7 +- app/util/qrenderstats.h | 4 +- qml/main.qml | 4 +- .../qopenhd_settings/AppDevSettingsView.qml | 2 +- qml/ui/configpopup/status/StatusCardRow.qml | 8 +- qml/ui/elements/RestartQOpenHDMessageBox.qml | 4 +- qml/ui/elements/SmallHeaderInfoRow.qml | 6 +- qml/ui/widgets/VideoBitrateWidgetGeneric.qml | 2 +- qml/ui/widgets/WBLinkRateControlWidget.qml | 87 ++++++++++++------- 12 files changed, 90 insertions(+), 63 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 9aded53b7..a9bb3e342 100755 --- a/app/main.cpp +++ b/app/main.cpp @@ -202,6 +202,7 @@ int main(int argc, char *argv[]) { } QSettings settings; + qDebug()<<"Storing settings at ["< Date: Wed, 15 Nov 2023 15:26:49 +0100 Subject: [PATCH 12/16] make restart dialoque even smaller --- qml/ui/elements/RestartQOpenHDMessageBox.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qml/ui/elements/RestartQOpenHDMessageBox.qml b/qml/ui/elements/RestartQOpenHDMessageBox.qml index fcfbfd550..457c348f5 100644 --- a/qml/ui/elements/RestartQOpenHDMessageBox.qml +++ b/qml/ui/elements/RestartQOpenHDMessageBox.qml @@ -11,8 +11,8 @@ import OpenHD 1.0 // See corresponding .cpp for more info Card { id: restartqopenhdmessagebox - width: 320 - height: 240 + width: 300 + height: 200 z: 6.0 anchors.centerIn: parent cardName: qsTr("QOpenHD") From 69a9de5102f7cf30cdc34754f06f0ade620dd05a Mon Sep 17 00:00:00 2001 From: consti10 Date: Wed, 15 Nov 2023 15:44:25 +0100 Subject: [PATCH 13/16] fix " " --- qml/ui/configpopup/status/StatusCardBodyOpenHD.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml b/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml index 8e42b7365..8994b341f 100644 --- a/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml +++ b/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml @@ -95,7 +95,7 @@ Column { m_right_text_color: m_last_ping === "N/A" ? "#DC143C" : "green" } StatusCardRow{ - m_left_text: qsTr(m_is_ground ? "Link HW: " : "Link HW:") + m_left_text: qsTr(m_is_ground ? "Link HW:" : "Link HW:") m_right_text: { if(m_is_ground){ if(!_ohdSystemGround.is_alive){ From 2a39c4344d2efc75e1363d47082be1bd3a3e8211 Mon Sep 17 00:00:00 2001 From: consti10 Date: Wed, 15 Nov 2023 16:17:00 +0100 Subject: [PATCH 14/16] show restart dialoque when changed --- .../configpopup/qopenhd_settings/AppScreenSettingsView.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml index f7446c79c..5f94586f3 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml @@ -146,7 +146,11 @@ ScrollView { } } onCurrentIndexChanged: { - settings.screen_custom_font_dpi = font_dpi.get(currentIndex).value + const value_fdpi = font_dpi.get(currentIndex).value + if(settings.screen_custom_font_dpi != value_fdpi){ + _restartqopenhdmessagebox.show(); + } + settings.screen_custom_font_dpi = value_fdpi } } } From 090bdeee3d76efead658cad060fe5324a7b833df Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:08:17 +0100 Subject: [PATCH 15/16] debug --- .github/workflows/build_package_Rock5.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_package_Rock5.yml b/.github/workflows/build_package_Rock5.yml index 2c083d313..26c8c5665 100644 --- a/.github/workflows/build_package_Rock5.yml +++ b/.github/workflows/build_package_Rock5.yml @@ -1,4 +1,4 @@ -name: build_package_rock5_debian +name: build_package_rock_debian on: push: @@ -6,6 +6,7 @@ on: - "2.5-evo" - "dev-release" - "release" + - "debug" paths-ignore: - '**.md' - '**.asciidoc' From 810447c4a224b0d6d1d5cec64e1db0a415b85bfe Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:30:10 +0100 Subject: [PATCH 16/16] Revert "debug" This reverts commit 090bdeee3d76efead658cad060fe5324a7b833df. --- .github/workflows/build_package_Rock5.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_package_Rock5.yml b/.github/workflows/build_package_Rock5.yml index 26c8c5665..2c083d313 100644 --- a/.github/workflows/build_package_Rock5.yml +++ b/.github/workflows/build_package_Rock5.yml @@ -1,4 +1,4 @@ -name: build_package_rock_debian +name: build_package_rock5_debian on: push: @@ -6,7 +6,6 @@ on: - "2.5-evo" - "dev-release" - "release" - - "debug" paths-ignore: - '**.md' - '**.asciidoc'