From a7566b92a284d15e3b844089e66c41faa3883618 Mon Sep 17 00:00:00 2001 From: Ulrich Kuehn Date: Mon, 22 Jul 2024 22:32:54 +0200 Subject: [PATCH] Fix TEC temperature range initialisation (missing cast, missing scaling), set 0 degree as starting point instead of indicated minimum. --- indi-toupbase/indi_toupbase.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indi-toupbase/indi_toupbase.cpp b/indi-toupbase/indi_toupbase.cpp index 668c9d707..c9044bc48 100644 --- a/indi-toupbase/indi_toupbase.cpp +++ b/indi-toupbase/indi_toupbase.cpp @@ -463,8 +463,10 @@ bool ToupBase::Connect() { int tecRange = 0; FP(get_Option(m_Handle, CP(OPTION_TECTARGET_RANGE), &tecRange)); - TemperatureN[0].min = TemperatureN[0].value = tecRange & 0xffff; - TemperatureN[0].max = (tecRange >> 16) & 0xffff; + TemperatureN[0].min = (static_cast(tecRange & 0xffff))/10.0; + TemperatureN[0].max + = (static_cast((tecRange >> 16) & 0xffff)) / 10.0; + TemperatureN[0].value = 0; // reasonable default } {