space_packet_parser.xtce.containers
Module with XTCE models related to SequenceContainers
Classes
<xtce:SequenceContainer> |
Module Contents
- class space_packet_parser.xtce.containers.SequenceContainer
Bases:
space_packet_parser.common.Parseable,space_packet_parser.common.XmlObject<xtce:SequenceContainer>
- Parameters:
name (str) – Container name
entry_list (list) – List of Parameter objects
long_description (str) – Long description of the container
base_container_name (str) – Name of the base container from which this may inherit if restriction criteria are met.
restriction_criteria (list) – A list of MatchCriteria elements that evaluate to determine whether the SequenceContainer should be included.
abstract (bool) – True if container has abstract=true attribute. False otherwise.
inheritors (Optional[list]) – List of SequenceContainer objects that may inherit this one’s entry list if their restriction criteria are met. Any SequenceContainers with this container as base_container_name should be listed here.
- entry_list: list[space_packet_parser.xtce.parameters.Parameter | SequenceContainer]
- restriction_criteria: list[space_packet_parser.xtce.comparisons.MatchCriteria] | None = []
- __post_init__()
- parse(packet: space_packet_parser.SpacePacket) None
Parse the entry list of parameters/containers in the order they are expected in the packet.
This could be recursive if the entry list contains SequenceContainers.
- classmethod from_xml(element: lxml.etree.Element, *, tree: lxml.etree.ElementTree, parameter_lookup: dict[str, space_packet_parser.xtce.parameters.Parameter], container_lookup: dict[str, Any] | None, parameter_type_lookup: dict[str, space_packet_parser.xtce.parameter_types.ParameterType] | None = None) SequenceContainer
Parses the list of parameters in a SequenceContainer element, recursively parsing nested SequenceContainers to build an entry list of parameters that flattens the nested structure to derive a sequential ordering of expected parameters for each SequenceContainer. Note that this also stores entry lists for containers that are not intended to stand alone.
- Parameters:
tree (ElementTree.ElementTree) – Full XTCE tree
element (ElementTree.Element) – The SequenceContainer element to parse.
parameter_lookup (dict[str, parameters.Parameter]) – Parameters contained in the entry lists of sequence containers
container_lookup (Optional[dict[str, SequenceContainer]]) – Containers already parsed, used to sort out duplicate references
parameter_type_lookup (Optional[dict[str, parameter_types.ParameterType]]) – Ignored.
- Returns:
SequenceContainer containing an entry_list of SequenceContainers and Parameters with ParameterTypes in the order expected in a packet.
- Return type:
cls
- to_xml(*, elmaker: lxml.builder.ElementMaker) lxml.etree.Element
Create a SequenceContainer XML element
- Parameters:
elmaker (ElementMaker) – Element factory with predefined namespace
- Return type:
ElementTree.Element
- static _get_container_element(tree: lxml.etree.ElementTree, name: str) lxml.etree.Element
Finds an XTCE container <xtce:SequenceContainer> by name.
- Parameters:
name (str) – Name of the container to find
- Return type:
ElementTree.Element
- static _get_base_container_element(tree: lxml.etree.Element, container_element: lxml.etree.Element) tuple[lxml.etree.Element, list[space_packet_parser.xtce.comparisons.MatchCriteria]]
Finds the referenced base container of an existing XTCE container element, including its inheritance restrictions.
- Parameters:
tree (ElementTree.ElementTree) – Full XML tree object, for finding additional referenced containers if necessary.
container_element (ElementTree.Element) – The container element for which to find its base container.
- Returns:
The base container element of the input container_element. The restriction criteria for the inheritance.
- Return type:
tuple[ElementTree.Element, list[comparisons.MatchCriteria]]
- static _is_abstract_container(container_element: lxml.etree.Element) bool
Determine in a SequenceContainer element is abstract
- Parameters:
container_element (ElementTree.Element) – SequenceContainer element to examine
- Returns:
True if SequenceContainer element has the attribute abstract=true. False otherwise.
- Return type: