From 7466cf82f3adb8b559a4941f04ba6b40ac305526 Mon Sep 17 00:00:00 2001 From: consti10 Date: Mon, 6 Nov 2023 13:50:41 +0100 Subject: [PATCH] less spammy on secondary cam --- app/telemetry/models/aohdsystem.cpp | 8 +++----- app/telemetry/models/aohdsystem.h | 2 ++ qml/ui/widgets/VideoBitrateWidgetSecondary.qml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/telemetry/models/aohdsystem.cpp b/app/telemetry/models/aohdsystem.cpp index 4d2bab18a..309554d6e 100644 --- a/app/telemetry/models/aohdsystem.cpp +++ b/app/telemetry/models/aohdsystem.cpp @@ -139,18 +139,16 @@ bool AOHDSystem::process_message(const mavlink_message_t &msg) CameraStreamModel::instance(0).update_mavlink_openhd_camera_status_air(parsedMsg); }else if(msg.compid==OHD_COMP_ID_AIR_CAMERA_SECONDARY){ CameraStreamModel::instance(1).update_mavlink_openhd_camera_status_air(parsedMsg); + set_dirty_air_has_secondary_cam(true); // Feature - tell user to enable 2 cameras in qopenhd set_n_openhd_cameras(2); const int value_in_qopenhd=QOpenHDVideoHelper::get_qopenhd_n_cameras(); if(value_in_qopenhd!=2){ const auto elapsed=std::chrono::steady_clock::now()-m_last_n_cameras_message; - if(elapsed>std::chrono::seconds(10)){ - auto message="QOpenHD is not configured for dual cam usage, go to QOpenHD settings / General to configure your GCS to show secondary camera screen"; - qDebug()<std::chrono::seconds(5)){ + LogMessagesModel::instanceGround().add_message_debug("QOpenHD","Please enable 2 camera control"); m_last_n_cameras_message=std::chrono::steady_clock::now(); } - HUDLogMessagesModel::instance().add_message_info("QOpenHD only shows 1 camera"); } } diff --git a/app/telemetry/models/aohdsystem.h b/app/telemetry/models/aohdsystem.h index f147f49a6..e132c687f 100644 --- a/app/telemetry/models/aohdsystem.h +++ b/app/telemetry/models/aohdsystem.h @@ -118,6 +118,8 @@ class AOHDSystem : public QObject L_RO_PROP(int,wb_gnd_operating_mode,set_wb_gnd_operating_mode,-1) // L_RO_PROP(int,air_reported_fc_sys_id,set_air_reported_fc_sys_id,-1) + // + L_RO_PROP(bool,dirty_air_has_secondary_cam,set_dirty_air_has_secondary_cam,false) private: const bool m_is_air; // either true (for air) or false (for ground) uint8_t get_own_sys_id()const{ diff --git a/qml/ui/widgets/VideoBitrateWidgetSecondary.qml b/qml/ui/widgets/VideoBitrateWidgetSecondary.qml index d3c9e7216..3850bbc99 100644 --- a/qml/ui/widgets/VideoBitrateWidgetSecondary.qml +++ b/qml/ui/widgets/VideoBitrateWidgetSecondary.qml @@ -10,6 +10,6 @@ import OpenHD 1.0 VideoBitrateWidgetGeneric{ m_is_for_primary_camera: false - visible: settings.show_bitrate && settings.dev_qopenhd_n_cameras==2 - + // Also show it if air has a seconary cam + visible: (settings.show_bitrate && settings.dev_qopenhd_n_cameras>1) || (settings.show_bitrate && _ohdSystemAir.dirty_air_has_secondary_cam) }