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 OptionsLibrary 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) constParses a Qucs schematic and returns a database.
const std::vector<std::string> & warnings() constNon-fatal messages from the last import.
const std::vector<std::string> & errors() constFatal 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

MemberDefaultDescription
std::string libName"qucs_import"Name of the target Lib.
std::string cellNameemptyCell 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.

ParameterDescription
optionsImport settings (libName, optional cellName).

Database importFile(const std::string & schPath) const

Parses a Qucs schematic text file and builds a ROOM database.

ParameterDescription
schPathPath 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 sectionROOM
<Components>Instance in payload.schematic.block (C++: CellContent::block())
<Wires>Net + Term (union of wire endpoints)
<Properties>CellContent properties (qucs.properties)
Header, Symbol, Diagrams, PaintingsStored as qucs.* properties for round-trip export

Private Variables

Private members are implementation details.

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

See the Qucs import example.