diff --git a/bcvalue.cpp b/bcvalue.cpp index 16a1cf9..ad5d12b 100644 --- a/bcvalue.cpp +++ b/bcvalue.cpp @@ -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(); + +} /// ---- diff --git a/bcvalue.h b/bcvalue.h index 1b41ed0..f22b24b 100644 --- a/bcvalue.h +++ b/bcvalue.h @@ -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}; diff --git a/bcxmlloader.cpp b/bcxmlloader.cpp index f3108bf..ca4fe91 100644 --- a/bcxmlloader.cpp +++ b/bcxmlloader.cpp @@ -224,14 +224,13 @@ std::optional BCXmlLoader::makeValue( BCDevice::ID deviceID, const B BCValuePtr newValuePtr = std::make_shared( deviceID, static_cast(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 BCXmlLoader::makeValue( BCDevice::ID deviceID, const B QString Max; QString IsWord; QString ValueType; -*/ + */ qDebug() << " --- created: " << params.Label; + newValue.dumpValue(); return std::optional( newValuePtr ); }