Fixed value loading.

This commit is contained in:
2026-01-03 13:15:15 +01:00
parent 56ab0fbc0f
commit 68680db6b4
3 changed files with 14 additions and 4 deletions

View File

@@ -89,5 +89,14 @@ QString BCValue::formatValue( uint32_t value ) const
return QString::number(result, 'f', 2);
}
void BCValue::dumpValue() const
{
qDebug() << "DeviceID: " << deviceID << " Register: " << registerID << " state:" " << state << " << " label: " << label;
qDebug() << "visibleValue: " << visibleValue << " min: " << min << " max: " << max << " factor: " << factor << " ValueType: " << (char)valueType << " ";
qDebug() << "indexRow: " << indexRow << " isWord: " << isWord;
qDebug();
}
/// ----

View File

@@ -98,6 +98,7 @@ public:
BCValue( BCDevice::ID deviceID_, BC::ID registerID_ );
QString formatValue( uint32_t value ) const;
void dumpValue() const;
mutable States state{BCValue::State::ReadOnly};
BCDevice::ID deviceID{BCDevice::ID::Invalid};

View File

@@ -224,14 +224,13 @@ std::optional<BCValuePtr> BCXmlLoader::makeValue( BCDevice::ID deviceID, const B
BCValuePtr newValuePtr = std::make_shared<BCValue>( deviceID, static_cast<BC::ID>(IDVal) );
BCValue& newValue = *newValuePtr.get();
setIfExists( params.Factor, newValue.factor );
setIfExists( params.Min, newValue.min );
setIfExists( params.Max, newValue.max );
setIfExists( params.IsWord, newValue.isWord );
newValue.label = params.Label;
newValue.label = params.UnitLabel;
newValue.label = params.Label;
newValue.unitLabel = params.UnitLabel;
if( s_valueTypes.contains( params.ValueType ) )
newValue.valueType = s_valueTypes[params.ValueType];
@@ -245,9 +244,10 @@ std::optional<BCValuePtr> BCXmlLoader::makeValue( BCDevice::ID deviceID, const B
QString Max;
QString IsWord;
QString ValueType;
*/
*/
qDebug() << " --- created: " << params.Label;
newValue.dumpValue();
return std::optional<BCValuePtr>( newValuePtr );
}