ROOM » Utilities » C++ Classes » QucsExporter

QucsExporter Class

Writes a schematic CellContent from a Database back to Qucs .sch text. More…

Header:#include "qucs_exporter.h"
CMake:target_link_libraries(mytarget PRIVATE ROOM::room_utils)

Public Types

struct OptionsPrimitive paths, tech library, Qucs version header.

Free Functions

bool isQucsSchematicDecoration(const std::string & cellName)true for Xschem-only decorations skipped in Qucs (lab_wire, code_shown, launcher).

Public Functions

QucsExporter()Default constructor.
explicit QucsExporter(const Options & options)Constructs with custom export settings.
void exportCell(…)Writes one cell's schematic view to a Qucs file or stream.
std::string exportCellToString(…)In-memory export of schematic view.
void exportSymbolCell(…)Export symbol view to Qucs .sch symbol section.
std::string exportInstanceAsLine(…)Single <Components> line for one Instance.
std::vector<std::string> exportBlockWiresAsLines(…)<Wires> lines from block topology.
const std::vector<std::string> & warnings() constWarnings from the last export.
const std::vector<std::string> & errors() constErrors from the last export.

Detailed Description

Uses stored qucs.wire lines when present for lossless round-trip. Otherwise reconstructs wires from Net terminals with pin retargeting when primitive symbols are attached. Coordinates are converted with dbuPerEditorUnit via coord_scale.

Export policy: map attached passives to native Qucs devices (res → R, capa → C, iopin → Port). Emit <Lib> only for PDK/hierarchy cells and visual title blocks (title*). Skip Xschem decorations via isQucsSchematicDecoration().

Member Type Documentation

struct Options

MemberDefaultDescription
std::string qucsVersion"0.0.19"Version string in the <Qucs Schematic …> header.
std::vector<std::string> primitiveCorePathsemptyAttached *.symbol.room paths (or set via environment).
std::string techLibraryemptyTech/design library prefix for <Lib> export.
std::string qucsPrimitiveLibemptyQucs library name in <Lib> lines (e.g. PDK bundle name).

bool isQucsSchematicDecoration(const std::string & cellName)

Returns true for cells that should not appear in a Qucs schematic: lab_wire, code_shown, launcher. Title blocks (title*) are exported as <Lib> for display only.

Member Function Documentation

QucsExporter()

Default constructor.

explicit QucsExporter(const Options & options)

Constructs an exporter with a custom Qucs version header.

ParameterDescription
optionsExport settings.

void exportCell(const Database & db, const std::string & cellName, const std::string & schPath) const

Writes one cell's schematic view to a Qucs file. Overloads accept std::ostream & or return exportCellToString().

std::string exportCellToString(const Database & db, const std::string & cellName) const

In-memory schematic export (used by Qucs-S ROOM bridge).

void exportSymbolCell(…)

Export ViewType::Symbol content to Qucs symbol section format.

std::string exportInstanceAsLine(const Instance & inst, double dbuPerEditorUnit, const std::string & sourceFormat) const

Low-level single-component line for incremental ROOM → Qucs mapping.

std::vector<std::string> exportBlockWiresAsLines(…)

Emit wire lines from Block nets, applying pin retarget when primitives are configured.

const std::vector<std::string> & warnings() const

Warnings from the last export.

const std::vector<std::string> & errors() const

Errors (missing cell, no schematic view, I/O failure).

Private Variables

Private members are implementation details.

Options m_optionsExport settings.
mutable std::vector<std::string> m_warningsWarnings from last exportCell().
mutable std::vector<std::string> m_errorsErrors from last exportCell().

See the Qucs import example for a full round-trip workflow.