diff --git a/tangostationcontrol/tangostationcontrol/toolkit/archiver_config/lofar2.json b/tangostationcontrol/tangostationcontrol/toolkit/archiver_config/lofar2.json index fabec554e0531bcc7e5c62c1224408610310ed65..b81b46cf111b0743791c3b60f3151c10022a1ac2 100644 --- a/tangostationcontrol/tangostationcontrol/toolkit/archiver_config/lofar2.json +++ b/tangostationcontrol/tangostationcontrol/toolkit/archiver_config/lofar2.json @@ -22,9 +22,9 @@ "event_period": "60000", "strategy": "RUN", "infixes":[ - {"attribute": "IOUT", "archive_period": "60000", "event_period": "1000", "abs_change": null, "rel_change": 5}, - {"attribute": "VOUT", "archive_period": "60000", "event_period": "1000", "abs_change": null, "rel_change": 5}, - {"attribute": "TEMP", "archive_period": "60000", "event_period": "1000", "abs_change": 0.5, "rel_change": 5} + {"attribute": "/*IOUT*", "archive_period": "60000", "event_period": "1000", "abs_change": null, "rel_change": 5}, + {"attribute": "/*VOUT*", "archive_period": "60000", "event_period": "1000", "abs_change": null, "rel_change": 5}, + {"attribute": "/*TEMP*", "archive_period": "60000", "event_period": "1000", "abs_change": 0.5, "rel_change": 5} ], "suffixes":[ {"attribute": "_error_R", "archive_period": "60000", "event_period": "1000", "abs_change": "1", "rel_change": null}, diff --git a/tangostationcontrol/tangostationcontrol/toolkit/archiver_configurator.py b/tangostationcontrol/tangostationcontrol/toolkit/archiver_configurator.py index 848d236419b78ee5f0ce1c1f8f4eb7d145e1e134..f6e9e60d1a57892598495e81bfe6679c5e7dfd98 100644 --- a/tangostationcontrol/tangostationcontrol/toolkit/archiver_configurator.py +++ b/tangostationcontrol/tangostationcontrol/toolkit/archiver_configurator.py @@ -6,6 +6,7 @@ Functions related to the managing of the archiver configuration JSON file """ import logging +import re from tangostationcontrol.toolkit.archiver_util import get_attributes_from_suffix, retrieve_attributes_from_wildcards logger = logging.getLogger() @@ -35,7 +36,8 @@ def get_parameters_from_attribute(device_name:str, attribute_name:str, config_di # Search if the archiving parameters are listed inside the global infixes attributes infixes = config_dict['_global_variables'][environment]['infixes'] for a in infixes: - if a['attribute'].lower() in attribute_name.lower(): + # Match regular expression with attribute name + if re.compile(a['attribute'].lower()).search(attribute_name): return _get_archiving_parameters(a) # Search if the archiving parameters are listed inside the global suffixes attributes suffixes = config_dict['_global_variables'][environment]['suffixes']