TUI shell + ftxui via FetchContent.

- ftxui v6.1.9 fetched at configure time; vendored .a + headers dropped.
- TUI: visualisation area on top, input prompt at the bottom; ↑/↓ history,
  Tab completion (commands + file paths), Esc cancels prompts. History is
  persisted (XDG on Linux, %LOCALAPPDATA% on Windows when ported).
- Command registry: `new`, `load`, `search`, `clear`, `help`, `quit`/`exit`.
  Inline params or interactive prompts; either way the canonical inline
  form is what gets stored in history.
- `search`: second full-screen mode with module + parts/signals menus and
  a live-filtered list; Tab cycles focus, Esc returns to the main shell.
- Domain: `System::modules()` accessor + `SystemElementContainer::size()`
  to support load summary + search.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-08 10:17:03 +02:00
parent 8b1de63849
commit 3395469810
40 changed files with 673 additions and 2674 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -9,20 +9,29 @@ project(essim
DESCRIPTION "System digital twin."
)
set(DIR_LIBS ${CMAKE_SOURCE_DIR}/libs)
include(FetchContent)
set(FTXUI_BUILD_DOCS OFF CACHE INTERNAL "")
set(FTXUI_BUILD_EXAMPLES OFF CACHE INTERNAL "")
set(FTXUI_BUILD_TESTS OFF CACHE INTERNAL "")
set(FTXUI_ENABLE_INSTALL OFF CACHE INTERNAL "")
FetchContent_Declare(ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/FTXUI.git
GIT_TAG v6.1.9
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(ftxui)
file(GLOB_RECURSE ALL_SOURCES "src/*.cpp")
file(GLOB_RECURSE LIB_FTXUI "lib/ftxui/*.a")
add_executable(essim ${ALL_SOURCES})
target_include_directories(essim PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
add_executable(
essim
${ALL_SOURCES}
target_link_libraries(essim
PRIVATE
ftxui::screen
ftxui::dom
ftxui::component
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(
essim PRIVATE ${LIB_FTXUI}
)