Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventFilter: handle objects in EventTypes #906

Merged
merged 1 commit into from
Jun 5, 2022

Conversation

schroeder-
Copy link
Contributor

If a EventType has a object as child, add it's variables and properties to the eventfilter. Also handles variables that contain nested variables or objects.
Fixes #905

@oroulet oroulet merged commit 22c2e99 into FreeOpcUa:master Jun 5, 2022
browse_path = []
if parent_variable:
browse_path.append(await parent_variable.read_browse_name())
async def _append_new_attribute_to_select_clauses(attribute: "Node", select_clauses: List[ua.SimpleAttributeOperand], already_selected: Dict[str, str], browse_path: List[ua.QualifiedName]):
browse_path.append(await attribute.read_browse_name())
string_path = '/'.join(map(str, browse_path))
if string_path not in already_selected:
already_selected[string_path] = string_path
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess because filters work on browse_names not on nodeids?

await _append_new_attribute_to_select_clauses(property, select_clauses, already_selected, [*browse_path])
for variable in await child.get_variables():
await _append_new_attribute_to_select_clauses(variable, select_clauses, already_selected, [*browse_path])
await _select_clause_from_childs(variable, select_clauses, already_selected, browse_path + [await variable.read_browse_name()])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Will "variables" actually have nested objects or do they only contain properties? (Just to make sure I have the definition right, properties are leaf nodes that hold values)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Porperties as of spec shouldn't contain child nodes. A non conforming server could do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add event support for nested objects (NodeClass.Object)
3 participants