![]() |
LibrePCB Developers Documentation
|
The Circuit class represents all electrical connections in a project (drawed in the schematics) More...
#include <circuit.h>
Signals | |
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, bool restore, bool readOnly, bool create) | |
~Circuit () noexcept | |
Project & | getProject () const noexcept |
const QMap< Uuid, NetClass * > & | getNetClasses () const noexcept |
NetClass * | getNetClassByUuid (const Uuid &uuid) const noexcept |
NetClass * | getNetClassByName (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 |
NetSignal * | getNetSignalByUuid (const Uuid &uuid) const noexcept |
NetSignal * | getNetSignalByName (const QString &name) const noexcept |
NetSignal * | getNetSignalWithMostElements () const noexcept |
void | addNetSignal (NetSignal &netsignal) |
void | removeNetSignal (NetSignal &netsignal) |
void | setNetSignalName (NetSignal &netsignal, const CircuitIdentifier &newName, bool isAutoName) |
void | setHighlightedNetSignal (NetSignal *signal) noexcept |
QString | generateAutoComponentInstanceName (const library::ComponentPrefix &cmpPrefix) const noexcept |
const QMap< Uuid, ComponentInstance * > & | getComponentInstances () const noexcept |
ComponentInstance * | getComponentInstanceByUuid (const Uuid &uuid) const noexcept |
ComponentInstance * | getComponentInstanceByName (const QString &name) const noexcept |
void | addComponentInstance (ComponentInstance &cmp) |
void | removeComponentInstance (ComponentInstance &cmp) |
void | setComponentInstanceName (ComponentInstance &cmp, const CircuitIdentifier &newName) |
bool | save (bool toOriginal, QStringList &errors) noexcept |
Circuit & | operator= (const Circuit &rhs)=delete |
bool | operator== (const Circuit &rhs) noexcept |
bool | operator!= (const Circuit &rhs) noexcept |
![]() | |
SerializableObject () noexcept | |
virtual | ~SerializableObject () noexcept |
SExpression | serializeToDomElement (const QString &name) const |
Serialize the object to a new S-Expression node. More... | |
Private Member Functions | |
void | serialize (SExpression &root) const override |
Serialize the object into an existing S-Expression node. More... | |
Private Attributes | |
Project & | mProject |
A reference to the Project object (from the ctor) More... | |
FilePath | mFilepath |
SmartSExprFile * | mFile |
QMap< Uuid, NetClass * > | mNetClasses |
QMap< Uuid, NetSignal * > | mNetSignals |
QMap< Uuid, ComponentInstance * > | mComponentInstances |
Additional Inherited Members | |
![]() | |
template<typename T > | |
static void | serializeObjectContainer (SExpression &root, const T &container, const QString &itemName) |
template<typename T > | |
static void | serializePointerContainer (SExpression &root, const T &container, const QString &itemName) |
template<typename T > | |
static void | serializePointerContainerUuidSorted (SExpression &root, const T &container, const QString &itemName) |
The Circuit class represents all electrical connections in a project (drawed in the schematics)
Each #project#Project object contains exactly one 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:
|
delete |
|
noexcept |
|
inlinenoexcept |
|
noexcept |
void addNetClass | ( | NetClass & | netclass | ) |
void removeNetClass | ( | NetClass & | netclass | ) |
void setNetClassName | ( | NetClass & | netclass, |
const ElementName & | newName | ||
) |
|
noexcept |
|
noexcept |
|
noexcept |
void addNetSignal | ( | NetSignal & | netsignal | ) |
void removeNetSignal | ( | NetSignal & | netsignal | ) |
void setNetSignalName | ( | NetSignal & | netsignal, |
const CircuitIdentifier & | newName, | ||
bool | isAutoName | ||
) |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
void addComponentInstance | ( | ComponentInstance & | cmp | ) |
void removeComponentInstance | ( | ComponentInstance & | cmp | ) |
void setComponentInstanceName | ( | ComponentInstance & | cmp, |
const CircuitIdentifier & | newName | ||
) |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
overrideprivatevirtual |
Serialize the object into an existing S-Expression node.
This method inserts/appends all attributes and childs of the object to an existing S-Expression node. The content which already exists in the given S-Expression node will not be removed.
root | The target DOM root node |
Exception | This method throws an exception if an error occurs. |
Implements SerializableObject.
|
private |
|
private |
|
private |