diff --git a/src/ds/d500/d500-color.cpp b/src/ds/d500/d500-color.cpp index ec92b6d9aa..4ecdc81b7b 100644 --- a/src/ds/d500/d500-color.cpp +++ b/src/ds/d500/d500-color.cpp @@ -143,13 +143,8 @@ namespace librealsense { 1.f, "50Hz" }, { 2.f, "60Hz" } }; - if (val_in_range(_pid, { ds::D555E_PID })) - { - description_per_value.insert(std::make_pair(3.f, "AUTO")); - } - color_ep.register_option(RS2_OPTION_POWER_LINE_FREQUENCY, - std::make_shared(raw_color_ep, RS2_OPTION_POWER_LINE_FREQUENCY, + std::make_shared(raw_color_ep, RS2_OPTION_POWER_LINE_FREQUENCY, description_per_value)); color_ep.register_pu(RS2_OPTION_AUTO_EXPOSURE_PRIORITY); diff --git a/src/ds/d500/d500-options.cpp b/src/ds/d500/d500-options.cpp index 57ee6e8bc5..c4765c8a38 100644 --- a/src/ds/d500/d500-options.cpp +++ b/src/ds/d500/d500-options.cpp @@ -50,4 +50,8 @@ namespace librealsense return temperature; } + + power_line_freq_option::power_line_freq_option(const std::weak_ptr< uvc_sensor >& ep, rs2_option id, + const std::map< float, std::string >& description_per_value) : + uvc_pu_option(ep, id, description_per_value) {} } diff --git a/src/ds/d500/d500-options.h b/src/ds/d500/d500-options.h index 698166e128..4196974412 100644 --- a/src/ds/d500/d500-options.h +++ b/src/ds/d500/d500-options.h @@ -6,6 +6,7 @@ #include "ds/ds-private.h" #include "core/options-container.h" #include "option.h" +#include "platform/uvc-option.h" #include @@ -74,4 +75,20 @@ namespace librealsense temperature_component _component; const char* _description; }; + + class power_line_freq_option : public uvc_pu_option + { + public: + explicit power_line_freq_option(const std::weak_ptr< uvc_sensor >& ep, rs2_option id, + const std::map< float, std::string >& description_per_value); + + virtual option_range get_range() const override + { + // this hardcoded max range has been done because + // some d500 devices do not support the "AUTO" value + auto range = uvc_pu_option::get_range(); + range.max = 2.f; + return range; + } + }; }