Skip to content

Commit

Permalink
finally the popup works again
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Apr 23, 2024
1 parent 5954749 commit d333c4c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/telemetry/models/aohdsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/telemetry/models/aohdsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
29 changes: 15 additions & 14 deletions qml/ui/widgets/X20OverheatWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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
Expand Down

0 comments on commit d333c4c

Please sign in to comment.