From fdd8a45173dd48d746323aebba2993acdefc1b77 Mon Sep 17 00:00:00 2001 From: Remi Bettan Date: Tue, 2 Apr 2024 16:04:32 +0300 Subject: [PATCH] projector temperature restored in the test, is supported added --- .../live/d500/test-temperatures-xu-vs-hwmc.py | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/unit-tests/live/d500/test-temperatures-xu-vs-hwmc.py b/unit-tests/live/d500/test-temperatures-xu-vs-hwmc.py index 169e8c6764..f2a3c4a9e0 100644 --- a/unit-tests/live/d500/test-temperatures-xu-vs-hwmc.py +++ b/unit-tests/live/d500/test-temperatures-xu-vs-hwmc.py @@ -18,14 +18,17 @@ def get_temperatures_from_xu(): pvt_temp = -10 ohm_temp = -10 + proj_temp = -10 test.check(depth_sensor.supports(rs.option.soc_pvt_temperature)) test.check(depth_sensor.supports(rs.option.ohm_temperature)) + test.check(depth_sensor.supports(rs.option.projector_temperature)) pvt_temp = depth_sensor.get_option(rs.option.soc_pvt_temperature) ohm_temp = depth_sensor.get_option(rs.option.ohm_temperature) + proj_temp = depth_sensor.get_option(rs.option.projector_temperature) - return pvt_temp, ohm_temp + return pvt_temp, ohm_temp, proj_temp def parse_temperature_from_hwm(hwm_answer): @@ -75,20 +78,28 @@ def get_temperatures_from_hwm(): ohm_temp_index = 2 ohm_temp = all_temp_list[ohm_temp_index - 1] - return pvt_temp, ohm_temp + # get projector temperature + proj_temp_index = 1 + proj_temp = all_temp_list[proj_temp_index - 1] + + return pvt_temp, ohm_temp, proj_temp ############################################################################################# test.start("Compare Temperature readings XU vs HWMC") -pvt_temp_xu, ohm_temp_xu = get_temperatures_from_xu() +pvt_temp_xu, ohm_temp_xu, projector_temp_xu = get_temperatures_from_xu() -pvt_temp_hwm, ohm_temp_hwm = get_temperatures_from_hwm() +pvt_temp_hwm, ohm_temp_hwm, projector_temp_hwm = get_temperatures_from_hwm() tolerance = 1.0 -test.check_approx_abs(pvt_temp_xu, pvt_temp_hwm, tolerance) -test.check_approx_abs(ohm_temp_xu, ohm_temp_hwm, tolerance) +if depth_sensor.supports(rs.option.soc_pvt_temperature): + test.check_approx_abs(pvt_temp_xu, pvt_temp_hwm, tolerance) +if depth_sensor.supports(rs.option.ohm_temperature): + test.check_approx_abs(ohm_temp_xu, ohm_temp_hwm, tolerance) +if depth_sensor.supports(rs.option.projector_temperature): + test.check_approx_abs(projector_temp_xu, projector_temp_xu, tolerance) test.finish() #############################################################################################