From 73205078f84d3e1bff31967408f73dd8d3494b06 Mon Sep 17 00:00:00 2001 From: consti10 Date: Tue, 5 Dec 2023 12:19:22 +0100 Subject: [PATCH 1/7] make the labels of the graph less wrong (still not scientific, but thats out of scope) --- qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml b/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml index 4b13457ea..74840b5b2 100644 --- a/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml +++ b/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml @@ -209,7 +209,7 @@ Rectangle{ } BarSet { id: bar_set - label: "Pollution (pps)"; + label: m_normalize_data ? "Pollution estimate %" : "Pollution estimate (pps)"; values: [5,10,3,100] //values: [0,0,0,0] color: "red" From 8d9519356798de24a4b427547d8e146100277b37 Mon Sep 17 00:00:00 2001 From: consti10 Date: Tue, 5 Dec 2023 13:03:54 +0100 Subject: [PATCH 2/7] well, fix it the easy way - make it non scientific. This is enough for an user. --- .../openhd_settings/PopupAnalyzeChannels.qml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml b/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml index 74840b5b2..23837c8bb 100644 --- a/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml +++ b/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml @@ -125,7 +125,7 @@ Rectangle{ } } Switch{ - id:normalize + id:normalize_sw checked: m_normalize_data onCheckedChanged: { m_normalize_data=checked @@ -133,7 +133,7 @@ Rectangle{ } } Text{ - text: "Normalize" + text: m_normalize_data ? "Relative" : "Absolute" color: "#fff" font.pixelSize: 18 verticalAlignment: Qt.AlignVCenter @@ -207,9 +207,14 @@ Rectangle{ //min: "0" //max: "500" } + axisY: ValueAxis { + labelsVisible: false + gridVisible:false + } BarSet { id: bar_set - label: m_normalize_data ? "Pollution estimate %" : "Pollution estimate (pps)"; + //label: m_normalize_data ? "Pollution estimate %" : "WiFiPollution estimate (pps)"; + label: "WiFi pollution estimate" values: [5,10,3,100] //values: [0,0,0,0] color: "red" From 67c987b67f0a817947f59a5c16838a160f27e286 Mon Sep 17 00:00:00 2001 From: consti10 Date: Wed, 6 Dec 2023 11:10:49 +0100 Subject: [PATCH 3/7] finalze scan. Now it is simple by default, but can be used advanced, too. Limitations of qt charts apply. --- app/telemetry/action/ohdaction.cpp | 3 +- app/telemetry/action/ohdaction.h | 2 +- app/telemetry/settings/frequencyhelper.cpp | 16 ++++ app/telemetry/settings/frequencyhelper.h | 2 + app/telemetry/settings/pollutionhelper.cpp | 19 +++- .../settings/wblinksettingshelper.cpp | 4 +- app/telemetry/settings/wblinksettingshelper.h | 2 +- .../openhd_settings/PopupAnalyzeChannels.qml | 87 +++++++++++++++---- 8 files changed, 111 insertions(+), 24 deletions(-) diff --git a/app/telemetry/action/ohdaction.cpp b/app/telemetry/action/ohdaction.cpp index 7aa740721..15a279415 100644 --- a/app/telemetry/action/ohdaction.cpp +++ b/app/telemetry/action/ohdaction.cpp @@ -32,12 +32,13 @@ bool OHDAction::send_command_reboot_gnd(bool reboot) return res==CmdSender::Result::CMD_SUCCESS; } -bool OHDAction::send_command_analyze_channels_blocking() +bool OHDAction::send_command_analyze_channels_blocking(int freq_bands) { mavlink_command_long_t cmd{}; cmd.target_system=OHD_SYS_ID_GROUND; cmd.target_component=MAV_COMP_ID_ONBOARD_COMPUTER; cmd.command=OPENHD_CMD_INITIATE_CHANNEL_ANALYZE; + cmd.param1=static_cast(freq_bands); const auto res=CmdSender::instance().send_command_long_blocking(cmd); return res==CmdSender::Result::CMD_SUCCESS; } diff --git a/app/telemetry/action/ohdaction.h b/app/telemetry/action/ohdaction.h index 9a6ccb5de..3673bf879 100644 --- a/app/telemetry/action/ohdaction.h +++ b/app/telemetry/action/ohdaction.h @@ -24,7 +24,7 @@ class OHDAction : public QObject Q_INVOKABLE bool send_command_reboot_gnd(bool reboot); // Sent to the ground unit only - bool send_command_analyze_channels_blocking(); + bool send_command_analyze_channels_blocking(int freq_bands); bool send_command_start_scan_channels_blocking(int freq_bands,int channel_widths); private: }; diff --git a/app/telemetry/settings/frequencyhelper.cpp b/app/telemetry/settings/frequencyhelper.cpp index 543a798dc..5249a3c3a 100644 --- a/app/telemetry/settings/frequencyhelper.cpp +++ b/app/telemetry/settings/frequencyhelper.cpp @@ -39,6 +39,22 @@ QList FrequencyHelper::get_frequencies(int filter) return ret; } +QList FrequencyHelper::filter_frequencies_40mhz_ht40plus_only(QList frequencies) +{ + std::vector frequencies2; + for(auto& freq:frequencies){ + frequencies2.push_back(freq); + } + QList ret; + auto channels=openhd::frequencies_to_channels(frequencies2); + for(auto& channel:channels){ + if(channel.in_40Mhz_ht40_plus){ + ret.push_back(channel.frequency); + } + } + return ret; +} + QList FrequencyHelper::get_frequencies_all_40Mhz() { QList ret; diff --git a/app/telemetry/settings/frequencyhelper.h b/app/telemetry/settings/frequencyhelper.h index ce30d5f28..d8ac694be 100644 --- a/app/telemetry/settings/frequencyhelper.h +++ b/app/telemetry/settings/frequencyhelper.h @@ -16,6 +16,8 @@ class FrequencyHelper : public QObject static FrequencyHelper &instance(); // 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 filter_frequencies_40mhz_ht40plus_only(QList); + Q_INVOKABLE QList get_frequencies_all_40Mhz(); Q_INVOKABLE bool get_frequency_radar(int frequency_mhz); diff --git a/app/telemetry/settings/pollutionhelper.cpp b/app/telemetry/settings/pollutionhelper.cpp index d2b46fedb..4769abd48 100644 --- a/app/telemetry/settings/pollutionhelper.cpp +++ b/app/telemetry/settings/pollutionhelper.cpp @@ -59,7 +59,19 @@ QStringList PollutionHelper::pollution_frequencies_int_to_qstringlist(QList for(auto& freq:frequencies){ std::stringstream ss; ss< if(normalize){ ret.push_back(static_cast(pollution.value().n_foreign_packets_normalized)); }else{ + /*if(pollution.value().n_foreign_packets<1){ + ret.push_back(static_cast(0)); + }else{ + ret.push_back(static_cast(100)); + }*/ ret.push_back(static_cast(pollution.value().n_foreign_packets)); } diff --git a/app/telemetry/settings/wblinksettingshelper.cpp b/app/telemetry/settings/wblinksettingshelper.cpp index ec14ac3e0..a0acdcefb 100644 --- a/app/telemetry/settings/wblinksettingshelper.cpp +++ b/app/telemetry/settings/wblinksettingshelper.cpp @@ -31,9 +31,9 @@ WBLinkSettingsHelper& WBLinkSettingsHelper::instance() return tmp; } -bool WBLinkSettingsHelper::start_analyze_channels() +bool WBLinkSettingsHelper::start_analyze_channels(int freq_bands) { - if(OHDAction::instance().send_command_analyze_channels_blocking()){ + if(OHDAction::instance().send_command_analyze_channels_blocking(freq_bands)){ set_analyze_progress_perc(0); return true; } diff --git a/app/telemetry/settings/wblinksettingshelper.h b/app/telemetry/settings/wblinksettingshelper.h index ee865e275..e99d7d5f9 100644 --- a/app/telemetry/settings/wblinksettingshelper.h +++ b/app/telemetry/settings/wblinksettingshelper.h @@ -59,7 +59,7 @@ class WBLinkSettingsHelper : public QObject void validate_and_set_gnd_channel_width_mhz(int channel_width_mhz); void validate_and_set_air_channel_width_mhz(int channel_width_mhz); public: - Q_INVOKABLE bool start_analyze_channels(); + Q_INVOKABLE bool start_analyze_channels(int freq_bands); // freq_bands: // 0: 2.4G and 5.8G // 1: 2.4G only diff --git a/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml b/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml index 23837c8bb..1f938ffbb 100644 --- a/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml +++ b/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml @@ -26,7 +26,6 @@ Rectangle{ property bool m_normalize_data: false; property int m_chart_view_minimum_width: 1280; - property int m_chart_view_minimum_width2: 1280; property bool m_chart_enlarged: false; @@ -44,9 +43,9 @@ Rectangle{ ListModel{ id: model_filter - ListElement {title: "NO FILTER"; value: 0} - ListElement {title: "2.4G ONLY"; value: 1} - ListElement {title: "5.8G ONLY"; value: 2} + ListElement {title: "OHD [1-5]"; value: 0} + ListElement {title: "All 2.4G"; value: 1} + ListElement {title: "All 5.8G"; value: 2} } property string m_info_string: "Analyze channels for pollution by wifi access points.\n"+ @@ -105,7 +104,8 @@ Rectangle{ id:startButton text: "START" onClicked: { - var result=_wbLinkSettingsHelper.start_analyze_channels() + var how_many_freq_bands=comboBoxWhichFrequencyToAnalyze.currentIndex + var result=_wbLinkSettingsHelper.start_analyze_channels(how_many_freq_bands) if(result!==true){ _qopenhd.show_toast("Busy,please try again later",true); }else{ @@ -117,7 +117,7 @@ Rectangle{ ComboBox { Layout.preferredWidth: 150 Layout.minimumWidth: 50 - id: comboBoxFilter + id: comboBoxWhichFrequencyToAnalyze model: model_filter textRole: "title" onCurrentIndexChanged: { @@ -130,6 +130,9 @@ Rectangle{ onCheckedChanged: { m_normalize_data=checked pollution_chart.update_pollution_graph(); + if(m_normalize_data){ + _qopenhd.show_toast("WARNING: THIS VIEW CAN BE DECEIVING !"); + } } } Text{ @@ -171,16 +174,17 @@ Rectangle{ ChartView { id: pollution_chart + clip: true //width: main_background.width>m_chart_view_minimum_width ? main_background.width : m_chart_view_minimum_width; width: { const screen_width = main_background.width-10; - if(comboBoxFilter.currentIndex==0){ - return screen_width>m_chart_view_minimum_width ? screen_width : m_chart_view_minimum_width; - } - if(comboBoxFilter.currentIndex==1){ - return screen_width + // 2.4G and OHD 1-5 should always fit into screen size + const filter=comboBoxWhichFrequencyToAnalyze.currentIndex; + if(filter==0 || filter==1){ + return screen_width; } - return screen_width>m_chart_view_minimum_width2 ? screen_width : m_chart_view_minimum_width2; + // All the 5.8G frequencies together do not! + return screen_width>m_chart_view_minimum_width ? screen_width : m_chart_view_minimum_width; } //width: m_chart_enlarged ? 1280 : main_background.width height: parent.height @@ -191,14 +195,30 @@ Rectangle{ //const frequencies_list = _wbLinkSettingsHelper.get_pollution_qstringlist(); //bar_axis_x.categories=frequencies_list; //const supported_frequencies = _wbLinkSettingsHelper.get_supported_frequencies(); - const all_40Mhz_frequencies_unfiltered=_frequencyHelper.get_frequencies_all_40Mhz(); - const all_40Mhz_frequencies = _frequencyHelper.filter_frequencies(all_40Mhz_frequencies_unfiltered,comboBoxFilter.currentIndex); - var categories = _pollutionHelper.pollution_frequencies_int_to_qstringlist(all_40Mhz_frequencies); - var values = _pollutionHelper.pollution_frequencies_int_get_pollution(all_40Mhz_frequencies,m_normalize_data); + const channels_to_analyze=comboBoxWhichFrequencyToAnalyze.currentIndex; + var frequencies_to_analyze=_frequencyHelper.get_frequencies(0); + if(channels_to_analyze==0){ + frequencies_to_analyze=_frequencyHelper.get_frequencies(0); + }else if(channels_to_analyze==1){ + frequencies_to_analyze=_frequencyHelper.get_frequencies(1); + }else{ + frequencies_to_analyze=_frequencyHelper.get_frequencies(2); + frequencies_to_analyze=_frequencyHelper.filter_frequencies_40mhz_ht40plus_only(frequencies_to_analyze); + } + var categories = _pollutionHelper.pollution_frequencies_int_to_qstringlist(frequencies_to_analyze); + var values = _pollutionHelper.pollution_frequencies_int_get_pollution(frequencies_to_analyze,m_normalize_data); bar_axis_x.categories=categories; bar_set.values=values; + if(m_normalize_data){ + element_x_axis.labelsVisible=false; + element_x_axis.min=0; + element_x_axis.max=100; + }else{ + element_x_axis.labelsVisible=true; + element_x_axis.min=0; + element_x_axis.max=30; + } } - BarSeries { id: hm_bar_series axisX: BarCategoryAxis { @@ -207,9 +227,33 @@ Rectangle{ //min: "0" //max: "500" } - axisY: ValueAxis { + /*axisY: ValueAxis { labelsVisible: false gridVisible:false + }*/ + axisY: CategoryAxis{ + id: element_x_axis + min: 0 + max: 30 + labelsPosition: CategoryAxis.AxisLabelsPositionOnValue + CategoryRange { + label: "perfect" + endValue: 0 + + } + CategoryRange { + label: "good" + endValue: 10 + + } + CategoryRange { + label: "medium" + endValue: 20 + } + CategoryRange { + label: "bad" + endValue: 30 + } } BarSet { id: bar_set @@ -219,6 +263,13 @@ Rectangle{ //values: [0,0,0,0] color: "red" } + /*BarSet{ + id: bar_set2 + label: "GOOD" + color: "green" + values: [5,10,3,100] + }*/ + labelsPosition: AbstractBarSeries.LabelsInsideEnd } } } From 400f129dad51a50519d3ba4055ec483a486032fb Mon Sep 17 00:00:00 2001 From: consti10 Date: Wed, 6 Dec 2023 15:15:00 +0100 Subject: [PATCH 4/7] Fix problems @Thomas complained about. Add feature of having categories. Categories can be easily opened / closed We can hide things inside them if we want to. --- qml/qml.qrc | 19 +- .../openhd_settings/LinkQuickPanel.qml | 562 ++--- .../AppScreenSettingsView.qml | 323 ++- .../qopenhd_settings/AppVideoSettingsView.qml | 596 ++--- .../AppWidgetSettingsView.qml | 2144 ++++++++--------- qml/ui/elements/SettingBaseElement.qml | 1 + qml/ui/elements/SettingsCategory.qml | 75 + 7 files changed, 1878 insertions(+), 1842 deletions(-) create mode 100644 qml/ui/elements/SettingsCategory.qml diff --git a/qml/qml.qrc b/qml/qml.qrc index 19dffdd1c..f3907ee16 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 @@ -265,5 +265,6 @@ ui/elements/CardBasic.qml ui/elements/ButtonIconConnect.qml ui/elements/SmallHeaderInfoRow.qml + ui/elements/SettingsCategory.qml diff --git a/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml b/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml index e52832d5c..6cae39cee 100644 --- a/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml +++ b/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml @@ -24,7 +24,8 @@ Rectangle{ //property color m_background_color: "#ADD8E6" property color m_background_color: "#8cbfd7f3" - property int m_small_width: 200 + property int m_small_height: 50 + property int m_small_width: 120 function user_quidance_animate_channel_scan(){ console.log("User guidance animate channel scan"); @@ -134,106 +135,103 @@ Rectangle{ 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 - id: main_column_layout - Layout.margins: 10 - - BaseHeaderItem{ - m_text: "FREQUENCY / TOOLKIT" - } - - RowLayout{ - Layout.fillWidth: true - Item{ // FILLER - Layout.fillWidth: true - } - ComboBox { - Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: elementComboBoxWidth - id: comboBoxFreq - model: frequencies_model - 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 - } - 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; + Item { + anchors.fill: parent + + Column{ + id: main_column_layout + anchors.left: parent.left + anchors.right: parent.right + + SettingsCategory{ + m_description: "FREQUENCY / TOOLKIT" + spacing: 1 + + Row{ + anchors.horizontalCenter: parent.horizontalCenter + spacing: 8 + ComboBox { + width: elementComboBoxWidth + id: comboBoxFreq + model: frequencies_model + 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 + } + 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; } - // Change the freuquency - dialoqueFreqChangeAirGnd.initialize_and_show_frequency(frequency_mhz); - } - enabled: _ohdSystemGround.is_alive && _ohdSystemGround.wb_gnd_operating_mode==0; - } - 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){ - _qopenhd.show_toast("2.4G is almost always polluted by WiFi. Not recommended.") - }else if(currentIndex==2){ - _qopenhd.show_toast("Please watch out for wifi pollution. Using DEF is highly recommended !") + TabBar{ + id: filter_tab_bar + width: 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){ + _qopenhd.show_toast("2.4G is almost always polluted by WiFi. Not recommended.") + }else if(currentIndex==2){ + _qopenhd.show_toast("Please watch out for wifi pollution. Using DEF is highly recommended !") + } + } + } + TabButton{ + text: "DEF" + } + TabButton{ + text: "2.4G" + } + TabButton{ + text: "5.8G" } + enabled: comboBoxFreq.enabled } - } - TabButton{ - text: "DEF" - } - TabButton{ - text: "2.4G" - } - TabButton{ - text: "5.8G" - } - enabled: comboBoxFreq.enabled - } - Item{ // FILLER - Layout.fillWidth: true - } - ButtonIconInfo2{ + /*ButtonIconInfo2{ Layout.alignment: Qt.AlignRight visible:false onClicked: { @@ -242,120 +240,103 @@ Rectangle{ " often are free of wifi pollution and should be used." _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 - } - // Shrink back to normal - PropertyAnimation { - target: b_find_air_unit - property: "scale" - to: 1.0 - duration: 200 - easing.type: Easing.InOutQuad + + Row{ + anchors.horizontalCenter: parent.horizontalCenter + spacing: 8 + Button{ + width: 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.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{ + Button{ + width: 150 + text: "ANALYZE" + enabled: _ohdSystemGround.is_alive 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) + close_all_dialoques(); + popup_analyze_channels.open() } - }*/ - } - 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+"%" - } - color: _ohdSystemGround.curr_rx_packet_loss_perc > 5 ? "red" : "black" - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: false - font.pixelSize: settings.qopenhd_general_font_pixel_size - } - 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: false - font.pixelSize: settings.qopenhd_general_font_pixel_size - } - Text{ - Layout.preferredHeight: 50 - Layout.preferredWidth: 120 - text: { - var ret="THROTTLE:\n"; - if(_ohdSystemAir.curr_n_rate_adjustments<=-1){ - ret+="N/A"; - }else if(_ohdSystemAir.curr_n_rate_adjustments==0){ - ret+="NONE"; - }else{ - ret+=("ACTIVE:"+_ohdSystemAir.curr_n_rate_adjustments+"x"); } - return ret; } - color: _ohdSystemAir.curr_n_rate_adjustments > 0 ? "red" : "black" - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: false - font.pixelSize: settings.qopenhd_general_font_pixel_size - } - Item{ // FILLER + Row{ + anchors.horizontalCenter: parent.horizontalCenter + Text{ + width: m_small_width + height: m_small_height + 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: false + font.pixelSize: settings.qopenhd_general_font_pixel_size + } + Text{ + width: m_small_width + height: m_small_height + 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: false + font.pixelSize: settings.qopenhd_general_font_pixel_size + } + Text{ + width: m_small_width + height: m_small_height + text: { + var ret="THROTTLE:\n"; + if(_ohdSystemAir.curr_n_rate_adjustments<=-1){ + ret+="N/A"; + }else if(_ohdSystemAir.curr_n_rate_adjustments==0){ + ret+="NONE"; + }else{ + ret+=("ACTIVE:"+_ohdSystemAir.curr_n_rate_adjustments+"x"); + } + return ret; + } + color: _ohdSystemAir.curr_n_rate_adjustments > 0 ? "red" : "black" + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: false + font.pixelSize: settings.qopenhd_general_font_pixel_size + } + /*Item{ // FILLER Layout.fillWidth: true - } - /*ButtonIconInfo{ + }*/ + /*ButtonIconInfo{ onClicked: { var text="High Loss / Pollution / active throttle hint at a polluted channel." _messageBoxInstance.set_text_and_show(text) @@ -370,110 +351,91 @@ Rectangle{ _messageBoxInstance.set_text_and_show(text) } }*/ - } - - BaseHeaderItem{ - m_text: "TX POWER" - } - - RowLayout { - id: tx_power_layout - Layout.fillWidth: true - Layout.fillHeight: true - - Item{ // FILLER - Layout.fillWidth: true - } - Text{ - Layout.preferredWidth: 120 - text: "AIR:\n "+get_text_wifi_tx_power(true) - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: false - font.pixelSize: settings.qopenhd_general_font_pixel_size - } - 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: false - font.pixelSize: settings.qopenhd_general_font_pixel_size - } - Button{ - text: "EDIT" - enabled: _ohdSystemGround.is_alive - onClicked: { - close_all_dialoques(); - popup_change_tx_power.m_is_air=false; - popup_change_tx_power.open() - } - } - Item{ // FILLER - Layout.fillWidth: true - } - } - BaseHeaderItem{ - m_text: "ADVANCED (STBC,LDPC)" - } + SettingsCategory{ + m_description: "TX POWER" + Row{ + anchors.horizontalCenter: parent.horizontalCenter + Text{ + width: m_small_width + height: m_small_height + text: "AIR:\n "+get_text_wifi_tx_power(true) + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: false + font.pixelSize: settings.qopenhd_general_font_pixel_size + } + 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{ + width: m_small_width + height: m_small_height + text: "GND:\n"+get_text_wifi_tx_power(false) + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: false + font.pixelSize: settings.qopenhd_general_font_pixel_size + } + Button{ + text: "EDIT" + enabled: _ohdSystemGround.is_alive + onClicked: { + close_all_dialoques(); + popup_change_tx_power.m_is_air=false; + popup_change_tx_power.open() + } + } - 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: false - font.pixelSize: settings.qopenhd_general_font_pixel_size - } - Text{ - Layout.preferredWidth: 120 - text: "GND:\n"+get_text_stbc_ldpc(false); - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - font.bold: false - font.pixelSize: settings.qopenhd_general_font_pixel_size - } - 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 !"); + + SettingsCategory{ + m_description: "ADVANCED (STBC,LDPC)" + + Row{ + anchors.horizontalCenter: parent.horizontalCenter + Text{ + width: m_small_width + height: m_small_height + text: "AIR:\n"+get_text_stbc_ldpc(true); + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: false + font.pixelSize: settings.qopenhd_general_font_pixel_size + } + Text{ + width: m_small_width + height: m_small_height + text: "GND:\n"+get_text_stbc_ldpc(false); + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + font.bold: false + font.pixelSize: settings.qopenhd_general_font_pixel_size + } + 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() + } + } } - }*/ + } } } } - PopupAnalyzeChannels{ id: popup_analyze_channels } @@ -495,4 +457,6 @@ Rectangle{ DialoqueFreqChangeAirGnd{ id: dialoqueFreqChangeAirGnd } + } + diff --git a/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml index aa8e27fa1..aaa1c4d3d 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml @@ -66,44 +66,9 @@ ScrollView { } } } - - - SettingBaseElement{ - m_short_description: "Screen rotation" - m_long_description: "Rotate QOpenHD, can be usefull if your screen is installed the wrong way around" - // anything other than 0 and 180 can breaks things - ComboBox { - height: elementHeight - anchors.right: parent.right - anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizonatalCenter - width: 320 - model: ListModel { - id: screen_rotations - ListElement { text: qsTr("0°") ; value: 0 } - ListElement { text: qsTr("90° (WARNING)") ; value: 90 } - ListElement { text: qsTr("180°") ; value: 180 } - ListElement { text: qsTr("270° (WARNING)") ; value: 270 } - } - textRole: "text" - Component.onCompleted: { - for (var i = 0; i < model.count; i++) { - var choice = model.get(i); - if (choice.value == settings.general_screen_rotation) { - currentIndex = i; - } - } - } - onCurrentIndexChanged: { - settings.general_screen_rotation = screen_rotations.get(currentIndex).value - } - } - } - SettingBaseElement{ - m_short_description: "Background transparent" - m_long_description: "Use a transparent surface, such that another application can play (hw composer accelerated) video behind the QOpenHD surface." + m_short_description: "Cursor AutoHide" + m_long_description: "Automatically hide cursor on inactivity" Switch { width: 32 @@ -112,94 +77,18 @@ ScrollView { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - checked: settings.app_background_transparent - onCheckedChanged: settings.app_background_transparent = checked - } - } - - SettingBaseElement{ - m_short_description: "Font DPI" - m_long_description: "Scale the text / line size of the artifical horizon / ladders, requires restart of QOpenHD." - ComboBox { - height: elementHeight - anchors.right: parent.right - anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizonatalCenter - width: 320 - model: ListModel { - ListElement { text: qsTr("-1 Disable") ; value: -1 } - ListElement { text: qsTr("0 Auto (Recommended)") ; value: 0 } - ListElement { text: qsTr("50 (ultra small)") ; value: 50 } - ListElement { text: qsTr("72 (smaller)") ; value: 72 } - ListElement { text: qsTr("100") ; value: 100 } - ListElement { text: qsTr("120 (bigger)") ; value: 120 } - ListElement { text: qsTr("150 (ultra big)") ; value: 150 } - } - textRole: "text" - Component.onCompleted: { - for (var i = 0; i < model.count; i++) { - var choice = model.get(i); - if (choice.value == settings.screen_custom_font_dpi) { - currentIndex = i; - } - } - } - onActivated:{ - const value_fdpi = model.get(currentIndex).value - if(settings.screen_custom_font_dpi != value_fdpi){ - console.log("font dpi changed from :"+settings.screen_custom_font_dpi+" to:"+value_fdpi); - _restartqopenhdmessagebox.show(); - settings.screen_custom_font_dpi = value_fdpi + checked: settings.enable_cursor_auto_hide + onCheckedChanged: { + if(settings.enable_cursor_auto_hide!=checked){ + settings.enable_cursor_auto_hide=checked; + _mouseHelper.set_hide_cursor_inactive_enable(settings.enable_cursor_auto_hide); } - } } } - SettingBaseElement{ - m_short_description: "Force full screen" - m_long_description: "Force Full screen if QOpenHD is not already full screen" - - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.dev_force_show_full_screen - onCheckedChanged: settings.dev_force_show_full_screen = checked - } - } - SettingBaseElement{ - m_short_description: "dev_set_swap_interval_zero" - m_long_description: "Can decrease latency on x86 / laptop. Requires restart. Experimental." - - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.dev_set_swap_interval_zero - onCheckedChanged: settings.dev_set_swap_interval_zero = checked - } - } SettingBaseElement{ m_short_description: "Custom cursor" m_long_description: "Customize cursor for high visibility in the field" - - /*Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.enable_colored_cursor - onCheckedChanged: settings.enable_colored_cursor = checked - }*/ SpinBox { width: 210 font.pixelSize: 14 @@ -240,64 +129,164 @@ ScrollView { } } } - SettingBaseElement{ - m_short_description: "Cursor AutoHide" - m_long_description: "Automatically hide cursor on inactivity" - - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.enable_cursor_auto_hide - onCheckedChanged: { - if(settings.enable_cursor_auto_hide!=checked){ - settings.enable_cursor_auto_hide=checked; - _mouseHelper.set_hide_cursor_inactive_enable(settings.enable_cursor_auto_hide); + SettingsCategory{ + m_description: "ADVANCED USERS ONLY" + m_hide_elements: true + + SettingBaseElement{ + m_short_description: "Screen rotation" + m_long_description: "Rotate QOpenHD, can be usefull if your screen is installed the wrong way around. Might or might not work." + // anything other than 0 and 180 can breaks things + ComboBox { + height: elementHeight + anchors.right: parent.right + anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizonatalCenter + width: 320 + model: ListModel { + id: screen_rotations + ListElement { text: qsTr("0°") ; value: 0 } + ListElement { text: qsTr("90° (WARNING)") ; value: 90 } + ListElement { text: qsTr("180°") ; value: 180 } + ListElement { text: qsTr("270° (WARNING)") ; value: 270 } + } + textRole: "text" + Component.onCompleted: { + for (var i = 0; i < model.count; i++) { + var choice = model.get(i); + if (choice.value == settings.general_screen_rotation) { + currentIndex = i; + } + } + } + onCurrentIndexChanged: { + settings.general_screen_rotation = screen_rotations.get(currentIndex).value } } } - } - - SettingBaseElement{ - m_short_description: "Settings window size" - m_long_description: "Change the size of the settings window, such that you can view the live video while changing settings" - - SpinBox { - width: 210 - font.pixelSize: 14 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - - from: 50 - to: 100 - stepSize: 1 - value: settings.screen_settings_overlay_size_percent - onValueChanged: { - settings.screen_settings_overlay_size_percent = value + SettingBaseElement{ + m_short_description: "Background transparent" + m_long_description: "Use a transparent surface, such that another application can play (hw composer accelerated) video behind the QOpenHD surface." + + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.app_background_transparent + onCheckedChanged: settings.app_background_transparent = checked + } + } + SettingBaseElement{ + m_short_description: "Force full screen" + m_long_description: "Force Full screen if QOpenHD is not already full screen" + + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.dev_force_show_full_screen + onCheckedChanged: settings.dev_force_show_full_screen = checked + } + } + SettingBaseElement{ + m_short_description: "Swap interval 0" + m_long_description: "Can decrease latency on x86 / laptop. Requires restart. Experimental." + + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.dev_set_swap_interval_zero + onCheckedChanged: settings.dev_set_swap_interval_zero = checked } } - } - SettingBaseElement{ - m_short_description: "Settings window transparency" - m_long_description: "make the openhd parameters window semi-transparent" - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + SettingBaseElement{ + m_short_description: "Settings window size" + m_long_description: "Change the size of the settings window, such that you can view the live video while changing settings" + + SpinBox { + width: 210 + font.pixelSize: 14 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + + from: 50 + to: 100 + stepSize: 1 + value: settings.screen_settings_overlay_size_percent + onValueChanged: { + settings.screen_settings_overlay_size_percent = value + } + } + } + SettingBaseElement{ + m_short_description: "Settings window transparency" + m_long_description: "make the openhd parameters window semi-transparent" + + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.screen_settings_openhd_parameters_transparent + onCheckedChanged: settings.screen_settings_openhd_parameters_transparent = checked + } + } + SettingBaseElement{ + m_short_description: "Font DPI" + m_long_description: "Scale the text / line size of the artifical horizon / ladders, requires restart of QOpenHD." + ComboBox { + height: elementHeight + anchors.right: parent.right + anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizonatalCenter + width: 320 + model: ListModel { + ListElement { text: qsTr("-1 Disable") ; value: -1 } + ListElement { text: qsTr("0 Auto (Recommended)") ; value: 0 } + ListElement { text: qsTr("50 (ultra small)") ; value: 50 } + ListElement { text: qsTr("72 (smaller)") ; value: 72 } + ListElement { text: qsTr("100") ; value: 100 } + ListElement { text: qsTr("120 (bigger)") ; value: 120 } + ListElement { text: qsTr("150 (ultra big)") ; value: 150 } + } + textRole: "text" + Component.onCompleted: { + for (var i = 0; i < model.count; i++) { + var choice = model.get(i); + if (choice.value == settings.screen_custom_font_dpi) { + currentIndex = i; + } + } + } + onActivated:{ + const value_fdpi = model.get(currentIndex).value + if(settings.screen_custom_font_dpi != value_fdpi){ + console.log("font dpi changed from :"+settings.screen_custom_font_dpi+" to:"+value_fdpi); + _restartqopenhdmessagebox.show(); + settings.screen_custom_font_dpi = value_fdpi + } - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.screen_settings_openhd_parameters_transparent - onCheckedChanged: settings.screen_settings_openhd_parameters_transparent = checked + } + } } } - } } } diff --git a/qml/ui/configpopup/qopenhd_settings/AppVideoSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppVideoSettingsView.qml index 740d53d1b..25719b014 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppVideoSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppVideoSettingsView.qml @@ -36,33 +36,9 @@ ScrollView { } SettingBaseElement{ - m_short_description: "Video codec primary" - m_long_description: "Video codec of primary stream (main video). Automatically fetched from OpenHD." - ComboBox { - id: selectVideoCodecPrimary - width: 320 - height: elementHeight - anchors.right: parent.right - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizonatalCenter - model: itemsVideoCodec - Component.onCompleted: { - // out of bounds checking - if(settings.qopenhd_primary_video_codec>2 || settings.qopenhd_primary_video_codec<0){ - settings.qopenhd_primary_video_codec=0; - } - currentIndex = settings.qopenhd_primary_video_codec; - } - onCurrentIndexChanged:{ - console.debug("VideoCodec:"+itemsVideoCodec.get(currentIndex).text + ", "+currentIndex) - settings.qopenhd_primary_video_codec=currentIndex; - } - } - } - SettingBaseElement{ - m_short_description: "Primary video force SW" - m_long_description: "Force SW decode for primary video stream (unless it already defaulted to sw decode). Can fix bug(s) in rare hardware incompability cases." + m_short_description: "Scale primary video to fit" + m_long_description: "Fit the primary video to the exact screen size (discards actual video aspect ratio,aka video is a bit distorted). Not supported on all platforms / implementations. Might require a restart." + Switch { width: 32 height: elementHeight @@ -70,301 +46,331 @@ ScrollView { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - checked: settings.qopenhd_primary_video_force_sw - onCheckedChanged: settings.qopenhd_primary_video_force_sw = checked - } - } - SettingBaseElement{ - m_short_description: "Primary video udp in port" - m_long_description: "UDP port where qopenhd listens for video data for the primary video stream" - SpinBox { - height: elementHeight - width: 210 - font.pixelSize: 14 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - from: 1 - to: 6900 - stepSize: 1 - editable: true - anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 - value: settings.qopenhd_primary_video_rtp_input_port - onValueChanged: settings.qopenhd_primary_video_rtp_input_port = value + checked: settings.primary_video_scale_to_fit + onCheckedChanged: settings.primary_video_scale_to_fit = checked + enabled: _qopenhd.is_linux() && (!_qopenhd.is_android() && !_qopenhd.is_platform_rock() && !_qopenhd.is_platform_rpi()) } } - SettingBaseElement{ - m_short_description: "Video codec secondary" - m_long_description: "Video codec of secondary stream (pip video). Automatically fetched from OpenHD." - // only show to dualcam users - visible: settings.dev_qopenhd_n_cameras==2 - ComboBox { - id: selectVideoCodecSecondary - width: 320 - height: elementHeight - anchors.right: parent.right - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizonatalCenter - model: itemsVideoCodec - Component.onCompleted: { - // out of bounds checking - if(settings.qopenhd_secondary_video_codec >2 || settings.qopenhd_secondary_video_codec<0){ - settings.qopenhd_secondary_video_codec=0; + + SettingsCategory{ + m_description: "DEVELOPER ONLY" + m_hide_elements: true + + SettingBaseElement{ + m_short_description: "Video codec primary" + m_long_description: "Video codec of primary stream (main video). Automatically fetched from OpenHD." + ComboBox { + id: selectVideoCodecPrimary + width: 320 + height: elementHeight + anchors.right: parent.right + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizonatalCenter + model: itemsVideoCodec + Component.onCompleted: { + // out of bounds checking + if(settings.qopenhd_primary_video_codec>2 || settings.qopenhd_primary_video_codec<0){ + settings.qopenhd_primary_video_codec=0; + } + currentIndex = settings.qopenhd_primary_video_codec; + } + onCurrentIndexChanged:{ + console.debug("VideoCodec:"+itemsVideoCodec.get(currentIndex).text + ", "+currentIndex) + settings.qopenhd_primary_video_codec=currentIndex; } - currentIndex = settings.qopenhd_secondary_video_codec; - } - onCurrentIndexChanged:{ - console.debug("VideoCodec:"+itemsVideoCodec.get(currentIndex).text + ", "+currentIndex) - settings.qopenhd_secondary_video_codec=currentIndex; } } - } - - SettingBaseElement{ - m_short_description: "Secondary video force SW" - m_long_description: "Force SW decode for secondary video stream (unless it already defaulted to sw decode). Can fix bug(s) in rare hardware incompability cases." - // only show to dualcam users - visible: settings.dev_qopenhd_n_cameras==2 - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + SettingBaseElement{ + m_short_description: "Primary video force SW" + m_long_description: "Force SW decode for primary video stream (unless it already defaulted to sw decode). Can fix bug(s) in rare hardware incompability cases." + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.qopenhd_secondary_video_force_sw - onCheckedChanged: settings.qopenhd_secondary_video_force_sw = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.qopenhd_primary_video_force_sw + onCheckedChanged: settings.qopenhd_primary_video_force_sw = checked + } } - } - SettingBaseElement{ - m_short_description: "Secondary video udp in port" - m_long_description: "UDP port where qopenhd listens for video data for the secondary video stream" - visible: settings.dev_qopenhd_n_cameras==2 - SpinBox { - height: elementHeight - width: 210 - font.pixelSize: 14 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - from: 1 - to: 6900 - stepSize: 1 - editable: true - anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 - value: settings.qopenhd_secondary_video_rtp_input_port - onValueChanged: settings.qopenhd_secondary_video_rtp_input_port = value + SettingBaseElement{ + m_short_description: "Primary video udp in port" + m_long_description: "UDP port where qopenhd listens for video data for the primary video stream" + SpinBox { + height: elementHeight + width: 210 + font.pixelSize: 14 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + from: 1 + to: 6900 + stepSize: 1 + editable: true + anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 + value: settings.qopenhd_primary_video_rtp_input_port + onValueChanged: settings.qopenhd_primary_video_rtp_input_port = value + } } - } - - SettingBaseElement{ - m_short_description: "Scale primary video to fit" - m_long_description: "Fit the primary video to the exact screen size (discards actual video aspect ratio,aka video is a bit distorted). Not supported on all platforms / implementations. Might require a restart." - - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.primary_video_scale_to_fit - onCheckedChanged: settings.primary_video_scale_to_fit = checked + SettingBaseElement{ + m_short_description: "Video codec secondary" + m_long_description: "Video codec of secondary stream (pip video). Automatically fetched from OpenHD." + // only show to dualcam users + visible: settings.dev_qopenhd_n_cameras==2 + ComboBox { + id: selectVideoCodecSecondary + width: 320 + height: elementHeight + anchors.right: parent.right + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizonatalCenter + model: itemsVideoCodec + Component.onCompleted: { + // out of bounds checking + if(settings.qopenhd_secondary_video_codec >2 || settings.qopenhd_secondary_video_codec<0){ + settings.qopenhd_secondary_video_codec=0; + } + currentIndex = settings.qopenhd_secondary_video_codec; + } + onCurrentIndexChanged:{ + console.debug("VideoCodec:"+itemsVideoCodec.get(currentIndex).text + ", "+currentIndex) + settings.qopenhd_secondary_video_codec=currentIndex; + } + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + SettingBaseElement{ + m_short_description: "Secondary video force SW" + m_long_description: "Force SW decode for secondary video stream (unless it already defaulted to sw decode). Can fix bug(s) in rare hardware incompability cases." + // only show to dualcam users + visible: settings.dev_qopenhd_n_cameras==2 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - Text { - text: qsTr("DEV_TEST_VIDEO_MODE") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.qopenhd_secondary_video_force_sw + onCheckedChanged: settings.qopenhd_secondary_video_force_sw = checked + } } - ComboBox { - width: 320 - height: elementHeight - anchors.right: parent.right - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizonatalCenter - model: ListModel { - ListElement { text: "DISABLE"; } - ListElement { text: "RAW_VIDEO"; } - ListElement { text: "RAW_DECODE_ENCODE"; } - } - Component.onCompleted: { - // out of bounds checking - if(settings.dev_test_video_mode>2 || settings.dev_test_video_mode<0){ - settings.dev_test_video_mode=0; - } - currentIndex = settings.dev_test_video_mode; - } - onCurrentIndexChanged:{ - //console.debug("Dev video testing::"+model.get(currentIndex).text + ", "+currentIndex) - settings.dev_test_video_mode=currentIndex; - } + SettingBaseElement{ + m_short_description: "Secondary video udp in port" + m_long_description: "UDP port where qopenhd listens for video data for the secondary video stream" + visible: settings.dev_qopenhd_n_cameras==2 + SpinBox { + height: elementHeight + width: 210 + font.pixelSize: 14 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + from: 1 + to: 6900 + stepSize: 1 + editable: true + anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 + value: settings.qopenhd_secondary_video_rtp_input_port + onValueChanged: settings.qopenhd_secondary_video_rtp_input_port = value + } } - } - // temporary - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - Text { - text: qsTr("dev_limit_fps_on_test_file") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - SpinBox { - id: dev_limit_fps_on_test_fileSpinBox - height: elementHeight - width: 210 - font.pixelSize: 14 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - from: -1 - to: 240 - stepSize: 1 - editable: true - anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 - value: settings.dev_limit_fps_on_test_file - onValueChanged: settings.dev_limit_fps_on_test_file = value + Text { + text: qsTr("DEV_TEST_VIDEO_MODE") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } + ComboBox { + width: 320 + height: elementHeight + anchors.right: parent.right + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizonatalCenter + model: ListModel { + ListElement { text: "DISABLE"; } + ListElement { text: "RAW_VIDEO"; } + ListElement { text: "RAW_DECODE_ENCODE"; } + } + Component.onCompleted: { + // out of bounds checking + if(settings.dev_test_video_mode>2 || settings.dev_test_video_mode<0){ + settings.dev_test_video_mode=0; + } + currentIndex = settings.dev_test_video_mode; + } + onCurrentIndexChanged:{ + //console.debug("Dev video testing::"+model.get(currentIndex).text + ", "+currentIndex) + settings.dev_test_video_mode=currentIndex; + } + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + // temporary + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - Text { - text: qsTr("dev_draw_alternating_rgb_dummy_frames") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.dev_draw_alternating_rgb_dummy_frames - onCheckedChanged: settings.dev_draw_alternating_rgb_dummy_frames = checked - } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + Text { + text: qsTr("dev_limit_fps_on_test_file") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Text { - text: qsTr("dev_use_low_latency_parser_when_possible") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + SpinBox { + id: dev_limit_fps_on_test_fileSpinBox + height: elementHeight + width: 210 + font.pixelSize: 14 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + from: -1 + to: 240 + stepSize: 1 + editable: true + anchors.rightMargin: Qt.inputMethod.visible ? 78 : 18 + value: settings.dev_limit_fps_on_test_file + onValueChanged: settings.dev_limit_fps_on_test_file = value + } } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.dev_use_low_latency_parser_when_possible - onCheckedChanged: settings.dev_use_low_latency_parser_when_possible = checked + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("dev_draw_alternating_rgb_dummy_frames") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.dev_draw_alternating_rgb_dummy_frames + onCheckedChanged: settings.dev_draw_alternating_rgb_dummy_frames = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - Text { - text: qsTr("dev_feed_incomplete_frames_to_decoder") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + Text { + text: qsTr("dev_use_low_latency_parser_when_possible") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.dev_use_low_latency_parser_when_possible + onCheckedChanged: settings.dev_use_low_latency_parser_when_possible = checked + } } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.dev_feed_incomplete_frames_to_decoder - onCheckedChanged: settings.dev_feed_incomplete_frames_to_decoder = checked + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("dev_feed_incomplete_frames_to_decoder") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.dev_feed_incomplete_frames_to_decoder + onCheckedChanged: settings.dev_feed_incomplete_frames_to_decoder = checked + } } - } - // dirty - SettingBaseElement{ - m_short_description: "dev_rpi_use_external_omx_decode_service" - //m_long_description: "On by default, RPI specific." - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.dev_rpi_use_external_omx_decode_service - onCheckedChanged: settings.dev_rpi_use_external_omx_decode_service = checked + // dirty + SettingBaseElement{ + m_short_description: "dev_rpi_use_external_omx_decode_service" + //m_long_description: "On by default, RPI specific." + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.dev_rpi_use_external_omx_decode_service + onCheckedChanged: settings.dev_rpi_use_external_omx_decode_service = checked + } } - } - SettingBaseElement{ - m_short_description: "dev_always_use_generic_external_decode_service" - //m_long_description: "Video decode is not done via QOpenHD, but rather in an extra service (started and stopped by QOpenHD). For platforms other than rpi" - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.dev_always_use_generic_external_decode_service - onCheckedChanged: settings.dev_always_use_generic_external_decode_service = checked + SettingBaseElement{ + m_short_description: "dev_always_use_generic_external_decode_service" + //m_long_description: "Video decode is not done via QOpenHD, but rather in an extra service (started and stopped by QOpenHD). For platforms other than rpi" + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.dev_always_use_generic_external_decode_service + onCheckedChanged: settings.dev_always_use_generic_external_decode_service = checked + } } - } - SettingBaseElement{ - m_short_description: "Switch primary / secondary video" - m_long_description: "Show secondary video in main video window & primary video in pip window (if the platform supports pip)" - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.qopenhd_switch_primary_secondary - onCheckedChanged: settings.qopenhd_switch_primary_secondary = checked + SettingBaseElement{ + m_short_description: "Switch primary / secondary video" + m_long_description: "Show secondary video in main video window & primary video in pip window (if the platform supports pip)" + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.qopenhd_switch_primary_secondary + onCheckedChanged: settings.qopenhd_switch_primary_secondary = checked + } } } } diff --git a/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml index 3db130e67..2e6b2538d 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml @@ -21,1257 +21,1257 @@ ScrollView { Item { anchors.fill: parent - Column { id: widgetColumn spacing: 0 anchors.left: parent.left anchors.right: parent.right - SettingsHeaderElement{ + SettingsCategory{ m_description: "OHD LINK / STREAMING WIDGETS" - } - SettingBaseElement{ - m_short_description: "Show Downlink RSSI" - m_long_description: "RSSI / Stats about downlink" - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_downlink_rssi - onCheckedChanged: settings.show_downlink_rssi = checked + SettingBaseElement{ + m_short_description: "Show Downlink RSSI" + m_long_description: "RSSI / Stats about downlink" + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_downlink_rssi + onCheckedChanged: settings.show_downlink_rssi = checked + } } - } - SettingBaseElement{ - m_short_description: "Show Uplink RSSI" - m_long_description: "RSSI / Stats about uplink" - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_uplink_rssi - onCheckedChanged: settings.show_uplink_rssi = checked + SettingBaseElement{ + m_short_description: "Show Uplink RSSI" + m_long_description: "RSSI / Stats about uplink" + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_uplink_rssi + onCheckedChanged: settings.show_uplink_rssi = checked + } } - } - SettingBaseElement{ - m_short_description: "Show live rate control widget" - m_long_description: "Trade range / stability for bitrate at run time. Requires hw support." - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.wb_link_rate_control_widget_show - onCheckedChanged: settings.wb_link_rate_control_widget_show = checked + SettingBaseElement{ + m_short_description: "Show live rate control widget" + m_long_description: "Trade range / stability for bitrate at run time. Requires hw support." + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.wb_link_rate_control_widget_show + onCheckedChanged: settings.wb_link_rate_control_widget_show = checked + } } - } - SettingBaseElement{ - m_short_description: "Show video widget" - m_long_description: "More stats about each camera stream, quick resolution changes and quick air recording." - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_bitrate - onCheckedChanged: settings.show_bitrate = checked + SettingBaseElement{ + m_short_description: "Show video widget" + m_long_description: "More stats about each camera stream, quick resolution changes and quick air recording." + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_bitrate + onCheckedChanged: settings.show_bitrate = checked + } } - } - // Dummy for positioner index - //Item{ - //} - SettingsHeaderElement{ - m_description: "UAV (FC) WIDGETS" } + SettingsCategory{ + m_description: "UAV (FC) WIDGETS" - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show GPS") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_gps - onCheckedChanged: settings.show_gps = checked - } - } + Text { + text: qsTr("Show GPS") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } + + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Home Distance") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_gps + onCheckedChanged: settings.show_gps = checked + } } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Home Distance") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_home_distance - onCheckedChanged: settings.show_home_distance = checked - } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show RC RSSI (not OpenHD RC)") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_home_distance + onCheckedChanged: settings.show_home_distance = checked + } } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show RC RSSI (not OpenHD RC)") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_rc_rssi - onCheckedChanged: settings.show_rc_rssi = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_rc_rssi + onCheckedChanged: settings.show_rc_rssi = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Flight Timer") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Flight Timer") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_flight_time - onCheckedChanged: settings.show_flight_time = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_flight_time + onCheckedChanged: settings.show_flight_time = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Flight Mode") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Flight Mode") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_flight_mode - onCheckedChanged: settings.show_flight_mode = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_flight_mode + onCheckedChanged: settings.show_flight_mode = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show IMU Sensor Temperature") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show IMU Sensor Temperature") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_imu_temp - onCheckedChanged: settings.show_imu_temp = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_imu_temp + onCheckedChanged: settings.show_imu_temp = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Pressure Sensor Temperature") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Pressure Sensor Temperature") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_press_temp - onCheckedChanged: settings.show_press_temp = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_press_temp + onCheckedChanged: settings.show_press_temp = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Airspeed Sensor Temperature") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Airspeed Sensor Temperature") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_airspeed_temp - onCheckedChanged: settings.show_airspeed_temp = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_airspeed_temp + onCheckedChanged: settings.show_airspeed_temp = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Esc Temperature") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Esc Temperature") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_esc_temp - onCheckedChanged: settings.show_esc_temp = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_esc_temp + onCheckedChanged: settings.show_esc_temp = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Ground Status") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Ground Status") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_ground_status - onCheckedChanged: settings.show_ground_status = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_ground_status + onCheckedChanged: settings.show_ground_status = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Ground Battery") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Ground Battery") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_ground_battery - onCheckedChanged: settings.show_ground_battery = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_ground_battery + onCheckedChanged: settings.show_ground_battery = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Air Status") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Air Status") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_air_status - onCheckedChanged: settings.show_air_status = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_air_status + onCheckedChanged: settings.show_air_status = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Air Battery") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Air Battery") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_air_battery - onCheckedChanged: settings.show_air_battery = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_air_battery + onCheckedChanged: settings.show_air_battery = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show mAh") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show mAh") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_flight_mah - onCheckedChanged: settings.show_flight_mah = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_flight_mah + onCheckedChanged: settings.show_flight_mah = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Efficiency in mAh/km") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Efficiency in mAh/km") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_flight_mah_km - onCheckedChanged: settings.show_flight_mah_km = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_flight_mah_km + onCheckedChanged: settings.show_flight_mah_km = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Total Flight Distance") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Total Flight Distance") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_flight_distance - onCheckedChanged: settings.show_flight_distance = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_flight_distance + onCheckedChanged: settings.show_flight_distance = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Horizon") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Horizon") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_horizon - onCheckedChanged: settings.show_horizon = checked - } - } - // Exp - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show performance horizon") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_horizon + onCheckedChanged: settings.show_horizon = checked + } } + // Exp + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show performance horizon") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_performance_horizon - onCheckedChanged: settings.show_performance_horizon = checked - } - } - // Exp end - - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Flight Path Vector") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_performance_horizon + onCheckedChanged: settings.show_performance_horizon = checked + } } + // Exp end + + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Flight Path Vector") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_flight_path_vector - onCheckedChanged: settings.show_flight_path_vector = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_flight_path_vector + onCheckedChanged: settings.show_flight_path_vector = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Altitude") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Altitude") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.altitude_ladder_show - onCheckedChanged: settings.altitude_ladder_show = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.altitude_ladder_show + onCheckedChanged: settings.altitude_ladder_show = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Speed") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Speed") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.speed_ladder_show - onCheckedChanged: settings.speed_ladder_show = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.speed_ladder_show + onCheckedChanged: settings.speed_ladder_show = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Second Speed") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Second Speed") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_speed_second - onCheckedChanged: settings.show_speed_second = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_speed_second + onCheckedChanged: settings.show_speed_second = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Heading") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Heading") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_heading - onCheckedChanged: settings.show_heading = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_heading + onCheckedChanged: settings.show_heading = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Second Altitude") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Second Altitude") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_altitude_second - onCheckedChanged: settings.show_altitude_second = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_altitude_second + onCheckedChanged: settings.show_altitude_second = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Bank Angle Indicator") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Bank Angle Indicator") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.bank_angle_indicator_widget_show - onCheckedChanged: settings.bank_angle_indicator_widget_show = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.bank_angle_indicator_widget_show + onCheckedChanged: settings.bank_angle_indicator_widget_show = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Home Arrow") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Home Arrow") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_arrow - onCheckedChanged: settings.show_arrow = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_arrow + onCheckedChanged: settings.show_arrow = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Throttle") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Throttle") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_throttle - onCheckedChanged: settings.show_throttle = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_throttle + onCheckedChanged: settings.show_throttle = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Control Inputs") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Control Inputs") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_control - onCheckedChanged: settings.show_control = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_control + onCheckedChanged: settings.show_control = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - Text { - text: qsTr("Show Vibration") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Text { + text: qsTr("Show Vibration") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_vibration - onCheckedChanged: settings.show_vibration = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_vibration + onCheckedChanged: settings.show_vibration = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Vertical Speed (minimal)") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Vertical Speed (minimal)") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_vertical_speed_simple_widget - onCheckedChanged: settings.show_vertical_speed_simple_widget = checked - } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Vertical Speed Gauge") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_vertical_speed_simple_widget + onCheckedChanged: settings.show_vertical_speed_simple_widget = checked + } } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Vertical Speed Gauge") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_vertical_speed_gauge_widget - onCheckedChanged: settings.show_vertical_speed_gauge_widget = checked - } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Wind (Experimental)") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_vertical_speed_gauge_widget + onCheckedChanged: settings.show_vertical_speed_gauge_widget = checked + } } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Wind (Experimental)") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_wind - onCheckedChanged: settings.show_wind = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_wind + onCheckedChanged: settings.show_wind = checked + } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Missions") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Missions") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_mission - onCheckedChanged: { - settings.show_mission = checked; + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_mission + onCheckedChanged: { + settings.show_mission = checked; + } } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Angle of Attack") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Angle of Attack") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_aoa - onCheckedChanged: { - settings.show_aoa = checked; + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_aoa + onCheckedChanged: { + settings.show_aoa = checked; + } } } - } - SettingBaseElement{ - m_short_description: "Show distance sensor widget" - m_long_description: "For UAVs with a distance sensor" - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + SettingBaseElement{ + m_short_description: "Show distance sensor widget" + m_long_description: "For UAVs with a distance sensor" + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_distance_sensor_widget - onCheckedChanged: settings.show_distance_sensor_widget = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_distance_sensor_widget + onCheckedChanged: settings.show_distance_sensor_widget = checked + } } - } - SettingBaseElement{ - m_short_description: "Show (GPS) time widget" - m_long_description: "For UAVs with GPS, shows the time as reported by the UAV" - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_time_widget - onCheckedChanged: settings.show_time_widget = checked + SettingBaseElement{ + m_short_description: "Show (GPS) time widget" + m_long_description: "For UAVs with GPS, shows the time as reported by the UAV" + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_time_widget + onCheckedChanged: settings.show_time_widget = checked + } } } - SettingsHeaderElement{ + SettingsCategory { m_description: "OTHER" - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show Map") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_map - onCheckedChanged: { - // Weird qt specifcs, see https://stackoverflow.com/questions/56817460/qml-appswitch-sending-oncheckedchanged-signal-each-time-page-is-opened - if(settings.show_map != checked){ - settings.show_map = checked; - _restartqopenhdmessagebox.show(); + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Map") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } + + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_map + onCheckedChanged: { + // Weird qt specifcs, see https://stackoverflow.com/questions/56817460/qml-appswitch-sending-oncheckedchanged-signal-each-time-page-is-opened + if(settings.show_map != checked){ + settings.show_map = checked; + _restartqopenhdmessagebox.show(); + } + //settings.show_map = checked } - //settings.show_map = checked } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show log messages on-screen") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show log messages on-screen") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_message_hud - onCheckedChanged: settings.show_message_hud = checked - } - } - Rectangle { - 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 - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_message_hud + onCheckedChanged: settings.show_message_hud = checked + } } + Rectangle { + 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 + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_sidebar - onCheckedChanged: settings.show_sidebar = checked - } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - - Text { - text: qsTr("Show QT Render stats") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_sidebar + onCheckedChanged: settings.show_sidebar = checked + } } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show QT Render stats") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.qrenderstats_show - onCheckedChanged: { - settings.qrenderstats_show = checked; + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.qrenderstats_show + onCheckedChanged: { + settings.qrenderstats_show = checked; + } } } - } - Rectangle { - width: parent.width - height: rowHeight - color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" - enabled: false // Not yet functional - - Text { - text: qsTr("Show GPIO") - font.weight: Font.Bold - font.pixelSize: 13 - anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - anchors.verticalCenter: parent.verticalCenter - width: 224 - height: elementHeight - anchors.left: parent.left - } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + enabled: false // Not yet functional + + Text { + text: qsTr("Show GPIO") + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + width: 224 + height: elementHeight + anchors.left: parent.left + } - Switch { - width: 32 - height: elementHeight - anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 + Switch { + width: 32 + height: elementHeight + anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - checked: settings.show_gpio - onCheckedChanged: settings.show_gpio = checked + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_gpio + onCheckedChanged: settings.show_gpio = checked + } } } } + } } + diff --git a/qml/ui/elements/SettingBaseElement.qml b/qml/ui/elements/SettingBaseElement.qml index 6e9ed38e8..23fe9ff56 100644 --- a/qml/ui/elements/SettingBaseElement.qml +++ b/qml/ui/elements/SettingBaseElement.qml @@ -38,6 +38,7 @@ Rectangle { return m_long_description !== "none" } + Text { id: description text: qsTr(m_short_description) diff --git a/qml/ui/elements/SettingsCategory.qml b/qml/ui/elements/SettingsCategory.qml new file mode 100644 index 000000000..fd4b08a43 --- /dev/null +++ b/qml/ui/elements/SettingsCategory.qml @@ -0,0 +1,75 @@ +import QtQuick 2.0 + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Dialogs 1.0 +import QtQuick.Controls.Material 2.12 + +Column { + id: category_column + spacing: 0 + anchors.left: parent.left + anchors.right: parent.right + + property string m_description: "FILL ME" + + property bool m_hide_elements: false + + + function change_children_visibility(){ + // 1st item is the headline itself + for (var i = 1; i < category_column.children.length; i++){ + //console.log("item "+i); + //console.log(category_column.children[i].propname); + if(m_hide_elements){ + category_column.children[i].visible=false; + }else{ + category_column.children[i].visible=true; + } + } + } + + Component.onCompleted: { + change_children_visibility() + } + + Rectangle { + width: parent.width + height: rowHeight*2 / 3; + //color: "green" + //color: "#8cbfd7f3" + color: "#8cbfd7f3" + + + Text { + id: description + text: qsTr(m_description) + font.weight: Font.Bold + font.pixelSize: 13 + anchors.leftMargin: 8 + anchors.rightMargin: 8 + anchors.fill: parent + + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + + } + MouseArea{ + anchors.fill: description + onClicked: { + m_hide_elements=!m_hide_elements + change_children_visibility() + } + } + Rectangle{ + width: parent.width + height: 2 + color: "black" + anchors.bottom: parent.bottom + anchors.left: parent.left + } + } + + +} + From f3de61a3b8c580a720994447bb7b37cd5dc2cea9 Mon Sep 17 00:00:00 2001 From: pilotnbr1 Date: Thu, 7 Dec 2023 19:06:54 -0500 Subject: [PATCH 5/7] Fix for FC reboot/shutdown --- app/telemetry/action/create_cmd_helper.hpp | 4 ++-- qml/ui/configpopup/status/StatusCardsColumn.qml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/telemetry/action/create_cmd_helper.hpp b/app/telemetry/action/create_cmd_helper.hpp index b383a45df..cc3ae2b0f 100644 --- a/app/telemetry/action/create_cmd_helper.hpp +++ b/app/telemetry/action/create_cmd_helper.hpp @@ -11,8 +11,8 @@ static mavlink_command_long_t create_cmd_reboot(int target_sysid,int target_comp cmd.target_system=target_sysid; cmd.target_component=target_compid; cmd.command=MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN; - cmd.param1=0; - cmd.param2=(reboot ? 1 : 2); + cmd.param1=(reboot ? 1 : 2); + //cmd.param2=(reboot ? 1 : 2); return cmd; } diff --git a/qml/ui/configpopup/status/StatusCardsColumn.qml b/qml/ui/configpopup/status/StatusCardsColumn.qml index 9768c5c75..90d9e5338 100644 --- a/qml/ui/configpopup/status/StatusCardsColumn.qml +++ b/qml/ui/configpopup/status/StatusCardsColumn.qml @@ -71,7 +71,7 @@ Row{ hasFooter: true cardFooter: FooterRebootShutdownWarning{ - m_supports_reboot_actions: false + m_supports_reboot_actions: true m_type: 2 } } From 102367382aff146e8befd1c7df9b730cf51bce1f Mon Sep 17 00:00:00 2001 From: consti10 Date: Fri, 8 Dec 2023 09:28:12 +0100 Subject: [PATCH 6/7] separate reboot / shutdown command openhd / fc --- app/telemetry/action/create_cmd_helper.hpp | 11 ++++++++--- app/telemetry/action/fcaction.cpp | 2 +- app/telemetry/action/ohdaction.cpp | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/telemetry/action/create_cmd_helper.hpp b/app/telemetry/action/create_cmd_helper.hpp index cc3ae2b0f..136c3d011 100644 --- a/app/telemetry/action/create_cmd_helper.hpp +++ b/app/telemetry/action/create_cmd_helper.hpp @@ -6,13 +6,18 @@ // Here we have various util methods to create mavlink_command_long_t commands namespace cmd::helper{ -static mavlink_command_long_t create_cmd_reboot(int target_sysid,int target_compid,bool reboot){ +// @Param: companion_computer: If set to true the message generated is for openhd +// otherwise,it is for the FC +static mavlink_command_long_t create_cmd_reboot(int target_sysid,int target_compid,bool reboot,bool companion_computer){ mavlink_command_long_t cmd{}; cmd.target_system=target_sysid; cmd.target_component=target_compid; cmd.command=MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN; - cmd.param1=(reboot ? 1 : 2); - //cmd.param2=(reboot ? 1 : 2); + if(companion_computer){ + cmd.param2=(reboot ? 1 : 2); + }else{ + cmd.param1=(reboot ? 1 : 2); + } return cmd; } diff --git a/app/telemetry/action/fcaction.cpp b/app/telemetry/action/fcaction.cpp index 140878d87..37c478314 100644 --- a/app/telemetry/action/fcaction.cpp +++ b/app/telemetry/action/fcaction.cpp @@ -177,7 +177,7 @@ void FCAction::request_home_position_from_fc() bool FCAction::send_command_reboot(bool reboot) { const auto fc_id=MavlinkTelemetry::instance().get_fc_mav_id(); - auto command=cmd::helper::create_cmd_reboot(fc_id.sys_id,fc_id.comp_id,reboot); + auto command=cmd::helper::create_cmd_reboot(fc_id.sys_id,fc_id.comp_id,reboot,false); const auto res=CmdSender::instance().send_command_long_blocking(command); return res==CmdSender::Result::CMD_SUCCESS; } diff --git a/app/telemetry/action/ohdaction.cpp b/app/telemetry/action/ohdaction.cpp index 15a279415..44042545d 100644 --- a/app/telemetry/action/ohdaction.cpp +++ b/app/telemetry/action/ohdaction.cpp @@ -20,14 +20,14 @@ OHDAction& OHDAction::instance() bool OHDAction::send_command_reboot_air(bool reboot) { - auto command=cmd::helper::create_cmd_reboot(OHD_SYS_ID_AIR,MAV_COMP_ID_ONBOARD_COMPUTER,reboot); + auto command=cmd::helper::create_cmd_reboot(OHD_SYS_ID_AIR,MAV_COMP_ID_ONBOARD_COMPUTER,reboot,true); const auto res=CmdSender::instance().send_command_long_blocking(command); return res==CmdSender::Result::CMD_SUCCESS; } bool OHDAction::send_command_reboot_gnd(bool reboot) { - auto command=cmd::helper::create_cmd_reboot(OHD_SYS_ID_GROUND,MAV_COMP_ID_ONBOARD_COMPUTER,reboot); + auto command=cmd::helper::create_cmd_reboot(OHD_SYS_ID_GROUND,MAV_COMP_ID_ONBOARD_COMPUTER,reboot,true); const auto res=CmdSender::instance().send_command_long_blocking(command); return res==CmdSender::Result::CMD_SUCCESS; } From 1a12fc1e95e574e822ed2a9e90ddea31dd1a50d0 Mon Sep 17 00:00:00 2001 From: consti10 Date: Fri, 8 Dec 2023 10:15:44 +0100 Subject: [PATCH 7/7] new version code 2.5.3-evo-release --- app/util/qopenhd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/util/qopenhd.h b/app/util/qopenhd.h index 85d3297ea..c03365185 100644 --- a/app/util/qopenhd.h +++ b/app/util/qopenhd.h @@ -67,7 +67,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.2-evo-beta"); + L_RO_PROP(QString,version_string,set_version_string,"2.5.3-evo-release"); public: L_RO_PROP(QString,toast_text,set_toast_text,"NONE"); L_RO_PROP(bool,toast_visible,set_toast_visible,false);