Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options: add BOOLEAN & ENUM; rs2_set_option_value #12708

Merged
merged 17 commits into from Mar 4, 2024

Conversation

maloel
Copy link
Collaborator

@maloel maloel commented Feb 26, 2024

Followup to previous options PR:

  • add is_valid member to rs2_option_value
  • add BOOLEAN and ENUM option types
  • added tests for librealsense interoperability
  • options now have get_value() returning json and get_value_type()
  • get booleans and enums with the old APIs (to get them as floats)
  • add rs2::options_list::get_supported_option_values() alongside get_supported_options() (the latter only returned the option IDs; now you can get the values, as well)
  • set with rs2_set_option
  • added rs2_set_option_value, enabling string (IP address, enum, etc.) sets
  • revise Viewer options handling and fix crash caused by changes in JSON-based DDS options #12650 (HSD 15015552561)
  • fix options_watcher querying options that aren't enabled (and in thermal loop)

@maloel maloel requested a review from OhadMeir February 26, 2024 20:16
src/dds/rs-dds-option.cpp Outdated Show resolved Hide resolved
@maloel maloel changed the title Options: add BOOLEAN & ENUM Options: add BOOLEAN & ENUM; rs2_set_option_value Mar 1, 2024
src/rs.cpp Show resolved Hide resolved
src/rs.cpp Outdated Show resolved Hide resolved
src/dds/rs-dds-option.cpp Outdated Show resolved Hide resolved
labels.push_back( endpoint->get_option_value_description( opt, i ) );
}
int selected;
std::vector< const char * > labels = get_combo_labels( &selected );
ImGui::PushStyleColor( ImGuiCol_TextSelectedBg, { 1, 1, 1, 1 } );

try
{
int tmp_selected = selected;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need tmp_selected, can't we just use selected?
Don't we need to update selected later?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it should be possible to just use selected. Doesn't look like selected is used after...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@maloel maloel merged commit a65aa0b into IntelRealSense:development Mar 4, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants