Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
5.15.3
-
None
Description
When reading multiple items are read via QOpcUaClient::readNodeAttributes at multiple location in user code they all are reported at the exact same signal. This means in each dedicated slot for a read I have to figure out if I should return immediately or handle the data by examining if the nodeids/attributes returned match the requested ones.
As a minimum (as other OPC UA API do) I would like to have some user-data I supply for the read call so that in the callbacks I can easily return if the user data does not match.
m_client->readNodeAttributes(request, 42);
auto handler = [](..., Userdata userdata){if (userdata ! =42) return; ...}
A better approach would be not to burden the user code with the same problem over and over again but to supply a single callback method for the read, e.g.
m_client->readNodeAttributes(
request,
[](QVector<QOpcUaReadResult> results, QOpcUa::UaStatusCode serviceResult){...});
For attributes of a single node I can retrieve the node and then add a slot for the read, but this creates a new node object which I might not need after the read and it does not generalize to read multiple values.