diff --git a/app/telemetry/MavlinkTelemetry.cpp b/app/telemetry/MavlinkTelemetry.cpp index a76208ff9..f5ae11567 100644 --- a/app/telemetry/MavlinkTelemetry.cpp +++ b/app/telemetry/MavlinkTelemetry.cpp @@ -26,6 +26,8 @@ void MavlinkTelemetry::start() QSettings settings; // By default, we always use UDP / localhost mode. enable_udp(); + m_heartbeat_thread_run=true; + m_heartbeat_thread=std::make_unique(&MavlinkTelemetry::send_heartbeat_loop,this); } bool MavlinkTelemetry::sendMessage(mavlink_message_t msg){ @@ -206,6 +208,7 @@ void MavlinkTelemetry::process_message_timesync(const mavlink_message_t &msg) } } + void MavlinkTelemetry::add_tcp_connection_handler(QString ip) { qDebug()<<"MavlinkTelemetry::add_tcp_connection_handler"< m_heartbeat_thread; + std::atomic_bool m_heartbeat_thread_run; + void send_heartbeat_loop(); }; #endif // OHDMAVLINKCONNECTION_H diff --git a/app/telemetry/models/camerastreammodel.cpp b/app/telemetry/models/camerastreammodel.cpp index 4378ed4d5..baa938b57 100644 --- a/app/telemetry/models/camerastreammodel.cpp +++ b/app/telemetry/models/camerastreammodel.cpp @@ -40,7 +40,7 @@ void CameraStreamModel::update_mavlink_openhd_stats_wb_video_air(const mavlink_o set_curr_recommended_bitrate_from_message(curr_recommended_bitrate_kbits); set_curr_video_measured_encoder_bitrate(Telemetryutil::bitrate_bps_to_qstring(msg.curr_measured_encoder_bitrate)); set_curr_video_injected_bitrate(Telemetryutil::bitrate_bps_to_qstring(msg.curr_injected_bitrate)); - set_curr_video0_injected_pps(Telemetryutil::pps_to_string(msg.curr_injected_pps)); + set_curr_video_injected_pps(Telemetryutil::pps_to_string(msg.curr_injected_pps)); set_total_n_tx_dropped_frames(msg.curr_dropped_frames); if(m_last_tx_frame_drop_calculation_count<0){ m_last_tx_frame_drop_calculation_count=msg.curr_dropped_frames; @@ -140,9 +140,9 @@ void CameraStreamModel::update_mavlink_openhd_camera_status_air(const mavlink_op void CameraStreamModel::update_mavlink_openhd_stats_wb_video_air_fec_performance(const mavlink_openhd_stats_wb_video_air_fec_performance_t &msg) { - set_curr_video0_fec_encode_time_avg_min_max( + set_curr_fec_encode_time_avg_min_max( Telemetryutil::us_min_max_avg_to_string(msg.curr_fec_encode_time_min_us,msg.curr_fec_encode_time_max_us,msg.curr_fec_encode_time_avg_us)); - set_curr_video0_fec_block_length_min_max_avg( + set_curr_fec_block_length_min_max_avg( Telemetryutil::min_max_avg_to_string(msg.curr_fec_block_size_min,msg.curr_fec_block_size_max,msg.curr_fec_block_size_avg)); set_curr_time_until_tx_min_max_avg( Telemetryutil::us_min_max_avg_to_string(msg.curr_tx_delay_min_us,msg.curr_tx_delay_max_us,msg.curr_tx_delay_avg_us)); @@ -150,17 +150,17 @@ void CameraStreamModel::update_mavlink_openhd_stats_wb_video_air_fec_performance void CameraStreamModel::update_mavlink_openhd_stats_wb_video_ground(const mavlink_openhd_stats_wb_video_ground_t &msg) { - set_curr_video0_received_bitrate_with_fec(Telemetryutil::bitrate_bps_to_qstring(msg.curr_incoming_bitrate)); - set_video0_count_blocks_lost(msg.count_blocks_lost); - set_video0_count_blocks_recovered(msg.count_blocks_recovered); - set_video0_count_fragments_recovered(msg.count_fragments_recovered); - set_video0_count_blocks_total(msg.count_blocks_total); + set_curr_received_bitrate_with_fec(Telemetryutil::bitrate_bps_to_qstring(msg.curr_incoming_bitrate)); + set_count_blocks_lost(msg.count_blocks_lost); + set_count_blocks_recovered(msg.count_blocks_recovered); + set_count_fragments_recovered(msg.count_fragments_recovered); + set_count_blocks_total(msg.count_blocks_total); //set_gnd_rx_packets_per_second_and_bits_per_second(StringHelper::bitrate_and_pps_to_string(msg.curr_incoming_bitrate,msg.cur_).c_str()); } void CameraStreamModel::update_mavlink_openhd_stats_wb_video_ground_fec_performance(const mavlink_openhd_stats_wb_video_ground_fec_performance_t &msg) { - set_curr_video0_fec_decode_time_avg_min_max( + set_curr_fec_decode_time_avg_min_max( Telemetryutil::us_min_max_avg_to_string(msg.curr_fec_decode_time_min_us,msg.curr_fec_decode_time_max_us,msg.curr_fec_decode_time_avg_us)); } diff --git a/app/telemetry/models/camerastreammodel.h b/app/telemetry/models/camerastreammodel.h index 009481a0d..7531f207e 100644 --- a/app/telemetry/models/camerastreammodel.h +++ b/app/telemetry/models/camerastreammodel.h @@ -35,14 +35,14 @@ class CameraStreamModel : public QObject L_RO_PROP(int,curr_recomended_video_bitrate_kbits,set_curr_recomended_video_bitrate_kbits,0) L_RO_PROP(QString,curr_video_measured_encoder_bitrate,set_curr_video_measured_encoder_bitrate,"N/A") L_RO_PROP(QString,curr_video_injected_bitrate,set_curr_video_injected_bitrate,"N/A") //includes FEC overhead - L_RO_PROP(QString,curr_video0_injected_pps,set_curr_video0_injected_pps,"-1pps") //includes FEC overhead + L_RO_PROP(QString,curr_video_injected_pps,set_curr_video_injected_pps,"-1pps") //includes FEC overhead // total n of frames that were dropped on the tx (hints at too high bitrate) L_RO_PROP(int,total_n_tx_dropped_frames,set_total_n_tx_dropped_frames,0) // calculated in fixed X second interval(s) - n of tx frames dropped during this interval L_RO_PROP(int,curr_delta_tx_dropped_frames,set_curr_delta_tx_dropped_frames,0) // DEV stats - L_RO_PROP(QString,curr_video0_fec_encode_time_avg_min_max,set_curr_video0_fec_encode_time_avg_min_max,"avg na, min na, max na") - L_RO_PROP(QString,curr_video0_fec_block_length_min_max_avg,set_curr_video0_fec_block_length_min_max_avg,"avg na, min na, max na") + L_RO_PROP(QString,curr_fec_encode_time_avg_min_max,set_curr_fec_encode_time_avg_min_max,"avg na, min na, max na") + L_RO_PROP(QString,curr_fec_block_length_min_max_avg,set_curr_fec_block_length_min_max_avg,"avg na, min na, max na") L_RO_PROP(QString,curr_time_until_tx_min_max_avg,set_curr_time_until_tx_min_max_avg,"avg na, min na, max na") // Used to show the user a visual indication that the set and measured encoder bitrate are far apart // 0 - all okay, 1= bitrate is too low (yellow), 2= bitrate is too high (red) @@ -58,12 +58,12 @@ class CameraStreamModel : public QObject // // These are generated by the OpenHD ground unit // - L_RO_PROP(QString,curr_video0_received_bitrate_with_fec,set_curr_video0_received_bitrate_with_fec,"N/A") - L_RO_PROP(qint64,video0_count_blocks_total,set_video0_count_blocks_total,-1) - L_RO_PROP(qint64,video0_count_blocks_lost,set_video0_count_blocks_lost,-1) - L_RO_PROP(qint64,video0_count_blocks_recovered,set_video0_count_blocks_recovered,-1) - L_RO_PROP(qint64,video0_count_fragments_recovered,set_video0_count_fragments_recovered,-1) - L_RO_PROP(QString,curr_video0_fec_decode_time_avg_min_max,set_curr_video0_fec_decode_time_avg_min_max,"avg na, min na, max na") + L_RO_PROP(QString,curr_received_bitrate_with_fec,set_curr_received_bitrate_with_fec,"N/A") + L_RO_PROP(qint64,count_blocks_total,set_count_blocks_total,-1) + L_RO_PROP(qint64,count_blocks_lost,set_count_blocks_lost,-1) + L_RO_PROP(qint64,count_blocks_recovered,set_count_blocks_recovered,-1) + L_RO_PROP(qint64,count_fragments_recovered,set_count_fragments_recovered,-1) + L_RO_PROP(QString,curr_fec_decode_time_avg_min_max,set_curr_fec_decode_time_avg_min_max,"avg na, min na, max na") // public: // generated by wb / link diff --git a/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml b/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml index ca2030023..83accd948 100644 --- a/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml +++ b/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml @@ -79,7 +79,7 @@ Rectangle { // air Text { id: test2 - text: qsTr("video0 FEC encode: "+_cameraStreamModelPrimary.curr_video0_fec_encode_time_avg_min_max) + text: qsTr("video0 FEC encode: "+_cameraStreamModelPrimary.curr_fec_encode_time_avg_min_max) } Text { id: testX @@ -87,12 +87,12 @@ Rectangle { } Text { id: test4 - text: qsTr("video0 FEC block length: "+_cameraStreamModelPrimary.curr_video0_fec_block_length_min_max_avg) + text: qsTr("video0 FEC block length: "+_cameraStreamModelPrimary.curr_fec_block_length_min_max_avg) } // ground Text { id: test3 - text: qsTr("video0 FEC decode: "+_cameraStreamModelPrimary.curr_video0_fec_decode_time_avg_min_max) + text: qsTr("video0 FEC decode: "+_cameraStreamModelPrimary.curr_fec_decode_time_avg_min_max) } Text { id: test5 diff --git a/qml/ui/configpopup/openhd_settings/MavlinkExtraWBParamPanel.qml b/qml/ui/configpopup/openhd_settings/MavlinkExtraWBParamPanel.qml index 78fbf2d03..d8e1b8941 100644 --- a/qml/ui/configpopup/openhd_settings/MavlinkExtraWBParamPanel.qml +++ b/qml/ui/configpopup/openhd_settings/MavlinkExtraWBParamPanel.qml @@ -14,7 +14,7 @@ import OpenHD 1.0 import "../../../ui" as Ui import "../../elements" -import QtCharts 2.0 +//simport QtCharts 2.0 // This is an extra screen for changing the frequency / channel width - // They both need to match ! @@ -97,11 +97,18 @@ Rectangle{ console.log("function_rebuild_ui:"+_wbLinkSettingsHelper.ui_rebuild_models); if(_wbLinkSettingsHelper.ui_rebuild_models<=0)return create_list_model_supported(); + //update_pollution_graph(); } + /*property BarCategoryAxis m_bar_category_axis; function update_pollution_graph(){ - - } + const supported_frequencies=_wbLinkSettingsHelper.get_supported_frequencies(); + m_bar_category_axis.categories.clear(); + for(var i=0;i