Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DynamicAttributes
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
spe
ds
DynamicAttributes
Commits
922fe566
Commit
922fe566
authored
1 year ago
by
Martin Scarcia
Browse files
Options
Downloads
Patches
Plain Diff
removed filter script + consequent bug on w/r functions
parent
260611b6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dynamic-srv.py
+2
-24
2 additions, 24 deletions
src/dynamic-srv.py
with
2 additions
and
24 deletions
src/dynamic-srv.py
+
2
−
24
View file @
922fe566
...
...
@@ -220,24 +220,6 @@ class Dynamic(PyTango.Device_4Impl):
self
.
write_functions
=
CaseLessDict
()
#link to the Tango DB
self
.
db
=
PyTango
.
Database
()
if
self
.
FiltersScript
:
aux
=
self
.
FiltersScript
.
split
(
'
/
'
)
path
=
'
/
'
.
join
(
aux
[:
-
1
])
if
path
:
if
path
not
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
path
)
module_name
=
aux
[
-
1
].
replace
(
'
.py
'
,
''
)
try
:
self
.
module
=
__import__
(
module_name
)
except
ImportError
as
ex
:
#sys.stderr.write(str(ex)+"\n")
self
.
module
=
None
self
.
set_state
(
PyTango
.
DevState
.
FAULT
)
self
.
set_status
(
"
Invalid Filters Script
"
+
self
.
FiltersScript
)
return
else
:
self
.
module
=
None
# import the configuration script as a module
if
self
.
ConfiguratorScript
:
...
...
@@ -568,7 +550,7 @@ class Dynamic(PyTango.Device_4Impl):
#------------------------------------------------------------------
def
read_dynamic_attribute
(
self
,
attr_name
):
if
self
.
read_functions
[
attr_name
]:
read_method
=
getattr
(
self
.
module
,
self
.
read_functions
[
attr_name
])
read_method
=
getattr
(
self
.
cfg_
module
,
self
.
read_functions
[
attr_name
])
num_of_args
=
read_method
.
__code__
.
co_argcount
if
num_of_args
==
1
:
# If method allows an input parameter,
...
...
@@ -586,7 +568,7 @@ class Dynamic(PyTango.Device_4Impl):
#------------------------------------------------------------------
def
write_dynamic_attribute
(
self
,
attr_name
,
value_in
):
if
self
.
write_functions
[
attr_name
]:
write_method
=
getattr
(
self
.
module
,
self
.
write_functions
[
attr_name
])
write_method
=
getattr
(
self
.
cfg_
module
,
self
.
write_functions
[
attr_name
])
num_of_args
=
write_method
.
__code__
.
co_argcount
if
num_of_args
==
2
:
# If method allows two input parameter,
...
...
@@ -622,10 +604,6 @@ class DynamicClass(PyTango.DeviceClass):
[
PyTango
.
DevString
,
"
Path to the config file
"
,
[]
],
'
FiltersScript
'
:
[
PyTango
.
DevString
,
"
Path to the python script that will be executed.
"
,
[]
],
'
DefaultCfgScript
'
:
[
PyTango
.
DevString
,
"
Path to the default config file
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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