From d333c4cad762222150193ae00b578ca7c2fb8e00 Mon Sep 17 00:00:00 2001 From: Consti10 Date: Tue, 23 Apr 2024 18:25:10 +0200 Subject: [PATCH] finally the popup works again --- app/telemetry/models/aohdsystem.cpp | 2 +- app/telemetry/models/aohdsystem.h | 2 +- .../openhd_settings/PopupTxPowerEditor.qml | 2 +- qml/ui/widgets/X20OverheatWidget.qml | 29 ++++++++++--------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/app/telemetry/models/aohdsystem.cpp b/app/telemetry/models/aohdsystem.cpp index 648a90003..f72471b25 100644 --- a/app/telemetry/models/aohdsystem.cpp +++ b/app/telemetry/models/aohdsystem.cpp @@ -429,7 +429,7 @@ void AOHDSystem::process_x3(const mavlink_openhd_stats_wb_video_air_t &msg){ set_tx_is_currently_dropping_packets(false); } } - set_video_disabled_due_to_overheating(msg.dummy0); + set_thermal_protection_level(msg.dummy0); } void AOHDSystem::process_x3b(const mavlink_openhd_stats_wb_video_air_fec_performance_t &msg) diff --git a/app/telemetry/models/aohdsystem.h b/app/telemetry/models/aohdsystem.h index f40c7f73c..f479c98fa 100644 --- a/app/telemetry/models/aohdsystem.h +++ b/app/telemetry/models/aohdsystem.h @@ -126,7 +126,7 @@ class AOHDSystem : public QObject // L_RO_PROP(bool,dirty_air_has_secondary_cam,set_dirty_air_has_secondary_cam,false) // x20 only right now - L_RO_PROP(int,video_disabled_due_to_overheating,set_video_disabled_due_to_overheating,-1) + L_RO_PROP(int,thermal_protection_level,set_thermal_protection_level,-1) public: Q_INVOKABLE QString get_rate_for_mcs_bw(int mcs,int bw); private: diff --git a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml index 6f8294169..818e84c26 100644 --- a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml +++ b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml @@ -62,7 +62,7 @@ PopupBigGeneric{ } // The user has to enter the card type every time - otherwise, we have issues with air and ground if(m_user_selected_card_manufacturer>=1){ - comboBoxCardSelectManufacturer.currentIndex=m_user_selected_card_manufacturer-1; + comboBoxCardSelectManufacturer.currentIndex=m_user_selected_card_manufacturer+1; }else{ comboBoxCardSelectManufacturer.currentIndex=0; } diff --git a/qml/ui/widgets/X20OverheatWidget.qml b/qml/ui/widgets/X20OverheatWidget.qml index 3b369da01..55f9f286e 100644 --- a/qml/ui/widgets/X20OverheatWidget.qml +++ b/qml/ui/widgets/X20OverheatWidget.qml @@ -5,27 +5,27 @@ Item { anchors.bottom: parent.bottom anchors.bottomMargin: 120 anchors.rightMargin: 20 - width: 100 - height: 30 + width: 150 + height: 50 - // 0 - all okay - // 1 - warning, soon overheating - // 2 - error, overheating protection on (Video disabled) property int m_x20_state: { - //return 1; + //return 2; if(_ohdSystemAir.ohd_platform_type!=30){ // only on x20 return 0; } - if(_ohdSystemAir.video_disabled_due_to_overheating<0){ + if(_ohdSystemAir.thermal_protection_level<0){ return 0; // Unknown } - if(_ohdSystemAir.video_disabled_due_to_overheating==1){ - return 2; - } - if(_ohdSystemAir.curr_soc_temp_degree>=71){ + if(_ohdSystemAir.thermal_protection_level==1){ return 1; } + if(_ohdSystemAir.thermal_protection_level==2){ + return 2; + } + //if(_ohdSystemAir.curr_soc_temp_degree>=71){ + // return 1; + //} return 0; } @@ -43,16 +43,17 @@ Item { visible: m_x20_state>0; anchors.fill: parent text: { + // "\uf2c7"+" \uf46a"+" !" "\uf4e2" if(m_x20_state==0)return ""; - if(m_x20_state==1)return "\uf2c7"+" \uf46a"+" !" - return "\uf2c7"+" \uf46a"+" \uf4e2" + if(m_x20_state==1)return "\uf2c7-VIDEO REDUCED"; + return "\uf2c7-VIDEO DISABLED"; } color: { if(m_x20_state==1)return "orange"; if(m_x20_state==2)return "red"; return "white"; } - font.pixelSize: 16 + font.pixelSize: 18 font.family: "Font Awesome 5 Free" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter