Skip to content

Commit

Permalink
less spammy on secondary cam
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Nov 6, 2023
1 parent aea6fdc commit 7466cf8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 3 additions & 5 deletions app/telemetry/models/aohdsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()<<message;
WorkaroundMessageBox::makePopupMessage(message,8);
if(elapsed>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");
}

}
Expand Down
2 changes: 2 additions & 0 deletions app/telemetry/models/aohdsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
4 changes: 2 additions & 2 deletions qml/ui/widgets/VideoBitrateWidgetSecondary.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 7466cf8

Please sign in to comment.