Skip to content
Snippets Groups Projects
Commit b18753e9 authored by Graziano Scalamera's avatar Graziano Scalamera
Browse files

Add support for alarm-handler in SendAlarmHDB

parent 40bf9ebe
No related branches found
Tags 1.2.0
No related merge requests found
......@@ -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:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment