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
9d1384af
Commit
9d1384af
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-449
: Actually read new values when waiting for the value to change
parent
3af690cd
Branches
Branches containing commit
No related tags found
1 merge request
!175
Resolve L2SS-449 "Add deviceproxy to devices"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/devices/lofar_device.py
+3
-5
3 additions, 5 deletions
...tationcontrol/tangostationcontrol/devices/lofar_device.py
with
3 additions
and
5 deletions
tangostationcontrol/tangostationcontrol/devices/lofar_device.py
+
3
−
5
View file @
9d1384af
...
@@ -15,7 +15,7 @@ from abc import abstractmethod
...
@@ -15,7 +15,7 @@ from abc import abstractmethod
# PyTango imports
# PyTango imports
from
tango.server
import
Device
,
command
,
DeviceMeta
,
attribute
from
tango.server
import
Device
,
command
,
DeviceMeta
,
attribute
from
tango
import
AttrWriteType
,
DevState
,
DebugIt
,
Attribute
,
DeviceProxy
from
tango
import
AttrWriteType
,
DevState
,
DebugIt
,
Attribute
,
DeviceProxy
,
DevFailed
import
time
import
time
import
math
import
math
...
@@ -284,13 +284,11 @@ class lofar_device(Device, metaclass=AbstractDeviceMetas):
...
@@ -284,13 +284,11 @@ class lofar_device(Device, metaclass=AbstractDeviceMetas):
pollperiod: how often to check the attribute, in seconds.
pollperiod: how often to check the attribute, in seconds.
"""
"""
attr
=
getattr
(
self
.
proxy
,
attr_name
)
# Poll every half a second
# Poll every half a second
for
_
in
range
(
math
.
ceil
(
timeout
/
pollperiod
)):
for
_
in
range
(
math
.
ceil
(
timeout
/
pollperiod
)):
if
attr
!=
value
:
if
get
attr
(
self
.
proxy
,
attr_name
)
!=
value
:
return
return
time
.
sleep
(
pollperiod
)
time
.
sleep
(
pollperiod
)
raise
Exception
(
f
"
{
attr
}
!=
{
value
}
after
f
{
timeout
}
seconds still.
"
)
raise
Exception
(
f
"
{
attr
_name
}
!=
{
value
}
after
{
timeout
}
seconds still.
"
)
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