Skip to content

Commit

Permalink
Merge pull request #118 from tloubrieu-jpl/crc_converter
Browse files Browse the repository at this point in the history
Accept CCSDS header fields as converter inputs
  • Loading branch information
ddasilva authored Mar 12, 2024
2 parents 036a66f + 8e09f86 commit 1f2bac8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ccsdspy/packet_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ def add_converted_field(self, input_field_name, output_field_name, converter):

# Check that each of the input field names exists in the packet, and report
# the missing fields if not
fields_in_packet_set = {field._name for field in self._fields}
# Collect valid names of fields, which include primary header fields as well
# as fields defined in the packet.
fields_in_packet_set = set()

for field in _prepend_primary_header_fields(self._fields):
fields_in_packet_set.add(field._name)

input_field_names_set = set(input_field_names)
all_fields_present = input_field_names_set <= fields_in_packet_set # subset

Expand Down

0 comments on commit 1f2bac8

Please sign in to comment.