020b(gui): output-file Browse + scenario Save/Load buttons #33
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/020b-gui-file-buttons"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements backlog step 020b (
docs/backlog/020b-gui-file-buttons.md). Depends on 020a (merged in #32) — 020c (Generate-scenario) is unblocked by this.What was missing
The GUI had no way to persist or restore a scenario: closing the window discarded everything, and sidecar
*.scenario.jsonfiles written by the CLI could not be reopened from the GUI (reported and confirmed by inspection — the only buttons were Set/Remove offset and Generate).Changes
src/gengnss/gui/app.py(Settings tab):asksaveasfilename, default extension follows the fmt combobox (.i8/.i16); writesoutput_paththrough the same_on_settingpath as the entryscenario_from_model(model).to_json()to a.scenario.jsonsidecar; refuses an invalid model (validate_settings, e.g. NaN spans) with a status-line message, no file writtento_json()dict and the full sidecar artifact written bygenerate_to_file({"scenario": ...}wrapper) via the newscenario_from_sidecarhelper; corrupt/wrong-shape JSON surfaces an error on the status line and leaves the model untouchedsat_spec_for_system(checkbox checked first, then the spec var set, so the existing_on_sat_spectrace registers them)resolved_seedis carried along for bookkeeping;output_pathis deliberately not loaded (a sidecar travels with its IQ file) — the status line saysoutput path unchangedsrc/gengnss/gui/controllers.py:scenario_to_model(scenario, model)(inverse ofscenario_from_model) andscenario_from_sidecar(data)(both JSON shapes).Tests
tests/test_gui_load_save.py(headless, 5 tests): save→load round trip incl. GLONASS:chan+ power offset; loading agenerate_to_filesidecar in both shapes; corrupt-JSON rejection leaves the model unchanged;resolved_seedcarried /output_pathuntouched;sat_spec_for_systemspecs re-parse to identical selections for all four systemstests/test_gui_app.py: gui-marked smoke — buttons exist, lock behavior, Browse/Save/Load end-to-end with monkeypatched dialogs (checkbox + spec entry restored)ruffclean;pytest: 197 passed, 1 skipped (gui-marked tests skip headless; run in CI with a display)Note: CI legs 3.12/3.14 have been failing since run 119 on docs-only commits (known unreliable runner workspace per the CI header note); the 3.9 leg is green and local runs (Python 3.14.4) are green.