Skip to content

Commit

Permalink
param_auto_test: bitmask priority over values
Browse files Browse the repository at this point in the history
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
  • Loading branch information
robertlong13 authored and loki077 committed Jun 14, 2024
1 parent 3e77397 commit 5b3993a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Tools/Carbonix_scripts/param_auto_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}

Expand Down

0 comments on commit 5b3993a

Please sign in to comment.