Skip to content
Snippets Groups Projects
Commit b96e0eaf authored by Thomas Juerges's avatar Thomas Juerges
Browse files

Add helper funcs to add/remove attribute archiving

parent c3a8d64d
No related branches found
No related tags found
No related merge requests found
#! /usr/bin/env python3
from .lofar2_config import configure_logging
from tango import DeviceProxy
def add_attribute_to_archiver(attribute: str, polling_period: float, event_period: float, archive_manager: str = 'archiving/hdbpp/confmanager01', archiver: str = 'archiving/hdbpp/eventsubscriber01'):
am = DeviceProxy(archive_manager)
am.write_attribute('SetAttributeName', attribute)
am.write_attribute('SetArchiver', archiver)
am.write_attribute('SetStrategy', 'ALWAYS')
am.write_attribute('SetPollingPeriod', int(polling_period))
am.write_attribute('SetPeriodEvent', int(event_period))
am.AttributeAdd()
am.AttributeStart(attribute)
def remove_attribute_from_archiver(attribute: str, archive_manager: str = 'archiving/hdbpp/confmanager01'):
am = DeviceProxy(archive_manager)
am.AttributeStop(attribute)
am.AttributeRemove(attribute)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment