Updated ValueHandling.

This commit is contained in:
Christoph Holzheuer
2026-01-07 17:13:35 +01:00
parent 7d43b0a694
commit 3bdc491830
17 changed files with 152 additions and 150 deletions

View File

@@ -183,12 +183,12 @@ std::optional<BCValuePtr> BCXmlLoader::makeValue( BCDevice::ID deviceID, const B
auto setIfExists = [&]<typename T>( QStringView source, T& target )
{
if( !source.isEmpty() )
{
bool ok;
double testVal = source.toDouble(&ok);
if (ok)
target = testVal;
}
{
bool ok;
double testVal = source.toDouble(&ok);
if (ok)
target = testVal;
}
};
@@ -214,7 +214,9 @@ std::optional<BCValuePtr> BCXmlLoader::makeValue( BCDevice::ID deviceID, const B
setIfExists( params.Factor, newValue.factor );
setIfExists( params.Min, newValue.optMin );
setIfExists( params.Max, newValue.optMax );
setIfExists( params.IsWord, newValue.isWord );
//setIfExists( params.IsWord, newValue.isWord );
newValue.label = params.Label;
newValue.unitLabel = params.UnitLabel;