LibrePCB Developers Documentation
Circuit Class Referencefinal

The Circuit class represents all electrical connections in a project (drawn in the schematics) More...

#include <circuit.h>

Inherits QObject.

+ Collaboration diagram for Circuit:

Signals

void assemblyVariantAdded (std::shared_ptr< AssemblyVariant > &av)
 
void assemblyVariantRemoved (std::shared_ptr< AssemblyVariant > &av)
 
void netClassAdded (NetClass &netclass)
 
void netClassRemoved (NetClass &netclass)
 
void netSignalAdded (NetSignal &netsignal)
 
void netSignalRemoved (NetSignal &netsignal)
 
void componentAdded (ComponentInstance &cmp)
 
void componentRemoved (ComponentInstance &cmp)
 

Public Member Functions

 Circuit ()=delete
 
 Circuit (const Circuit &other)=delete
 
 Circuit (Project &project)
 
 ~Circuit () noexcept
 
ProjectgetProject () const noexcept
 
AssemblyVariantListgetAssemblyVariants () noexcept
 
const AssemblyVariantListgetAssemblyVariants () const noexcept
 
int addAssemblyVariant (std::shared_ptr< AssemblyVariant > av, int index=-1)
 
void removeAssemblyVariant (std::shared_ptr< AssemblyVariant > av)
 
void setAssemblyVariantName (std::shared_ptr< AssemblyVariant > av, const FileProofName &newName)
 
const QMap< Uuid, NetClass * > & getNetClasses () const noexcept
 
NetClassgetNetClassByName (const ElementName &name) const noexcept
 
void addNetClass (NetClass &netclass)
 
void removeNetClass (NetClass &netclass)
 
void setNetClassName (NetClass &netclass, const ElementName &newName)
 
QString generateAutoNetSignalName () const noexcept
 
const QMap< Uuid, NetSignal * > & getNetSignals () const noexcept
 
NetSignalgetNetSignalByName (const QString &name) const noexcept
 
NetSignalgetNetSignalWithMostElements () const noexcept
 
void addNetSignal (NetSignal &netsignal)
 
void removeNetSignal (NetSignal &netsignal)
 
void setNetSignalName (NetSignal &netsignal, const CircuitIdentifier &newName, bool isAutoName)
 
QString generateAutoComponentInstanceName (const ComponentPrefix &cmpPrefix) const noexcept
 
const QMap< Uuid, ComponentInstance * > & getComponentInstances () const noexcept
 
ComponentInstancegetComponentInstanceByUuid (const Uuid &uuid) const noexcept
 
ComponentInstancegetComponentInstanceByName (const QString &name) const noexcept
 
void addComponentInstance (ComponentInstance &cmp)
 
void removeComponentInstance (ComponentInstance &cmp)
 
void setComponentInstanceName (ComponentInstance &cmp, const CircuitIdentifier &newName)
 
void serialize (SExpression &root) const
 Serialize into librepcb::SExpression node. More...
 
Circuitoperator= (const Circuit &rhs)=delete
 
bool operator== (const Circuit &rhs) noexcept
 
bool operator!= (const Circuit &rhs) noexcept
 

Private Attributes

ProjectmProject
 A reference to the Project object (from the ctor) More...
 
AssemblyVariantList mAssemblyVariants
 
QMap< Uuid, NetClass * > mNetClasses
 
QMap< Uuid, NetSignal * > mNetSignals
 
QMap< Uuid, ComponentInstance * > mComponentInstances
 

Detailed Description

The Circuit class represents all electrical connections in a project (drawn in the schematics)

Each librepcb::Project object contains exactly one librepcb::Circuit object which contains the whole electrical components and connections. They are created with the schematic editor and used by the board editor. The whole circuit is saved in the file "circuit.lp" in the project's "circuit" directory.

Each Circuit object contains:

Constructor & Destructor Documentation

◆ Circuit() [1/3]

Circuit ( )
delete

◆ Circuit() [2/3]

Circuit ( const Circuit other)
delete

◆ Circuit() [3/3]

Circuit ( Project project)
explicit

◆ ~Circuit()

~Circuit ( )
noexcept
+ Here is the call graph for this function:

Member Function Documentation

◆ getProject()

Project & getProject ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getAssemblyVariants() [1/2]

