diff --git a/common/motion-dashboard.cpp b/common/motion-dashboard.cpp index 22948a65dd..3d3d0ad305 100644 --- a/common/motion-dashboard.cpp +++ b/common/motion-dashboard.cpp @@ -29,9 +29,8 @@ void motion_dashboard::process_frame( rs2::frame f ) && ( f.as< rs2::motion_frame >() ).get_profile().stream_type() == stream_type ) { double ts = glfwGetTime(); - auto it = frame_to_time.find( f.get_profile().unique_id() ); - if( ts - last_time > dashboard_update_rate && it != frame_to_time.end() ) + if( ts - last_time > dashboard_update_rate ) { rs2::motion_frame frame = f.as< rs2::motion_frame >(); @@ -56,8 +55,6 @@ void motion_dashboard::process_frame( rs2::frame f ) last_time = ts; } - - frame_to_time[f.get_profile().unique_id()] = ts; } } ); } @@ -173,7 +170,11 @@ void motion_dashboard::show_radiobuttons() void motion_dashboard::show_data_rate_slider() { - ImGui::PushItemWidth( 100 ); + if( ( ImGui::GetContentRegionMax().x - ImGui::GetCursorPosX() - 10.f ) < 100 ) + ImGui::PushItemWidth( ImGui::GetContentRegionMax().x - ImGui::GetCursorPosX() - 10.f ); + else + ImGui::PushItemWidth( 100 ); + ImGui::SliderFloat( "##rate", &dashboard_update_rate, MIN_FRAME_RATE, MAX_FRAME_RATE, "%.2f" ); ImGui::GetWindowWidth(); diff --git a/common/motion-dashboard.h b/common/motion-dashboard.h index f6818f4a15..08656328b2 100644 --- a/common/motion-dashboard.h +++ b/common/motion-dashboard.h @@ -33,7 +33,6 @@ namespace rs2 float dashboard_update_rate; double last_time; - std::map< int, double > frame_to_time; const char * x_axes_name = "X"; const char * y_axes_name = "Y"; diff --git a/common/ux-window.cpp b/common/ux-window.cpp index 4cb40d1b89..760581015d 100644 --- a/common/ux-window.cpp +++ b/common/ux-window.cpp @@ -72,7 +72,7 @@ namespace rs2 config_file::instance().set_default(configurations::viewer::metric_system, true); config_file::instance().set_default(configurations::viewer::ground_truth_r, 2500); config_file::instance().set_default(configurations::viewer::dashboard_open, true); - config_file::instance().set_default(configurations::viewer::last_opened_dashboard, 1 ); + config_file::instance().set_default(configurations::viewer::last_opened_dashboard, 0 ); config_file::instance().set_default(configurations::record::compression_mode, 2); // Let the device decide config_file::instance().set_default(configurations::record::file_save_mode, 0); // Auto-select name