Skip to content

Commit

Permalink
PR IntelRealSense#11034 from remibettan: D4 xx emitter on off
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Oct 27, 2022
2 parents e45b1fa + 1414e05 commit dee61e5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
45 changes: 21 additions & 24 deletions src/ds5/ds5-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,31 +1050,28 @@ namespace librealsense
options_and_reasons));
}

if (!mipi_sensor)
if (_fw_version >= hdr_firmware_version)
{
if (_fw_version >= hdr_firmware_version)
{
std::vector<std::pair<std::shared_ptr<option>, std::string>> options_and_reasons = { std::make_pair(hdr_enabled_option, "Emitter ON/OFF cannot be set while HDR is enabled"),
std::make_pair(emitter_always_on_opt, "Emitter ON/OFF cannot be set while Emitter always ON is enabled") };
depth_sensor.register_option(RS2_OPTION_EMITTER_ON_OFF,
std::make_shared<gated_option>(
alternating_emitter_opt,
options_and_reasons
));
}
else if ((_fw_version >= firmware_version("5.12.1.0")) && ((_device_capabilities & d400_caps::CAP_GLOBAL_SHUTTER) == d400_caps::CAP_GLOBAL_SHUTTER))
{
std::vector<std::pair<std::shared_ptr<option>, std::string>> options_and_reasons = { std::make_pair(emitter_always_on_opt,
"Emitter ON/OFF cannot be set while Emitter always ON is enabled") };
depth_sensor.register_option(RS2_OPTION_EMITTER_ON_OFF,
std::make_shared<gated_option>(
alternating_emitter_opt,
options_and_reasons));
}
else
{
depth_sensor.register_option(RS2_OPTION_EMITTER_ON_OFF, alternating_emitter_opt);
}
std::vector<std::pair<std::shared_ptr<option>, std::string>> options_and_reasons = { std::make_pair(hdr_enabled_option, "Emitter ON/OFF cannot be set while HDR is enabled"),
std::make_pair(emitter_always_on_opt, "Emitter ON/OFF cannot be set while Emitter always ON is enabled") };
depth_sensor.register_option(RS2_OPTION_EMITTER_ON_OFF,
std::make_shared<gated_option>(
alternating_emitter_opt,
options_and_reasons
));
}
else if ((_fw_version >= firmware_version("5.12.1.0")) && ((_device_capabilities & d400_caps::CAP_GLOBAL_SHUTTER) == d400_caps::CAP_GLOBAL_SHUTTER))
{
std::vector<std::pair<std::shared_ptr<option>, std::string>> options_and_reasons = { std::make_pair(emitter_always_on_opt,
"Emitter ON/OFF cannot be set while Emitter always ON is enabled") };
depth_sensor.register_option(RS2_OPTION_EMITTER_ON_OFF,
std::make_shared<gated_option>(
alternating_emitter_opt,
options_and_reasons));
}
else
{
depth_sensor.register_option(RS2_OPTION_EMITTER_ON_OFF, alternating_emitter_opt);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ namespace librealsense
{
auto strong = gated.first.lock();
if (!strong)
return;
continue; // if gated option is not available, step over it
auto val = strong->query();
if (val)
{
Expand Down

0 comments on commit dee61e5

Please sign in to comment.