Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alarm-mail
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
cs
ds
alarm-mail
Commits
b18753e9
Commit
b18753e9
authored
4 years ago
by
Graziano Scalamera
Browse files
Options
Downloads
Patches
Plain Diff
Add support for alarm-handler in SendAlarmHDB
parent
40bf9ebe
No related branches found
Branches containing commit
Tags
1.2.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/AlarmMail.py
+25
-13
25 additions, 13 deletions
src/AlarmMail.py
with
25 additions
and
13 deletions
src/AlarmMail.py
+
25
−
13
View file @
b18753e9
...
...
@@ -292,24 +292,36 @@ class AlarmMail (PyTango.Device_4Impl):
params
=
{
}
for
param
in
argin
.
split
(
'
;
'
):
params
[
param
.
split
(
'
=
'
,
1
)[
0
]]
=
param
.
split
(
'
=
'
,
1
)[
1
]
#print('looping param=' + param)
params
[
param
.
split
(
'
=
'
,
1
)[
0
]]
=
param
.
split
(
'
=
'
,
1
)[
1
]
#print('looping param=' + param)
att_list
=
[]
err_list
=
[]
hdbppes
=
''
print
(
params
)
word
=
'
([a-zA-Z0-9\+\._\*\#\-]+)
'
word2
=
'
([a-zA-Z0-9\+\.\*\#\-]+)
'
m
=
re
.
compile
(
word
+
"
/
"
+
word
+
"
/
"
+
word
+
"
/
"
+
word
).
match
(
params
[
'
name
'
])
if
m
is
not
None
:
hdbppes
=
m
.
groups
()[
0
]
+
"
/
"
+
m
.
groups
()[
1
]
+
"
/
"
+
m
.
groups
()[
2
]
dev
=
PyTango
.
DeviceProxy
(
hdbppes
)
try
:
#tmp_nok = dev.read_attribute("AttributeNokList")
tmp_errs
=
dev
.
read_attribute
(
"
AttributeErrorList
"
)
tmp_list
=
dev
.
read_attribute
(
"
AttributeList
"
)
#nok_list = tmp_nok.value
err_list
=
tmp_errs
.
value
att_list
=
tmp_list
.
value
comb_list
=
map
(
lambda
x
,
y
:(
x
,
y
),
att_list
,
err_list
)
except
(
DevFailed
,
ConnectionFailed
,
EventSystemFailed
),
e
:
print
'
Error read_attribute: %s
'
%
(
e
[
0
][
'
desc
'
])
else
:
m
=
re
.
compile
(
"
hdbppes_
"
+
word2
+
"
_
"
+
word2
).
match
(
params
[
'
name
'
])
if
m
is
not
None
:
hdbppes
=
"
archiving/hdb++archiver/
"
+
m
.
groups
()[
0
]
dev
=
PyTango
.
DeviceProxy
(
hdbppes
)
try
:
#tmp_nok = dev.read_attribute("AttributeNokList")
tmp_errs
=
dev
.
read_attribute
(
"
AttributeErrorList
"
)
tmp_list
=
dev
.
read_attribute
(
"
AttributeList
"
)
#nok_list = tmp_nok.value
err_list
=
tmp_errs
.
value
att_list
=
tmp_list
.
value
#comb_list = map(lambda x,y:(x,y),att_list,err_list)
except
(
DevFailed
,
ConnectionFailed
,
EventSystemFailed
),
e
:
print
'
Error read_attribute: %s
'
%
(
e
[
0
][
'
desc
'
])
comb_list
=
map
(
lambda
x
,
y
:(
x
,
y
),
att_list
,
err_list
)
msg_hdb
=
''
for
iii
in
comb_list
:
if
len
(
iii
[
1
])
>
0
:
...
...
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