| 1 | // Copyright (C) 2017 The Qt Company Ltd. | 
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | 
| 3 | |
| 4 | #include "qopen62541client.h" | 
| 5 | #include "qopen62541node.h" | 
| 6 | #include "qopen62541plugin.h" | 
| 7 | #include "qopen62541valueconverter.h" | 
| 8 | #include <QtOpcUa/qopcuaclient.h> | 
| 9 | |
| 10 | #include <QtCore/qloggingcategory.h> | 
| 11 | |
| 12 | QT_BEGIN_NAMESPACE | 
| 13 | |
| 14 | static void compileTimeEnforceEnumMappings(void) | 
| 15 | { | 
| 16 | static_assert(static_cast<QOpcUa::NodeClass>(UA_NODECLASS_UNSPECIFIED) == QOpcUa::NodeClass::Undefined, | 
| 17 |                   "open62541 and QOpcUa values for NodeClasses must be the same");  | 
| 18 | static_assert(static_cast<QOpcUa::NodeClass>(UA_NODECLASS_VARIABLE) == QOpcUa::NodeClass::Variable, | 
| 19 |                   "open62541 and QOpcUa values for NodeClasses must be the same");  | 
| 20 | } | 
| 21 | |
| 22 | QOpen62541Plugin::QOpen62541Plugin(QObject *parent) | 
| 23 | : QOpcUaPlugin(parent) | 
| 24 | { | 
| 25 | compileTimeEnforceEnumMappings(); | 
| 26 | qRegisterMetaType<UA_NodeId>(); | 
| 27 | } | 
| 28 | |
| 29 | QOpen62541Plugin::~QOpen62541Plugin() | 
| 30 | { | 
| 31 | } | 
| 32 | |
| 33 | QOpcUaClient *QOpen62541Plugin::createClient(const QVariantMap &backendProperties) | 
| 34 | { | 
| 35 | Q_UNUSED(backendProperties) | 
| 36 | return new QOpcUaClient(new QOpen62541Client(backendProperties)); | 
| 37 | } | 
| 38 | |
| 39 | Q_LOGGING_CATEGORY(QT_OPCUA_PLUGINS_OPEN62541, "qt.opcua.plugins.open62541")  | 
| 40 | |
| 41 | QT_END_NAMESPACE | 
| 42 | 
