struct2ui 0.6.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {struct2ui-0.6.0/src/struct2ui.egg-info → struct2ui-0.7.0}/PKG-INFO +27 -14
- {struct2ui-0.6.0 → struct2ui-0.7.0}/README.md +26 -13
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/__init__.py +1 -1
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/editor.py +2110 -2107
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/exporters/c_emitter.py +304 -292
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/schema.py +7 -116
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/ui/renderers.py +366 -333
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/ui/tables.py +189 -69
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/ui/widgets.py +1116 -1155
- {struct2ui-0.6.0 → struct2ui-0.7.0/src/struct2ui.egg-info}/PKG-INFO +27 -14
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_editor.py +615 -615
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_union.py +107 -65
- {struct2ui-0.6.0 → struct2ui-0.7.0}/LICENSE +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/pyproject.toml +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/setup.cfg +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/exporters/__init__.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/exporters/bin_emitter.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/exporters/bin_reader.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/exporters/c_parser.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/exporters/elf_verifier.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/exporters/json_format.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/icons/c2j.png +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/icons/elf.png +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/icons/export_notes_24dp_000000_FILL0_wght400_GRAD0_opsz24.png +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/icons/flowchart_24dp_000000_FILL0_wght400_GRAD0_opsz24.png +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/icons/refresh_24dp_000000_FILL0_wght400_GRAD0_opsz24.png +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/icons/report_24dp_000000_FILL0_wght400_GRAD0_opsz24.png +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/icons/save_24dp_000000_FILL0_wght400_GRAD0_opsz24.png +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/icons/save_as_24dp_000000_FILL0_wght400_GRAD0_opsz24.png +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/icons/settings_24dp_000000_FILL0_wght400_GRAD0_opsz24.png +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/icons/widgets_24dp_000000_FILL0_wght400_GRAD0_opsz24.png +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui/ui/__init__.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui.egg-info/SOURCES.txt +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui.egg-info/dependency_links.txt +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui.egg-info/requires.txt +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/src/struct2ui.egg-info/top_level.txt +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_bin_emitter.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_bin_reader.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_c_emitter.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_c_parser.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_choices.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_container_verify.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_elf_verifier.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_float_precision.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_int_checkbox.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_json_format.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_load_report.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_macro_bounds.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_save.py +0 -0
- {struct2ui-0.6.0 → struct2ui-0.7.0}/tests/test_value_readback.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: struct2ui
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Render C struct / JSON schema as editable PySide6 UI, export to C/JSON/bin
|
|
5
5
|
Author-email: Jay <huoyj0108@163.com>
|
|
6
6
|
License: MIT License
|
|
@@ -144,7 +144,7 @@ generated from it. Files live in the **modules directory** (`cfg_dir`), one
|
|
|
144
144
|
| --- | --- | --- |
|
|
145
145
|
| `struct` | `type`, `items` (list of field specs) | `items` is required |
|
|
146
146
|
| `enum` | `type`, `items` (object `{NAME: value}`) | reads back the enumerator name |
|
|
147
|
-
| `union` | `type`, `items` (list of branch structs)
|
|
147
|
+
| `union` | `type`, `items` (list of branch structs) | tagged union; each branch is an inline `struct` selected by its `when` (see below; a legacy `branch` key is accepted but ignored) |
|
|
148
148
|
| `typedefs` | object `{alias: real_type}` | resolved before field building |
|
|
149
149
|
|
|
150
150
|
Free-form metadata keys are allowed and ignored at any level: `version`,
|
|
@@ -185,7 +185,7 @@ When omitted, the widget is inferred from `type` (and from `min/max`,
|
|
|
185
185
|
| `dial` | int | Rotary dial popup (requires `min` & `max`). |
|
|
186
186
|
| `file` | array | Path label + Browse button; loads array values from a text file. |
|
|
187
187
|
| `multiline` | array | Single-line shell that pops up a multi-line editor. |
|
|
188
|
-
| `table` | struct array |
|
|
188
|
+
| `table` | struct array | Express grid-layout intent (one column per struct member; a union member expands the branch inferred from the pipeline rows into columns — see the union section below). |
|
|
189
189
|
|
|
190
190
|
Numeric fields without an explicit `widget` become a `QSpinBox` /
|
|
191
191
|
`QDoubleSpinBox`; scalar arrays become a comma-separated line edit.
|
|
@@ -218,7 +218,7 @@ match (logical AND):
|
|
|
218
218
|
The dependency name is matched against the dotted leaf name in scope. When a
|
|
219
219
|
dependency is not found, the field stays enabled.
|
|
220
220
|
|
|
221
|
-
### `union` (tagged union)
|
|
221
|
+
### `union` (tagged union)
|
|
222
222
|
|
|
223
223
|
A `union` block declares overlapping branches, each an inline `struct` in
|
|
224
224
|
`items`. At runtime the branch whose `when` matches is the one shown / exported
|
|
@@ -234,16 +234,29 @@ and unmatched exports are zero-padded.
|
|
|
234
234
|
] }
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
237
|
+
#### Union inside a table-rendered struct array
|
|
238
|
+
|
|
239
|
+
A struct array containing a union renders as a **table** when all its rows use
|
|
240
|
+
the same union branch. The branch is **inferred from the pipeline data** —
|
|
241
|
+
nothing is pinned in the modules file (the legacy `branch` key is accepted but
|
|
242
|
+
silently ignored):
|
|
243
|
+
|
|
244
|
+
- **Uniform rows** → the inferred branch's members expand into columns. Two
|
|
245
|
+
applications can therefore share one `FilterCoeffs` and still each get a
|
|
246
|
+
table: one pipeline writes only `raw` rows, the other only `design` rows.
|
|
247
|
+
- **Mixed rows** (e.g. one `RAW` row next to `PEAKINGEQ` rows) → the array
|
|
248
|
+
falls back to the **tree** layout, where each row keeps its own branch.
|
|
249
|
+
- **No rows written** → the discriminator's schema `value` picks the branch.
|
|
250
|
+
- **Tail rows** (the pipeline wrote fewer rows than `count`) follow the first
|
|
251
|
+
written row: the discriminator continues its value (rule A) and the branch
|
|
252
|
+
members use their defaults.
|
|
253
|
+
|
|
254
|
+
The discriminator combos in the table are filtered down to the values that
|
|
255
|
+
satisfy the inferred branch's `when`, so a mixed-branch row can never be
|
|
256
|
+
created from the UI — there are no greyed-out cells and no zero-padded exports.
|
|
257
|
+
For the same reason, `widget: "table"` on a union-bearing struct array is only
|
|
258
|
+
an *intent*: the data still decides table vs. tree, and the column-count limit
|
|
259
|
+
does not apply when the intent succeeds.
|
|
247
260
|
|
|
248
261
|
### `count` expressions & multi-dimensional arrays
|
|
249
262
|
|
|
@@ -91,7 +91,7 @@ generated from it. Files live in the **modules directory** (`cfg_dir`), one
|
|
|
91
91
|
| --- | --- | --- |
|
|
92
92
|
| `struct` | `type`, `items` (list of field specs) | `items` is required |
|
|
93
93
|
| `enum` | `type`, `items` (object `{NAME: value}`) | reads back the enumerator name |
|
|
94
|
-
| `union` | `type`, `items` (list of branch structs)
|
|
94
|
+
| `union` | `type`, `items` (list of branch structs) | tagged union; each branch is an inline `struct` selected by its `when` (see below; a legacy `branch` key is accepted but ignored) |
|
|
95
95
|
| `typedefs` | object `{alias: real_type}` | resolved before field building |
|
|
96
96
|
|
|
97
97
|
Free-form metadata keys are allowed and ignored at any level: `version`,
|
|
@@ -132,7 +132,7 @@ When omitted, the widget is inferred from `type` (and from `min/max`,
|
|
|
132
132
|
| `dial` | int | Rotary dial popup (requires `min` & `max`). |
|
|
133
133
|
| `file` | array | Path label + Browse button; loads array values from a text file. |
|
|
134
134
|
| `multiline` | array | Single-line shell that pops up a multi-line editor. |
|
|
135
|
-
| `table` | struct array |
|
|
135
|
+
| `table` | struct array | Express grid-layout intent (one column per struct member; a union member expands the branch inferred from the pipeline rows into columns — see the union section below). |
|
|
136
136
|
|
|
137
137
|
Numeric fields without an explicit `widget` become a `QSpinBox` /
|
|
138
138
|
`QDoubleSpinBox`; scalar arrays become a comma-separated line edit.
|
|
@@ -165,7 +165,7 @@ match (logical AND):
|
|
|
165
165
|
The dependency name is matched against the dotted leaf name in scope. When a
|
|
166
166
|
dependency is not found, the field stays enabled.
|
|
167
167
|
|
|
168
|
-
### `union` (tagged union)
|
|
168
|
+
### `union` (tagged union)
|
|
169
169
|
|
|
170
170
|
A `union` block declares overlapping branches, each an inline `struct` in
|
|
171
171
|
`items`. At runtime the branch whose `when` matches is the one shown / exported
|
|
@@ -181,16 +181,29 @@ and unmatched exports are zero-padded.
|
|
|
181
181
|
] }
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
184
|
+
#### Union inside a table-rendered struct array
|
|
185
|
+
|
|
186
|
+
A struct array containing a union renders as a **table** when all its rows use
|
|
187
|
+
the same union branch. The branch is **inferred from the pipeline data** —
|
|
188
|
+
nothing is pinned in the modules file (the legacy `branch` key is accepted but
|
|
189
|
+
silently ignored):
|
|
190
|
+
|
|
191
|
+
- **Uniform rows** → the inferred branch's members expand into columns. Two
|
|
192
|
+
applications can therefore share one `FilterCoeffs` and still each get a
|
|
193
|
+
table: one pipeline writes only `raw` rows, the other only `design` rows.
|
|
194
|
+
- **Mixed rows** (e.g. one `RAW` row next to `PEAKINGEQ` rows) → the array
|
|
195
|
+
falls back to the **tree** layout, where each row keeps its own branch.
|
|
196
|
+
- **No rows written** → the discriminator's schema `value` picks the branch.
|
|
197
|
+
- **Tail rows** (the pipeline wrote fewer rows than `count`) follow the first
|
|
198
|
+
written row: the discriminator continues its value (rule A) and the branch
|
|
199
|
+
members use their defaults.
|
|
200
|
+
|
|
201
|
+
The discriminator combos in the table are filtered down to the values that
|
|
202
|
+
satisfy the inferred branch's `when`, so a mixed-branch row can never be
|
|
203
|
+
created from the UI — there are no greyed-out cells and no zero-padded exports.
|
|
204
|
+
For the same reason, `widget: "table"` on a union-bearing struct array is only
|
|
205
|
+
an *intent*: the data still decides table vs. tree, and the column-count limit
|
|
206
|
+
does not apply when the intent succeeds.
|
|
194
207
|
|
|
195
208
|
### `count` expressions & multi-dimensional arrays
|
|
196
209
|
|