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
4afe2759
Commit
4afe2759
authored
3 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
finished processing feedback
parent
bc2aca25
No related branches found
No related tags found
1 merge request
!24
Resolve #2021 "04 16 branched from master ini file device"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
devices/clients/ini_client.py
+9
-9
9 additions, 9 deletions
devices/clients/ini_client.py
devices/ini_device.py
+0
-16
0 additions, 16 deletions
devices/ini_device.py
with
9 additions
and
25 deletions
devices/clients/ini_client.py
+
9
−
9
View file @
4afe2759
...
...
@@ -58,7 +58,7 @@ class ini_client(CommClient):
self
.
config_file
=
open
(
self
.
filename
,
"
r
"
)
self
.
connected
=
True
# set connected to true
return
True
# if succesful
l
, return true. otherwise return false
return
True
# if succes
s
ful, return true. otherwise return false
def
disconnect
(
self
):
self
.
connected
=
False
# always force a reconnect, regardless of a successful disconnect
...
...
@@ -73,16 +73,21 @@ class ini_client(CommClient):
example annotation may include:
- a file path and file line/location
- COM object path
Annotations:
name: Required, the name of the ini variable
section: Required, the section of the ini variable
"""
# as this is an example, just print the annotation
self
.
streams
.
debug_stream
(
"
annotation: {}
"
.
format
(
annotation
))
name
=
annotation
.
get
(
'
name
'
)
if
name
is
None
:
Assertion
Error
(
"
ini client requires a variable name to set/get
"
)
Value
Error
(
"
ini client requires a variable
`
name
` in the annotation
to set/get
"
)
section
=
annotation
.
get
(
'
section
'
)
if
section
is
None
:
Assertion
Error
(
"
requires a section to open
"
)
Value
Error
(
"
requires a
`
section
` specified in the annotation
to open
"
)
return
section
,
name
...
...
@@ -120,13 +125,8 @@ class ini_client(CommClient):
def
write_function
(
value
):
if
type
(
value
)
is
list
:
write_value
=
""
for
i
in
value
:
write_value
=
write_value
+
str
(
value
)
+
"
,
"
write_value
=
"
,
"
.
join
([
str
(
v
)
for
v
in
value
])
# strip the extra ", " at the end
write_value
=
write_value
[:
-
2
]
else
:
write_value
=
str
(
value
)
...
...
This diff is collapsed.
Click to expand it.
devices/ini_device.py
+
0
−
16
View file @
4afe2759
...
...
@@ -96,22 +96,6 @@ class ini_device(hardware_device):
str_image_RW
=
attribute_wrapper
(
comms_annotation
=
{
"
section
"
:
"
image
"
,
"
name
"
:
"
str_image_RW
"
},
datatype
=
numpy
.
str_
,
dims
=
(
3
,
2
),
access
=
AttrWriteType
.
READ_WRITE
)
str_image_R
=
attribute_wrapper
(
comms_annotation
=
{
"
section
"
:
"
image
"
,
"
name
"
:
"
str_image_R
"
},
datatype
=
numpy
.
str_
,
dims
=
(
3
,
2
))
def
always_executed_hook
(
self
):
"""
Method always executed before any TANGO command is executed.
"""
pass
def
delete_device
(
self
):
"""
Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command (a Tango built-in).
"""
self
.
debug_stream
(
"
Shutting down...
"
)
self
.
Off
()
self
.
debug_stream
(
"
Shut down. Good bye.
"
)
# --------
# overloaded functions
# --------
...
...
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