diff --git a/pyproject.toml b/pyproject.toml index 98b6afd1..bd9efefd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ "pexpect>=4.8.0", "pytest>=6.2.4", "flask_restful>=0.3.8", - "fprime-tools>=3.1.2a1", + "fprime-tools>=3.4.3", "argcomplete>=1.12.3", "Jinja2>=2.11.3", "openpyxl>=3.0.10", diff --git a/src/fprime_gds/common/loaders/xml_loader.py b/src/fprime_gds/common/loaders/xml_loader.py index 397c48e4..0fdc5259 100644 --- a/src/fprime_gds/common/loaders/xml_loader.py +++ b/src/fprime_gds/common/loaders/xml_loader.py @@ -49,6 +49,7 @@ class XmlLoader(dict_loader.DictLoader): ENUM_SECT = "enums" ENUM_TYPE_TAG = "type" + ENUM_SERIALIZE_TYPE_TAG = "serialize_type" ENUM_ELEM_NAME_TAG = "name" ENUM_ELEM_VAL_TAG = "value" ENUM_ELEM_DESC_TAG = "description" @@ -202,6 +203,9 @@ def get_enum_type(self, enum_name, xml_obj): for enum in enum_section: # Check enum name if enum.get(self.ENUM_TYPE_TAG) == enum_name: + # Get serialize/representation type, if present + serialize_type = enum.get(self.ENUM_SERIALIZE_TYPE_TAG, "I32") + # Go through all possible values of the enum members = {} for item in enum: @@ -209,7 +213,7 @@ def get_enum_type(self, enum_name, xml_obj): item_val = int(item.get(self.ENUM_ELEM_VAL_TAG)) members[item_name] = item_val - enum_obj = EnumType.construct_type(enum_name, members) + enum_obj = EnumType.construct_type(enum_name, members, serialize_type) self.enums[enum_name] = enum_obj return enum_obj