Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
2fa3c4f5
Commit
2fa3c4f5
authored
3 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
modified attribute wrapper read/write function exception
parent
0e016453
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5
2021 03 22 branched from master attribute wrapper
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
devices/clients/opcua_connection.py
+0
-4
0 additions, 4 deletions
devices/clients/opcua_connection.py
devices/src/attribute_wrapper.py
+4
-2
4 additions, 2 deletions
devices/src/attribute_wrapper.py
with
4 additions
and
6 deletions
devices/clients/opcua_connection.py
+
0
−
4
View file @
2fa3c4f5
...
@@ -142,7 +142,6 @@ class OPCUAConnection(CommClient):
...
@@ -142,7 +142,6 @@ class OPCUAConnection(CommClient):
MANDATORY function: is used by the attribute wrapper to get read/write functions. must return the read and write functions
MANDATORY function: is used by the attribute wrapper to get read/write functions. must return the read and write functions
"""
"""
# process the annotation
# process the annotation
node
=
self
.
_setup_annotation
(
annotation
)
node
=
self
.
_setup_annotation
(
annotation
)
...
@@ -202,7 +201,4 @@ class ProtocolAttribute:
...
@@ -202,7 +201,4 @@ class ProtocolAttribute:
self
.
node
.
set_data_value
(
opcua
.
ua
.
uatypes
.
Variant
(
value
=
value
,
varianttype
=
self
.
ua_type
))
self
.
node
.
set_data_value
(
opcua
.
ua
.
uatypes
.
Variant
(
value
=
value
,
varianttype
=
self
.
ua_type
))
def
pass_func
(
self
,
value
=
None
):
pass
This diff is collapsed.
Click to expand it.
devices/src/attribute_wrapper.py
+
4
−
2
View file @
2fa3c4f5
...
@@ -130,12 +130,14 @@ class attribute_wrapper(attribute):
...
@@ -130,12 +130,14 @@ class attribute_wrapper(attribute):
"""
"""
try
:
try
:
self
.
read_function
,
self
.
write_function
=
client
.
setup_attribute
(
self
.
comms_annotation
,
self
)
self
.
read_function
,
self
.
write_function
=
client
.
setup_attribute
(
self
.
comms_annotation
,
self
)
except
:
except
Exception
as
e
:
def
pass_func
(
value
=
None
):
def
pass_func
(
value
=
None
):
pass
pass
print
(
"
setting comm_client failed. using pass function instead
"
)
logger
.
error
(
"
setting comm_client failed. using pass function instead
"
)
self
.
read_function
=
pass_func
self
.
read_function
=
pass_func
self
.
write_function
=
pass_func
self
.
write_function
=
pass_func
raise
Exception
(
"
Exception while setting comm_client read/write functions. using pass function instead. %s
"
)
from
e
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment