ROOM » Utilities » C++ Classes » QucsImporter
QucsImporter Class
Reads a Qucs schematic (.sch) into an in-memory Database. More…
| Header: | #include "qucs_importer.h" |
|---|---|
| CMake: | target_link_libraries(mytarget PRIVATE ROOM::room_utils) |
Public Types
| struct Options | Library and cell naming for import. |
Public Functions
| QucsImporter() | Default constructor with default Options. |
| explicit QucsImporter(const Options & options) | Constructs with custom import settings. |
| Database importFile(const std::string & schPath) const | Parses a Qucs schematic and returns a database. |
| const std::vector<std::string> & warnings() const | Non-fatal messages from the last import. |
| const std::vector<std::string> & errors() const | Fatal error messages from the last import. |
Detailed Description
Creates one cell with ViewType::Schematic. Sets dbuPerEditorUnit = 1 and SourceInfo::format = qucs. Components become Instance objects; wires become Net and Term pairs. See the Qucs import example and coordinate scale.
Member Type Documentation
struct Options
| Member | Default | Description |
|---|---|---|
std::string libName | "qucs_import" | Name of the target Lib. |
std::string cellName | empty | Cell name; if empty, derived from the .sch file name. |
Member Function Documentation
QucsImporter()
Default constructor with Options defaults.
explicit QucsImporter(const Options & options)
Constructs an importer with custom library and cell naming.
| Parameter | Description |
|---|---|
options | Import settings (libName, optional cellName). |
Database importFile(const std::string & schPath) const
Parses a Qucs schematic text file and builds a ROOM database.
| Parameter | Description |
|---|---|
schPath | Path to the input .sch file. |
Returns: Populated Database, or empty on failure.
const std::vector<std::string> & warnings() const
Non-fatal messages from the last importFile() call.
const std::vector<std::string> & errors() const
Fatal errors from the last import (for example file not found).
Qucs → ROOM mapping
| Qucs section | ROOM |
|---|---|
<Components> | Instance in payload.schematic.block (C++: CellContent::block()) |
<Wires> | Net + Term (union of wire endpoints) |
<Properties> | CellContent properties (qucs.properties) |
| Header, Symbol, Diagrams, Paintings | Stored as qucs.* properties for round-trip export |
Private Variables
Private members are implementation details.
Options m_options | Import settings. |
mutable std::vector<std::string> m_warnings | Warnings from last importFile(). |
mutable std::vector<std::string> m_errors | Errors from last importFile(). |
See the Qucs import example.