From e97c54374bca1e66e79c9cc7cfe20d6c70eeb3a4 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Sun, 24 Nov 2024 23:18:53 +0100 Subject: [PATCH 1/2] A few sidebar fixes --- app/telemetry/models/camerastreammodel.cpp | 6 +- app/telemetry/settings/frequencyhelper.cpp | 58 ++++++++++++++++++- app/telemetry/settings/frequencyhelper.h | 1 + app/telemetry/settings/wifi_channel.h | 4 ++ .../DialoqueFreqChangeAirGnd.qml | 1 + .../openhd_settings/FreqComboBoxRow.qml | 2 + .../openhd_settings/LinkQuickPanel.qml | 35 ++++++----- qml/ui/sidebar/MavlinkChoiceElement.qml | 12 +--- qml/ui/sidebar/MavlinkChoiceElement2.qml | 25 ++------ qml/ui/sidebar/Panel4Recording.qml | 2 +- 10 files changed, 96 insertions(+), 50 deletions(-) diff --git a/app/telemetry/models/camerastreammodel.cpp b/app/telemetry/models/camerastreammodel.cpp index 9bcd1658a..d56ab56c5 100644 --- a/app/telemetry/models/camerastreammodel.cpp +++ b/app/telemetry/models/camerastreammodel.cpp @@ -63,9 +63,9 @@ QString CameraStreamModel::camera_codec_to_string(int camera_codec) QString CameraStreamModel::camera_recording_mode_to_string(int recording_mode) { - if(recording_mode<0)return "n/a"; - if(recording_mode==0)return "not active"; - if(recording_mode==1)return "active"; + if(recording_mode<0)return " n/a"; + if(recording_mode==0)return " off"; + if(recording_mode==1)return " on"; return "error"; } diff --git a/app/telemetry/settings/frequencyhelper.cpp b/app/telemetry/settings/frequencyhelper.cpp index 582538656..90ae7ca97 100644 --- a/app/telemetry/settings/frequencyhelper.cpp +++ b/app/telemetry/settings/frequencyhelper.cpp @@ -20,6 +20,11 @@ QList FrequencyHelper::get_frequencies(int filter) for(auto& channel:tmp){ ret.push_back(channel.frequency); } + }else if(filter==3){ + auto tmp=openhd::get_openhd_channels_licensed(); + for(auto& channel:tmp){ + ret.push_back(channel.frequency); + } }else{ const auto frequency_items=openhd::get_all_channels_2G_5G(); for(auto& item:frequency_items){ @@ -29,7 +34,7 @@ QList FrequencyHelper::get_frequencies(int filter) ret.push_back(item.frequency); } }else{ - if(item.frequency>3000){ + if(item.frequency>=5180 && item.frequency<=5865){ ret.push_back(item.frequency); } } @@ -107,6 +112,57 @@ int FrequencyHelper::get_frequency_openhd_race_band(int frequency_mhz) } return -1; } +int FrequencyHelper::get_frequency_openhd_licensed_band(int frequency_mhz) +{ + // Frequencies: 5080,5100,5120,5140,5160,5905,5925,5945,5965,5985,6005,6025,6045,6065,6085 + if(frequency_mhz==5080){ + return 1; + } + if(frequency_mhz==5100){ + return 2; + } + if(frequency_mhz==5120){ + return 3; + } + if(frequency_mhz==5140){ + return 4; + } + if(frequency_mhz==5160){ + return 5; + } + if(frequency_mhz==5905){ + return 6; + } + if(frequency_mhz==5925){ + return 7; + } + if(frequency_mhz==5945){ + return 8; + } + if(frequency_mhz==5965){ + return 9; + } + if(frequency_mhz==5985){ + return 10; + } + if(frequency_mhz==6005){ + return 11; + } + if(frequency_mhz==6025){ + return 12; + } + if(frequency_mhz==6045){ + return 13; + } + if(frequency_mhz==6065){ + return 14; + } + if(frequency_mhz==6085){ + return 15; + } + return -1; +} + int FrequencyHelper::get_frequency_channel_nr(int frequency_mhz) { diff --git a/app/telemetry/settings/frequencyhelper.h b/app/telemetry/settings/frequencyhelper.h index 6bcf385ec..71b18f39a 100644 --- a/app/telemetry/settings/frequencyhelper.h +++ b/app/telemetry/settings/frequencyhelper.h @@ -22,6 +22,7 @@ class FrequencyHelper : public QObject Q_INVOKABLE bool get_frequency_radar(int frequency_mhz); Q_INVOKABLE int get_frequency_openhd_race_band(int frequency_mhz); + Q_INVOKABLE int get_frequency_openhd_licensed_band(int frequency_mhz); Q_INVOKABLE int get_frequency_channel_nr(int frequency_mhz); // -------------- Q_INVOKABLE bool hw_supports_frequency_threadsafe(int frequency_mhz); diff --git a/app/telemetry/settings/wifi_channel.h b/app/telemetry/settings/wifi_channel.h index 73bd1c8b8..2acb6c3d4 100644 --- a/app/telemetry/settings/wifi_channel.h +++ b/app/telemetry/settings/wifi_channel.h @@ -282,6 +282,10 @@ static std::vector get_openhd_channels_1_to_7() { std::vector frequencies = {5700, 5745, 5785, 5825, 5865, 5260, 5280}; return frequencies_to_channels(frequencies); } +static std::vector get_openhd_channels_licensed() { + std::vector frequencies = {5080,5100,5120,5140,5160,5905,5925,5945,5965,5985,6005,6025,6045,6065,6085}; + return frequencies_to_channels(frequencies); +} static std::vector filter_ht40plus_only( const std::vector& frequencies) { diff --git a/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeAirGnd.qml b/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeAirGnd.qml index a4b7b4d85..0ed34532e 100644 --- a/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeAirGnd.qml +++ b/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeAirGnd.qml @@ -46,6 +46,7 @@ Card { function get_card_body_string(){ const channel_nr=_frequencyHelper.get_frequency_channel_nr(m_wanted_frequency); const channel_nr_openhd=_frequencyHelper.get_frequency_openhd_race_band(m_wanted_frequency); + const channel_nr_openhd_licensed=_frequencyHelper.get_frequency_openhd_licensed_band(m_wanted_frequency); return "Set AIR and GROUND to CHANNEL ["+channel_nr+"]\n"+ "("+m_wanted_frequency+" Mhz) ?"; diff --git a/qml/ui/configpopup/openhd_settings/FreqComboBoxRow.qml b/qml/ui/configpopup/openhd_settings/FreqComboBoxRow.qml index b4eb997ad..d52a0da0e 100644 --- a/qml/ui/configpopup/openhd_settings/FreqComboBoxRow.qml +++ b/qml/ui/configpopup/openhd_settings/FreqComboBoxRow.qml @@ -27,6 +27,8 @@ Rectangle{ property bool m_show_radar: false property int m_openhd_race_band: -1 + property int m_openhd_licensed_band: -1 + property int m_pollution_pps: -1 diff --git a/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml b/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml index 247c1a9fb..fd8f43ee5 100644 --- a/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml +++ b/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml @@ -5,7 +5,7 @@ import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import QtQuick.Controls.Material 2.12 - + import Qt.labs.settings 1.0 @@ -166,6 +166,7 @@ Rectangle{ 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_openhd_licensed_band: _frequencyHelper.get_frequency_openhd_licensed_band(value_frequency_mhz) m_pollution_pps: _pollutionHelper.pollution_get_last_scan_pollution_for_frequency(value_frequency_mhz) } highlighted: comboBoxFreq.highlightedIndex === index @@ -206,40 +207,42 @@ Rectangle{ } enabled: _ohdSystemGround.is_alive && _ohdSystemGround.wb_gnd_operating_mode==0; } - TabBar{ + TabBar { id: filter_tab_bar - width: 200 + width: 350 currentIndex: settings.qopenhd_frequency_filter_selection onCurrentIndexChanged: { - if(currentIndex!=settings.qopenhd_frequency_filter_selection){ - settings.qopenhd_frequency_filter_selection=currentIndex; + if (currentIndex != settings.qopenhd_frequency_filter_selection) { + settings.qopenhd_frequency_filter_selection = currentIndex; + console.log("Tab changed to index:", 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: "OpenHD" + font.capitalization: Font.MixedCase } - TabButton{ + TabButton { text: "2.4G" enabled: { - if(_ohdSystemAir.is_alive && _ohdSystemAir.ohd_platform_type==30){ + if (_ohdSystemAir.is_alive && _ohdSystemAir.ohd_platform_type == 30) { // X20 does not support 2.4G return false; } return true; - } } - TabButton{ + TabButton { text: "5.8G" } enabled: comboBoxFreq.enabled + TabButton { + text: "Custom" + font.capitalization: Font.MixedCase + visible: settings.dev_show_5180mhz_lowband + } } + /*ButtonIconInfo2{ Layout.alignment: Qt.AlignRight visible:false diff --git a/qml/ui/sidebar/MavlinkChoiceElement.qml b/qml/ui/sidebar/MavlinkChoiceElement.qml index 3f483efcc..161167490 100644 --- a/qml/ui/sidebar/MavlinkChoiceElement.qml +++ b/qml/ui/sidebar/MavlinkChoiceElement.qml @@ -26,13 +26,7 @@ BaseJoyEditElement{ property var m_settings_model: _ohdSystemGroundSettings // Int param is much more common, but string param is also possible property bool override_takes_string_param: false - ListModel{ - id: elements_frequency_scan - ListElement {value: 0; verbose:"OHD"} - ListElement {value: 1; verbose:"5.8"} - ListElement {value: 2; verbose:"2.4"} - ListElement {value: 3; verbose:"ALL"} - } + ListModel{ id: elements_model_brightness ListElement {value: 0; verbose:"0%"} @@ -97,7 +91,7 @@ BaseJoyEditElement{ id: elements_model_air_recording ListElement {value: 0; verbose:"ALWAYS\nOFF"} ListElement {value: 1; verbose:"ALWAYS\nON"} - ListElement {value: 2; verbose:"AUTO\n(WHEN ARMED)"} + ListElement {value: 2; verbose:"AUTO\n(WHEN ARMED)"} } ListModel{ id: elements_model_hotspot @@ -156,8 +150,6 @@ BaseJoyEditElement{ property string m_actual_value_string: "" function get_model(){ - }else if(param_id=="FREQUENCY_SCAN"){ - return elements_frequency_scan; if(m_param_id=="BRIGHTNESS"){ return elements_model_brightness; }else if(m_param_id=="SATURATION"){ diff --git a/qml/ui/sidebar/MavlinkChoiceElement2.qml b/qml/ui/sidebar/MavlinkChoiceElement2.qml index de01fb4e5..bdfab8f9d 100644 --- a/qml/ui/sidebar/MavlinkChoiceElement2.qml +++ b/qml/ui/sidebar/MavlinkChoiceElement2.qml @@ -35,7 +35,6 @@ BaseJoyEditElement2{ // EXTRA property string mPARAM_ID_CHANNEL_WIDTH: "CHANNEL_WIDTH" property string mPARAM_ID_FREQUENCY: "FREQUENCY" - property string mPARAM_ID_FREQUENCY_SCAN: "FREQUENCY_SCAN" property string mPARAM_ID_RATE: "RATE" @@ -120,7 +119,8 @@ BaseJoyEditElement2{ property string populate_display_text:"I SHOULD NEVER APPEAR" function populate(){ - if(m_param_id==mPARAM_ID_CHANNEL_WIDTH || m_param_id==mPARAM_ID_FREQUENCY || mPARAM_ID_FREQUENCY_SCAN || m_param_id==mPARAM_ID_RATE){ + // Don't mind those 3 + if(m_param_id==mPARAM_ID_CHANNEL_WIDTH || m_param_id==mPARAM_ID_FREQUENCY || m_param_id==mPARAM_ID_RATE){ return; } // First, check if the system is alive @@ -189,7 +189,7 @@ BaseJoyEditElement2{ function user_selected_value(value_new){ // A few need to be handled specially - if(m_param_id==mPARAM_ID_FREQUENCY || m_param_id==mPARAM_ID_FREQUENCY_SCAN){ + if(m_param_id==mPARAM_ID_FREQUENCY){ if(_fcMavlinkSystem.armed){ if(settings.dev_allow_freq_change_when_armed){ // okay @@ -204,11 +204,6 @@ BaseJoyEditElement2{ _qopenhd.set_busy_for_milliseconds(2000,"CHANGING FREQUENCY"); _wbLinkSettingsHelper.change_param_air_and_ground_frequency(value_new) return; - }else if(m_param_id==mPARAM_ID_FREQUENCY_SCAN){ - const frequency_scan=value_new; - _qopenhd.set_busy_for_milliseconds(2000,"Starting scan"); - //PLATZHALTER - return; }else if(m_param_id==mPARAM_ID_CHANNEL_WIDTH){ const channel_width_mhz=value_new; if(!_ohdSystemAir.is_alive){ @@ -247,13 +242,8 @@ BaseJoyEditElement2{ onCurr_bandwidth_mhzChanged: { extra_populate(); } - property bool curr_frequency_scan: (_ohdSystemGround.wb_gnd_operating_mode == 0) - onCurr_frequency_scanChanged: { - extra_populate(); - } - function extra_populate(){ - if(!(m_param_id==mPARAM_ID_CHANNEL_WIDTH || m_param_id==mPARAM_ID_FREQUENCY || mPARAM_ID_FREQUENCY_SCAN || m_param_id==mPARAM_ID_RATE )){ + if(!(m_param_id==mPARAM_ID_CHANNEL_WIDTH || m_param_id==mPARAM_ID_FREQUENCY || m_param_id==mPARAM_ID_RATE)){ return; } // First, check if the system is alive @@ -263,10 +253,6 @@ BaseJoyEditElement2{ populate_display_text="N/A"; return; } - if(m_param_id==mPARAM_ID_FREQUENCY_SCAN){ - populate_display_text="Debug"; - return; - } if(m_param_id==mPARAM_ID_FREQUENCY){ if(curr_channel_mhz<=0){ m_param_exists=false; @@ -293,4 +279,5 @@ BaseJoyEditElement2{ m_param_exists=true; } } -} \ No newline at end of file + +} diff --git a/qml/ui/sidebar/Panel4Recording.qml b/qml/ui/sidebar/Panel4Recording.qml index 6ac267790..ea69a5305 100644 --- a/qml/ui/sidebar/Panel4Recording.qml +++ b/qml/ui/sidebar/Panel4Recording.qml @@ -51,7 +51,7 @@ SideBarBasePanel { anchors.centerIn: parent anchors.leftMargin: 40 text: { - var tmp = " Status"; + var tmp = " Status"; if (!_ohdSystemAir.is_alive) { return tmp + " disabled "; } From 78474bbe2284eefaaaa3882dc47aadd07988041c Mon Sep 17 00:00:00 2001 From: Aleksey Degtyarev Date: Tue, 26 Nov 2024 14:42:48 +0700 Subject: [PATCH 2/2] third baro temp widget (#723) * third baro temp widget for fc with 2 baros onboard * debug output fix --- app/telemetry/models/fcmavlinksystem.cpp | 7 + app/telemetry/models/fcmavlinksystem.h | 1 + qml/qml.qrc | 1 + qml/ui/HUDOverlayGrid.qml | 4 + .../AppWidgetSettingsView.qml | 29 +++ qml/ui/elements/AppSettings.qml | 6 + qml/ui/widgets/PressTempWidget3.qml | 196 ++++++++++++++++++ 7 files changed, 244 insertions(+) create mode 100644 qml/ui/widgets/PressTempWidget3.qml diff --git a/app/telemetry/models/fcmavlinksystem.cpp b/app/telemetry/models/fcmavlinksystem.cpp index 45ab19a78..d708c6ad3 100644 --- a/app/telemetry/models/fcmavlinksystem.cpp +++ b/app/telemetry/models/fcmavlinksystem.cpp @@ -183,6 +183,13 @@ bool FCMavlinkSystem::process_message(const mavlink_message_t &msg) //qDebug() << "Temp:" << scaled_pressure2.temperature; break; } + case MAVLINK_MSG_ID_SCALED_PRESSURE3:{ + mavlink_scaled_pressure_t scaled_pressure3; + mavlink_msg_scaled_pressure_decode(&msg, &scaled_pressure3); + set_preasure_sensor3_temperature_degree((int)scaled_pressure3.temperature/100); + //qDebug() << "Temp:" << scaled_pressure3.temperature; + break; + } case MAVLINK_MSG_ID_ATTITUDE:{ mavlink_attitude_t attitude; mavlink_msg_attitude_decode (&msg, &attitude); diff --git a/app/telemetry/models/fcmavlinksystem.h b/app/telemetry/models/fcmavlinksystem.h index 3d71fcaa5..d398cce20 100644 --- a/app/telemetry/models/fcmavlinksystem.h +++ b/app/telemetry/models/fcmavlinksystem.h @@ -131,6 +131,7 @@ class FCMavlinkSystem : public QObject L_RO_PROP(int,imu_temp_degree,set_imu_temp_degree,0); L_RO_PROP(int,preasure_sensor_temperature_degree,set_preasure_sensor_temperature_degree,0) L_RO_PROP(int,preasure_sensor2_temperature_degree,set_preasure_sensor2_temperature_degree,0) + L_RO_PROP(int,preasure_sensor3_temperature_degree,set_preasure_sensor3_temperature_degree,0) L_RO_PROP(int,airspeed_sensor_temperature_degree,set_airspeed_sensor_temperature_degree,99) L_RO_PROP(int,esc_temp,set_esc_temp,0); L_RO_PROP(int,battery_temperature,set_battery_temperature,0) diff --git a/qml/qml.qrc b/qml/qml.qrc index 1ab0d4cdb..eaa9596cc 100644 --- a/qml/qml.qrc +++ b/qml/qml.qrc @@ -315,5 +315,6 @@ ui/sidebar/ActionElement.qml ui/widgets/BatteryTempWidget.qml ui/widgets/PressTempWidget2.qml + ui/widgets/PressTempWidget3.qml diff --git a/qml/ui/HUDOverlayGrid.qml b/qml/ui/HUDOverlayGrid.qml index 132f795e7..1c58b906a 100644 --- a/qml/ui/HUDOverlayGrid.qml +++ b/qml/ui/HUDOverlayGrid.qml @@ -374,6 +374,10 @@ Item { PressTempWidget2 { id: press_temp2 } + + PressTempWidget3 { + id: press_temp3 + } RCRssiWidget { id: rc_rssi_widget diff --git a/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml index 5233e663d..beb5fb34a 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml @@ -46,6 +46,7 @@ ScrollView { settings.show_flight_mah_km=enable_elements; settings.show_press_temp=enable_elements; settings.show_press_temp2=enable_elements + settings.show_press_temp3=enable_elements settings.show_imu_temp=enable_elements; settings.show_airspeed_temp=enable_elements; settings.show_esc_temp=enable_elements; @@ -466,6 +467,34 @@ ScrollView { onCheckedChanged: settings.show_press_temp2 = checked } } + + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Pressure Sensor 3 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 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + checked: settings.show_press_temp3 + onCheckedChanged: settings.show_press_temp3 = checked + } + } Rectangle { width: parent.width diff --git a/qml/ui/elements/AppSettings.qml b/qml/ui/elements/AppSettings.qml index f96feef09..7f6e38a19 100644 --- a/qml/ui/elements/AppSettings.qml +++ b/qml/ui/elements/AppSettings.qml @@ -208,6 +208,12 @@ Settings { //AC180 or another 8812 wifi module temperature ranges (datasheet 125 max) property double press_temp_warn2: 75 property double press_temp_caution2: 60 + + property bool show_press_temp3: false + property bool press_temp_declutter3: false + //AC180 or another 8812 wifi module temperature ranges (datasheet 125 max) + property double press_temp_warn3: 75 + property double press_temp_caution3: 60 property bool show_airspeed_temp: false diff --git a/qml/ui/widgets/PressTempWidget3.qml b/qml/ui/widgets/PressTempWidget3.qml new file mode 100644 index 000000000..1317a3c52 --- /dev/null +++ b/qml/ui/widgets/PressTempWidget3.qml @@ -0,0 +1,196 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.12 + +import Qt.labs.settings 1.0 + +import OpenHD 1.0 +//third bmp280 or another barometer used to monitor AC180 temperature so wifi icon was used +BaseWidget { + id: pressTempWidget3 + width: 30 + height: 30 + + visible: settings.show_press_temp3 && settings.show_widgets + + widgetIdentifier: "press_temp_widget3" + bw_verbose_name: "PREASSURE3 SENSOR TEMP" + + defaultAlignment: 1 + defaultXOffset: 205 + defaultYOffset: 32 + defaultHCenter: false + defaultVCenter: false + + hasWidgetDetail: false + + widgetDetailComponent: ScrollView { + + contentHeight: idBaseWidgetDefaultUiControlElements.height + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + clip: true + + BaseWidgetDefaultUiControlElements{ + id: idBaseWidgetDefaultUiControlElements + Item { + width: parent.width + height: 32 + Text { + text: qsTr("Declutter Upon Arm") + color: "white" + height: parent.height + font.bold: true + font.pixelSize: detailPanelFontPixels + anchors.left: parent.left + verticalAlignment: Text.AlignVCenter + } + Switch { + width: 32 + height: parent.height + anchors.rightMargin: 6 + anchors.right: parent.right + checked: settings.press_temp_declutter3 + onCheckedChanged: settings.press_temp_declutter3 = checked + } + } + Item { + id: press_temp_warn_label3 + width: parent.width + height: 32 + Text { + text: qsTr("Warn Temp") + color: "white" + height: parent.height + font.bold: true + font.pixelSize: detailPanelFontPixels + anchors.left: parent.left + verticalAlignment: Text.AlignVCenter + } + Text { + text: settings.press_temp_warn3 + color: settings.color_warn + height: parent.height + font.bold: true + font.pixelSize: detailPanelFontPixels + anchors.left: parent.right + verticalAlignment: Text.AlignVCenter + } + Slider { + id: press_temp_warn_Slider3 + orientation: Qt.Horizontal + from: 75 + value: settings.press_temp_warn3 + to: 150 + stepSize: 1 + height: parent.height + anchors.rightMargin: 0 + anchors.right: parent.right + width: parent.width - 96 + + onValueChanged: { + settings.press_temp_warn3 = Math.round( + press_temp_warn_Slider3.value * 10) / 10.0 + } + } + } + Item { + id: press_temp_caution_label3 + width: parent.width + height: 32 + Text { + text: qsTr("Caution Temp") + color: "white" + height: parent.height + font.bold: true + font.pixelSize: detailPanelFontPixels + anchors.left: parent.left + verticalAlignment: Text.AlignVCenter + } + Text { + text: settings.press_temp_caution3 + color: settings.color_caution + height: parent.height + font.bold: true + font.pixelSize: detailPanelFontPixels + anchors.left: press_temp_caution_label3.right + verticalAlignment: Text.AlignVCenter + } + Slider { + id: press_temp_caution_Slider3 + orientation: Qt.Horizontal + from: 30 + value: settings.press_temp_caution3 + to: 74 + stepSize: 1 + height: parent.height + anchors.rightMargin: 0 + anchors.right: parent.right + width: parent.width - 96 + + onValueChanged: { + settings.press_temp_caution3 = Math.round( + press_temp_caution_Slider3.value * 10) / 10.0 + } + } + } + } + } + + Item { + id: widgetInner + + anchors.fill: parent + scale: bw_current_scale + opacity: bw_current_opacity + + Text { + id: temp_glyph + color: _fcMavlinkSystem.preasure_sensor3_temperature_degree >= settings.press_temp_caution3 ? (_fcMavlinkSystem.preasure_sensor3_temperature_degree >= settings.press_temp_warn3 ? settings.color_warn : settings.color_caution) : settings.color_shape + text: "\uf1eb" + anchors.left: parent.left + anchors.bottom: parent.bottom + font.family: "Font Awesome 5 Free" + horizontalAlignment: Text.AlignLeft + font.pixelSize: 16 + verticalAlignment: Text.AlignTop + wrapMode: Text.NoWrap + elide: Text.ElideRight + style: Text.Outline + styleColor: settings.color_glow + } + + Text { + id: press_temp3 + color: { + if (_fcMavlinkSystem.preasure_sensor3_temperature_degree >= settings.press_temp_warn3) { + widgetInner.visible = true + return settings.color_warn + } else if (_fcMavlinkSystem.preasure_sensor3_temperature_degree > settings.press_temp_caution3) { + widgetInner.visible = true + return settings.color_caution + } else if (settings.press_temp_declutter3 == true + && _fcMavlinkSystem.armed == true) { + widgetInner.visible = false + return settings.color_text + } else { + widgetInner.visible = true + return settings.color_text + } + } + text: _fcMavlinkSystem.preasure_sensor3_temperature_degree == 0 ? qsTr("N/A") : _fcMavlinkSystem.preasure_sensor3_temperature_degree + "°" + anchors.left: temp_glyph.right + anchors.leftMargin: 2 + anchors.bottom: parent.bottom + horizontalAlignment: Text.AlignRight + font.pixelSize: 14 + font.family: settings.font_text + verticalAlignment: Text.AlignVCenter + wrapMode: Text.NoWrap + elide: Text.ElideRight + style: Text.Outline + styleColor: settings.color_glow + } + + } + +}