From 5b3993af98c1534acf5cc02a9f8237769ec7a8b7 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Thu, 13 Jun 2024 17:19:54 +1000 Subject: [PATCH] param_auto_test: bitmask priority over values If a parameter is a bitmask parameter, use that check and ignore the values check. Often, some common values will be included in the meta as well, but the values list is obviously not usually exhaustive. SW-159 --- Tools/Carbonix_scripts/param_auto_test.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Tools/Carbonix_scripts/param_auto_test.py b/Tools/Carbonix_scripts/param_auto_test.py index 8e3124078f..381be77ed2 100644 --- a/Tools/Carbonix_scripts/param_auto_test.py +++ b/Tools/Carbonix_scripts/param_auto_test.py @@ -48,6 +48,15 @@ param_dict[param_name] = None continue + # Check for 'Bitmask' field + field_elem = param_elem.find(".//field[@name='Bitmask']") + if field_elem is not None: + field_values = [ + value.strip().split(':')[0] for value in field_elem.text.split(',') + ] + param_dict[param_name] = {'type': 'Bitmask', 'values': field_values} + continue + # Check for 'values' element param_range = param_elem.find('values') if param_range is not None: @@ -86,15 +95,6 @@ param_dict[param_name] = {'type': 'values', 'values': parsed_values} continue - # Check for 'Bitmask' field - field_elem = param_elem.find(".//field[@name='Bitmask']") - if field_elem is not None: - field_values = [ - value.strip().split(':')[0] for value in field_elem.text.split(',') - ] - param_dict[param_name] = {'type': 'Bitmask', 'values': field_values} - continue - # Default to Int type if no other type is found param_dict[param_name] = {'type': 'Int', 'values': None}