From 5a66f01d59a80834a87b9bec8e0187b83cc16409 Mon Sep 17 00:00:00 2001 From: Nir Azkiel Date: Mon, 11 Dec 2023 14:08:10 +0200 Subject: [PATCH] mode asic & proj temperatures to d400 only --- src/ds/d400/d400-active.cpp | 21 +++++++++++++++++++++ src/ds/ds-active-common.cpp | 23 ++++------------------- src/ds/ds-options.cpp | 2 -- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/ds/d400/d400-active.cpp b/src/ds/d400/d400-active.cpp index 20a1bfc570..0ffd180cf4 100644 --- a/src/ds/d400/d400-active.cpp +++ b/src/ds/d400/d400-active.cpp @@ -29,5 +29,26 @@ namespace librealsense _device_capabilities, _hw_monitor, _fw_version); _ds_active_common->register_options(); + + //PROJECTOR TEMPERATURE OPTION + auto pid = this->_pid; + auto& depth_ep = get_depth_sensor(); + auto &raw_depth_ep = get_raw_depth_sensor(); + auto uvc_s = std::dynamic_pointer_cast(raw_depth_ep.shared_from_this()); + if (!uvc_s) + throw std::runtime_error("Sensor base is not uvc sensor"); + + if (pid == ds::RS457_PID) + { + depth_ep.register_option(RS2_OPTION_PROJECTOR_TEMPERATURE, + std::make_shared(_hw_monitor, + RS2_OPTION_PROJECTOR_TEMPERATURE)); + } + else + { + depth_ep.register_option(RS2_OPTION_PROJECTOR_TEMPERATURE, + std::make_shared(std::move(uvc_s), + RS2_OPTION_PROJECTOR_TEMPERATURE)); + } } } diff --git a/src/ds/ds-active-common.cpp b/src/ds/ds-active-common.cpp index 26517e1485..c63087a9c9 100644 --- a/src/ds/ds-active-common.cpp +++ b/src/ds/ds-active-common.cpp @@ -2,7 +2,10 @@ // Copyright(c) 2022 Intel Corporation. All Rights Reserved. #include "ds-active-common.h" -#include "d400/d400-color.h" +#include "d400/d400-private.h" // for RS_USB2_PID +#include "ds-options.h" + +#include namespace librealsense { @@ -62,24 +65,6 @@ namespace librealsense _depth_ep.register_option(RS2_OPTION_EMITTER_ENABLED, emitter_enabled); _depth_ep.register_option(RS2_OPTION_LASER_POWER, laser_power_auto_disabling); } - - //PROJECTOR TEMPERATURE OPTION - if (pid == ds::RS457_PID) - { - _depth_ep.register_option(RS2_OPTION_PROJECTOR_TEMPERATURE, - std::make_shared(_hw_monitor, - RS2_OPTION_PROJECTOR_TEMPERATURE)); - } - else - { - auto uvc_s = std::dynamic_pointer_cast(_raw_depth_ep.shared_from_this()); - if (!uvc_s) - throw std::runtime_error("Sensor base is not uvc sensor"); - - _depth_ep.register_option(RS2_OPTION_PROJECTOR_TEMPERATURE, - std::make_shared(std::move(uvc_s), - RS2_OPTION_PROJECTOR_TEMPERATURE)); - } } else { diff --git a/src/ds/ds-options.cpp b/src/ds/ds-options.cpp index 39f0c6056c..e25bdfa337 100644 --- a/src/ds/ds-options.cpp +++ b/src/ds/ds-options.cpp @@ -4,8 +4,6 @@ #include "ds-options.h" #include -#include - namespace librealsense