Fixed value loading.
This commit is contained in:
@@ -89,5 +89,14 @@ QString BCValue::formatValue( uint32_t value ) const
|
|||||||
return QString::number(result, 'f', 2);
|
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();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// ----
|
/// ----
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ public:
|
|||||||
BCValue( BCDevice::ID deviceID_, BC::ID registerID_ );
|
BCValue( BCDevice::ID deviceID_, BC::ID registerID_ );
|
||||||
|
|
||||||
QString formatValue( uint32_t value ) const;
|
QString formatValue( uint32_t value ) const;
|
||||||
|
void dumpValue() const;
|
||||||
|
|
||||||
mutable States state{BCValue::State::ReadOnly};
|
mutable States state{BCValue::State::ReadOnly};
|
||||||
BCDevice::ID deviceID{BCDevice::ID::Invalid};
|
BCDevice::ID deviceID{BCDevice::ID::Invalid};
|
||||||
|
|||||||
@@ -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) );
|
BCValuePtr newValuePtr = std::make_shared<BCValue>( deviceID, static_cast<BC::ID>(IDVal) );
|
||||||
BCValue& newValue = *newValuePtr.get();
|
BCValue& newValue = *newValuePtr.get();
|
||||||
|
|
||||||
|
|
||||||
setIfExists( params.Factor, newValue.factor );
|
setIfExists( params.Factor, newValue.factor );
|
||||||
setIfExists( params.Min, newValue.min );
|
setIfExists( params.Min, newValue.min );
|
||||||
setIfExists( params.Max, newValue.max );
|
setIfExists( params.Max, newValue.max );
|
||||||
setIfExists( params.IsWord, newValue.isWord );
|
setIfExists( params.IsWord, newValue.isWord );
|
||||||
|
|
||||||
newValue.label = params.Label;
|
newValue.label = params.Label;
|
||||||
newValue.label = params.UnitLabel;
|
newValue.unitLabel = params.UnitLabel;
|
||||||
|
|
||||||
if( s_valueTypes.contains( params.ValueType ) )
|
if( s_valueTypes.contains( params.ValueType ) )
|
||||||
newValue.valueType = s_valueTypes[params.ValueType];
|
newValue.valueType = s_valueTypes[params.ValueType];
|
||||||
@@ -248,6 +247,7 @@ std::optional<BCValuePtr> BCXmlLoader::makeValue( BCDevice::ID deviceID, const B
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
qDebug() << " --- created: " << params.Label;
|
qDebug() << " --- created: " << params.Label;
|
||||||
|
newValue.dumpValue();
|
||||||
|
|
||||||
return std::optional<BCValuePtr>( newValuePtr );
|
return std::optional<BCValuePtr>( newValuePtr );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user