#ifndef _APP_LOAD_HPP_ #define _APP_LOAD_HPP_ #include "core/domain/system.hpp" // ImportType #include // Application layer: UI-independent operations that any frontend (TUI, GUI, …) // can call. No console, no dialogs, no FTXUI — just System in, result out. namespace app { // Map an import-type name (mentor / altium / ods, case-insensitive) to an // ImportType. Returns false if the name is none of those. bool import_type_from_name(const std::string &name, ImportType &out); // Outcome of loading a module: the post-import counts the caller renders. struct LoadResult { bool ok = false; std::string error; ///< human-readable, set when !ok int parts = 0; int signals = 0; int dropped = 0; ///< singleton/NC signals removed after import int power = 0; ///< signals inferred Power (name + structure) int gnd = 0; ///< signals inferred GndShield (name) int kept_other = 0; ///< name said Power but evidence too weak → kept Other }; // Import a module from a netlist/pinout file into `sys`, drop singleton signals, // then infer signal types. Returns the counts or an error. Pure core — safe to // call from any frontend. LoadResult load_module(System *sys, const std::string &module_name, const std::string &path, ImportType type); } // namespace app #endif // _APP_LOAD_HPP_