Skip to content

Commit

Permalink
Merge pull request #35 from dinkelk/hydra_fixes
Browse files Browse the repository at this point in the history
some small fixes to the way hydra interacts with floating point value…
  • Loading branch information
dinkelk authored Apr 4, 2024
2 parents aa64f1e + 7eb98ad commit 6f99229
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions gen/generators/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self):
# Hydra XML generator:
##############################################
# Mapping from basic Ada types to format strings for Hydra.
type_format_dictionary = {"Natural": "%d", "Integer": "%d", "Float": "%f"}
type_format_dictionary = {"U": "%d", "I": "%d", "F": "%f"}


# Function which produces a format string to print an Ada type:
Expand All @@ -136,7 +136,7 @@ def create_type_print_strings(theAssembly):
)
elif field.format:
try:
string += type_format_dictionary[field.type]
string += type_format_dictionary[field.format.type[0]]
except Exception:
string += "%d"
else:
Expand Down
6 changes: 3 additions & 3 deletions gnd/hydra/Config/adamant_types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@
<typeDN name="E64" size="64" endian="BIG"/>

<!-- Floating point types -->
<typeFloat name="F32"/>
<typeDouble name="F64"/>
<typeFloat name="F32" size="32" endian="BIG"/>
<typeDouble name="F64" size="64" endian="BIG"/>

<!-- Special types -->
<typeChar name="char"/>
<typeChar name="char" size="8"/>

<!-- Ada specific types -->
<typeDN name="Natural" size="32" endian="BIG"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<frameCopy name="Sys_Time" prefix="Ccsds-{{ packet.full_name|replace(".","-") }}-"/>
{% if packet.items %}
{% for item_name,item in packet.items.items() %}
<itemDef name="Ccsds-{{ item.full_name|replace(".","-") }}" type="{% if item.is_enum or item.literals %}{{ item.full_name|replace(".","-") }}-Enum{% else %}{{ item.format.type}}{% endif %}"{% if item.format.length and item.format.length > 1 %} num="{{ item.format.length }}"{% endif%}>
<itemDef name="Ccsds-{{ item.full_name|replace(".","-") }}" type="{% if item.is_enum or item.literals %}{{ item.full_name|replace(".","-") }}-Enum{% else %}{{ item.format.type }}{% endif %}"{% if item.format.length and item.format.length > 1 %} num="{{ item.format.length }}"{% endif%}>
{% if item.flattened_description %}
<description text="{{ item.flattened_description }}"/>
{% endif %}
Expand Down

0 comments on commit 6f99229

Please sign in to comment.