Skip to content
Snippets Groups Projects
fixevents.py 1.08 KiB
Newer Older
#fix format of pressure readings
#.C.S. 2019
#
from tango import *
sip120 = DeviceProxy('rpcbridge/rpc2tangobridge/sip120')
sip400 = DeviceProxy('rpcbridge/rpc2tangobridge/sip400')



sip120attrlist = sip120.get_attribute_list()

for att in sip120attrlist:
    attconf=sip120.get_attribute_config(att)
    attconf.format='%6.2e'
    attconf.events.arch_event.archive_rel_change = '20'
    attconf.events.arch_event.archive_period = '360000'
    attconf.events.ch_event.rel_change = '10'
    try:
        sip120.set_attribute_config(attconf)
        sip120.poll_attribute(att,3000)
    except:
        print ('fail for %s', att)
        pass
    
sip400attrlist = sip400.get_attribute_list()

for att in sip400attrlist:
    attconf=sip400.get_attribute_config(att)
    attconf.format='%6.2e'
    attconf.events.arch_event.archive_rel_change = '20'
    attconf.events.arch_event.archive_period = '360000'
    attconf.events.ch_event.rel_change = '10'
    try:
        sip400.set_attribute_config(attconf)
        sip400.poll_attribute(att,3000)
    except:
        print ('fail for %s', att)
        pass