You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.
I have written an editor using PyCrate and PySimpleGUI that works well for editing existing fields in an object. It uses get_val_paths() to go through a message and construct a PySimpleGUI TreeData. This works well, and didn't take too long to implement.
However, it only allows changing fields that already exist. I'd like to extend this to allow changing a Choice, generating some minimal/default value for that choice, and then allowing the user to modify the newly created sub-fields.
Any suggestions on how to do this? My first thought is that I can borrow some of the get_proto code, but that seems a fair amount of work.
I've attached a screenshot showing the editor I have working now.
The text was updated successfully, but these errors were encountered:
When you set a value for a constructed type (CHOICE, SEQUENCE, SET) from scratch, you need to know all exact sub-components values. When working with such a graphical editor, it should propose a default values for all sub-components, that can be then edited further.
To initialize a value for a constructed type, you would need to go through all mandatory sub-components, assigning one default value in accordance with any existing constraint (value, size, content...) for each. What I would do myself is creating a common method to all ASN.1 types (e.g. set_default_val()): for classes defined in asnobj_basic.py, asnobj_str.py, asnobj_construct.py and eventually asnobj_ext.py. In this way, calling such a method for a constructed object would just call it recursively to all its components.
This is still quite a lot of work, as defining default values could be cumbersome for some ASN.1 objects and constraints.
I have written an editor using PyCrate and PySimpleGUI that works well for editing existing fields in an object. It uses get_val_paths() to go through a message and construct a PySimpleGUI TreeData. This works well, and didn't take too long to implement.
However, it only allows changing fields that already exist. I'd like to extend this to allow changing a Choice, generating some minimal/default value for that choice, and then allowing the user to modify the newly created sub-fields.
Any suggestions on how to do this? My first thought is that I can borrow some of the get_proto code, but that seems a fair amount of work.
I've attached a screenshot showing the editor I have working now.
The text was updated successfully, but these errors were encountered: