LibrePCB Developers Documentation
KiCadLibraryConverter Class Referencefinal

Converts KiCad library elements to LibrePCB. More...

#include <kicadlibraryconverter.h>

Inherits QObject.

+ Collaboration diagram for KiCadLibraryConverter:

Public Member Functions

 KiCadLibraryConverter (const KiCadLibraryConverter &other)=delete
 
 KiCadLibraryConverter (WorkspaceLibraryDb &db, const KiCadLibraryConverterSettings &settings, QObject *parent=nullptr) noexcept
 
 ~KiCadLibraryConverter () noexcept
 
void reset () noexcept
 
std::unique_ptr< PackagecreatePackage (const FilePath &libFp, const KiCadFootprint &kiFpt, const QString &generatedBy, const QMap< QString, FilePath > &models, MessageLogger &log)
 
std::unique_ptr< SymbolcreateSymbol (const FilePath &libFp, const KiCadSymbol &kiSym, const KiCadSymbolGate &kiGate, const QString &generatedBy, MessageLogger &log)
 
std::unique_ptr< ComponentcreateComponent (const FilePath &libFp, const KiCadSymbol &kiSym, const QList< KiCadSymbolGate > &kiGates, const QString &generatedBy, const QStringList &symGeneratedBy, MessageLogger &log)
 
std::unique_ptr< DevicecreateDevice (const FilePath &libFp, const KiCadSymbol &kiSym, const QList< KiCadSymbolGate > &kiGates, const QString &generatedBy, const QString &cmpGeneratedBy, const QString &pkgGeneratedBy, MessageLogger &log)
 
KiCadLibraryConverteroperator= (const KiCadLibraryConverter &rhs)=delete
 

Private Member Functions

void loadAlreadyImportedSymbol (const QString &generatedBy)
 
void loadAlreadyImportedPackage (const QString &generatedBy)
 
void loadAlreadyImportedComponent (const QString &generatedBy)
 
template<typename T >
FilePath getAlreadyImportedFp (const QString &generatedBy) const
 
void tryOrLogError (std::function< void()> func, MessageLogger &log)
 

Private Attributes

WorkspaceLibraryDbmLibraryDb
 
KiCadLibraryConverterSettings mSettings
 
QHash< QString, tl::optional< Uuid > > mPackageMap
 
QHash< QString, QMap< QString, tl::optional< Uuid > > > mPackagePadMap
 
QHash< QString, tl::optional< Uuid > > mSymbolMap
 
QHash< std::pair< QString, QString >, tl::optional< Uuid > > mSymbolPinMap
 
QHash< QString, tl::optional< Uuid > > mComponentMap
 
QHash< std::pair< QString, QString >, tl::optional< Uuid > > mComponentSignalMap
 

Detailed Description

Converts KiCad library elements to LibrePCB.

Constructor & Destructor Documentation

◆ KiCadLibraryConverter() [1/2]

KiCadLibraryConverter ( const KiCadLibraryConverter other)
delete

◆ KiCadLibraryConverter() [2/2]

KiCadLibraryConverter ( WorkspaceLibraryDb db,
const KiCadLibraryConverterSettings settings,
QObject *  parent = nullptr 
)
explicitnoexcept

◆ ~KiCadLibraryConverter()

~KiCadLibraryConverter ( )
noexcept

Member Function Documentation

◆ reset()

void reset ( )
noexcept

◆ createPackage()

std::unique_ptr< Package > createPackage ( const FilePath libFp,
const KiCadFootprint kiFpt,
const QString &  generatedBy,
const QMap< QString, FilePath > &  models,
MessageLogger log 
)
+ Here is the call graph for this function:

◆ createSymbol()

std::unique_ptr< Symbol > createSymbol ( const FilePath libFp,
const KiCadSymbol kiSym,
const KiCadSymbolGate kiGate,
const QString &  generatedBy,
MessageLogger log 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createComponent()

std::unique_ptr< Component > createComponent ( const FilePath libFp,
const KiCadSymbol kiSym,
const QList< KiCadSymbolGate > &  kiGates,
const QString &  generatedBy,
const QStringList &  symGeneratedBy,
MessageLogger log 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createDevice()

std::unique_ptr< Device > createDevice ( const FilePath libFp,
const KiCadSymbol kiSym,
const QList< KiCadSymbolGate > &  kiGates,
const QString &  generatedBy,
const QString &  cmpGeneratedBy,
const QString &  pkgGeneratedBy,
MessageLogger log 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

KiCadLibraryConverter & operator= ( const KiCadLibraryConverter rhs)
delete

◆ loadAlreadyImportedSymbol()

void loadAlreadyImportedSymbol ( const QString &  generatedBy)
private
+ Here is the call graph for this function:

◆ loadAlreadyImportedPackage()

void loadAlreadyImportedPackage ( const QString &  generatedBy)
private
+ Here is the call graph for this function:

◆ loadAlreadyImportedComponent()

void loadAlreadyImportedComponent ( const QString &  generatedBy)
private
+ Here is the call graph for this function:

◆ getAlreadyImportedFp()

FilePath getAlreadyImportedFp ( const QString &  generatedBy) const
private
+ Here is the call graph for this function:

◆ tryOrLogError()

void tryOrLogError ( std::function< void()>  func,
MessageLogger log 
)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mLibraryDb

WorkspaceLibraryDb& mLibraryDb
private

◆ mSettings

KiCadLibraryConverterSettings mSettings
private

◆ mPackageMap

QHash<QString, tl::optional<Uuid> > mPackageMap
private

Key: generatedBy Value: LibrePCB Package UUID

◆ mPackagePadMap

QHash<QString, QMap<QString, tl::optional<Uuid> > > mPackagePadMap
private

Key: generatedBy | Pad Number (after conversion) Value: LibrePCB Package Pad UUID

◆ mSymbolMap

QHash<QString, tl::optional<Uuid> > mSymbolMap
private

Key: generatedBy Value: LibrePCB Symbol UUID

◆ mSymbolPinMap

QHash<std::pair<QString, QString>, tl::optional<Uuid> > mSymbolPinMap
private

Key: [Symbol generatedBy, Pin Name (after conversion)] Value: LibrePCB Symbol Pin UUID

◆ mComponentMap

QHash<QString, tl::optional<Uuid> > mComponentMap
private

Key: generatedBy Value: LibrePCB Component UUID

◆ mComponentSignalMap

QHash<std::pair<QString, QString>, tl::optional<Uuid> > mComponentSignalMap
private

Key: [Component generatedBy, Signal Name (after conversion)] Value: LibrePCB Component Signal UUID


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