Skip to content

Commit

Permalink
Prevent depth calibration profile to be selected in DQT
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadMeir committed Nov 28, 2024
1 parent a75366f commit 6577433
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
39 changes: 39 additions & 0 deletions common/subdevice-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,45 @@ namespace rs2
return is_cal_format;
}

bool subdevice_model::is_depth_calibration_profile() const
{
// Check if D555 at depth resolution of 1280x800
std::string dev_name = "";
if( dev.supports( RS2_CAMERA_INFO_NAME ) )
dev_name = dev.get_info( RS2_CAMERA_INFO_NAME );

if( dev_name.find( "D555" ) != std::string::npos )
{
// More efficient to check resolution before format
if( ui.selected_res_id > 0 && res_values.size() > ui.selected_res_id && // Verify res_values is initialized
res_values[ui.selected_res_id].first == 1280 && res_values[ui.selected_res_id].second == 800 )
{
for( auto it = stream_enabled.begin(); it != stream_enabled.end(); ++it )
{
if( it->second )
{
int selected_format_index = -1;
if( ui.selected_format_id.count( it->first ) > 0 )
selected_format_index = ui.selected_format_id.at( it->first );

if( format_values.count( it->first ) > 0 && selected_format_index > -1 )
{
auto formats = format_values.at( it->first );
if( formats.size() > selected_format_index )
{
auto format = formats[selected_format_index];
if( format == RS2_FORMAT_Z16 )
return true;
}
}
}
}
}
}

return false;
}

std::pair<int, int> subdevice_model::get_max_resolution(rs2_stream stream) const
{
if (resolutions_per_stream.count(stream) > 0)
Expand Down
2 changes: 2 additions & 0 deletions common/subdevice-model.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ namespace rs2
return false;
}

bool is_depth_calibration_profile() const;

viewer_model& viewer;
std::function<void()> on_frame = [] {};

Expand Down
3 changes: 2 additions & 1 deletion tools/depth-quality/depth-quality-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,8 @@ namespace rs2

if (_depth_sensor_model->draw_stream_selection(_error_message))
{
if (_depth_sensor_model->is_selected_combination_supported())
if (_depth_sensor_model->is_selected_combination_supported() &&
!_depth_sensor_model->is_depth_calibration_profile())
{
// Preserve streams and ui selections
auto primary = _depth_sensor_model->get_selected_profiles().front().as<video_stream_profile>();
Expand Down

0 comments on commit 6577433

Please sign in to comment.