Skip to content

Commit

Permalink
semantic change
Browse files Browse the repository at this point in the history
  • Loading branch information
remibettan committed Oct 11, 2020
1 parent f3a46ef commit 68c1cb8
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/ds5/ds5-active.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,8 @@ namespace librealsense
auto&& depth_ep = get_depth_sensor();
auto&& raw_depth_ep = get_raw_depth_sensor();

auto emitter_enabled = std::make_shared<emitter_option>(raw_depth_ep);
std::shared_ptr<option> hdr_enabled_option(depth_ep.get_option_handler(RS2_OPTION_HDR_ENABLED));

//EMITTER ENABLED OPTION
if (hdr_enabled_option)
{
depth_ep.register_option(RS2_OPTION_EMITTER_ENABLED,
std::make_shared<gated_option>(
emitter_enabled,
hdr_enabled_option,
"Emitter status cannot be set while HDR is enabled"));
}
else
{
depth_ep.register_option(RS2_OPTION_EMITTER_ENABLED, emitter_enabled);
}
auto emitter_enabled = std::make_shared<emitter_option>(raw_depth_ep);

//LASER POWER OPTION
auto laser_power = std::make_shared<uvc_xu_option<uint16_t>>(raw_depth_ep,
Expand All @@ -60,8 +46,14 @@ namespace librealsense
emitter_enabled,
std::vector<float>{0.f, 2.f}, 1.f);

if (hdr_enabled_option)
if (auto hdr_enabled_option = depth_ep.get_option_handler(RS2_OPTION_HDR_ENABLED))
{
depth_ep.register_option(RS2_OPTION_EMITTER_ENABLED,
std::make_shared<gated_option>(
emitter_enabled,
hdr_enabled_option,
"Emitter status cannot be set while HDR is enabled"));

depth_ep.register_option(RS2_OPTION_LASER_POWER,
std::make_shared<gated_option>(
laser_power_auto_disabling,
Expand All @@ -70,6 +62,7 @@ namespace librealsense
}
else
{
depth_ep.register_option(RS2_OPTION_EMITTER_ENABLED, emitter_enabled);
depth_ep.register_option(RS2_OPTION_LASER_POWER, laser_power_auto_disabling);
}

Expand Down

0 comments on commit 68c1cb8

Please sign in to comment.