Driver fixes.
This commit is contained in:
@@ -51,6 +51,7 @@ BCXmlLoader::BCXmlLoader(QObject *parent)
|
||||
|
||||
void BCXmlLoader::loadXmlBikeData( const QString& fileName )
|
||||
{
|
||||
/*
|
||||
auto printAttrs = [](const QXmlStreamReader& xml)
|
||||
{
|
||||
QStringList parts;
|
||||
@@ -60,6 +61,7 @@ void BCXmlLoader::loadXmlBikeData( const QString& fileName )
|
||||
}
|
||||
qDebug().noquote() << parts.join(" ");
|
||||
};
|
||||
*/
|
||||
|
||||
QMetaEnum bcDeviceEnum{QMetaEnum::fromType<BCDevice::ID>()};
|
||||
|
||||
@@ -83,10 +85,6 @@ void BCXmlLoader::loadXmlBikeData( const QString& fileName )
|
||||
if (token == QXmlStreamReader::StartElement)
|
||||
{
|
||||
QString deviceType = _xml.attributes().value("Type"_L1).toString();
|
||||
|
||||
|
||||
qDebug() << " --- FETCH 1: " << deviceType;
|
||||
|
||||
// Wir wollen die Device-ID aus dem XML Tag ermitteln
|
||||
if( deviceType.isEmpty() )
|
||||
continue;
|
||||
@@ -99,7 +97,6 @@ void BCXmlLoader::loadXmlBikeData( const QString& fileName )
|
||||
//if( optDeviceID.has_value())
|
||||
if(!ok)
|
||||
throw BCException( "Fehler", QString("Devicetype %1 existiert nicht.").arg(deviceType) );
|
||||
qDebug() << " --- FETCH 2: Device: " << deviceType << " : " << optDeviceID;
|
||||
//BCDevice::ID currentDeviceID = BCDevice::ID( optDeviceID.value() );
|
||||
BCDevice::ID currentDeviceID = BCDevice::ID( optDeviceID );
|
||||
loadXmlBikeDeviceData(currentDeviceID);
|
||||
@@ -132,9 +129,7 @@ void BCXmlLoader::loadXmlBikeDeviceData(BCDevice::ID deviceID)
|
||||
while( _xml.readNextStartElement() )
|
||||
{
|
||||
if( _xml.attributes().hasAttribute(BCTags::ID) )
|
||||
{
|
||||
qDebug() << " --- found: " << _xml.name() << " : " << _xml.attributes().value(BCTags::ID);
|
||||
|
||||
{
|
||||
// füllen des Parameter packs
|
||||
BCValueParams params
|
||||
{
|
||||
@@ -206,7 +201,6 @@ std::optional<BCValuePtr> BCXmlLoader::makeValue( BCDevice::ID deviceID, const B
|
||||
static QMetaEnum s_bcValueEnum{QMetaEnum::fromType<BC::ID>()};
|
||||
QByteArray byteArray = params.ID.toUtf8();
|
||||
int IDVal = s_bcValueEnum.keyToValue( params.ID.toUtf8().constData(), &ok );
|
||||
qDebug() << " --- should create: " << params.Label;
|
||||
//if( IDVal.has_value() )
|
||||
if( !ok )
|
||||
throw BCException( "Fehler", QString("Devicetype %1 existiert nicht.").arg(params.ID) );
|
||||
@@ -233,8 +227,7 @@ std::optional<BCValuePtr> BCXmlLoader::makeValue( BCDevice::ID deviceID, const B
|
||||
if( params.ReadOnly == "true")
|
||||
newValue.valueFlags.setFlag( BCValue::Flag::ReadOnly, true );
|
||||
|
||||
qDebug() << " --- created: " << params.Label;
|
||||
newValue.dumpValue();
|
||||
//newValue.dumpValue();
|
||||
|
||||
return std::optional<BCValuePtr>( newValuePtr );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user