Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
8b3323a7
Commit
8b3323a7
authored
May 21, 2016
by
olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter events by EventType attribute
parent
fbf1f8dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
examples/client_to_prosys.py
examples/client_to_prosys.py
+3
-3
opcua/common/subscription.py
opcua/common/subscription.py
+5
-3
No files found.
examples/client_to_prosys.py
View file @
8b3323a7
...
...
@@ -23,9 +23,9 @@ class SubHandler(object):
if
__name__
==
"__main__"
:
#from IPython import embed
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
#
client = Client("opc.tcp://localhost:53530/OPCUA/SimulationServer/")
client
=
Client
(
"opc.tcp://olivier:olivierpass@localhost:53530/OPCUA/SimulationServer/"
)
client
.
set_security_string
(
"Basic256,SignAndEncrypt,certificate-example.der,private-key-example.pem"
)
client
=
Client
(
"opc.tcp://localhost:53530/OPCUA/SimulationServer/"
)
#
client = Client("opc.tcp://olivier:olivierpass@localhost:53530/OPCUA/SimulationServer/")
#
client.set_security_string("Basic256,SignAndEncrypt,certificate-example.der,private-key-example.pem")
try
:
client
.
connect
()
root
=
client
.
get_root_node
()
...
...
opcua/common/subscription.py
View file @
8b3323a7
...
...
@@ -217,11 +217,11 @@ class Subscription(object):
def
_select_clauses_from_evtype
(
self
,
evtype
):
clauses
=
[]
for
prop
erty
in
get_event_properties_from_type_node
(
evtype
):
for
prop
in
get_event_properties_from_type_node
(
evtype
):
op
=
ua
.
SimpleAttributeOperand
()
op
.
TypeDefinitionId
=
evtype
.
nodeid
op
.
AttributeId
=
ua
.
AttributeIds
.
Value
op
.
BrowsePath
=
[
prop
erty
.
get_browse_name
()]
op
.
BrowsePath
=
[
prop
.
get_browse_name
()]
clauses
.
append
(
op
)
return
clauses
...
...
@@ -230,7 +230,9 @@ class Subscription(object):
el
=
ua
.
ContentFilterElement
()
# operands can be ElementOperand, LiteralOperand, AttributeOperand, SimpleAttribute
op
=
ua
.
SimpleAttributeOperand
()
op
.
AttributeId
=
ua
.
AttributeIds
.
NodeId
op
.
TypeDefinitionId
=
evtype
.
nodeid
op
.
BrowsePath
.
append
(
ua
.
QualifiedName
(
"EventType"
,
0
))
op
.
AttributeId
=
ua
.
AttributeIds
.
Value
el
.
FilterOperands
.
append
(
op
)
for
subtypeid
in
[
st
.
nodeid
for
st
in
self
.
_get_subtypes
(
evtype
)]:
op
=
ua
.
LiteralOperand
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment