d400-thermal-monitor.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2021 Intel Corporation. All Rights Reserved.
3 #pragma once
4 
5 #include "sensor.h"
6 #include "device-calibration.h"
7 #include <set>
8 
9 
10 namespace librealsense
11 {
12 
14  {
15  public:
16  d400_thermal_monitor(std::shared_ptr<option> temp_option,
17  std::shared_ptr<option> tl_toggle);
19 
20  void update(bool on);
21  void add_observer(std::function<void(float)> callback)
22  {
23  _thermal_changes_callbacks.push_back(callback);
24  }
25 
26  private:
27  d400_thermal_monitor(const d400_thermal_monitor&) = delete; // disable copy and assignment ctors
29 
30  // Active Object's main routine
31  void polling(dispatcher::cancellable_timer cancellable_timer);
32  void notify(float temperature);
33 
35  unsigned int _poll_intervals_ms;
37  float _temp_base;
39  std::weak_ptr<option> _temperature_sensor;
40  std::weak_ptr<option> _tl_activation;
41  std::vector<std::function<void(float)>> _thermal_changes_callbacks; // Distribute notifications on device thermal changes
42  };
43 
48  {
49  public:
50  d400_thermal_tracking(std::shared_ptr<d400_thermal_monitor> monitor):
51  _monitor(monitor)
52  {
53  if (auto mon = _monitor.lock())
54  mon->add_observer([&](float)
55  {
56  for (auto && cb : _user_callbacks)
58  });
59  }
60 
62  {
63  _user_callbacks.insert(callback);
64  }
65 
66  private:
67  std::weak_ptr<d400_thermal_monitor> _monitor;
68  std::set< rs2_calibration_change_callback_sptr > _user_callbacks;
69  };
70 
71 }
RS2_CALIBRATION_SUCCESSFUL
@ RS2_CALIBRATION_SUCCESSFUL
Definition: rs_device.h:421
librealsense
Definition: algo.h:18
active_object
Definition: concurrency.h:406
dispatcher::cancellable_timer
Definition: concurrency.h:279
rs2_calibration_change_callback_sptr
std::shared_ptr< rs2_calibration_change_callback > rs2_calibration_change_callback_sptr
Definition: rs_types.hpp:73
librealsense::d400_thermal_tracking
Definition: d400-thermal-monitor.h:47
device-calibration.h
void
typedef void(APIENTRY *GLDEBUGPROC)(GLenum source
librealsense::calibration_change_device
Definition: device-calibration.h:13
librealsense::d400_thermal_tracking::register_calibration_change_callback
void register_calibration_change_callback(rs2_calibration_change_callback_sptr callback) override
Definition: d400-thermal-monitor.h:61
librealsense::d400_thermal_monitor::_tl_activation
std::weak_ptr< option > _tl_activation
Definition: d400-thermal-monitor.h:40
librealsense::d400_thermal_tracking::_user_callbacks
std::set< rs2_calibration_change_callback_sptr > _user_callbacks
Definition: d400-thermal-monitor.h:68
sensor.h
librealsense::d400_thermal_monitor::d400_thermal_monitor
d400_thermal_monitor(std::shared_ptr< option > temp_option, std::shared_ptr< option > tl_toggle)
Definition: d400-thermal-monitor.cpp:12
librealsense::d400_thermal_monitor::polling
void polling(dispatcher::cancellable_timer cancellable_timer)
Definition: d400-thermal-monitor.cpp:51
librealsense::d400_thermal_monitor::notify
void notify(float temperature)
Definition: d400-thermal-monitor.cpp:110
librealsense::d400_thermal_monitor::_hw_loop_on
bool _hw_loop_on
Definition: d400-thermal-monitor.h:38
librealsense::d400_thermal_monitor::_thermal_threshold_deg
float _thermal_threshold_deg
Definition: d400-thermal-monitor.h:36
librealsense::d400_thermal_monitor::_temperature_sensor
std::weak_ptr< option > _temperature_sensor
Definition: d400-thermal-monitor.h:39
librealsense::d400_thermal_monitor::_poll_intervals_ms
unsigned int _poll_intervals_ms
Definition: d400-thermal-monitor.h:35
librealsense::d400_thermal_monitor::_monitor
active_object _monitor
Definition: d400-thermal-monitor.h:34
librealsense::d400_thermal_tracking::_monitor
std::weak_ptr< d400_thermal_monitor > _monitor
Definition: d400-thermal-monitor.h:67
librealsense::d400_thermal_monitor::add_observer
void add_observer(std::function< void(float)> callback)
Definition: d400-thermal-monitor.h:21
librealsense::d400_thermal_monitor::_thermal_changes_callbacks
std::vector< std::function< void(float)> > _thermal_changes_callbacks
Definition: d400-thermal-monitor.h:41
librealsense::d400_thermal_monitor
Definition: d400-thermal-monitor.h:13
librealsense::d400_thermal_monitor::operator=
d400_thermal_monitor & operator=(const d400_thermal_monitor &)=delete
test-color_frame_frops.cb
def cb(frame, ts)
Definition: test-color_frame_frops.py:29
librealsense::d400_thermal_monitor::~d400_thermal_monitor
~d400_thermal_monitor()
Definition: d400-thermal-monitor.cpp:27
librealsense::d400_thermal_monitor::update
void update(bool on)
Definition: d400-thermal-monitor.cpp:34
librealsense::d400_thermal_tracking::d400_thermal_tracking
d400_thermal_tracking(std::shared_ptr< d400_thermal_monitor > monitor)
Definition: d400-thermal-monitor.h:50
librealsense::d400_thermal_monitor::_temp_base
float _temp_base
Definition: d400-thermal-monitor.h:37


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:02