Commit Graph

28 Commits

Author SHA1 Message Date
Brian S. Stephan 2adb1540a1
include .json in the TUI Save As... prompt
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-15 23:22:18 -05:00
Brian S. Stephan 2a40c70b56
cover a bit more TUI in tests, and remove dead branches
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 20:01:20 -05:00
Brian S. Stephan 3a55cad86f
implement Save As... in the TUI
this allows for loading an existing GP2040-CE dump or board in BOOTSEL
over USB and saving the parsed configuration to a new .bin/.uf2 file.
might be useful for making quick backups or variants of configs

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-26 13:47:30 -05:00
Brian S. Stephan f6d3ad02e0
support writing new configs as .uf2 files via the TUI
`edit-config --filename foo.uf2` can now create standalone config UF2
files. still working on reading UF2s, or maybe what edit-config needs is
a "Save As..." in order to read from a board/config and output it to a
new file, but this is a start

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-25 12:01:52 -05:00
Brian S. Stephan 610e1a2801
show a quick bit of copyright/license info
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-12 13:33:37 -05:00
Brian S. Stephan c1ab61c61e
improve the positioning of the edit dialog buttons
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-12 12:45:58 -05:00
Brian S. Stephan 1d887c9fdf
add MessageScreen back and tweak/enhance screen layouts
this will be used for a help screen, which isn't done yet, but this
makes the edit screen incrementally better too

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-11 12:59:58 -05:00
Brian S. Stephan 5fc2339c74
isort gp2040ce_bintools/gui.py
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-10 23:43:12 -05:00
Brian S. Stephan b900e1dd04
relicense as GPLv3
prior MIT-licensed versions can be obtained from the Git history; this
does not revoke those versions

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-08 00:02:43 -06:00
Brian S. Stephan 069aa27927
style the GUI tree widget a bit
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-02-18 00:05:16 -06:00
Brian S. Stephan 22de9ae6d6
use Textual's notify instead of a custom popup window
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-02-17 23:38:41 -06:00
Brian S. Stephan df875a5d99
rename GUI Save button as Confirm
more idiomatic this way, since it's really just "set the value", not
actually saving the config

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-02-17 23:05:51 -06:00
Brian S. Stephan 03a8235445
include the package version number in the edit-config title
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-02-17 23:05:36 -06:00
Brian S. Stephan 05228b9f62
s/STORAGE_/USER_CONFIG_/
more address define renames to make an upcoming feature clearer

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-03 18:27:16 -06:00
Brian S. Stephan 416157663d
STORAGE_BOOTSEL_ADDRESS is a better name than _MEMORY_
this is also just a different addressing mode with the same binary
offset from the start, so derive it from the binary location
2024-01-03 12:24:05 -06:00
Brian S. Stephan 23cb5c9e5a
add SPDX-FileCopyrightText
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-02 15:15:55 -06:00
Brian S. Stephan b2bf7984b0
add SPDX-License-Identifier: MIT to all source
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2023-12-18 10:17:35 -06:00
Brian S. Stephan fc022452f5
replace most references to pico with RP2040 2023-11-07 00:26:51 -06:00
Brian S. Stephan d2ef3efa3b
trivial reordering of command line flags 2023-07-12 18:32:05 -05:00
Brian S. Stephan 8c5bd4397f
allow edit-config to fallback to new config if old doesn't exist 2023-07-12 00:08:55 -05:00
Brian S. Stephan 2f5a99b695
use proper field descriptor when checking missing children 2023-07-10 16:00:26 -05:00
Brian S. Stephan 853283e69c
edit-config over USB 2023-07-09 10:47:27 -05:00
Brian S. Stephan e2ad75371e
DRY: convenience method to get config from USB 2023-07-07 20:03:41 -05:00
Brian S. Stephan 0378269a00
--usb flag to edit-config direct off the board 2023-07-07 18:58:25 -05:00
Brian S. Stephan 221f45557e
support the adding of new repeated elements
take for instance:
repeated AlternativePinMappings alternativePinMappings = 1 [(nanopb).max_count = 3];

this, in C, creates a three-struct-sized array alternativePinMappings[].
in python, this is the same idea, where profileOptions' field is a
special container to which AlternativePinMappings can be added. this
allows adding elements via the UI. it does *NOT* implement limits (yet?)
so you can add more (and I think the board will just ignore them and
drop them on write)
2023-07-01 17:05:19 -05:00
Brian S. Stephan c60a5e784d
refactor to retain field_value in case it is a message
we can save some config lookups in this case (in particular in the case
where we are working with repeateds and the lookup against an iterable
won't work)
2023-07-01 13:00:48 -05:00
Brian S. Stephan 71f6af624e
refactor to add a node outside of the main tree builder 2023-07-01 12:24:31 -05:00
Brian S. Stephan 7d5052e811
add edit-config, a Textual TUI for editing a configuration
this tree UI allows for viewing and basic editing of a configuration
section from a board. it does a decent job of displaying most of the
settings, and editing is equally convenient, as in it tries to handle
enums correctly, but doesn't validate pins or handle long binary strings
well.

saving is done in place --- if a config/storage section was opened, a
config section (no padding) is what results. if a whole board was
opened, the whole binary is rewritten with the new offset config
section. this way, a whole board dump can be changed in place, or a new
config can be made for use in e.g. concatenate to build an image

many enhancements to come over time
2023-06-30 02:01:01 -05:00