-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary exporter support for structs. #420
Changes from 5 commits
847ed46
5fda216
edbfc8f
71e3e8b
f3ac54e
4cba86c
4c64632
4a8c9a3
caf4823
fc2f3b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
|
@@ -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, | ||
|
@@ -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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if types_output is not defined? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test shows that if --types-output is not used in the make command the second if statement becomes false. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does not really answer my question because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ulf - I suggest you add an else statement, something like
or
... that gives a hint that they maybe have forgotten to specify output file. |
||
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not using that, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extend_all_attributes is probably not needed. The other two are referenced at other places in the code so I assume they are needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah so please get rid of the unused ones