1 | // Copyright (C) 2021 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 | #ifndef OPCUASTATUS_P_H |
5 | #define OPCUASTATUS_P_H |
6 | |
7 | #include <QStandardItemModel> |
8 | #include <QtOpcUa/qopcuatype.h> |
9 | #include <QOpcUaApplicationDescription> |
10 | #include <QtQml/qqml.h> |
11 | #include <QtCore/private/qglobal_p.h> |
12 | |
13 | // |
14 | // W A R N I N G |
15 | // ------------- |
16 | // |
17 | // This file is not part of the Qt API. It exists purely as an |
18 | // implementation detail. This header file may change from version to |
19 | // version without notice, or even be removed. |
20 | // |
21 | // We mean it. |
22 | // |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | class OpcUaConnection; |
27 | |
28 | class OpcUaStatus |
29 | { |
30 | Q_GADGET |
31 | Q_PROPERTY(bool isGood READ isGood) |
32 | Q_PROPERTY(bool isBad READ isBad) |
33 | Q_PROPERTY(Status status READ status) |
34 | |
35 | // This is a value type. Thus lowercase. The enums are taken care of below |
36 | QML_VALUE_TYPE(status) |
37 | QML_ADDED_IN_VERSION(5, 13) |
38 | |
39 | public: |
40 | enum class Status { |
41 | Good = 0x0000, |
42 | BadUnexpectedError = 0x8001, |
43 | BadInternalError = 0x8002, |
44 | BadOutOfMemory = 0x8003, |
45 | BadResourceUnavailable = 0x8004, |
46 | BadCommunicationError = 0x8005, |
47 | BadEncodingError = 0x8006, |
48 | BadDecodingError = 0x8007, |
49 | BadEncodingLimitsExceeded = 0x8008, |
50 | BadRequestTooLarge = 0x80B8, |
51 | BadResponseTooLarge = 0x80B9, |
52 | BadUnknownResponse = 0x8009, |
53 | BadTimeout = 0x800A, |
54 | BadServiceUnsupported = 0x800B, |
55 | BadShutdown = 0x800C, |
56 | BadServerNotConnected = 0x800D, |
57 | BadServerHalted = 0x800E, |
58 | BadNothingToDo = 0x800F, |
59 | BadTooManyOperations = 0x8010, |
60 | BadTooManyMonitoredItems = 0x80DB, |
61 | BadDataTypeIdUnknown = 0x8011, |
62 | BadCertificateInvalid = 0x8012, |
63 | BadSecurityChecksFailed = 0x8013, |
64 | BadCertificateTimeInvalid = 0x8014, |
65 | BadCertificateIssuerTimeInvalid = 0x8015, |
66 | BadCertificateHostNameInvalid = 0x8016, |
67 | BadCertificateUriInvalid = 0x8017, |
68 | BadCertificateUseNotAllowed = 0x8018, |
69 | BadCertificateIssuerUseNotAllowed = 0x8019, |
70 | BadCertificateUntrusted = 0x801A, |
71 | BadCertificateRevocationUnknown = 0x801B, |
72 | BadCertificateIssuerRevocationUnknown = 0x801C, |
73 | BadCertificateRevoked = 0x801D, |
74 | BadCertificateIssuerRevoked = 0x801E, |
75 | BadCertificateChainIncomplete = 0x810D, |
76 | BadUserAccessDenied = 0x801F, |
77 | BadIdentityTokenInvalid = 0x8020, |
78 | BadIdentityTokenRejected = 0x8021, |
79 | BadSecureChannelIdInvalid = 0x8022, |
80 | BadInvalidTimestamp = 0x8023, |
81 | BadNonceInvalid = 0x8024, |
82 | BadSessionIdInvalid = 0x8025, |
83 | BadSessionClosed = 0x8026, |
84 | BadSessionNotActivated = 0x8027, |
85 | BadSubscriptionIdInvalid = 0x8028, |
86 | = 0x802A, |
87 | BadTimestampsToReturnInvalid = 0x802B, |
88 | BadRequestCancelledByClient = 0x802C, |
89 | BadTooManyArguments = 0x80E5, |
90 | GoodSubscriptionTransferred = 0x002D, |
91 | GoodCompletesAsynchronously = 0x002E, |
92 | GoodOverload = 0x002F, |
93 | GoodClamped = 0x0030, |
94 | BadNoCommunication = 0x8031, |
95 | BadWaitingForInitialData = 0x8032, |
96 | BadNodeIdInvalid = 0x8033, |
97 | BadNodeIdUnknown = 0x8034, |
98 | BadAttributeIdInvalid = 0x8035, |
99 | BadIndexRangeInvalid = 0x8036, |
100 | BadIndexRangeNoData = 0x8037, |
101 | BadDataEncodingInvalid = 0x8038, |
102 | BadDataEncodingUnsupported = 0x8039, |
103 | BadNotReadable = 0x803A, |
104 | BadNotWritable = 0x803B, |
105 | BadOutOfRange = 0x803C, |
106 | BadNotSupported = 0x803D, |
107 | BadNotFound = 0x803E, |
108 | BadObjectDeleted = 0x803F, |
109 | BadNotImplemented = 0x8040, |
110 | BadMonitoringModeInvalid = 0x8041, |
111 | BadMonitoredItemIdInvalid = 0x8042, |
112 | BadMonitoredItemFilterInvalid = 0x8043, |
113 | BadMonitoredItemFilterUnsupported = 0x8044, |
114 | BadFilterNotAllowed = 0x8045, |
115 | BadStructureMissing = 0x8046, |
116 | BadEventFilterInvalid = 0x8047, |
117 | BadContentFilterInvalid = 0x8048, |
118 | BadFilterOperatorInvalid = 0x80C1, |
119 | BadFilterOperatorUnsupported = 0x80C2, |
120 | BadFilterOperandCountMismatch = 0x80C3, |
121 | BadFilterOperandInvalid = 0x8049, |
122 | BadFilterElementInvalid = 0x80C4, |
123 | BadFilterLiteralInvalid = 0x80C5, |
124 | BadContinuationPointInvalid = 0x804A, |
125 | BadNoContinuationPoints = 0x804B, |
126 | BadReferenceTypeIdInvalid = 0x804C, |
127 | BadBrowseDirectionInvalid = 0x804D, |
128 | BadNodeNotInView = 0x804E, |
129 | BadServerUriInvalid = 0x804F, |
130 | BadServerNameMissing = 0x8050, |
131 | BadDiscoveryUrlMissing = 0x8051, |
132 | BadSempahoreFileMissing = 0x8052, |
133 | BadRequestTypeInvalid = 0x8053, |
134 | BadSecurityModeRejected = 0x8054, |
135 | BadSecurityPolicyRejected = 0x8055, |
136 | BadTooManySessions = 0x8056, |
137 | BadUserSignatureInvalid = 0x8057, |
138 | BadApplicationSignatureInvalid = 0x8058, |
139 | BadNoValidCertificates = 0x8059, |
140 | BadIdentityChangeNotSupported = 0x80C6, |
141 | BadRequestCancelledByRequest = 0x805A, |
142 | BadParentNodeIdInvalid = 0x805B, |
143 | BadReferenceNotAllowed = 0x805C, |
144 | BadNodeIdRejected = 0x805D, |
145 | BadNodeIdExists = 0x805E, |
146 | BadNodeClassInvalid = 0x805F, |
147 | BadBrowseNameInvalid = 0x8060, |
148 | BadBrowseNameDuplicated = 0x8061, |
149 | BadNodeAttributesInvalid = 0x8062, |
150 | BadTypeDefinitionInvalid = 0x8063, |
151 | BadSourceNodeIdInvalid = 0x8064, |
152 | BadTargetNodeIdInvalid = 0x8065, |
153 | BadDuplicateReferenceNotAllowed = 0x8066, |
154 | BadInvalidSelfReference = 0x8067, |
155 | BadReferenceLocalOnly = 0x8068, |
156 | BadNoDeleteRights = 0x8069, |
157 | UncertainReferenceNotDeleted = 0x40BC, |
158 | BadServerIndexInvalid = 0x806A, |
159 | BadViewIdUnknown = 0x806B, |
160 | BadViewTimestampInvalid = 0x80C9, |
161 | BadViewParameterMismatch = 0x80CA, |
162 | BadViewVersionInvalid = 0x80CB, |
163 | UncertainNotAllNodesAvailable = 0x40C0, |
164 | GoodResultsMayBeIncomplete = 0x00BA, |
165 | BadNotTypeDefinition = 0x80C8, |
166 | UncertainReferenceOutOfServer = 0x406C, |
167 | BadTooManyMatches = 0x806D, |
168 | BadQueryTooComplex = 0x806E, |
169 | BadNoMatch = 0x806F, |
170 | BadMaxAgeInvalid = 0x8070, |
171 | BadSecurityModeInsufficient = 0x80E6, |
172 | BadHistoryOperationInvalid = 0x8071, |
173 | BadHistoryOperationUnsupported = 0x8072, |
174 | BadInvalidTimestampArgument = 0x80BD, |
175 | BadWriteNotSupported = 0x8073, |
176 | BadTypeMismatch = 0x8074, |
177 | BadMethodInvalid = 0x8075, |
178 | BadArgumentsMissing = 0x8076, |
179 | BadTooManySubscriptions = 0x8077, |
180 | BadTooManyPublishRequests = 0x8078, |
181 | BadNoSubscription = 0x8079, |
182 | BadSequenceNumberUnknown = 0x807A, |
183 | BadMessageNotAvailable = 0x807B, |
184 | BadInsufficientClientProfile = 0x807C, |
185 | BadStateNotActive = 0x80BF, |
186 | BadTcpServerTooBusy = 0x807D, |
187 | BadTcpMessageTypeInvalid = 0x807E, |
188 | BadTcpSecureChannelUnknown = 0x807F, |
189 | BadTcpMessageTooLarge = 0x8080, |
190 | BadTcpNotEnoughResources = 0x8081, |
191 | BadTcpInternalError = 0x8082, |
192 | BadTcpEndpointUrlInvalid = 0x8083, |
193 | BadRequestInterrupted = 0x8084, |
194 | BadRequestTimeout = 0x8085, |
195 | BadSecureChannelClosed = 0x8086, |
196 | BadSecureChannelTokenUnknown = 0x8087, |
197 | BadSequenceNumberInvalid = 0x8088, |
198 | BadProtocolVersionUnsupported = 0x80BE, |
199 | BadConfigurationError = 0x8089, |
200 | BadNotConnected = 0x808A, |
201 | BadDeviceFailure = 0x808B, |
202 | BadSensorFailure = 0x808C, |
203 | BadOutOfService = 0x808D, |
204 | BadDeadbandFilterInvalid = 0x808E, |
205 | UncertainNoCommunicationLastUsableValue = 0x408F, |
206 | UncertainLastUsableValue = 0x4090, |
207 | UncertainSubstituteValue = 0x4091, |
208 | UncertainInitialValue = 0x4092, |
209 | UncertainSensorNotAccurate = 0x4093, |
210 | UncertainEngineeringUnitsExceeded = 0x4094, |
211 | UncertainSubNormal = 0x4095, |
212 | GoodLocalOverride = 0x0096, |
213 | BadRefreshInProgress = 0x8097, |
214 | BadConditionAlreadyDisabled = 0x8098, |
215 | BadConditionAlreadyEnabled = 0x80CC, |
216 | BadConditionDisabled = 0x8099, |
217 | BadEventIdUnknown = 0x809A, |
218 | BadEventNotAcknowledgeable = 0x80BB, |
219 | BadDialogNotActive = 0x80CD, |
220 | BadDialogResponseInvalid = 0x80CE, |
221 | BadConditionBranchAlreadyAcked = 0x80CF, |
222 | BadConditionBranchAlreadyConfirmed = 0x80D0, |
223 | BadConditionAlreadyShelved = 0x80D1, |
224 | BadConditionNotShelved = 0x80D2, |
225 | BadShelvingTimeOutOfRange = 0x80D3, |
226 | BadNoData = 0x809B, |
227 | BadBoundNotFound = 0x80D7, |
228 | BadBoundNotSupported = 0x80D8, |
229 | BadDataLost = 0x809D, |
230 | BadDataUnavailable = 0x809E, |
231 | BadEntryExists = 0x809F, |
232 | BadNoEntryExists = 0x80A0, |
233 | BadTimestampNotSupported = 0x80A1, |
234 | GoodEntryInserted = 0x00A2, |
235 | GoodEntryReplaced = 0x00A3, |
236 | UncertainDataSubNormal = 0x40A4, |
237 | GoodNoData = 0x00A5, |
238 | GoodMoreData = 0x00A6, |
239 | BadAggregateListMismatch = 0x80D4, |
240 | BadAggregateNotSupported = 0x80D5, |
241 | BadAggregateInvalidInputs = 0x80D6, |
242 | BadAggregateConfigurationRejected = 0x80DA, |
243 | GoodDataIgnored = 0x00D9, |
244 | BadRequestNotAllowed = 0x80E4, |
245 | GoodEdited = 0x00DC, |
246 | GoodPostActionFailed = 0x00DD, |
247 | UncertainDominantValueChanged = 0x40DE, |
248 | GoodDependentValueChanged = 0x00E0, |
249 | BadDominantValueChanged = 0x80E1, |
250 | UncertainDependentValueChanged = 0x40E2, |
251 | BadDependentValueChanged = 0x80E3, |
252 | GoodCommunicationEvent = 0x00A7, |
253 | GoodShutdownEvent = 0x00A8, |
254 | GoodCallAgain = 0x00A9, |
255 | GoodNonCriticalTimeout = 0x00AA, |
256 | BadInvalidArgument = 0x80AB, |
257 | BadConnectionRejected = 0x80AC, |
258 | BadDisconnect = 0x80AD, |
259 | BadConnectionClosed = 0x80AE, |
260 | BadInvalidState = 0x80AF, |
261 | BadEndOfStream = 0x80B0, |
262 | BadNoDataAvailable = 0x80B1, |
263 | BadWaitingForResponse = 0x80B2, |
264 | BadOperationAbandoned = 0x80B3, |
265 | BadExpectedStreamToBlock = 0x80B4, |
266 | BadWouldBlock = 0x80B5, |
267 | BadSyntaxError = 0x80B6, |
268 | BadMaxConnectionsReached = 0x80B7 |
269 | }; |
270 | Q_ENUM(Status) |
271 | |
272 | OpcUaStatus(); |
273 | OpcUaStatus(QOpcUa::UaStatusCode); |
274 | OpcUaStatus(Status); |
275 | ~OpcUaStatus(); |
276 | |
277 | bool isGood() const; |
278 | bool isBad() const; |
279 | Status status() const; |
280 | |
281 | private: |
282 | quint32 m_statusCode{QOpcUa::Good}; |
283 | }; |
284 | |
285 | // Expose only the enums with the uppercase "Status" name |
286 | namespace OpcuaStatusForeign |
287 | { |
288 | Q_NAMESPACE |
289 | QML_FOREIGN_NAMESPACE(OpcUaStatus) |
290 | QML_NAMED_ELEMENT(Status) |
291 | QML_ADDED_IN_VERSION(5, 13) |
292 | }; |
293 | |
294 | QT_END_NAMESPACE |
295 | |
296 | #endif // OPCUASTATUS_P_H |
297 | |