diff options
author | Jannis Voelker <jannis.voelker@basyskom.com> | 2018-09-17 08:14:27 +0200 |
---|---|---|
committer | Rainer Keller <Rainer.Keller@qt.io> | 2018-09-17 13:46:28 +0000 |
commit | d1888ef6c83ea2d6bc582fff3f66364550d84f22 (patch) | |
tree | 089f8dc8ac2cb8716b441b389f763e28edc80573 | |
parent | cdf465babd7fbf406498d9963be28084d956e290 (diff) |
Rename QOpcUa::NodeIds::NS0 to QOpcUa::NodeIds::Namespace0
The abbreviation "ns0" is also removed from the converter
functions in qopcuatype.cpp.
Change-Id: Ic8e9aed4891f9e550f4e00105182744f1eb9b2e3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r-- | examples/opcua/opcuaviewer/treeitem.cpp | 6 | ||||
-rw-r--r-- | examples/opcua/waterpump/simulationserver/simulationserver.cpp | 2 | ||||
-rw-r--r-- | src/opcua/client/qopcuaclient.cpp | 6 | ||||
-rw-r--r-- | src/opcua/client/qopcuanodeids.cpp | 8 | ||||
-rw-r--r-- | src/opcua/client/qopcuanodeids.h | 4 | ||||
-rw-r--r-- | src/opcua/client/qopcuatype.cpp | 26 | ||||
-rw-r--r-- | src/opcua/client/qopcuatype.h | 6 | ||||
-rw-r--r-- | src/opcua/configure.json | 4 | ||||
-rw-r--r-- | src/plugins/opcua/open62541/qopen62541valueconverter.cpp | 26 | ||||
-rw-r--r-- | src/plugins/opcua/uacpp/quacppvalueconverter.cpp | 28 | ||||
-rw-r--r-- | tests/auto/qopcuaclient/tst_client.cpp | 64 | ||||
-rw-r--r-- | tools/defaultnodeidsgenerator/main.cpp | 12 |
12 files changed, 96 insertions, 96 deletions
diff --git a/examples/opcua/opcuaviewer/treeitem.cpp b/examples/opcua/opcuaviewer/treeitem.cpp index f1d6854..56b10a7 100644 --- a/examples/opcua/opcuaviewer/treeitem.cpp +++ b/examples/opcua/opcuaviewer/treeitem.cpp @@ -138,11 +138,11 @@ QVariant TreeItem::data(int column) return tr("Loading ..."); const QString typeId = mOpcNode->attribute(QOpcUa::NodeAttribute::DataType).toString(); - auto enumEntry = QOpcUa::ns0IDFromNodeId(typeId); + auto enumEntry = QOpcUa::namespace0IdFromNodeId(typeId); QString name; - if (enumEntry == QOpcUa::NodeIds::NS0::Unknown) + if (enumEntry == QOpcUa::NodeIds::Namespace0::Unknown) return typeId; - return QOpcUa::ns0IDName(enumEntry) + " (" + typeId + ")"; + return QOpcUa::namespace0IdName(enumEntry) + " (" + typeId + ")"; } else if (column == 4) { return mNodeId; } else if (column == 5) { diff --git a/examples/opcua/waterpump/simulationserver/simulationserver.cpp b/examples/opcua/waterpump/simulationserver/simulationserver.cpp index f49229b..520f870 100644 --- a/examples/opcua/waterpump/simulationserver/simulationserver.cpp +++ b/examples/opcua/waterpump/simulationserver/simulationserver.cpp @@ -385,7 +385,7 @@ void DemoServer::launch() qFatal("Unexpected namespace index for Demo namespace"); } - UA_NodeId machineObject = addObject(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::ObjectsFolder), "ns=2;s=Machine", + UA_NodeId machineObject = addObject(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::ObjectsFolder), "ns=2;s=Machine", "Machine", "Machine", "The machine simulator", UA_NS0ID_ORGANIZES); UA_NodeId tank1Object = addObject("ns=2;s=Machine", "ns=2;s=Machine.Tank1", "Tank1", "Tank 1"); UA_NodeId tank2Object = addObject("ns=2;s=Machine", "ns=2;s=Machine.Tank2", "Tank2", "Tank 2"); diff --git a/src/opcua/client/qopcuaclient.cpp b/src/opcua/client/qopcuaclient.cpp index f484df7..aec0667 100644 --- a/src/opcua/client/qopcuaclient.cpp +++ b/src/opcua/client/qopcuaclient.cpp @@ -488,7 +488,7 @@ QOpcUa::QQualifiedName QOpcUaClient::qualifiedNameFromNamespaceUri(const QString attributes.setDisplayName(QOpcUa::QLocalizedText("en", "My new Variable node")); attributes.setDescription(QOpcUa::QLocalizedText("en", "A node which has been added at runtime")); attributes.setValue(23.0, QOpcUa::Types::Double); - attributes.setDataTypeId(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Double)); + attributes.setDataTypeId(QOpcUa::ns0ID(QOpcUa::NodeIds::Namespace0::Double)); attributes.setValueRank(-2); // Scalar or array attributes.setAccessLevel(QOpcUa::AccessLevelBit::CurrentRead); attributes.setUserAccessLevel(QOpcUa::AccessLevelBit::CurrentRead); @@ -552,7 +552,7 @@ bool QOpcUaClient::deleteNode(const QString &nodeId, bool deleteTargetReferences \code QOpcUaAddReferenceItem item; - item.setSourceNodeId(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::ObjectsFolder)); + item.setSourceNodeId(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::ObjectsFolder)); item.setReferenceTypeId(QOpcUa::nodeIdFromInteger(0, static_cast<quint32>(QOpcUa::ReferenceTypeId::Organizes))); item.setIsForward(true); item.setTargetNodeId(QOpcUa::QExpandedNodeId("ns=3;s=MyNewVariableNode")); @@ -583,7 +583,7 @@ bool QOpcUaClient::addReference(const QOpcUaAddReferenceItem &referenceToAdd) \code QOpcUaDeleteReferenceItem item; - item.setSourceNodeId(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::ObjectsFolder)); + item.setSourceNodeId(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::ObjectsFolder)); item.setReferenceTypeId(QOpcUa::nodeIdFromInteger(0, static_cast<quint32>(QOpcUa::ReferenceTypeId::Organizes))); item.setIsForward(true); item.setTargetNodeId(QOpcUa::QExpandedNodeId("ns=3;s=MyNewVariableNode")); diff --git a/src/opcua/client/qopcuanodeids.cpp b/src/opcua/client/qopcuanodeids.cpp index 14807d6..707e214 100644 --- a/src/opcua/client/qopcuanodeids.cpp +++ b/src/opcua/client/qopcuanodeids.cpp @@ -46,17 +46,17 @@ QT_BEGIN_NAMESPACE */ /*! - \enum QOpcUa::NodeIds::NS0 + \enum QOpcUa::NodeIds::Namespace0 Contains all numeric node identifiers from namespace 0 defined in the OPC Foundation's \l {https://opcfoundation.org/UA/schemas/1.03/NodeIds.csv} {NodeIds.csv} file. The values in this enum follow the naming from the CSV file and can be converted between - enum and node id string using \l QOpcUa::ns0ID() and \l QOpcUa::ns0IDFromNodeId(). - \l QOpcUa::ns0IDName() provides a conversion from enum value to the name string from the CSV file. + enum and node id string using \l QOpcUa::namespace0Id() and \l QOpcUa::namespace0IdFromNodeId(). + \l QOpcUa::namespace0IdName() provides a conversion from enum value to the name string from the CSV file. \code - QScopedPointer<QOpcUaNode> rootNode(client->node(QOpcUa::ns0ID(QOpcUa::NodeIds::RootFolder))); + QScopedPointer<QOpcUaNode> rootNode(client->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::RootFolder))); \endcode \value Unknown diff --git a/src/opcua/client/qopcuanodeids.h b/src/opcua/client/qopcuanodeids.h index ee8bdda..6a4dfbb 100644 --- a/src/opcua/client/qopcuanodeids.h +++ b/src/opcua/client/qopcuanodeids.h @@ -49,7 +49,7 @@ namespace QOpcUa { Q_OPCUA_EXPORT Q_NAMESPACE #endif - enum class NS0 : quint32 { + enum class Namespace0 : quint32 { Unknown = 0, Boolean = 1, SByte = 2, @@ -5799,7 +5799,7 @@ namespace QOpcUa { Server_Namespaces_OPCUANamespaceUri_NamespaceFile_ExportNamespace = 15211, }; #ifndef QT_OPCUA_NO_NS0IDNAMES - Q_ENUM_NS(NS0) + Q_ENUM_NS(Namespace0) #endif } } diff --git a/src/opcua/client/qopcuatype.cpp b/src/opcua/client/qopcuatype.cpp index 4512b17..4d97802 100644 --- a/src/opcua/client/qopcuatype.cpp +++ b/src/opcua/client/qopcuatype.cpp @@ -947,28 +947,28 @@ bool QOpcUa::nodeIdEquals(const QString &first, const QString &second) /*! Returns a node id string for the namespace 0 identifier \a id. */ -QString QOpcUa::ns0ID(QOpcUa::NodeIds::NS0 id) +QString QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0 id) { return QStringLiteral("ns=0;i=%1").arg(quint32(id)); } /*! - Returns the enum value from \l QOpcUa::NodeIds::NS0 for \a nodeId. + Returns the enum value from \l QOpcUa::NodeIds::Namespace0 for \a nodeId. If the node id is not in namespace 0 or doesn't have a numeric identifier which is part of the OPC Foundation's NodeIds.csv file, - \l {QOpcUa::NodeIds::NS0} {Unknown} is returned. + \l {QOpcUa::NodeIds::Namespace0} {Unknown} is returned. If Qt OPC UA has been configured with -no-feature-ns0idnames, the check if the numeric identifier is part of the NodeIds.csv file is omitted. If the node id is in namespace 0 and has a numeric identifier, the identifier is returned regardless if it - is part of the \l QOpcUa::NodeIds::NS0 enum. + is part of the \l QOpcUa::NodeIds::Namespace0 enum. */ -QOpcUa::NodeIds::NS0 QOpcUa::ns0IDFromNodeId(const QString &nodeId) +QOpcUa::NodeIds::Namespace0 QOpcUa::namespace0IdFromNodeId(const QString &nodeId) { if (!nodeId.startsWith(QLatin1String("ns=0;i="))) - return QOpcUa::NodeIds::NS0::Unknown; + return QOpcUa::NodeIds::Namespace0::Unknown; QStringRef sr = nodeId.midRef(7); @@ -976,14 +976,14 @@ QOpcUa::NodeIds::NS0 QOpcUa::ns0IDFromNodeId(const QString &nodeId) quint32 identifier = sr.toUInt(&ok); if (!ok) - return QOpcUa::NodeIds::NS0::Unknown; + return QOpcUa::NodeIds::Namespace0::Unknown; #ifndef QT_OPCUA_NO_NS0IDNAMES - if (!QMetaEnum::fromType<QOpcUa::NodeIds::NS0>().valueToKey(identifier)) - return QOpcUa::NodeIds::NS0::Unknown; + if (!QMetaEnum::fromType<QOpcUa::NodeIds::Namespace0>().valueToKey(identifier)) + return QOpcUa::NodeIds::Namespace0::Unknown; #endif - return QOpcUa::NodeIds::NS0(identifier); + return QOpcUa::NodeIds::Namespace0(identifier); } /*! @@ -992,15 +992,15 @@ QOpcUa::NodeIds::NS0 QOpcUa::ns0IDFromNodeId(const QString &nodeId) If \a id is unknown or Qt OPC UA has been configured with -no-feature-ns0idnames, an empty string is returned. */ -QString QOpcUa::ns0IDName(QOpcUa::NodeIds::NS0 id) +QString QOpcUa::namespace0IdName(QOpcUa::NodeIds::Namespace0 id) { #ifdef QT_OPCUA_NO_NS0IDNAMES Q_UNUSED(id); return QString(); #else - if (id == QOpcUa::NodeIds::NS0::Unknown) + if (id == QOpcUa::NodeIds::Namespace0::Unknown) return QString(); - return QString::fromUtf8(QMetaEnum::fromType<QOpcUa::NodeIds::NS0>().valueToKey(quint32(id))); + return QString::fromUtf8(QMetaEnum::fromType<QOpcUa::NodeIds::Namespace0>().valueToKey(quint32(id))); #endif } diff --git a/src/opcua/client/qopcuatype.h b/src/opcua/client/qopcuatype.h index 77905be..1aea724 100644 --- a/src/opcua/client/qopcuatype.h +++ b/src/opcua/client/qopcuatype.h @@ -482,9 +482,9 @@ Q_OPCUA_EXPORT QString nodeIdFromReferenceType(QOpcUa::ReferenceTypeId reference Q_OPCUA_EXPORT bool nodeIdStringSplit(const QString &nodeIdString, quint16 *nsIndex, QString *identifier, char *identifierType); Q_OPCUA_EXPORT bool nodeIdEquals(const QString &first, const QString &second); -Q_OPCUA_EXPORT QString ns0ID(QOpcUa::NodeIds::NS0 id); -Q_OPCUA_EXPORT QOpcUa::NodeIds::NS0 ns0IDFromNodeId(const QString &nodeId); -Q_OPCUA_EXPORT QString ns0IDName(QOpcUa::NodeIds::NS0 id); +Q_OPCUA_EXPORT QString namespace0Id(QOpcUa::NodeIds::Namespace0 id); +Q_OPCUA_EXPORT QOpcUa::NodeIds::Namespace0 namespace0IdFromNodeId(const QString &nodeId); +Q_OPCUA_EXPORT QString namespace0IdName(QOpcUa::NodeIds::Namespace0 id); typedef QPair<QVariant, QOpcUa::Types> TypedVariant; diff --git a/src/opcua/configure.json b/src/opcua/configure.json index 8a7dd97..5cdc63e 100644 --- a/src/opcua/configure.json +++ b/src/opcua/configure.json @@ -55,12 +55,12 @@ }, "ns0idnames": { "label": "Support for namespace 0 NodeId names", - "purpose": "Provides names for the QOpcUa::NodeIds::NS0 enum.", + "purpose": "Provides names for the QOpcUa::NodeIds::Namespace0 enum.", "output": [ "privateFeature" ] }, "ns0idgenerator": { "label": "Namespace 0 NodeIds generator", - "purpose": "Build a generator for updating the QOpcUa::NodeIds::NS0 enum from the NodeIds.csv file.", + "purpose": "Build a generator for updating the QOpcUa::NodeIds::Namespace0 enum from the NodeIds.csv file.", "autoDetect": "false", "output": [ "privateFeature" ] } diff --git a/src/plugins/opcua/open62541/qopen62541valueconverter.cpp b/src/plugins/opcua/open62541/qopen62541valueconverter.cpp index e78cc75..81091dd 100644 --- a/src/plugins/opcua/open62541/qopen62541valueconverter.cpp +++ b/src/plugins/opcua/open62541/qopen62541valueconverter.cpp @@ -413,24 +413,24 @@ QVariant scalarToQt<QVariant, UA_ExtensionObject>(const UA_ExtensionObject *data bool success = false; QVariant result; - NS0 objType = NS0(data->content.encoded.typeId.identifier.numeric); + Namespace0 objType = Namespace0(data->content.encoded.typeId.identifier.numeric); switch (objType) { - case NS0::EUInformation_Encoding_DefaultBinary: + case Namespace0::EUInformation_Encoding_DefaultBinary: result = decoder.decode<QOpcUa::QEUInformation>(success); break; - case NS0::Range_Encoding_DefaultBinary: + case Namespace0::Range_Encoding_DefaultBinary: result = decoder.decode<QOpcUa::QRange>(success); break; - case NS0::ComplexNumberType_Encoding_DefaultBinary: + case Namespace0::ComplexNumberType_Encoding_DefaultBinary: result = decoder.decode<QOpcUa::QComplexNumber>(success); break; - case NS0::DoubleComplexNumberType_Encoding_DefaultBinary: + case Namespace0::DoubleComplexNumberType_Encoding_DefaultBinary: result = decoder.decode<QOpcUa::QDoubleComplexNumber>(success); break; - case NS0::AxisInformation_Encoding_DefaultBinary: + case Namespace0::AxisInformation_Encoding_DefaultBinary: result = decoder.decode<QOpcUa::QAxisInformation>(success); break; - case NS0::XVType_Encoding_DefaultBinary: + case Namespace0::XVType_Encoding_DefaultBinary: result = decoder.decode<QOpcUa::QXValue>(success); break; default: @@ -566,7 +566,7 @@ void scalarFromQt<UA_ExtensionObject, QOpcUa::QRange>(const QOpcUa::QRange &valu QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QRange>(value); return createExtensionObject(temp, - UA_NODEID_NUMERIC(0,static_cast<UA_UInt32>(NS0::Range_Encoding_DefaultBinary)), ptr); + UA_NODEID_NUMERIC(0,static_cast<UA_UInt32>(Namespace0::Range_Encoding_DefaultBinary)), ptr); } template<> @@ -576,7 +576,7 @@ void scalarFromQt<UA_ExtensionObject, QOpcUa::QEUInformation>(const QOpcUa::QEUI QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QEUInformation>(value); return createExtensionObject(temp, - UA_NODEID_NUMERIC(0, static_cast<UA_UInt32>(NS0::EUInformation_Encoding_DefaultBinary)), ptr); + UA_NODEID_NUMERIC(0, static_cast<UA_UInt32>(Namespace0::EUInformation_Encoding_DefaultBinary)), ptr); } template<> @@ -586,7 +586,7 @@ void scalarFromQt<UA_ExtensionObject, QOpcUa::QComplexNumber>(const QOpcUa::QCom QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QComplexNumber>(value); return createExtensionObject(temp, - UA_NODEID_NUMERIC(0, static_cast<UA_UInt32>(NS0::ComplexNumberType_Encoding_DefaultBinary)), ptr); + UA_NODEID_NUMERIC(0, static_cast<UA_UInt32>(Namespace0::ComplexNumberType_Encoding_DefaultBinary)), ptr); } template<> @@ -596,7 +596,7 @@ void scalarFromQt<UA_ExtensionObject, QOpcUa::QDoubleComplexNumber>(const QOpcUa QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QDoubleComplexNumber>(value); return createExtensionObject(temp, - UA_NODEID_NUMERIC(0, static_cast<UA_UInt32>(NS0::DoubleComplexNumberType_Encoding_DefaultBinary)), ptr); + UA_NODEID_NUMERIC(0, static_cast<UA_UInt32>(Namespace0::DoubleComplexNumberType_Encoding_DefaultBinary)), ptr); } template<> @@ -606,7 +606,7 @@ void scalarFromQt<UA_ExtensionObject, QOpcUa::QAxisInformation>(const QOpcUa::QA QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QAxisInformation>(value); return createExtensionObject(temp, - UA_NODEID_NUMERIC(0, static_cast<UA_UInt32>(NS0::AxisInformation_Encoding_DefaultBinary)), ptr); + UA_NODEID_NUMERIC(0, static_cast<UA_UInt32>(Namespace0::AxisInformation_Encoding_DefaultBinary)), ptr); } template<> @@ -616,7 +616,7 @@ void scalarFromQt<UA_ExtensionObject, QOpcUa::QXValue>(const QOpcUa::QXValue &va QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QXValue>(value); return createExtensionObject(temp, - UA_NODEID_NUMERIC(0, static_cast<UA_UInt32>(NS0::XVType_Encoding_DefaultBinary)), ptr); + UA_NODEID_NUMERIC(0, static_cast<UA_UInt32>(Namespace0::XVType_Encoding_DefaultBinary)), ptr); } template<> diff --git a/src/plugins/opcua/uacpp/quacppvalueconverter.cpp b/src/plugins/opcua/uacpp/quacppvalueconverter.cpp index a09c706..58d0eb1 100644 --- a/src/plugins/opcua/uacpp/quacppvalueconverter.cpp +++ b/src/plugins/opcua/uacpp/quacppvalueconverter.cpp @@ -283,9 +283,9 @@ QVariant scalarToQVariant<QVariant, OpcUa_ExtensionObject>(OpcUa_ExtensionObject bool success = true; QVariant result; - NS0 objType = NS0(data->TypeId.NodeId.Identifier.Numeric); + Namespace0 objType = Namespace0(data->TypeId.NodeId.Identifier.Numeric); switch (objType) { - case NS0::EUInformation_Encoding_DefaultBinary: { + case Namespace0::EUInformation_Encoding_DefaultBinary: { // ### TODO: Check for non ns=0 cases. Apparently there is an auto-conversion happening in the // underlaying OpcUA SDK for ns=0 nodes, hence we do not receive a ByteStream, but rather an // already decoded object. For non ns=0, we might be able to use the generic decoder from the module. @@ -295,16 +295,16 @@ QVariant scalarToQVariant<QVariant, OpcUa_ExtensionObject>(OpcUa_ExtensionObject result = QVariant::fromValue(euinfo); break; } - case NS0::Range_Encoding_DefaultBinary: + case Namespace0::Range_Encoding_DefaultBinary: result = QVariant::fromValue(decoder.decode<QOpcUa::QRange>(success)); break; - case NS0::ComplexNumberType_Encoding_DefaultBinary: + case Namespace0::ComplexNumberType_Encoding_DefaultBinary: result = QVariant::fromValue(decoder.decode<QOpcUa::QComplexNumber>(success)); break; - case NS0::DoubleComplexNumberType_Encoding_DefaultBinary: + case Namespace0::DoubleComplexNumberType_Encoding_DefaultBinary: result = QVariant::fromValue(decoder.decode<QOpcUa::QDoubleComplexNumber>(success)); break; - case NS0::AxisInformation_Encoding_DefaultBinary: { + case Namespace0::AxisInformation_Encoding_DefaultBinary: { UaAxisInformation info(*data); const UaRange uaRange = info.getEURange(); const UaLocalizedText uaTitle = info.getTitle(); @@ -323,7 +323,7 @@ QVariant scalarToQVariant<QVariant, OpcUa_ExtensionObject>(OpcUa_ExtensionObject result = QVariant::fromValue(qAxisInfo); break; } - case NS0::XVType_Encoding_DefaultBinary: + case Namespace0::XVType_Encoding_DefaultBinary: result = QVariant::fromValue(decoder.decode<QOpcUa::QXValue>(success)); break; default: @@ -544,7 +544,7 @@ void scalarFromQVariant<OpcUa_Guid, QUuid>(const QVariant &var, OpcUa_Guid *ptr) memcpy(ptr->Data4, uuid.data4, sizeof(uuid.data4)); } -void createExtensionObject(QByteArray &data, NS0 id, OpcUa_ExtensionObject *ptr) +void createExtensionObject(QByteArray &data, Namespace0 id, OpcUa_ExtensionObject *ptr) { OpcUa_ExtensionObject_Initialize(ptr); UaByteArray arr(data.data(), data.length()); @@ -562,7 +562,7 @@ void scalarFromQVariant<OpcUa_ExtensionObject, QOpcUa::QRange>(const QVariant &v QByteArray temp; QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QRange>(range); - return createExtensionObject(temp, NS0::Range_Encoding_DefaultBinary, ptr); + return createExtensionObject(temp, Namespace0::Range_Encoding_DefaultBinary, ptr); } template<> @@ -572,7 +572,7 @@ void scalarFromQVariant<OpcUa_ExtensionObject, QOpcUa::QEUInformation>(const QVa QByteArray temp; QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QEUInformation>(info); - return createExtensionObject(temp, NS0::EUInformation_Encoding_DefaultBinary, ptr); + return createExtensionObject(temp, Namespace0::EUInformation_Encoding_DefaultBinary, ptr); } template<> @@ -582,7 +582,7 @@ void scalarFromQVariant<OpcUa_ExtensionObject, QOpcUa::QComplexNumber>(const QVa QByteArray temp; QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QComplexNumber>(num); - return createExtensionObject(temp, NS0::ComplexNumberType_Encoding_DefaultBinary, ptr); + return createExtensionObject(temp, Namespace0::ComplexNumberType_Encoding_DefaultBinary, ptr); } template<> @@ -592,7 +592,7 @@ void scalarFromQVariant<OpcUa_ExtensionObject, QOpcUa::QDoubleComplexNumber>(con QByteArray temp; QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QDoubleComplexNumber>(num); - return createExtensionObject(temp, NS0::DoubleComplexNumberType_Encoding_DefaultBinary, ptr); + return createExtensionObject(temp, Namespace0::DoubleComplexNumberType_Encoding_DefaultBinary, ptr); } template<> @@ -602,7 +602,7 @@ void scalarFromQVariant<OpcUa_ExtensionObject, QOpcUa::QAxisInformation>(const Q QByteArray temp; QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QAxisInformation>(num); - return createExtensionObject(temp, NS0::AxisInformation_Encoding_DefaultBinary, ptr); + return createExtensionObject(temp, Namespace0::AxisInformation_Encoding_DefaultBinary, ptr); } template<> @@ -612,7 +612,7 @@ void scalarFromQVariant<OpcUa_ExtensionObject, QOpcUa::QXValue>(const QVariant & QByteArray temp; QOpcUaBinaryDataEncoding encoder(&temp); encoder.encode<QOpcUa::QXValue>(num); - return createExtensionObject(temp, NS0::XVType_Encoding_DefaultBinary, ptr); + return createExtensionObject(temp, Namespace0::XVType_Encoding_DefaultBinary, ptr); } template<> diff --git a/tests/auto/qopcuaclient/tst_client.cpp b/tests/auto/qopcuaclient/tst_client.cpp index b340f52..05059e4 100644 --- a/tests/auto/qopcuaclient/tst_client.cpp +++ b/tests/auto/qopcuaclient/tst_client.cpp @@ -807,7 +807,7 @@ void Tst_QOpcUaClient::requestNotInCache() OpcuaConnector connector(opcuaClient, m_endpoint); - QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder))); + QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder))); QVERIFY(node != nullptr); QCOMPARE(node->attributeError(QOpcUa::NodeAttribute::BrowseName), QOpcUa::UaStatusCode::BadNoEntryExists); @@ -988,7 +988,7 @@ void Tst_QOpcUaClient::getRootNode() QFETCH(QOpcUaClient *, opcuaClient); OpcuaConnector connector(opcuaClient, m_endpoint); - QScopedPointer<QOpcUaNode> root(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder))); + QScopedPointer<QOpcUaNode> root(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder))); QVERIFY(root != nullptr); QVERIFY(root->client() == opcuaClient); @@ -996,7 +996,7 @@ void Tst_QOpcUaClient::getRootNode() QCOMPARE(root->attribute(QOpcUa::NodeAttribute::DisplayName).value<QOpcUa::QLocalizedText>().text(), QLatin1String("Root")); QString nodeId = root->nodeId(); - QCOMPARE(nodeId, QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder)); + QCOMPARE(nodeId, QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder)); } void Tst_QOpcUaClient::getChildren() @@ -1067,7 +1067,7 @@ void Tst_QOpcUaClient::inverseBrowse() QFETCH(QOpcUaClient *, opcuaClient); OpcuaConnector connector(opcuaClient, m_endpoint); - QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Boolean))); + QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::Boolean))); QVERIFY(node != nullptr); QSignalSpy spy(node.data(), &QOpcUaNode::browseFinished); @@ -1081,7 +1081,7 @@ void Tst_QOpcUaClient::inverseBrowse() QCOMPARE(spy.size(), 1); QVector<QOpcUaReferenceDescription> ref = spy.at(0).at(0).value<QVector<QOpcUaReferenceDescription>>(); QCOMPARE(ref.size(), 1); - QCOMPARE(ref.at(0).targetNodeId().nodeId(), QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::BaseDataType)); + QCOMPARE(ref.at(0).targetNodeId().nodeId(), QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::BaseDataType)); QCOMPARE(ref.at(0).isForward(), false); QCOMPARE(ref.at(0).browseName().name(), QStringLiteral("BaseDataType")); QCOMPARE(ref.at(0).displayName().text(), QStringLiteral("BaseDataType")); @@ -1196,7 +1196,7 @@ void Tst_QOpcUaClient::addAndRemoveVariableNode() attributes.setDisplayName(displayName); attributes.setDescription(description); attributes.setValue(23.0, QOpcUa::Types::Double); - attributes.setDataTypeId(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Double)); + attributes.setDataTypeId(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::Double)); attributes.setValueRank(-2); // Scalar or array attributes.setAccessLevel(QOpcUa::AccessLevelBit::CurrentRead); @@ -1275,7 +1275,7 @@ void Tst_QOpcUaClient::addAndRemoveReference() QString referenceType = QOpcUa::nodeIdFromInteger(0, static_cast<quint32>(QOpcUa::ReferenceTypeId::Organizes)); QOpcUaAddReferenceItem refInfo; - refInfo.setSourceNodeId(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder)); + refInfo.setSourceNodeId(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder)); refInfo.setReferenceTypeId(referenceType); refInfo.setIsForward(true); refInfo.setTargetNodeId(target); @@ -1285,7 +1285,7 @@ void Tst_QOpcUaClient::addAndRemoveReference() addReferenceSpy.wait(); QCOMPARE(addReferenceSpy.count(), 1); - QCOMPARE(addReferenceSpy.at(0).at(0), QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder)); + QCOMPARE(addReferenceSpy.at(0).at(0), QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder)); QCOMPARE(addReferenceSpy.at(0).at(1), referenceType); QCOMPARE(addReferenceSpy.at(0).at(2).value<QOpcUa::QExpandedNodeId>().nodeId(), target.nodeId()); QCOMPARE(addReferenceSpy.at(0).at(3).value<bool>(), true); @@ -1293,7 +1293,7 @@ void Tst_QOpcUaClient::addAndRemoveReference() // Check if the reference has been added { - QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder))); + QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder))); QVERIFY(node != nullptr); QSignalSpy browseSpy(node.data(), &QOpcUaNode::browseFinished); @@ -1317,7 +1317,7 @@ void Tst_QOpcUaClient::addAndRemoveReference() QSignalSpy deleteReferenceSpy(opcuaClient, &QOpcUaClient::deleteReferenceFinished); QOpcUaDeleteReferenceItem refDelInfo; - refDelInfo.setSourceNodeId(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder)); + refDelInfo.setSourceNodeId(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder)); refDelInfo.setReferenceTypeId(referenceType); refDelInfo.setIsForward(true); refDelInfo.setTargetNodeId(target); @@ -1327,7 +1327,7 @@ void Tst_QOpcUaClient::addAndRemoveReference() deleteReferenceSpy.wait(); QCOMPARE(deleteReferenceSpy.count(), 1); - QCOMPARE(deleteReferenceSpy.at(0).at(0), QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder)); + QCOMPARE(deleteReferenceSpy.at(0).at(0), QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder)); QCOMPARE(deleteReferenceSpy.at(0).at(1), referenceType); QCOMPARE(deleteReferenceSpy.at(0).at(2).value<QOpcUa::QExpandedNodeId>().nodeId(), target.nodeId()); QCOMPARE(deleteReferenceSpy.at(0).at(3).value<bool>(), true); @@ -1335,7 +1335,7 @@ void Tst_QOpcUaClient::addAndRemoveReference() // Check if the reference has been deleted { - QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder))); + QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder))); QVERIFY(node != nullptr); QSignalSpy browseSpy(node.data(), &QOpcUaNode::browseFinished); @@ -1481,7 +1481,7 @@ void Tst_QOpcUaClient::dataChangeSubscriptionInvalidNode() QFETCH(QOpcUaClient *, opcuaClient); OpcuaConnector connector(opcuaClient, m_endpoint); - QScopedPointer<QOpcUaNode> noDataNode(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder))); + QScopedPointer<QOpcUaNode> noDataNode(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder))); QSignalSpy monitoringEnabledSpy(noDataNode.data(), &QOpcUaNode::enableMonitoringFinished); QOpcUaMonitoringParameters settings; @@ -1629,18 +1629,18 @@ void Tst_QOpcUaClient::readMethodArguments() OpcuaConnector connector(opcuaClient, m_endpoint); QScopedPointer<QOpcUaNode> node( - opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Server_GetMonitoredItems_InputArguments))); + opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::Server_GetMonitoredItems_InputArguments))); QVERIFY(node != nullptr); READ_MANDATORY_VARIABLE_NODE(node); QOpcUa::QArgument argument = node->attribute(QOpcUa::NodeAttribute::Value).value<QOpcUa::QArgument>(); QCOMPARE(argument.name(), QStringLiteral("SubscriptionId")); - QCOMPARE(argument.dataTypeId(), QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::UInt32)); + QCOMPARE(argument.dataTypeId(), QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::UInt32)); QCOMPARE(argument.valueRank(), -1); QVERIFY(argument.arrayDimensions().isEmpty()); QCOMPARE(argument.description(), QOpcUa::QLocalizedText()); - node.reset(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Server_GetMonitoredItems_OutputArguments))); + node.reset(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::Server_GetMonitoredItems_OutputArguments))); QVERIFY(node != nullptr); READ_MANDATORY_VARIABLE_NODE(node); @@ -1649,14 +1649,14 @@ void Tst_QOpcUaClient::readMethodArguments() argument = list.at(0).value<QOpcUa::QArgument>(); QCOMPARE(argument.name(), QStringLiteral("ServerHandles")); - QCOMPARE(argument.dataTypeId(), QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::UInt32)); + QCOMPARE(argument.dataTypeId(), QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::UInt32)); QCOMPARE(argument.valueRank(), 1); QVERIFY(argument.arrayDimensions().isEmpty()); QCOMPARE(argument.description(), QOpcUa::QLocalizedText()); argument = list.at(1).value<QOpcUa::QArgument>(); QCOMPARE(argument.name(), QStringLiteral("ClientHandles")); - QCOMPARE(argument.dataTypeId(), QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::UInt32)); + QCOMPARE(argument.dataTypeId(), QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::UInt32)); QCOMPARE(argument.valueRank(), 1); QVERIFY(argument.arrayDimensions().isEmpty()); QCOMPARE(argument.description(), QOpcUa::QLocalizedText()); @@ -1697,7 +1697,7 @@ void Tst_QOpcUaClient::nodeIdGeneration() nodeId = QOpcUa::nodeIdFromByteString(1, QByteArray::fromBase64("UXQgZnR3IQ==")); QCOMPARE(nodeId, QStringLiteral("ns=1;b=UXQgZnR3IQ==")); nodeId = QOpcUa::nodeIdFromReferenceType(QOpcUa::ReferenceTypeId::HasComponent); - QCOMPARE(nodeId, QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::HasComponent)); + QCOMPARE(nodeId, QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::HasComponent)); } void Tst_QOpcUaClient::multipleClients() @@ -1735,37 +1735,37 @@ void Tst_QOpcUaClient::nodeClass() OpcuaConnector connector(opcuaClient, m_endpoint); // Root -> Types -> ReferenceTypes -> References - QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::References))); + QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::References))); QVERIFY(node != nullptr); READ_MANDATORY_BASE_NODE(node) QCOMPARE(node->attribute(QOpcUa::NodeAttribute::NodeClass).value<QOpcUa::NodeClass>(), QOpcUa::NodeClass::ReferenceType); // Root -> Types -> DataTypes -> BaseDataTypes -> Boolean - node.reset(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Boolean))); + node.reset(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::Boolean))); QVERIFY(node != nullptr); READ_MANDATORY_BASE_NODE(node) QCOMPARE(node->attribute(QOpcUa::NodeAttribute::NodeClass).value<QOpcUa::NodeClass>(), QOpcUa::NodeClass::DataType); // Root -> Types -> DataTypes -> ObjectTypes -> BaseObjectTypes -> FolderType - node.reset(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::FolderType))); + node.reset(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::FolderType))); QVERIFY(node != nullptr); READ_MANDATORY_BASE_NODE(node) QCOMPARE(node->attribute(QOpcUa::NodeAttribute::NodeClass).value<QOpcUa::NodeClass>(), QOpcUa::NodeClass::ObjectType); // Root -> Types -> DataTypes -> VariableTypes -> BaseVariableType -> PropertyType - node.reset(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::PropertyType))); + node.reset(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::PropertyType))); QVERIFY(node != nullptr); READ_MANDATORY_BASE_NODE(node) QCOMPARE(node->attribute(QOpcUa::NodeAttribute::NodeClass).value<QOpcUa::NodeClass>(), QOpcUa::NodeClass::VariableType); // Root -> Objects - node.reset(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::ObjectsFolder))); + node.reset(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::ObjectsFolder))); QVERIFY(node != nullptr); READ_MANDATORY_BASE_NODE(node) QCOMPARE(node->attribute(QOpcUa::NodeAttribute::NodeClass).value<QOpcUa::NodeClass>(), QOpcUa::NodeClass::Object); // Root -> Objects -> Server -> NamespaceArray - node.reset(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Server_NamespaceArray))); + node.reset(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::Server_NamespaceArray))); QVERIFY(node != nullptr); READ_MANDATORY_BASE_NODE(node) QCOMPARE(node->attribute(QOpcUa::NodeAttribute::NodeClass).value<QOpcUa::NodeClass>(), QOpcUa::NodeClass::Variable); @@ -3077,7 +3077,7 @@ void Tst_QOpcUaClient::checkMonitoredItemCleanup() QScopedPointer<QOpcUaNode> readWriteNode(opcuaClient->node("ns=3;s=TestNode.ReadWrite")); QVERIFY(readWriteNode != nullptr); - QScopedPointer<QOpcUaNode> serverNode(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Server))); + QScopedPointer<QOpcUaNode> serverNode(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::Server))); QVERIFY(serverNode != nullptr); QSignalSpy monitoringEnabledSpy(readWriteNode.data(), &QOpcUaNode::enableMonitoringFinished); @@ -3099,7 +3099,7 @@ void Tst_QOpcUaClient::checkMonitoredItemCleanup() QSignalSpy methodSpy(serverNode.data(), &QOpcUaNode::methodCallFinished); QVector<QOpcUa::TypedVariant> parameter; parameter.append(QOpcUa::TypedVariant(QVariant(quint32(subscriptionId)), QOpcUa::Types::UInt32)); - serverNode->callMethod(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Server_GetMonitoredItems), parameter); + serverNode->callMethod(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::Server_GetMonitoredItems), parameter); methodSpy.wait(); QCOMPARE(methodSpy.size(), 1); @@ -3115,7 +3115,7 @@ void Tst_QOpcUaClient::checkMonitoredItemCleanup() methodSpy.wait(); // Give the backend some time to process the deletion request methodSpy.clear(); - serverNode->callMethod(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Server_GetMonitoredItems), parameter); + serverNode->callMethod(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::Server_GetMonitoredItems), parameter); methodSpy.wait(); QCOMPARE(methodSpy.size(), 1); QCOMPARE(methodSpy.at(0).at(2).value<QOpcUa::UaStatusCode>(), QOpcUa::UaStatusCode::BadNoMatch); @@ -3352,7 +3352,7 @@ void Tst_QOpcUaClient::createNodeFromExpandedId() // Node on a remote server, nullptr expected QOpcUa::QExpandedNodeId id; - id.setNodeId(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::RootFolder)); + id.setNodeId(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::RootFolder)); id.setServerIndex(1); QScopedPointer<QOpcUaNode> node(opcuaClient->node(id)); QVERIFY(node == nullptr); @@ -3534,7 +3534,7 @@ void Tst_QOpcUaClient::resolveBrowsePath() QFETCH(QOpcUaClient *, opcuaClient); OpcuaConnector connector(opcuaClient, m_endpoint); - QScopedPointer<QOpcUaNode> typesNode(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::TypesFolder))); + QScopedPointer<QOpcUaNode> typesNode(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::TypesFolder))); QVERIFY(typesNode != nullptr); QSignalSpy spy(typesNode.data(), &QOpcUaNode::resolveBrowsePathFinished); @@ -3551,7 +3551,7 @@ void Tst_QOpcUaClient::resolveBrowsePath() QVector<QOpcUa::QBrowsePathTarget> results = spy.at(0).at(0).value<QVector<QOpcUa::QBrowsePathTarget>>(); QCOMPARE(results.size(), 1); QCOMPARE(results.at(0).remainingPathIndex(), (std::numeric_limits<quint32>::max)()); - QCOMPARE(results.at(0).targetId().nodeId(), QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::BaseDataType)); + QCOMPARE(results.at(0).targetId().nodeId(), QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::BaseDataType)); QVERIFY(results.at(0).targetId().namespaceUri().isEmpty()); QCOMPARE(results.at(0).targetId().serverIndex(), 0U); QCOMPARE(spy.at(0).at(1).value<QVector<QOpcUa::QRelativePathElement>>(), path); @@ -3591,7 +3591,7 @@ void Tst_QOpcUaClient::addNamespace() QVector<QOpcUa::TypedVariant> args; args.push_back(QOpcUa::TypedVariant(newNamespaceName, QOpcUa::String)); - QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::ns0ID(QOpcUa::NodeIds::NS0::Server))); + QScopedPointer<QOpcUaNode> node(opcuaClient->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::Namespace0::Server))); QVERIFY(node != nullptr); QSignalSpy methodSpy(node.data(), &QOpcUaNode::methodCallFinished); diff --git a/tools/defaultnodeidsgenerator/main.cpp b/tools/defaultnodeidsgenerator/main.cpp index 3390857..1123cfd 100644 --- a/tools/defaultnodeidsgenerator/main.cpp +++ b/tools/defaultnodeidsgenerator/main.cpp @@ -108,7 +108,7 @@ void createHeader(QTextStream &output) output << "#ifndef QT_OPCUA_NO_NS0IDNAMES" << "\n"; output << " " << "Q_OPCUA_EXPORT Q_NAMESPACE" << "\n"; output << "#endif" << "\n\n"; - output << " " << "enum class NS0 : quint32 {" << "\n"; + output << " " << "enum class Namespace0 : quint32 {" << "\n"; output << " " << "Unknown = 0," << "\n"; } @@ -116,7 +116,7 @@ void createFooter(QTextStream &output) { output << " " << "};" << "\n"; output << "#ifndef QT_OPCUA_NO_NS0IDNAMES" << "\n"; - output << " " << "Q_ENUM_NS(NS0)" << "\n"; + output << " " << "Q_ENUM_NS(Namespace0)" << "\n"; output << "#endif" << "\n"; output << " " << "}" << "\n"; output << "}" << "\n\n"; @@ -138,17 +138,17 @@ void createSourceHeader(QTextStream &output) */ /*! - \enum QOpcUa::NodeIds::NS0 + \enum QOpcUa::NodeIds::Namespace0 Contains all numeric node identifiers from namespace 0 defined in the OPC Foundation's \l {https://opcfoundation.org/UA/schemas/1.03/NodeIds.csv} {NodeIds.csv} file. The values in this enum follow the naming from the CSV file and can be converted between - enum and node id string using \l QOpcUa::ns0ID() and \l QOpcUa::ns0IDFromNodeId(). - \l QOpcUa::ns0IDName() provides a conversion from enum value to the name string from the CSV file. + enum and node id string using \l QOpcUa::namespace0Id() and \l QOpcUa::namespace0IdFromNodeId(). + \l QOpcUa::namespace0IdName() provides a conversion from enum value to the name string from the CSV file. \code - QScopedPointer<QOpcUaNode> rootNode(client->node(QOpcUa::ns0ID(QOpcUa::NodeIds::RootFolder))); + QScopedPointer<QOpcUaNode> rootNode(client->node(QOpcUa::namespace0Id(QOpcUa::NodeIds::RootFolder))); \endcode)" << "\n\n"; output << " " << "\\value Unknown" << "\n"; } |