wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ICLoader Class Reference

Loads an IC's sub-circuit (from file or embedded blob), migrates old-format files, and builds the resulting boundary port lists. More...

#include <ICLoader.h>

Static Public Member Functions

static IC::PortMetadata buildPortMetadata (const QVector< GraphicElement * > &elements)
 Scans elements for Input/Output groups, sorts by Y/X position, and builds labels.
static void loadFile (IC &ic, const QString &fileName, const QString &contextDir={})
 Loads ic's circuit from fileName and rebuilds the logic mapping.
static void loadFromBlob (IC &ic, const QByteArray &blob, const QString &contextDir)
 Loads ic from in-memory blob bytes (full .panda file format).

Detailed Description

Loads an IC's sub-circuit (from file or embedded blob), migrates old-format files, and builds the resulting boundary port lists.

Extracted from IC so file/blob loading is a collaborator rather than a cluster of methods on the element itself, mirroring the GraphicElement / GraphicElementSerializer split. A friend of IC, it reaches the element's internal-element/port vectors directly. All methods are static and take the IC explicitly; IC keeps all state (it's already heavily friended by tests), so this is a pure logic extraction, not a new owner-back-pointer collaborator.

Definition at line 36 of file ICLoader.h.

Member Function Documentation

◆ buildPortMetadata()

IC::PortMetadata ICLoader::buildPortMetadata ( const QVector< GraphicElement * > & elements)
static

Scans elements for Input/Output groups, sorts by Y/X position, and builds labels.

Definition at line 468 of file ICLoader.cpp.

References GraphicElement::elementGroup(), IC::PortMetadata::inputCount, IC::PortMetadata::inputLabels, GraphicElement::inputs(), IC::PortMetadata::outputCount, IC::PortMetadata::outputLabels, and GraphicElement::outputs().

Referenced by IC::buildPortMetadata().

◆ loadFile()

void ICLoader::loadFile ( IC & ic,
const QString & fileName,
const QString & contextDir = {} )
static

Loads ic's circuit from fileName and rebuilds the logic mapping.

Definition at line 88 of file ICLoader.cpp.

References GraphicElement::label(), PANDACEPTION, qCDebug, ExternalFilePath::resolve(), and GraphicElement::setLabel().

Referenced by IC::loadFile().

◆ loadFromBlob()

void ICLoader::loadFromBlob ( IC & ic,
const QByteArray & blob,
const QString & contextDir )
static

Loads ic from in-memory blob bytes (full .panda file format).

Definition at line 348 of file ICLoader.cpp.

References qCDebug.

Referenced by IC::loadFromBlob().


The documentation for this class was generated from the following files: