20#ifndef LIBREPCB_CORE_CIRCUIT_H
21#define LIBREPCB_CORE_CIRCUIT_H
26#include "../../fileio/filepath.h"
27#include "../../library/cmp/componentprefix.h"
28#include "../../types/circuitidentifier.h"
29#include "../../types/elementname.h"
30#include "../../types/fileproofname.h"
31#include "../../types/uuid.h"
44class ComponentInstance;
48class TransactionalDirectory;
123 const Uuid& uuid)
const noexcept;
125 const QString& name)
const noexcept;
The Circuit class represents all electrical connections in a project (drawn in the schematics)
Definition: circuit.h:70
const QMap< Uuid, NetClass * > & getNetClasses() const noexcept
Definition: circuit.h:96
NetSignal * getNetSignalWithMostElements() const noexcept
Definition: circuit.cpp:208
bool operator!=(const Circuit &rhs) noexcept
Definition: circuit.h:143
AssemblyVariantList & getAssemblyVariants() noexcept
Definition: circuit.h:84
void addNetClass(NetClass &netclass)
Definition: circuit.cpp:141
NetClass * getNetClassByName(const ElementName &name) const noexcept
Definition: circuit.cpp:132
void addComponentInstance(ComponentInstance &cmp)
Definition: circuit.cpp:295
void setNetClassName(NetClass &netclass, const ElementName &newName)
Definition: circuit.cpp:171
QString generateAutoComponentInstanceName(const ComponentPrefix &cmpPrefix) const noexcept
Definition: circuit.cpp:271
~Circuit() noexcept
Definition: circuit.cpp:48
void componentRemoved(ComponentInstance &cmp)
Circuit(const Circuit &other)=delete
const QMap< Uuid, ComponentInstance * > & getComponentInstances() const noexcept
Definition: circuit.h:119
void netClassAdded(NetClass &netclass)
ComponentInstance * getComponentInstanceByUuid(const Uuid &uuid) const noexcept
Definition: circuit.cpp:282
void removeComponentInstance(ComponentInstance &cmp)
Definition: circuit.cpp:318
bool operator==(const Circuit &rhs) noexcept
Definition: circuit.h:142
Circuit & operator=(const Circuit &rhs)=delete
QMap< Uuid, NetSignal * > mNetSignals
Definition: circuit.h:159
void componentAdded(ComponentInstance &cmp)
QMap< Uuid, ComponentInstance * > mComponentInstances
Definition: circuit.h:160
void setNetSignalName(NetSignal &netsignal, const CircuitIdentifier &newName, bool isAutoName)
Definition: circuit.cpp:250
void netSignalAdded(NetSignal &netsignal)
void removeNetClass(NetClass &netclass)
Definition: circuit.cpp:162
void netClassRemoved(NetClass &netclass)
Project & getProject() const noexcept
Definition: circuit.h:81
const AssemblyVariantList & getAssemblyVariants() const noexcept
Definition: circuit.h:87
Project & mProject
A reference to the Project object (from the ctor)
Definition: circuit.h:156
ComponentInstance * getComponentInstanceByName(const QString &name) const noexcept
Definition: circuit.cpp:287
void setComponentInstanceName(ComponentInstance &cmp, const CircuitIdentifier &newName)
Definition: circuit.cpp:329
void assemblyVariantRemoved(std::shared_ptr< AssemblyVariant > &av)
void assemblyVariantAdded(std::shared_ptr< AssemblyVariant > &av)
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition: circuit.cpp:349
void netSignalRemoved(NetSignal &netsignal)
QMap< Uuid, NetClass * > mNetClasses
Definition: circuit.h:158
AssemblyVariantList mAssemblyVariants
Definition: circuit.h:157
void addNetSignal(NetSignal &netsignal)
Definition: circuit.cpp:220
NetSignal * getNetSignalByName(const QString &name) const noexcept
Definition: circuit.cpp:199
void removeAssemblyVariant(std::shared_ptr< AssemblyVariant > av)
Definition: circuit.cpp:103
QString generateAutoNetSignalName() const noexcept
Definition: circuit.cpp:190
void removeNetSignal(NetSignal &netsignal)
Definition: circuit.cpp:241
const QMap< Uuid, NetSignal * > & getNetSignals() const noexcept
Definition: circuit.h:106
void setAssemblyVariantName(std::shared_ptr< AssemblyVariant > av, const FileProofName &newName)
Definition: circuit.cpp:115
int addAssemblyVariant(std::shared_ptr< AssemblyVariant > av, int index=-1)
Definition: circuit.cpp:78
The ComponentInstance class.
Definition: componentinstance.h:54
The NetClass class.
Definition: netclass.h:46
The NetSignal class.
Definition: netsignal.h:50
The Project class represents a whole (opened) project with all its content.
Definition: project.h:71
The SExpression class.
Definition: sexpression.h:69
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, CircuitIdentifierConstraint, CircuitIdentifierVerifier > CircuitIdentifier
Definition: circuitidentifier.h:96
type_safe::constrained_type< QString, ComponentPrefixConstraint, ComponentPrefixVerifier > ComponentPrefix
Definition: componentprefix.h:85
type_safe::constrained_type< QString, FileProofNameConstraint, FileProofNameVerifier > FileProofName
Definition: fileproofname.h:89
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:84