summaryrefslogtreecommitdiffstats
path: root/src/OpcUaAuth.cpp
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-20 10:41:09 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-20 10:41:09 +0100
commit0012cb312e92c33f5263478d318eb82da22ee879 (patch)
treecaac374dd3716b42d13cb85b85a7f90c7d5aac45 /src/OpcUaAuth.cpp
parent11b99fda8727f2225961c0b83ecdb18674a9670a (diff)
downloadBobinkQtOpcUa-0012cb312e92c33f5263478d318eb82da22ee879.tar.gz
BobinkQtOpcUa-0012cb312e92c33f5263478d318eb82da22ee879.zip
Rename classes to OpcUa* prefix, replace BobinkNode with OpcUaMonitoredNode boilerplate
Rename BobinkAuth → OpcUaAuth, BobinkClient → OpcUaClient (C++ class names only; QML module URI and singleton name stay as Bobink). Remove BobinkNode (QQuickItem-based) and add OpcUaMonitoredNode skeleton using QObject + QQmlParserStatus, following Qt convention for non-visual QML types.
Diffstat (limited to 'src/OpcUaAuth.cpp')
-rw-r--r--src/OpcUaAuth.cpp101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/OpcUaAuth.cpp b/src/OpcUaAuth.cpp
new file mode 100644
index 0000000..258c9c7
--- /dev/null
+++ b/src/OpcUaAuth.cpp
@@ -0,0 +1,101 @@
+/**
+ * @file OpcUaAuth.cpp
+ * @brief OpcUaAuth implementation.
+ */
+#include "OpcUaAuth.h"
+
+OpcUaAuth::OpcUaAuth (QObject *parent) : QObject (parent) {}
+
+OpcUaAuth::AuthMode
+OpcUaAuth::mode () const
+{
+ return m_mode;
+}
+
+void
+OpcUaAuth::setMode (AuthMode mode)
+{
+ if (m_mode == mode)
+ return;
+ m_mode = mode;
+ emit modeChanged ();
+}
+
+QString
+OpcUaAuth::username () const
+{
+ return m_username;
+}
+
+void
+OpcUaAuth::setUsername (const QString &username)
+{
+ if (m_username == username)
+ return;
+ m_username = username;
+ emit usernameChanged ();
+}
+
+QString
+OpcUaAuth::password () const
+{
+ return m_password;
+}
+
+void
+OpcUaAuth::setPassword (const QString &password)
+{
+ if (m_password == password)
+ return;
+ m_password = password;
+ emit passwordChanged ();
+}
+
+QString
+OpcUaAuth::certPath () const
+{
+ return m_certPath;
+}
+
+void
+OpcUaAuth::setCertPath (const QString &path)
+{
+ if (m_certPath == path)
+ return;
+ m_certPath = path;
+ emit certPathChanged ();
+}
+
+QString
+OpcUaAuth::keyPath () const
+{
+ return m_keyPath;
+}
+
+void
+OpcUaAuth::setKeyPath (const QString &path)
+{
+ if (m_keyPath == path)
+ return;
+ m_keyPath = path;
+ emit keyPathChanged ();
+}
+
+QOpcUaAuthenticationInformation
+OpcUaAuth::toAuthenticationInformation () const
+{
+ QOpcUaAuthenticationInformation info;
+ switch (m_mode)
+ {
+ case Anonymous:
+ info.setAnonymousAuthentication ();
+ break;
+ case UserPass:
+ info.setUsernameAuthentication (m_username, m_password);
+ break;
+ case Certificate:
+ info.setCertificateAuthentication (m_certPath, m_keyPath);
+ break;
+ }
+ return info;
+}