Skip to content

Commit

Permalink
Binary exporter support for structs.
Browse files Browse the repository at this point in the history
Signed-off-by: Ulf Bjorkengren <[email protected]>
  • Loading branch information
UlfBj committed Oct 23, 2024
1 parent 71e3e8b commit f3ac54e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/vss_tools/exporters/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def export_node(node: VSSNode, generate_uuid, f: BinaryIO):
@clo.overlays_opt
@clo.quantities_opt
@clo.units_opt
@clo.types_opt
@clo.types_output_opt
@clo.extend_all_attributes_opt
def cli(
vspec: Path,
output: Path,
Expand All @@ -126,12 +129,15 @@ def cli(
overlays: tuple[Path],
quantities: tuple[Path],
units: tuple[Path],
types: tuple[Path],
types_output: Path,
extend_all_attributes: bool,
):
"""
Export to Binary.
"""

tree, _ = get_trees(
tree, datatype_tree = get_trees(
vspec=vspec,
include_dirs=include_dirs,
aborts=aborts,
Expand All @@ -140,9 +146,17 @@ def cli(
uuid=uuid,
quantities=quantities,
units=units,
types=types,
overlays=overlays,
)

log.info("Generating binary output...")
if datatype_tree:
if types_output:
with open(str(types_output), "wb") as f:
export_node(datatype_tree, uuid, f)
log.info("Binary datatype tree output generated in %s", types_output)

with open(str(output), "wb") as f:
export_node(tree, uuid, f)
log.info("Binary output generated in %s", output)
log.info("Binary main tree output generated in %s", output)

0 comments on commit f3ac54e

Please sign in to comment.