12 switch (static_cast<int>(val))
37 "Emitter select, 0-disable all emitters, 1-enable laser, 2-enable laser auto (opt), 3-enable LED (opt)")
50 int8_t projector_temperature;
61 reinterpret_cast<uint8_t*>(&temp),
70 int8_t temperature::* field;
71 uint8_t temperature::* is_valid_field;
76 field = &temperature::asic_temperature;
77 is_valid_field = &temperature::is_asic_valid;
80 field = &temperature::projector_temperature;
81 is_valid_field = &temperature::is_projector_valid;
87 if (0 == temperature_data.*is_valid_field)
90 return temperature_data.*field;
108 return "Current Asic Temperature (degree celsius)";
110 return "Current Projector Temperature (degree celsius)";
117 : _option(opt),
_ep(ep)
126 auto data =
_ep.get_custom_report_data(custom_sensor_name, report_name, report_field);
130 auto data_str =
std::string(reinterpret_cast<char const*>(
data.data()));
141 auto min_data =
_ep.get_custom_report_data(custom_sensor_name, report_name, min_report_field);
142 auto max_data =
_ep.get_custom_report_data(custom_sensor_name, report_name, max_report_field);
143 if (min_data.empty() || max_data.empty())
146 auto min_str =
std::string(reinterpret_cast<char const*>(min_data.data()));
147 auto max_str =
std::string(reinterpret_cast<char const*>(max_data.data()));
161 return "Current Motion-Module Temperature (degree celsius)";
173 _is_active = value > _opt_range.min;
174 _recording_function(*
this);
179 auto is_active = _is_active.load();
180 return is_active ? _opt_range.max : _opt_range.min;
193 auto auto_exposure_prev_state = _auto_exposure_state->get_enable_auto_exposure();
194 _auto_exposure_state->set_enable_auto_exposure(0.
f < std::fabs(value));
196 if (_auto_exposure_state->get_enable_auto_exposure())
198 if (!auto_exposure_prev_state)
200 _to_add_frames =
true;
205 if (auto_exposure_prev_state)
207 _to_add_frames =
false;
215 return _auto_exposure_state->get_enable_auto_exposure();
223 _auto_exposure_state(auto_exposure_state),
224 _to_add_frames((_auto_exposure_state->get_enable_auto_exposure())),
225 _auto_exposure(auto_exposure)
231 const std::map<float, std::string>& description_per_value)
235 _description_per_value(description_per_value)
258 catch(std::out_of_range)
290 const std::map<float, std::string>& description_per_value)
292 _description_per_value(description_per_value),
317 catch(std::out_of_range)
328 auto res = _hwm.send(cmd);
331 throw std::runtime_error(
"Not enough bytes returned from the firmware!");
345 (float)(0.000001 * max.depth_units),
356 depth_table.depth_units =
static_cast<uint32_t>(1000000 *
value);
357 auto ptr = (
uint8_t*)(&depth_table);
368 return (
float)(0.000001 * (float)
table.depth_units);
377 :
_hwm(hwm), _sensor(ep), _ver(ver)
398 throw std::runtime_error(
"Cannot change Inter-camera HW synchronization mode while streaming!");
402 else if (value == 259)
406 else if (value == 260)
413 cmd.
param1 |= (
static_cast<int>(value - 3)) << 8;
429 return (
res.front());
430 else if (
res[2] == 0x01)
434 else if (
res[2] == 0x03)
439 return (static_cast<float>(
res[1]) + 3.0f);
459 throw std::runtime_error(
"Cannot change Emitter On/Off option while streaming!");
475 return (
res.front());
486 return "Inter-camera synchronization mode: 0:Default, 1:Master, 2:Slave, 3:Full Salve, 4-258:Genlock with burst count of 1-255 frames for each trigger, 259 and 260 for two frames per trigger with laser ON-OFF and OFF-ON.";
488 return "Inter-camera synchronization mode: 0:Default, 1:Master, 2:Slave, 3:Full Salve, 4-258:Genlock with burst count of 1-255 frames for each trigger";
490 return "Inter-camera synchronization mode: 0:Default, 1:Master, 2:Slave";
494 :
_hwm(hwm),
_sensor(ep), _is_fw_version_using_id(is_fw_version_using_id)
504 std::vector<uint8_t>
pattern{};
506 if (static_cast<int>(value))
548 return (alt_emitter_name ==
res);
579 return (
res.front());
590 _hdr_cfg->set(_option, value,
_range);
596 return _hdr_cfg->get(_option);
606 if (_description_per_value.find(val) != _description_per_value.end())
607 return _description_per_value.at(val).c_str();
614 if (_hdr_cfg->is_config_in_process())
615 _hdr_option->set(value);
618 if (_hdr_cfg->is_enabled())
619 LOG_WARNING(
"The control - " << _uvc_option->get_description()
620 <<
" - is locked while HDR mode is active.\n");
622 _uvc_option->set(value);
628 if (_hdr_cfg->is_config_in_process())
629 return _hdr_option->query();
631 return _uvc_option->query();
636 if (_hdr_cfg->is_config_in_process())
637 return _hdr_option->get_range();
639 return _uvc_option->get_range();
644 if (_hdr_cfg->is_config_in_process())
645 return _hdr_option->get_description();
647 return _uvc_option->get_description();
652 if (_hdr_cfg->is_config_in_process())
653 return _hdr_option->is_enabled();
655 return _uvc_option->is_enabled();
674 std::vector<uint8_t> ret =
_hwm.
send(cmd_get);
695 return static_cast<float>(*(
reinterpret_cast<uint32_t*
>(
res.data())));
719 std::vector<uint8_t> ret =
_hwm.
send(cmd_get);
740 return static_cast<float>(*(
reinterpret_cast<uint32_t*
>(
res.data() + 4)));
749 std::shared_ptr<ds5_thermal_monitor> monitor,
750 std::shared_ptr<option>
toggle) :
751 _thermal_monitor(monitor),
752 _thermal_toggle(toggle)
773 return "Toggle thermal compensation adjustments mechanism";
780 return "Thermal compensation is disabled";
784 return "Thermal compensation is enabled";
791 snapshot = std::make_shared<const_value_option>(
get_description(), 0.f);
const std::vector< uint8_t > alternating_emitter_pattern
void set(float value) override
const option_range _opt_range
std::shared_ptr< auto_exposure_mechanism > _auto_exposure
bool is_streaming() const override
virtual option_range get_range() const override
const int etDepthTableControl
float stof(const std::string &value)
const char * get_description() const override
std::function< void(const option &)> _recording_function
auto_exposure_antiflicker_rate_option(std::shared_ptr< auto_exposure_mechanism > auto_exposure, std::shared_ptr< auto_exposure_state > auto_exposure_state, const option_range &opt_range, const std::map< float, std::string > &description_per_value)
void set(float value) override
virtual float query() const override
auto invoke_powered(T action) -> decltype(action(*static_cast< platform::uvc_device * >(nullptr)))
const char * get_value_description(float val) const override
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
const char * get_description() const override
lazy< option_range > _range
float query() const override
void set(float value) override
auto_exposure_limit_option(hw_monitor &hwm, sensor_base *depth_ep, option_range range)
thermal_compensation(std::shared_ptr< ds5_thermal_monitor > monitor, std::shared_ptr< option > toggle)
option_range get_range() const override
enable_motion_correction(sensor_base *mm_ep, const option_range &opt_range)
alternating_emitter_option(hw_monitor &hwm, sensor_base *depth_ep, bool is_fw_version_using_id)
std::shared_ptr< auto_exposure_mechanism > _auto_exposure
virtual void set(float value) override
bool is_enabled() const override
lazy< option_range > _range
std::shared_ptr< option > _thermal_toggle
virtual float query() const override
lazy< option_range > _range
virtual option_range get_range() const override
std::function< void(const option &)> _record_action
GLsizei const GLchar *const * string
const char * get_description() const override
auto_exposure_mode_option(std::shared_ptr< auto_exposure_mechanism > auto_exposure, std::shared_ptr< auto_exposure_state > auto_exposure_state, const option_range &opt_range, const std::map< float, std::string > &description_per_value)
virtual float query() const override
virtual float query() const override
const char * get_value_description(float val) const override
void set(float value) override
std::shared_ptr< auto_exposure_mechanism > _auto_exposure
bool is_enabled() const override
std::shared_ptr< auto_exposure_state > _auto_exposure_state
bool is_valid(const plane_3d &p)
virtual void set(float value) override
asic_and_projector_temperature_options(uvc_sensor &ep, rs2_option opt)
virtual void set(float value) override
float query() const override
virtual void set(float value) override
virtual float query() const override
float query() const override
bool _is_fw_version_using_id
virtual float query() const override
std::function< void(const option &)> _record_action
lazy< option_range > _range
std::vector< uint8_t > send(std::vector< uint8_t > const &data) const
std::shared_ptr< auto_exposure_mechanism > _auto_exposure
virtual option_range get_range() const override
const uint8_t ALTERNATING_EMITTER_SUBPRESET_ID
std::shared_ptr< auto_exposure_state > _auto_exposure_state
virtual float query() const override
std::function< void(const option &)> _record_action
emitter_always_on_option(hw_monitor &hwm, sensor_base *depth_ep)
float query() const override
virtual float query() const override
std::vector< uint8_t > data
std::function< void(const option &)> _record_action
virtual option_range get_range() const override
float query() const override
std::function< void(const option &)> _record_action
const char * get_value_description(float val) const override
virtual option_range get_range() const override
const std::map< float, std::string > _description_per_value
virtual option_range get_range() const override
std::shared_ptr< auto_exposure_state > _auto_exposure_state
const platform::extension_unit depth_xu
lazy< option_range > _range
virtual void set(float value) override
virtual void set(float value) override
virtual void set(float value) override
depth_scale_option(hw_monitor &hwm)
virtual void set(float value) override
virtual void set(float value) override
std::function< void(const option &)> _recording_function
void set(float value) override
void create_snapshot(std::shared_ptr< option > &snapshot) const override
GLenum GLenum GLsizei void * table
emitter_option(uvc_sensor &ep)
float query() const override
ds::depth_table_control get_depth_table(ds::advanced_query_mode mode) const
float query() const override
void set(float value) override
const std::map< float, std::string > _description_per_value
const char * get_description() const override
const uint8_t DS5_DEPTH_EMITTER_ENABLED
auto_gain_limit_option(hw_monitor &hwm, sensor_base *depth_ep, option_range range)
virtual float query() const override
virtual bool is_enabled() const override
lazy< option_range > _range
lazy< option_range > _range
std::shared_ptr< auto_exposure_state > _auto_exposure_state
motion_module_temperature_option(hid_sensor &ep)
enable_auto_exposure_option(synthetic_sensor *fisheye_ep, std::shared_ptr< auto_exposure_mechanism > auto_exposure, std::shared_ptr< auto_exposure_state > auto_exposure_state, const option_range &opt_range)
virtual const char * get_value_description(float) const override
bool is_enabled() const override
emitter_on_and_off_option(hw_monitor &hwm, sensor_base *depth_ep)
const char * get_value_description(float value) const override
virtual const char * get_option_name(rs2_option option) const override
virtual const char * get_description() const override
external_sync_mode(hw_monitor &hwm, sensor_base *depth_ep=nullptr, int ver=1)
bool is_valid(float value) const
std::function< void(const option &)> _record_action
option_range get_range() const override
virtual option_range get_range() const override
virtual option_range get_range() const override
auto_exposure_step_option(std::shared_ptr< auto_exposure_mechanism > auto_exposure, std::shared_ptr< auto_exposure_state > auto_exposure_state, const option_range &opt_range)
const std::vector< uint8_t > alternating_emitter_pattern_with_name
const uint8_t DS5_ASIC_AND_PROJECTOR_TEMPERATURES
float query() const override
std::function< void(const option &)> _record_action
std::string to_string(T value)