Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-cloning
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yogesh.m
opcua-cloning
Commits
8d0178af
Commit
8d0178af
authored
Mar 07, 2023
by
yogesh.m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
560e3327
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
hash_sender.py
hash_sender.py
+7
-5
No files found.
hash_sender.py
View file @
8d0178af
...
@@ -19,7 +19,7 @@ async def get_send_hash():
...
@@ -19,7 +19,7 @@ async def get_send_hash():
nm_no
=
await
client
.
get_namespace_index
(
"http://www.prosysopc.com/OPCUA/SimulationNodes/"
)
nm_no
=
await
client
.
get_namespace_index
(
"http://www.prosysopc.com/OPCUA/SimulationNodes/"
)
while
True
:
while
True
:
sleep
(
1
)
sleep
(
1
)
main_obj
=
{}
individual_node
=
{}
hierarchy
=
{}
hierarchy
=
{}
Objects
=
await
root_objects
[
0
]
.
get_children
()
Objects
=
await
root_objects
[
0
]
.
get_children
()
for
sub_obj
in
Objects
:
for
sub_obj
in
Objects
:
...
@@ -28,14 +28,16 @@ async def get_send_hash():
...
@@ -28,14 +28,16 @@ async def get_send_hash():
identifier_type
=
sub_obj
.
nodeid
.
NodeIdType
.
_name_
identifier_type
=
sub_obj
.
nodeid
.
NodeIdType
.
_name_
children
=
await
sub_obj
.
get_children
()
children
=
await
sub_obj
.
get_children
()
for
ch
in
children
:
for
ch
in
children
:
main_obj
[
"identifier"
]
=
ch
.
nodeid
.
Identifier
identifier
=
ch
.
nodeid
.
Identifier
individual_node
[
identifier
]
=
{}
node_name
=
await
ch
.
read_display_name
()
node_name
=
await
ch
.
read_display_name
()
main_obj
[
"node_name"
]
=
node_name
.
Text
individual_node
[
identifier
][
"node_name"
]
=
node_name
.
Text
datatype
=
await
ch
.
read_data_type_as_variant_type
()
datatype
=
await
ch
.
read_data_type_as_variant_type
()
main_obj
[
"datatype"
]
=
datatype
.
_value_
individual_node
[
identifier
][
"datatype"
]
=
datatype
.
_value_
print
(
individual_node
)
hierarchy
[
display_name
.
Text
]
=
{}
hierarchy
[
display_name
.
Text
]
=
{}
hierarchy
[
display_name
.
Text
][
"name"
]
=
identifier_type
hierarchy
[
display_name
.
Text
][
"name"
]
=
identifier_type
hierarchy
[
display_name
.
Text
][
"obj"
]
=
pickle
.
dumps
(
main_obj
)
hierarchy
[
display_name
.
Text
][
"obj"
]
=
pickle
.
dumps
(
individual_node
)
hierarchy
[
"hash"
]
=
hash
(
str
(
hierarchy
))
hierarchy
[
"hash"
]
=
hash
(
str
(
hierarchy
))
hierarchy
=
pickle
.
dumps
(
hierarchy
)
hierarchy
=
pickle
.
dumps
(
hierarchy
)
UDPClientSocket
.
sendto
(
hierarchy
,
serverAddressPort
)
UDPClientSocket
.
sendto
(
hierarchy
,
serverAddressPort
)
...
...
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