Files
essim/src/system/parts.hpp
François f3920964f0 ODS import, persistence, scripting, connector types + VPX transforms.
- ODS importer (libzip + pugixml): each sheet → Part, rows → Pin/Signal.
- save / restore commands: tab-delimited snapshot of modules, parts,
  signals, connections + pin_map. `restore` replaces the System.
- source / script-save: replay a file of commands; record canonical
  commands since last `new` for replay later. Interactive screens
  refused during source. `explore` marked non-scriptable.
- TUI screen_explore: 4 columns (modules, type, children, detail) with
  filters on children and detail; detail is a Menu so arrows scroll
  long pin lists.
- Connector types & transforms: each Part carries a `connector_type`
  string. `set-type` validates the part's pin layout against the type
  (cols set check). `connect` strict pair: rejects when lookup falls
  back to identity unless types are both empty AND pin sets match.
- VPX 3U transforms: 3 registered pairs (vpx-3u-bkp-pN ↔ vpx-3u-payload-pN,
  N=0/1/2) with row-pattern correspondence tables ported from the user's
  Python reference.
- Code split for maintainability: src/tui/{shell,completion,commands,
  screen_main,screen_search,screen_connect,screen_settype,screen_explore,
  tui_helpers}.cpp.
- Bug fixes: Module::add(Part*) override sets part->prnt (was always
  null, breaking save's W lines). Defensive guards in explore against
  empty Menu lists. Renderer wrapped in try/catch so domain throws
  surface as on-screen errors instead of SIGABRT.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 19:58:51 +02:00

27 lines
579 B
C++

#ifndef _PARTS_HPP_
#define _PARTS_HPP_
#include "syselmts.hpp"
#include "pins.hpp"
#pragma once
class Module; ///< Forward declaration of the Module class.
class Part : public SystemElementContainer<Pin>
{
public:
Part(std::string name);
~Part();
Module *prnt; ///< Pointer to the parent module.
std::string connector_type; ///< Tag used by the transform registry; empty = untyped.
void add(Pin *pin) override;
};
class Parts : public SystemElementContainer<Part>
{
public:
Parts(void);
Parts(std::vector<Part *> parts);
};
#endif // _PARTS_HPP_