Skip to content

Commit

Permalink
mode asic & proj temperatures to d400 only
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed Dec 11, 2023
1 parent cd2a5ec commit 5a66f01
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
21 changes: 21 additions & 0 deletions src/ds/d400/d400-active.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uvc_sensor>(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<projector_temperature_option_mipi>(_hw_monitor,
RS2_OPTION_PROJECTOR_TEMPERATURE));
}
else
{
depth_ep.register_option(RS2_OPTION_PROJECTOR_TEMPERATURE,
std::make_shared<asic_and_projector_temperature_options>(std::move(uvc_s),
RS2_OPTION_PROJECTOR_TEMPERATURE));
}
}
}
23 changes: 4 additions & 19 deletions src/ds/ds-active-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <backend-device.h>

namespace librealsense
{
Expand Down Expand Up @@ -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<projector_temperature_option_mipi>(_hw_monitor,
RS2_OPTION_PROJECTOR_TEMPERATURE));
}
else
{
auto uvc_s = std::dynamic_pointer_cast<uvc_sensor>(_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<asic_and_projector_temperature_options>(std::move(uvc_s),
RS2_OPTION_PROJECTOR_TEMPERATURE));
}
}
else
{
Expand Down
2 changes: 0 additions & 2 deletions src/ds/ds-options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "ds-options.h"
#include <src/hid-sensor.h>
#include <memory>



namespace librealsense
Expand Down

0 comments on commit 5a66f01

Please sign in to comment.