Skip to content

Commit

Permalink
default dashboard fixed
Browse files Browse the repository at this point in the history
A slider size is fixed for a small viewer size.
  • Loading branch information
Tamir91 committed Mar 5, 2024
1 parent 8a95915 commit 8b16100
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
11 changes: 6 additions & 5 deletions common/motion-dashboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 >();

Expand All @@ -56,8 +55,6 @@ void motion_dashboard::process_frame( rs2::frame f )

last_time = ts;
}

frame_to_time[f.get_profile().unique_id()] = ts;
}
} );
}
Expand Down Expand Up @@ -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();

Expand Down
1 change: 0 additions & 1 deletion common/motion-dashboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion common/ux-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b16100

Please sign in to comment.