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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
e2c91f20
Commit
e2c91f20
authored
3 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
some work
parent
311fedb9
Branches
Branches containing commit
No related tags found
1 merge request
!322
Resolve L2SS-697 "Notice temperature alarm across devices"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/devices/temperature_manager.py
+37
-4
37 additions, 4 deletions
...ontrol/tangostationcontrol/devices/temperature_manager.py
with
37 additions
and
4 deletions
tangostationcontrol/tangostationcontrol/devices/temperature_manager.py
+
37
−
4
View file @
e2c91f20
...
@@ -15,7 +15,8 @@ from tangostationcontrol.common.lofar_logging import device_logging_to_python, l
...
@@ -15,7 +15,8 @@ from tangostationcontrol.common.lofar_logging import device_logging_to_python, l
from
tango._tango
import
DevState
from
tango._tango
import
DevState
from
tangostationcontrol.integration_test.device_proxy
import
TestDeviceProxy
from
tangostationcontrol.integration_test.device_proxy
import
TestDeviceProxy
from
tango
import
Util
,
DeviceProxy
,
DevSource
from
tango
import
Util
,
DeviceProxy
,
DevSource
,
DeviceAttribute
,
AttributeInfo
,
AttrDataFormat
,
attr_config
from
tango.server
import
attribute
,
device_property
import
logging
import
logging
...
@@ -30,12 +31,25 @@ class temp_attr:
...
@@ -30,12 +31,25 @@ class temp_attr:
self
.
dev
=
dev
self
.
dev
=
dev
self
.
attr
=
attr
self
.
attr
=
attr
# fetch attribute configuration
attr_config
=
self
.
dev
.
get_attribute_config
(
attr
.
name
)
self
.
is_scalar
=
attr_config
.
data_format
==
AttrDataFormat
.
SCALAR
@device_logging_to_python
()
@device_logging_to_python
()
class
temperature_manager
(
lofar_device
):
class
temperature_manager
(
lofar_device
):
# -----------------
# -----------------
# Device Properties
# Device Properties
# -----------------
# -----------------
temperatureManager_polling_speed_ms
=
device_property
(
dtype
=
'
DevLong64
'
,
mandatory
=
False
,
default_value
=
10000
)
# ----------
# ----------
# Attributes
# Attributes
# ----------
# ----------
...
@@ -71,11 +85,13 @@ class temperature_manager(lofar_device):
...
@@ -71,11 +85,13 @@ class temperature_manager(lofar_device):
for
dev
in
dev_list
:
for
dev
in
dev_list
:
dev
.
set_source
(
DevSource
.
DEV
)
dev
.
set_source
(
DevSource
.
DEV
)
attribute_list
=
dev
.
get_attribute_list
()
# get a list of AttributeInfo objects
attribute_list
=
dev
.
attribute_list_query
()
# make a list of all temperature attributes
# make a list of all temperature attributes
for
attr
in
attribute_list
:
for
attr
in
attribute_list
:
if
"
_temp_error_r
"
in
attr
.
lowercase
():
if
"
_temp_error_r
"
in
attr
.
name
.
lowercase
():
self
.
temp_attr_list
.
append
(
temp_attr
(
dev
,
attr
))
self
.
temp_attr_list
.
append
(
temp_attr
(
dev
,
attr
))
super
().
configure_for_initialise
()
super
().
configure_for_initialise
()
...
@@ -88,10 +104,27 @@ class temperature_manager(lofar_device):
...
@@ -88,10 +104,27 @@ class temperature_manager(lofar_device):
def
configure_for_off
(
self
):
def
configure_for_off
(
self
):
super
().
configure_for_off
()
super
().
configure_for_off
()
def
read_alarm_state
(
self
,
devAttr
):
val
=
devAttr
.
dev
.
read_attribute
(
devAttr
.
attr
.
name
)
if
devAttr
.
is_scalar
:
if
val
.
value
:
# there is an alarm state
else
:
if
any
(
val
.
value
):
# there is something in the alarm state
pass
def
polling_loop
(
self
):
def
polling_loop
(
self
):
for
i
in
self
.
temp_attr_list
:
for
i
in
self
.
temp_attr_list
:
i
.
read
self
.
read_alarm_state
(
i
)
...
...
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