François 7d307dad57 Export command (CSV + ODS), file dialog, error modal, path persistence.
New user-facing features:
- `export connections <file>` writes a tabular dump of every wire pair:
  connection, transform, left/right module/part/pin/signal/type/suspect,
  mixed-types flag. Dispatch on extension: `.csv` (flat file) or `.ods`
  (one sheet per connection). Any other extension shows an error and
  writes nothing.
- Bare `export` (or dashboard `[x]`, or palette `export`) opens an
  interactive file-picker dialog with a CSV/ODS toggle at the top.
  Picking a filter rewrites the filename's extension. Last-used
  directory and filename are remembered per-call-site.
- Two new CLI flags on the binary: `--source FILE` to run a script at
  boot, `--restore FILE` to restore a snapshot at boot. Combinable.

Reusable infrastructure:
- `OdsWriter` (`src/imports/ods_writer.{hpp,cpp}`): minimal .ods writer
  using libzip + pugixml (already in the build for the importer).
  Multi-sheet workbook of string cells. ~180 lines, no new dep.
- Generic file-picker dialog (`screen_filedialog.cpp`): one Modal
  reused for any "pick a path" interaction via
  `OpenFileDialog(title, persist_key, default_filename, filters, cb)`.
  Validates the picked extension against the filter whitelist;
  unknown ones stay in the dialog with a status message. Persists
  (dir, filename) per `persist_key`.
- Generic error modal (`screen_error.cpp`, `ShowError(msg)`): centred
  red-titled popup, dismissable with Esc/Enter. Used by the export
  failures (open-for-write, ODS save, unknown extension/kind);
  ready for adoption elsewhere.
- Per-key path persistence (`SaveLastUsed`/`LoadLastUsed` in
  `shell.cpp`): two-line file per key under the user-data dir.
- `UserDataDir()` extracted from the history path helper so the new
  per-key persistence shares the same XDG/AppData logic.
- New help-screen topic "Export"; user-facing `doc/user/analysis.md`
  gains an "Exporting" section; `DESIGN.md` gains a generics
  section covering the dialog / error modal / persistence / ODS
  writer; `DumpCommandsMd` now respects the `hidden` flag (the
  `connect` alias no longer appears in the auto-gen reference).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 12:03:39 +02:00
2025-03-21 18:47:49 +01:00
2025-03-21 18:51:19 +01:00
2026-05-08 20:38:30 +02:00

essim — system digital twin

Interactive simulator for the inter-card connections inside a system. Built around a domain model of modules → parts → pins / signals → connections, with importers for Mentor Graphics, Altium and ODS pinout sheets, a TUI shell with scripting, snapshots and BFS net analysis.

Status: early work-in-progress.

Quick start

cmake -S . -B build
cmake --build build -j
./build/essim

Requirements:

  • A C++17 compiler.
  • CMake 3.14+.
  • System packages: libzip and pugixml (Arch: pacman -S libzip pugixml).
  • FTXUI (v6.1.9) and doctest (v2.4.11) are fetched at configure time via FetchContent.

Inside the shell, type help for the live command list — or read the auto-generated reference at doc/user/commands.md. A worked bring-up script is at test/system.essim; load it with source test/system.essim.

Tests

./build/essim_tests
# or
ctest --test-dir build

Skip building tests entirely:

cmake -S . -B build -DBUILD_TESTING=OFF

Documentation

  • doc/user/ — user guide, command reference, scripting.
  • doc/api/ — auto-generated C++ API reference.
  • DESIGN.md — implementation notes (domain conventions, TUI internals, gotchas).
  • doc/README.md — how the doc pipeline is wired.

Regenerate auto-generated parts after substantive code changes:

cmake --build build --target doc      # needs doxygen + python3

Project layout

src/system/   domain model (Module/Part/Pin/Signal, Connection, Transform, …)
src/imports/  Mentor / Altium / ODS netlist importers
src/tui/      FTXUI shell (commands, screens, completion, history)
tests/        doctest suite
doc/          api/ + user/ Markdown trees, Doxyfile.in, gen_api_md.py
test/         sample netlists + system.essim bring-up script

Full layout & rationale in DESIGN.md.

Licence

Copyright (c) 2026 François Dausseur

Licensed under the European Union Public Licence (EUPL), Version 1.2 — the "Licence". You may not use this work except in compliance with the Licence. You may obtain a copy of the Licence in the LICENSE file or at https://joinup.ec.europa.eu/software/page/eupl.

Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licence for the specific language governing permissions and limitations under the Licence.

SPDX-License-Identifier: EUPL-1.2

Description
Embedded System Simulation
Readme EUPL-1.2 3.8 MiB
Languages
C++ 98.2%
CMake 1.8%