Skip to content

Commit

Permalink
battery temp widget + second baro temp widget + temp widgets aligning (
Browse files Browse the repository at this point in the history
…#719)

merge without fixing, fix comes in a second
  • Loading branch information
hyperion11 authored Oct 18, 2024
1 parent 6ec836e commit 52d10b6
Show file tree
Hide file tree
Showing 16 changed files with 546 additions and 28 deletions.
13 changes: 9 additions & 4 deletions app/telemetry/models/fcmavlinksystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:{
Expand Down Expand Up @@ -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){
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions app/telemetry/models/fcmavlinksystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions app/telemetry/settings/documentedparam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,23 @@ static std::vector<std::shared_ptr<XParam>> get_parameters_list(){
//58: 420-450 mW
// NOTE: We now have the tx power wizzard !
auto values_WB_TX_PWR_INDEX=std::vector<ImprovedIntSetting::Item>{
{"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<ImprovedIntSetting::Item>{
{"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},
Expand Down Expand Up @@ -201,6 +205,11 @@ static std::vector<std::shared_ptr<XParam>> 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)."
);

}

Expand Down
1 change: 1 addition & 0 deletions app/telemetry/settings/param_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions app/videostreaming/gstreamer/gst_video.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 11 additions & 9 deletions qml/qml.qrc
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<RCC>
<qresource lang="en" prefix="/translations">
<qresource prefix="/translations" lang="en">
<file alias="QOpenHD.qm">../translations/QOpenHD_en.qm</file>
<file>resources/cursors/arrow_512_green.png</file>
<file>resources/cursors/arrow_512_transparent.png</file>
<file>resources/cursors/arrow_512_white.png</file>
<file>resources/cursors/hand_white.png</file>
</qresource>
<qresource lang="de" prefix="/translations">
<qresource prefix="/translations" lang="de">
<file alias="QOpenHD.qm">../translations/QOpenHD_de.qm</file>
</qresource>
<qresource lang="ru" prefix="/translations">
<qresource prefix="/translations" lang="ru">
<file alias="QOpenHD.qm">../translations/QOpenHD_ru.qm</file>
</qresource>
<qresource lang="es" prefix="/translations">
<qresource prefix="/translations" lang="es">
<file alias="QOpenHD.qm">../translations/QOpenHD_es.qm</file>
</qresource>
<qresource lang="fr" prefix="/translations">
<qresource prefix="/translations" lang="fr">
<file alias="QOpenHD.qm">../translations/QOpenHD_fr.qm</file>
</qresource>
<qresource lang="nl" prefix="/translations">
<qresource prefix="/translations" lang="nl">
<file alias="QOpenHD.qm">../translations/QOpenHD_nl.qm</file>
</qresource>
<qresource lang="ro" prefix="/translations">
<qresource prefix="/translations" lang="ro">
<file alias="QOpenHD.qm">../translations/QOpenHD_ro.qm</file>
</qresource>
<qresource lang="it" prefix="/translations">
<qresource prefix="/translations" lang="it">
<file alias="QOpenHD.qm">../translations/QOpenHD_it.qm</file>
</qresource>
<qresource lang="zh" prefix="/translations">
<qresource prefix="/translations" lang="zh">
<file alias="QOpenHD.qm">../translations/QOpenHD_zh.qm</file>
</qresource>
<qresource prefix="/">
Expand Down Expand Up @@ -313,5 +313,7 @@
<file>ui/sidebar/MappedMavlinkChoices.qml</file>
<file>ui/widgets/X20OverheatWidget.qml</file>
<file>ui/sidebar/ActionElement.qml</file>
<file>ui/widgets/BatteryTempWidget.qml</file>
<file>ui/widgets/PressTempWidget2.qml</file>
</qresource>
</RCC>
9 changes: 9 additions & 0 deletions qml/ui/HUDOverlayGrid.qml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ Item {
PressTempWidget {
id: press_temp
}

PressTempWidget2 {
id: press_temp2
}

RCRssiWidget {
id: rc_rssi_widget
}
Expand All @@ -378,6 +383,10 @@ Item {
id: airspeed_temp
}

BatteryTempWidget {
id: battery_temp
}

// + 0% cpu
EscTempWidget {
id: esc_temp
Expand Down
59 changes: 59 additions & 0 deletions qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
19 changes: 16 additions & 3 deletions qml/ui/elements/AppSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions qml/ui/widgets/AirspeedTempWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ BaseWidget {


defaultAlignment: 1
defaultXOffset: 12
defaultYOffset: 32
defaultXOffset: 90
defaultYOffset: 55
defaultHCenter: false
defaultVCenter: false

Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 52d10b6

Please sign in to comment.