Updated ValueHandling.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user