Changed value handling.

This commit is contained in:
2026-01-18 18:52:30 +01:00
parent 6aec85418a
commit 093b90fab6
7 changed files with 40 additions and 27 deletions

View File

@@ -173,7 +173,7 @@ void BCValue::setFromDouble( double value )
double BCValue::calcMinMaxRatio() const
{
double ratio = 0;
double ratio = 1;
if( _optMin.has_value() && _optMax.has_value() )
{
@@ -194,6 +194,13 @@ double BCValue::calcMinMaxRatio() const
return ratio;
}
uint32_t BCValue::getScaledValue() const noexcept
{
double value =_rawValue * _factor;
return (uint32_t) value * calcMinMaxRatio();
}
void BCValue::dumpValue() const
{