From 52d10b6f59af3630197370ebc3e13c337fdc48e2 Mon Sep 17 00:00:00 2001 From: Aleksey Degtyarev Date: Fri, 18 Oct 2024 16:33:36 +0700 Subject: [PATCH] battery temp widget + second baro temp widget + temp widgets aligning (#719) merge without fixing, fix comes in a second --- app/telemetry/models/fcmavlinksystem.cpp | 13 +- app/telemetry/models/fcmavlinksystem.h | 2 + app/telemetry/settings/documentedparam.cpp | 9 + app/telemetry/settings/param_names.h | 1 + app/videostreaming/gstreamer/gst_video.pri | 4 +- qml/qml.qrc | 20 +- qml/ui/HUDOverlayGrid.qml | 9 + .../AppWidgetSettingsView.qml | 59 +++++ qml/ui/elements/AppSettings.qml | 19 +- qml/ui/widgets/AirspeedTempWidget.qml | 5 +- qml/ui/widgets/BatteryTempWidget.qml | 221 ++++++++++++++++++ qml/ui/widgets/EscTempWidget.qml | 6 +- qml/ui/widgets/ImuTempWidget.qml | 4 +- qml/ui/widgets/PressTempWidget.qml | 4 +- qml/ui/widgets/PressTempWidget2.qml | 196 ++++++++++++++++ qml/ui/widgets/RCRssiWidget.qml | 2 +- 16 files changed, 546 insertions(+), 28 deletions(-) create mode 100644 qml/ui/widgets/BatteryTempWidget.qml create mode 100644 qml/ui/widgets/PressTempWidget2.qml diff --git a/app/telemetry/models/fcmavlinksystem.cpp b/app/telemetry/models/fcmavlinksystem.cpp index d921669ed..45ab19a78 100644 --- a/app/telemetry/models/fcmavlinksystem.cpp +++ b/app/telemetry/models/fcmavlinksystem.cpp @@ -173,7 +173,14 @@ bool FCMavlinkSystem::process_message(const mavlink_message_t &msg) mavlink_scaled_pressure_t scaled_pressure; mavlink_msg_scaled_pressure_decode(&msg, &scaled_pressure); set_preasure_sensor_temperature_degree((int)scaled_pressure.temperature/100); - //qDebug() << "Temp:" << scaled_pressure.temperature; + //qDebug() << "Temp:" << scaled_pressure.temperature;; + break; + } + case MAVLINK_MSG_ID_SCALED_PRESSURE2:{ + mavlink_scaled_pressure_t scaled_pressure2; + mavlink_msg_scaled_pressure_decode(&msg, &scaled_pressure2); + set_preasure_sensor2_temperature_degree((int)scaled_pressure2.temperature/100); + //qDebug() << "Temp:" << scaled_pressure2.temperature; break; } case MAVLINK_MSG_ID_ATTITUDE:{ @@ -334,6 +341,7 @@ bool FCMavlinkSystem::process_message(const mavlink_message_t &msg) mavlink_battery_status_t battery_status; mavlink_msg_battery_status_decode(&msg, &battery_status); set_battery_consumed_mah(battery_status.current_consumed); + set_battery_temperature((int)battery_status.temperature/100); QSettings settings; const bool air_battery_use_batt_id_0_only=settings.value("air_battery_use_batt_id_0_only", false).toBool(); if(!air_battery_use_batt_id_0_only){ @@ -418,9 +426,6 @@ bool FCMavlinkSystem::process_message(const mavlink_message_t &msg) case MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT:{ break; } - case MAVLINK_MSG_ID_SCALED_PRESSURE2:{ - break; - } case MAVLINK_MSG_ID_HIL_GPS:{ break; } diff --git a/app/telemetry/models/fcmavlinksystem.h b/app/telemetry/models/fcmavlinksystem.h index 32ab5d2d3..3d71fcaa5 100644 --- a/app/telemetry/models/fcmavlinksystem.h +++ b/app/telemetry/models/fcmavlinksystem.h @@ -130,8 +130,10 @@ class FCMavlinkSystem : public QObject L_RO_PROP(int,rc_rssi_percentage,set_rc_rssi_percentage,-1); 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,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) L_RO_PROP(QString,flight_time,set_flight_time,"00:00") L_RO_PROP(double,flight_distance_m,set_flight_distance_m,0) L_RO_PROP(double,lateral_speed,set_lateral_speed,0) diff --git a/app/telemetry/settings/documentedparam.cpp b/app/telemetry/settings/documentedparam.cpp index 258ef3508..ada448bb2 100644 --- a/app/telemetry/settings/documentedparam.cpp +++ b/app/telemetry/settings/documentedparam.cpp @@ -98,19 +98,23 @@ static std::vector> get_parameters_list(){ //58: 420-450 mW // NOTE: We now have the tx power wizzard ! auto values_WB_TX_PWR_INDEX=std::vector{ + {"Unitless [1]",1}, {"Unitless [3]",3}, {"Unitless [6]",6}, {"Unitless [10]",10}, {"Unitless [20]",20}, + {"Unitless [26]",26}, {"Unitless [40]",40}, {"Unitless [60]",60}, {"Unitless [63]",63}, }; auto values_WB_TX_PWR_INDEX_ARMED=std::vector{ {"Disabled [0]",0}, + {"Unitless [1]",1}, {"Unitless [3]",3}, {"Unitless [6]",6}, {"Unitless [10]",10}, {"Unitless [20]",20}, + {"Unitless [26]",26}, {"Unitless [40]",40}, {"Unitless [60]",60}, {"Unitless [63]",63}, @@ -201,6 +205,11 @@ static std::vector> get_parameters_list(){ ImprovedIntSetting::createEnum(disable_or_channels), "Dynamically change the BW via RC. NOT ALWAYS SAFE TO USE !" ); + append_int(ret,openhd::WB_POWER_VIA_RC_CHANNEL, + ImprovedIntSetting::createEnum(disable_or_channels), + "Dynamically change the POWER during flight using your RC and a specific channel " + "(similar to how flight modes work)." + ); } diff --git a/app/telemetry/settings/param_names.h b/app/telemetry/settings/param_names.h index 210081a49..7885f9267 100644 --- a/app/telemetry/settings/param_names.h +++ b/app/telemetry/settings/param_names.h @@ -27,6 +27,7 @@ static constexpr auto WB_ENABLE_STBC="WB_E_STBC"; static constexpr auto WB_ENABLE_LDPC="WB_E_LDPC"; static constexpr auto WB_ENABLE_SHORT_GUARD="WB_E_SHORT_GUARD"; static constexpr auto WB_MCS_INDEX_VIA_RC_CHANNEL="MCS_VIA_RC"; +static constexpr auto WB_POWER_VIA_RC_CHANNEL="PWR_VIA_RC"; static constexpr auto WB_BW_VIA_RC_CHANNEL = "BW_VIA_RC"; static constexpr auto WB_PASSIVE_MODE ="WB_PASSIVE_MODE"; static constexpr auto WB_DEV_AIR_SET_HIGH_RETRANSMIT_COUNT="DEV_HIGH_RETR"; diff --git a/app/videostreaming/gstreamer/gst_video.pri b/app/videostreaming/gstreamer/gst_video.pri index aa0c7a5a8..3074eb154 100644 --- a/app/videostreaming/gstreamer/gst_video.pri +++ b/app/videostreaming/gstreamer/gst_video.pri @@ -18,10 +18,10 @@ android{ message("gst android") # More or less taken from QGroundControl. # this is already the "least dirty" solution I could come up with :/ - + DOWNLOADED_GST_FOLDER= /home/hyperion/gstreamer-1.0-android-universal-1.20.5 #DOWNLOADED_GST_FOLDER= /home/consti10/Downloads/gstreamer-1.0-android-universal-1.20.5 #DOWNLOADED_GST_FOLDER= $$PWD/../../../lib/gstreamer_prebuilts/gstreamer-1.0-android-universal-1.20.5 - DOWNLOADED_GST_FOLDER= $$PWD/../../../lib/gstreamer_prebuilts/gstreamer-1.0-android-universal + #DOWNLOADED_GST_FOLDER= $$PWD/../../../lib/gstreamer_prebuilts/gstreamer-1.0-android-universal # Set the right folder for the compile arch GSTREAMER_ARCH_FOLDER = armv7 diff --git a/qml/qml.qrc b/qml/qml.qrc index abf4b0377..1ab0d4cdb 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 @@ -313,5 +313,7 @@ ui/sidebar/MappedMavlinkChoices.qml ui/widgets/X20OverheatWidget.qml ui/sidebar/ActionElement.qml + ui/widgets/BatteryTempWidget.qml + ui/widgets/PressTempWidget2.qml diff --git a/qml/ui/HUDOverlayGrid.qml b/qml/ui/HUDOverlayGrid.qml index b7c9b08ec..132f795e7 100644 --- a/qml/ui/HUDOverlayGrid.qml +++ b/qml/ui/HUDOverlayGrid.qml @@ -370,6 +370,11 @@ Item { PressTempWidget { id: press_temp } + + PressTempWidget2 { + id: press_temp2 + } + RCRssiWidget { id: rc_rssi_widget } @@ -378,6 +383,10 @@ Item { id: airspeed_temp } + BatteryTempWidget { + id: battery_temp + } + // + 0% cpu EscTempWidget { id: esc_temp diff --git a/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml index f3dbd2985..5233e663d 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml @@ -45,8 +45,11 @@ ScrollView { settings.show_flight_mah= enable_elements; settings.show_flight_mah_km=enable_elements; settings.show_press_temp=enable_elements; + settings.show_press_temp2=enable_elements + settings.show_imu_temp=enable_elements; settings.show_airspeed_temp=enable_elements; settings.show_esc_temp=enable_elements; + settings.show_battery_temp=enable_elements; settings.show_ground_status= enable_elements; settings.show_air_status=enable_elements; settings.show_message_hud= enable_elements; @@ -436,6 +439,34 @@ ScrollView { } } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Pressure Sensor 2 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_temp2 + onCheckedChanged: settings.show_press_temp2 = checked + } + } + Rectangle { width: parent.width height: rowHeight @@ -494,6 +525,34 @@ ScrollView { } } + Rectangle { + width: parent.width + height: rowHeight + color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000" + + Text { + text: qsTr("Show Battery 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_battery_temp + onCheckedChanged: settings.show_battery_temp = checked + } + } + Rectangle { width: parent.width height: rowHeight diff --git a/qml/ui/elements/AppSettings.qml b/qml/ui/elements/AppSettings.qml index 7d50ba3e4..f96feef09 100644 --- a/qml/ui/elements/AppSettings.qml +++ b/qml/ui/elements/AppSettings.qml @@ -193,26 +193,39 @@ Settings { property bool show_flight_mah_km: true - property bool show_imu_temp: false + property bool show_imu_temp: true property bool imu_temp_declutter: false property double imu_temp_warn: 75 property double imu_temp_caution: 65 - property bool show_press_temp: true + property bool show_press_temp: false property bool press_temp_declutter: false property double press_temp_warn: 75 property double press_temp_caution: 60 + property bool show_press_temp2: true + property bool press_temp_declutter2: false + //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_airspeed_temp: false property bool airspeed_temp_declutter: false property double airspeed_temp_warn: 0 property double airspeed_temp_caution: 10 - property bool show_esc_temp: false + property bool show_esc_temp: true property bool esc_temp_declutter: false property double esc_temp_warn: 75 property double esc_temp_caution: 60 + property bool show_battery_temp: true + property bool battery_temp_declutter: false + //samsung 35e has -10 to 60 temp range + property double battery_temp_warn: 60 + property double battery_temp_caution: 40 + property bool show_ground_status: true property bool ground_status_declutter: false property bool ground_status_show_undervolt_icon: true diff --git a/qml/ui/widgets/AirspeedTempWidget.qml b/qml/ui/widgets/AirspeedTempWidget.qml index 4644a3e13..59e5cf097 100644 --- a/qml/ui/widgets/AirspeedTempWidget.qml +++ b/qml/ui/widgets/AirspeedTempWidget.qml @@ -18,8 +18,8 @@ BaseWidget { defaultAlignment: 1 - defaultXOffset: 12 - defaultYOffset: 32 + defaultXOffset: 90 + defaultYOffset: 55 defaultHCenter: false defaultVCenter: false @@ -171,6 +171,7 @@ BaseWidget { id: temp_glyph color: _fcMavlinkSystem.airspeed_sensor_temperature_degree <= settings.airspeed_temp_caution ? (_fcMavlinkSystem.airspeed_sensor_temperature_degree <= settings.airspeed_temp_warn ? settings.color_warn : settings.color_caution) : settings.color_shape opacity: bw_current_opacity + //suggest change to wind icon f72e text: _fcMavlinkSystem.airspeed_sensor_temperature_degree <= settings.airspeed_temp_caution ? (_fcMavlinkSystem.airspeed_sensor_temperature_degree <= settings.airspeed_temp_warn ? "\uf2c7" : "\uf2c9") : "\uf2cb" anchors.left: parent.left anchors.bottom: parent.bottom diff --git a/qml/ui/widgets/BatteryTempWidget.qml b/qml/ui/widgets/BatteryTempWidget.qml new file mode 100644 index 000000000..bf99da3ce --- /dev/null +++ b/qml/ui/widgets/BatteryTempWidget.qml @@ -0,0 +1,221 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.12 + +import Qt.labs.settings 1.0 + +import OpenHD 1.0 + +BaseWidget { + id: batteryTempWidget + width: 30 + height: 30 + + visible: settings.show_battery_temp && settings.show_widgets + + widgetIdentifier: "battery_temp_widget" + bw_verbose_name: "BATTERY SENSOR TEMP" + + + defaultAlignment: 1 + defaultXOffset: 140 + defaultYOffset: 32 + defaultHCenter: false + defaultVCenter: false + + hasWidgetDetail: true + + widgetDetailComponent: ScrollView { + + contentHeight: idBaseWidgetDefaultUiControlElements.height + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + clip: true + + BaseWidgetDefaultUiControlElements{ + id: idBaseWidgetDefaultUiControlElements + Item { + width: parent.width + height: 42 + Text { + id: batterytempSettingsTitle + text: qsTr("BATTERY SENSOR TEMPERATURE") + color: "white" + height: parent.height - 10 + width: parent.width + font.bold: true + horizontalAlignment: Text.AlignHCenter + font.pixelSize: detailPanelFontPixels + verticalAlignment: Text.AlignVCenter + } + Rectangle { + id: batterytempSettingsTitleUL + y: 34 + width: parent.width + height: 3 + color: "white" + radius: 5 + } + } + + 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.battery_temp_declutter + onCheckedChanged: settings.battery_temp_declutter = checked + } + } + Item { + id: battery_temp_warn_label + 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.battery_temp_warn + color: settings.color_warn + height: parent.height + font.bold: true + font.pixelSize: detailPanelFontPixels + anchors.left: parent.right + verticalAlignment: Text.AlignVCenter + } + Slider { + id: battery_temp_warn_Slider + orientation: Qt.Horizontal + from: 0 + value: settings.battery_temp_warn + to: 9 + stepSize: 1 + height: parent.height + anchors.rightMargin: 0 + anchors.right: parent.right + width: parent.width - 96 + + onValueChanged: { + settings.battery_temp_warn = Math.round( + battery_temp_warn_Slider.value * 10) / 10.0 + } + } + } + Item { + id: battery_temp_caution_label + 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.battery_temp_caution + color: settings.color_caution + height: parent.height + font.bold: true + font.pixelSize: detailPanelFontPixels + anchors.left: battery_temp_caution_label.right + verticalAlignment: Text.AlignVCenter + } + Slider { + id: battery_temp_caution_Slider + orientation: Qt.Horizontal + from: 10 + value: settings.battery_temp_caution + to: 20 + stepSize: 1 + height: parent.height + anchors.rightMargin: 0 + anchors.right: parent.right + width: parent.width - 96 + + onValueChanged: { + settings.battery_temp_caution = Math.round( + battery_temp_caution_Slider.value * 10) / 10.0 + } + } + } + } + } + + Item { + id: widgetInner + + anchors.fill: parent + scale: bw_current_scale + + Text { + id: temp_glyph + color: _fcMavlinkSystem.battery_temperature <= settings.battery_temp_caution ? (_fcMavlinkSystem.battery_temperature <= settings.battery_temp_warn ? settings.color_warn : settings.color_caution) : settings.color_shape + opacity: bw_current_opacity + text: "\uf5df" + 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: battery_temp + color: { + if (_fcMavlinkSystem.battery_temperature <= settings.battery_temp_warn) { + widgetInner.visible = true + return settings.color_warn + } else if (_fcMavlinkSystem.battery_temperature < settings.battery_temp_caution) { + widgetInner.visible = true + return settings.color_caution + } else if (settings.battery_temp_declutter == true + && _fcMavlinkSystem.armed == true) { + widgetInner.visible = false + return settings.color_text + } else { + widgetInner.visible = true + return settings.color_text + } + } + opacity: bw_current_opacity + text: _fcMavlinkSystem.battery_temperature == 99 ? qsTr("N/A") : _fcMavlinkSystem.battery_temperature + "°" + 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 + } + } +} + diff --git a/qml/ui/widgets/EscTempWidget.qml b/qml/ui/widgets/EscTempWidget.qml index 2036bf759..c88410fdf 100644 --- a/qml/ui/widgets/EscTempWidget.qml +++ b/qml/ui/widgets/EscTempWidget.qml @@ -14,11 +14,11 @@ BaseWidget { visible: settings.show_esc_temp && settings.show_widgets widgetIdentifier: "esc_temp_widget" - bw_verbose_name: "EST TEMPERATURE" + bw_verbose_name: "ESC TEMPERATURE" defaultAlignment: 1 - defaultXOffset: 12 - defaultYOffset: 56 + defaultXOffset: 90 + defaultYOffset: 32 defaultHCenter: false defaultVCenter: false diff --git a/qml/ui/widgets/ImuTempWidget.qml b/qml/ui/widgets/ImuTempWidget.qml index bdc4c7982..3c73d326b 100644 --- a/qml/ui/widgets/ImuTempWidget.qml +++ b/qml/ui/widgets/ImuTempWidget.qml @@ -17,8 +17,8 @@ BaseWidget { bw_verbose_name: "IMU TEMPERATURE" defaultAlignment: 1 - defaultXOffset: 12 - defaultYOffset: 56 + defaultXOffset: 27 + defaultYOffset: 32 defaultHCenter: false defaultVCenter: false diff --git a/qml/ui/widgets/PressTempWidget.qml b/qml/ui/widgets/PressTempWidget.qml index 47d7e6e9a..b640816b5 100644 --- a/qml/ui/widgets/PressTempWidget.qml +++ b/qml/ui/widgets/PressTempWidget.qml @@ -17,8 +17,8 @@ BaseWidget { bw_verbose_name: "PREASSURE SENSOR TEMP" defaultAlignment: 1 - defaultXOffset: 12 - defaultYOffset: 32 + defaultXOffset: 140 + defaultYOffset: 55 defaultHCenter: false defaultVCenter: false diff --git a/qml/ui/widgets/PressTempWidget2.qml b/qml/ui/widgets/PressTempWidget2.qml new file mode 100644 index 000000000..7dd4cb15d --- /dev/null +++ b/qml/ui/widgets/PressTempWidget2.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 +//second bmp280 or another barometer used to monitor AC180 temperature so wifi icon was used +BaseWidget { + id: pressTempWidget2 + width: 30 + height: 30 + + visible: settings.show_press_temp2 && settings.show_widgets + + widgetIdentifier: "press_temp_widget2" + bw_verbose_name: "PREASSURE2 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_declutter2 + onCheckedChanged: settings.press_temp_declutter2 = checked + } + } + Item { + id: press_temp_warn_label2 + 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_warn2 + 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_Slider2 + orientation: Qt.Horizontal + from: 75 + value: settings.press_temp_warn2 + to: 150 + stepSize: 1 + height: parent.height + anchors.rightMargin: 0 + anchors.right: parent.right + width: parent.width - 96 + + onValueChanged: { + settings.press_temp_warn2 = Math.round( + press_temp_warn_Slider2.value * 10) / 10.0 + } + } + } + Item { + id: press_temp_caution_label2 + 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_caution2 + color: settings.color_caution + height: parent.height + font.bold: true + font.pixelSize: detailPanelFontPixels + anchors.left: press_temp_caution_label2.right + verticalAlignment: Text.AlignVCenter + } + Slider { + id: press_temp_caution_Slider2 + orientation: Qt.Horizontal + from: 30 + value: settings.press_temp_caution2 + to: 74 + stepSize: 1 + height: parent.height + anchors.rightMargin: 0 + anchors.right: parent.right + width: parent.width - 96 + + onValueChanged: { + settings.press_temp_caution2 = Math.round( + press_temp_caution_Slider2.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_sensor2_temperature_degree >= settings.press_temp_caution2 ? (_fcMavlinkSystem.preasure_sensor2_temperature_degree >= settings.press_temp_warn2 ? 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_temp2 + color: { + if (_fcMavlinkSystem.preasure_sensor2_temperature_degree >= settings.press_temp_warn2) { + widgetInner.visible = true + return settings.color_warn + } else if (_fcMavlinkSystem.preasure_sensor2_temperature_degree > settings.press_temp_caution2) { + widgetInner.visible = true + return settings.color_caution + } else if (settings.press_temp_declutter2 == true + && _fcMavlinkSystem.armed == true) { + widgetInner.visible = false + return settings.color_text + } else { + widgetInner.visible = true + return settings.color_text + } + } + text: _fcMavlinkSystem.preasure_sensor2_temperature_degree == 0 ? qsTr("N/A") : _fcMavlinkSystem.preasure_sensor2_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 + } + + } + +} diff --git a/qml/ui/widgets/RCRssiWidget.qml b/qml/ui/widgets/RCRssiWidget.qml index c233cba0b..22b28ac23 100644 --- a/qml/ui/widgets/RCRssiWidget.qml +++ b/qml/ui/widgets/RCRssiWidget.qml @@ -20,7 +20,7 @@ BaseWidget { defaultAlignment: 1 defaultXOffset: 12 - defaultYOffset: 62 + defaultYOffset: 64 defaultHCenter: false defaultVCenter: false