AssemblyVariantList & getAssemblyVariants ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getAssemblyVariants() [2/2]

const AssemblyVariantList & getAssemblyVariants ( ) const
inlinenoexcept

◆ addAssemblyVariant()

int addAssemblyVariant ( std::shared_ptr< AssemblyVariant av,
int  index = -1 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeAssemblyVariant()

void removeAssemblyVariant ( std::shared_ptr< AssemblyVariant av)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAssemblyVariantName()

void setAssemblyVariantName ( std::shared_ptr< AssemblyVariant av,
const FileProofName newName 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNetClasses()

const QMap< Uuid, NetClass * > & getNetClasses ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getNetClassByName()

NetClass * getNetClassByName ( const ElementName name) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addNetClass()

void addNetClass ( NetClass netclass)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeNetClass()

void removeNetClass ( NetClass netclass)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNetClassName()

void setNetClassName ( NetClass netclass,
const ElementName newName 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateAutoNetSignalName()

QString generateAutoNetSignalName ( ) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNetSignals()

const QMap< Uuid, NetSignal * > & getNetSignals ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getNetSignalByName()

NetSignal * getNetSignalByName ( const QString &  name) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNetSignalWithMostElements()

NetSignal * getNetSignalWithMostElements ( ) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addNetSignal()

void addNetSignal ( NetSignal netsignal)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeNetSignal()

void removeNetSignal ( NetSignal netsignal)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNetSignalName()

void setNetSignalName ( NetSignal netsignal,
const CircuitIdentifier newName,
bool  isAutoName 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateAutoComponentInstanceName()

QString generateAutoComponentInstanceName ( const ComponentPrefix cmpPrefix) const
noexcept
+ Here is the caller graph for this function:

◆ getComponentInstances()

const QMap< Uuid, ComponentInstance * > & getComponentInstances ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getComponentInstanceByUuid()

ComponentInstance * getComponentInstanceByUuid ( const Uuid uuid) const
noexcept
+ Here is the caller graph for this function:

◆ getComponentInstanceByName()

ComponentInstance * getComponentInstanceByName ( const QString &  name) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addComponentInstance()

void addComponentInstance ( ComponentInstance cmp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeComponentInstance()

void removeComponentInstance ( ComponentInstance cmp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setComponentInstanceName()

void setComponentInstanceName ( ComponentInstance cmp,
const CircuitIdentifier newName 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

void serialize ( SExpression root) const

Serialize into librepcb::SExpression node.

Parameters
rootRoot node to serialize into.
+ Here is the call graph for this function:

◆ operator=()

Circuit & operator= ( const Circuit rhs)
delete

◆ operator==()

bool operator== ( const Circuit rhs)
inlinenoexcept

◆ operator!=()

bool operator!= ( const Circuit rhs)
inlinenoexcept

◆ assemblyVariantAdded

void assemblyVariantAdded ( std::shared_ptr< AssemblyVariant > &  av)
signal
+ Here is the caller graph for this function:

◆ assemblyVariantRemoved

void assemblyVariantRemoved ( std::shared_ptr< AssemblyVariant > &  av)
signal
+ Here is the caller graph for this function:

◆ netClassAdded

void netClassAdded ( NetClass netclass)
signal
+ Here is the caller graph for this function:

◆ netClassRemoved

void netClassRemoved ( NetClass netclass)
signal
+ Here is the caller graph for this function:

◆ netSignalAdded

void netSignalAdded ( NetSignal netsignal)
signal
+ Here is the caller graph for this function:

◆ netSignalRemoved

void netSignalRemoved ( NetSignal netsignal)
signal
+ Here is the caller graph for this function:

◆ componentAdded

void componentAdded ( ComponentInstance cmp)
signal
+ Here is the caller graph for this function:

◆ componentRemoved

void componentRemoved ( ComponentInstance cmp)
signal
+ Here is the caller graph for this function:

Member Data Documentation

◆ mProject

Project& mProject
private

A reference to the Project object (from the ctor)

◆ mAssemblyVariants

AssemblyVariantList mAssemblyVariants
private

◆ mNetClasses

QMap<Uuid, NetClass*> mNetClasses
private

◆ mNetSignals

QMap<Uuid, NetSignal*> mNetSignals
private

◆ mComponentInstances

QMap<Uuid, ComponentInstance*> mComponentInstances
private

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