Skip to content

Commit

Permalink
Print state and error enum strings during connect
Browse files Browse the repository at this point in the history
  • Loading branch information
basyskom-jvoe committed Jul 11, 2024
1 parent a2772d4 commit b0f35f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,13 +819,17 @@ void BackEnd::namespacesArrayUpdated(const QStringList &namespaceArray)
void BackEnd::clientError(QOpcUaClient::ClientError error)
{
qCDebug(backendLog) << "client error:" << error;
setState(tr("client error: %1").arg(error));
const auto errorString =
QString::fromUtf8(QMetaEnum::fromType<QOpcUaClient::ClientState>().valueToKey(error));
setState(tr("client error: %1").arg(errorString));
}

void BackEnd::clientState(QOpcUaClient::ClientState state)
{
qCDebug(backendLog) << "client state:" << state;
setState(tr("client state changed: %1").arg(state));
const auto stateString =
QString::fromUtf8(QMetaEnum::fromType<QOpcUaClient::ClientState>().valueToKey(state));
setState(tr("client state changed: %1").arg(stateString));
}

void BackEnd::clientConnectError(QOpcUaErrorState *errorState)
Expand Down

0 comments on commit b0f35f4

Please sign in to comment.