1 | // Copyright (C) 2023 basysKom GmbH, opensource@basyskom.com |
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 "stringidentifier.h" |
5 | |
6 | const QString StringIdentifier::baseTypeIdentifier = "BaseType" ; |
7 | const QString StringIdentifier::binaryTypeIdentifier = "opc" ; |
8 | const QString StringIdentifier::bitIdentifier = "Bit" ; |
9 | const QString StringIdentifier::booleanIdentifier = "Boolean" ; |
10 | const QString StringIdentifier::byteIdentifier = "Byte" ; |
11 | const QString StringIdentifier::sbyteIdentifier = "SByte" ; |
12 | const QString StringIdentifier::byteStringIdentifier = "ByteString" ; |
13 | const QString StringIdentifier::charArrayIdentifier = "CharArray" ; |
14 | const QString StringIdentifier::cppIdentifier = ".cpp" ; |
15 | const QString StringIdentifier::datetimeIdentifier = "DateTime" ; |
16 | const QString StringIdentifier::defaultByteOrderIdentifier = "DefaultByteOrder" ; |
17 | const QString StringIdentifier::documentationIdentifier = "Documentation" ; |
18 | const QString StringIdentifier::doubleIdentifier = "Double" ; |
19 | const QString StringIdentifier::enumeratedTypeIdentifier = "EnumeratedType" ; |
20 | const QString StringIdentifier::enumeratedValueIdentifier = "EnumeratedValue" ; |
21 | const QString StringIdentifier::fieldIdentifier = "Field" ; |
22 | const QString StringIdentifier::floatIdentifier = "Float" ; |
23 | const QString StringIdentifier::guidIdentifier = "Guid" ; |
24 | const QString StringIdentifier:: = ".h" ; |
25 | const QString StringIdentifier::importIdentifier = "Import" ; |
26 | const QString StringIdentifier::integerIdentifier = "Int" ; |
27 | const QString StringIdentifier::lengthIdentifier = "Length" ; |
28 | const QString StringIdentifier::lengthFieldIdentifier = "LengthField" ; |
29 | const QString StringIdentifier::lengthInBitsIdentifier = "LengthInBits" ; |
30 | const QString StringIdentifier::locationIdentifier = "Location" ; |
31 | const QString StringIdentifier::mainIdentifier = "main.cpp" ; |
32 | const QString StringIdentifier::makelistIdentifier = "CMakeLists.txt" ; |
33 | const QString StringIdentifier::nameIdentifier = "Name" ; |
34 | const QString StringIdentifier::nameSpaceIdentifier = "Namespace" ; |
35 | const QString StringIdentifier::namespaceZeroIdentifier = "http://opcfoundation.org/UA/" ; |
36 | const QString StringIdentifier::opaqueTypeIdentifier = "OpaqueType" ; |
37 | const QString StringIdentifier::projectIdentifier = "cmakeqt6" ; |
38 | const QString StringIdentifier::qByteArrayIdentifier = "QByteArray" ; |
39 | const QString StringIdentifier::qStringIdentifier = "QString" ; |
40 | const QString StringIdentifier::uaStatusCodeIdentifier = "StatusCode" ; |
41 | const QString StringIdentifier::reservedIdentifier = "Reserved" ; |
42 | const QString StringIdentifier::specifiedIdentifier = "Specified" ; |
43 | const QString StringIdentifier::structuredTypeIdentifier = "StructuredType" ; |
44 | const QString StringIdentifier::switchFieldIdentifier = "SwitchField" ; |
45 | const QString StringIdentifier::switchValueIdentifier = "SwitchValue" ; |
46 | const QString StringIdentifier::targetNamespaceIdentifier = "TargetNamespace" ; |
47 | const QString StringIdentifier::typeDictionaryIdentifier = "TypeDictionary" ; |
48 | const QString StringIdentifier::typeNameIdentifier = "TypeName" ; |
49 | const QString StringIdentifier::valueIdentifier = "Value" ; |
50 | const QString StringIdentifier::xmlElementIdentifier = "XmlElement" ; |
51 | const QString StringIdentifier::opcBitIdentifier = "opc:Bit" ; |
52 | |
53 | const QList<StringIdentifier::OpcUaPrecodedType> StringIdentifier::opcUaPrecodedTypes{ |
54 | OpcUaPrecodedType("ApplicationRecordDataType" , "QOpcUaApplicationRecordDataType" , |
55 | "QOpcUaApplicationRecordDataType" ), |
56 | OpcUaPrecodedType("Argument" , "QOpcUaArgument" , "QOpcUaArgument" ), |
57 | OpcUaPrecodedType("AxisInformation" , "QOpcUaAxisInformation" , "QOpcUaAxisInformation" ), |
58 | OpcUaPrecodedType("ComplexNumber" , "QOpcUaComplexNumber" , "QOpcUaComplexNumber" ), |
59 | OpcUaPrecodedType("DoubleComplexNumber" , "QOpcUaDoubleComplexNumber" , "QOpcUaDoubleComplexNumber" ), |
60 | OpcUaPrecodedType("EUInformation" , "QOpcUaEUInformation" , "QOpcUaEUInformation" ), |
61 | OpcUaPrecodedType("ExpandedNodeId" , "QOpcUaExpandedNodeId" , "QOpcUaExpandedNodeId" ), |
62 | OpcUaPrecodedType("ExtensionObject" , "QOpcUaExtensionObject" , "QOpcUaExtensionObject" ), |
63 | OpcUaPrecodedType("LocalizedText" , "QOpcUaLocalizedText" , "QOpcUaLocalizedText" ), |
64 | OpcUaPrecodedType("NodeId" , QString(), "QString" , "QString" ), |
65 | OpcUaPrecodedType("QualifiedName" , "QOpcUaQualifiedName" , "QOpcUaQualifiedName" ), |
66 | OpcUaPrecodedType("Range" , "QOpcUaRange" , "QOpcUaRange" ), |
67 | OpcUaPrecodedType("StatusCode" , "qopcuatype.h" , "QOpcUa::UaStatusCode" ), |
68 | OpcUaPrecodedType("XVType" , "QOpcUaXValue" , "QOpcUaXValue" ), |
69 | OpcUaPrecodedType("DiagnosticInfo" , "QOpcUaDiagnosticInfo" , "QOpcUaDiagnosticInfo" ), |
70 | OpcUaPrecodedType("StructureField" , "QOpcUaStructureField" , "QOpcUaStructureField" ), |
71 | OpcUaPrecodedType("StructureDefinition" , "QOpcUaStructureDefinition" , "QOpcUaStructureDefinition" ), |
72 | OpcUaPrecodedType("EnumField" , "QOpcUaEnumField" , "QOpcUaEnumField" ), |
73 | OpcUaPrecodedType("EnumDefinition" , "QOpcUaEnumDefinition" , "QOpcUaEnumDefinition" ), |
74 | OpcUaPrecodedType("DataValue" , "QOpcUaDataValue" , "QOpcUaDataValue" ), |
75 | OpcUaPrecodedType("Variant" , "QOpcUaVariant" , "QOpcUaVariant" ) |
76 | }; |
77 | |
78 | const QList<QString> StringIdentifier::buildInTypesWithBitMask = {"DiagnosticInfo" , |
79 | "LocalizedText" , |
80 | "Variant" , |
81 | "DataValue" , |
82 | "Variant" }; |
83 | |
84 | const QMap<QString, QString> StringIdentifier::typeNameDataTypeConverter |
85 | = {{"opc:Bit" , "bool" }, |
86 | {"opc:Boolean" , "bool" }, |
87 | {"opc:Byte" , "quint8" }, |
88 | {"opc:ByteString" , "QByteArray" }, |
89 | {"opc:CharArray" , "QString" }, |
90 | {"opc:DateTime" , "QDateTime" }, |
91 | {"opc:Double" , "double" }, |
92 | {"opc:Float" , "float" }, |
93 | {"opc:Int16" , "qint16" }, |
94 | {"opc:Int32" , "qint32" }, |
95 | {"opc:Int64" , "qint64" }, |
96 | {"opc:SByte" , "qint8" }, |
97 | {"opc:String" , "QString" }, |
98 | {"opc:UInt16" , "quint16" }, |
99 | {"opc:UInt32" , "quint32" }, |
100 | {"opc:UInt64" , "quint64" }, |
101 | {"opc:Guid" , "QUuid" }, |
102 | {"ua:XmlElement" , "QString" }}; |
103 | |
104 | const QList<QString> StringIdentifier::illegalNames |
105 | = {"Boolean" , "boolean" , "Int16" , "int16" , "Float" , "float" , |
106 | "Datetime" , "datetime" , "byteString" , "ByteString" , "XmlElement" , "xmlElement" , |
107 | "byte" , "Byte" , "SByte" , "sByte" , "Int32" , "int32" , |
108 | "Int64" , "int64" , "Double" , "double" , "String" , "string" }; |
109 | |
110 | const QSet<QString> StringIdentifier::precodedTypesWithDebugOperator = { "LocalizedText" , "NodeId" , "QualifiedName" }; |
111 | |
112 | QString StringIdentifier::OpcUaPrecodedType::name() const |
113 | { |
114 | return m_name; |
115 | } |
116 | |
117 | QString StringIdentifier::OpcUaPrecodedType::filename() const |
118 | { |
119 | return m_filename; |
120 | } |
121 | |
122 | QString StringIdentifier::OpcUaPrecodedType::className() const |
123 | { |
124 | return m_className; |
125 | } |
126 | |
127 | QString StringIdentifier::OpcUaPrecodedType::deEncoderName() const |
128 | { |
129 | return m_deEncoderName; |
130 | } |
131 | |