![]() |
LibrePCB Developers Documentation
|
The ComponentInstance class. More...
#include <componentinstance.h>
Signals | |
void | attributesChanged () override |
This signal is emited when the value of attributes has changed. More... | |
![]() | |
virtual void | attributesChanged ()=0 |
This signal is emited when the value of attributes has changed. More... | |
Public Member Functions | |
ComponentInstance ()=delete | |
ComponentInstance (const ComponentInstance &other)=delete | |
ComponentInstance (Circuit &circuit, const SExpression &node, const Version &fileFormat) | |
ComponentInstance (Circuit &circuit, const library::Component &cmp, const Uuid &symbVar, const CircuitIdentifier &name, const tl::optional< Uuid > &defaultDevice=tl::nullopt) | |
~ComponentInstance () noexcept | |
const Uuid & | getUuid () const noexcept |
const CircuitIdentifier & | getName () const noexcept |
QString | getValue (bool replaceAttributes=false) const noexcept |
const tl::optional< Uuid > & | getDefaultDeviceUuid () const noexcept |
const library::Component & | getLibComponent () const noexcept |
const library::ComponentSymbolVariant & | getSymbolVariant () const noexcept |
ComponentSignalInstance * | getSignalInstance (const Uuid &signalUuid) const noexcept |
const AttributeList & | getAttributes () const noexcept |
Circuit & | getCircuit () const noexcept |
int | getPlacedSymbolsCount () const noexcept |
int | getUnplacedSymbolsCount () const noexcept |
int | getUnplacedRequiredSymbolsCount () const noexcept |
int | getUnplacedOptionalSymbolsCount () const noexcept |
int | getRegisteredElementsCount () const noexcept |
bool | isUsed () const noexcept |
void | setName (const CircuitIdentifier &name) noexcept |
Set the name of this component instance in the circuit. More... | |
void | setValue (const QString &value) noexcept |
Set the value of this component instance in the circuit. More... | |
void | setAttributes (const AttributeList &attributes) noexcept |
void | setDefaultDeviceUuid (const tl::optional< Uuid > &device) noexcept |
Set the default device of the component. More... | |
void | addToCircuit () |
void | removeFromCircuit () |
void | registerSymbol (SI_Symbol &symbol) |
void | unregisterSymbol (SI_Symbol &symbol) |
void | registerDevice (BI_Device &device) |
void | unregisterDevice (BI_Device &device) |
void | serialize (SExpression &root) const override |
Serialize the object into an existing S-Expression node. More... | |
QString | getUserDefinedAttributeValue (const QString &key) const noexcept override |
Get the value of a user defined attribute (if available) More... | |
QString | getBuiltInAttributeValue (const QString &key) const noexcept override |
Get the value of a built-in attribute (if available) More... | |
QVector< const AttributeProvider * > | getAttributeProviderParents () const noexcept override |
Get all parent attribute providers (fallback if attribute not found) More... | |
ComponentInstance & | operator= (const ComponentInstance &rhs)=delete |
![]() | |
AttributeProvider () noexcept | |
AttributeProvider (const AttributeProvider &other)=delete | |
AttributeProvider & | operator= (const AttributeProvider &rhs)=delete |
virtual | ~AttributeProvider () noexcept |
QString | getAttributeValue (const QString &key) const noexcept |
Get the value of an attribute which can be used in texts (like "{{NAME}}") More... | |
![]() | |
IF_ErcMsgProvider () | |
virtual | ~IF_ErcMsgProvider () |
virtual const char * | getErcMsgOwnerClassName () const noexcept=0 |
![]() | |
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 | init () |
bool | checkAttributesValidity () const noexcept |
void | updateErcMessages () noexcept |
const QStringList & | getLocaleOrder () const noexcept |
Private Attributes | |
Circuit & | mCircuit |
bool | mIsAddedToCircuit |
Uuid | mUuid |
The unique UUID of this component instance in the circuit. More... | |
CircuitIdentifier | mName |
The unique name of this component instance in the circuit (e.g. "R42") More... | |
QString | mValue |
The value of this component instance in the circuit (e.g. the resistance of a resistor) More... | |
tl::optional< Uuid > | mDefaultDeviceUuid |
THe default device when adding the component to a board. More... | |
const library::Component * | mLibComponent |
Pointer to the component in the project's library. More... | |
const library::ComponentSymbolVariant * | mCompSymbVar |
Pointer to the used symbol variant of mLibComponent. More... | |
QScopedPointer< AttributeList > | mAttributes |
All attributes of this component. More... | |
QMap< Uuid, ComponentSignalInstance * > | mSignals |
All signal instances (Key: component signal UUID) More... | |
QHash< Uuid, SI_Symbol * > | mRegisteredSymbols |
All registered symbols. More... | |
QList< BI_Device * > | mRegisteredDevices |
All registered devices (of all boards) More... | |
QScopedPointer< ErcMsg > | mErcMsgUnplacedRequiredSymbols |
The ERC message for unplaced required symbols of this component. More... | |
QScopedPointer< ErcMsg > | mErcMsgUnplacedOptionalSymbols |
The ERC message for unplaced optional symbols of this component. More... | |
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 ComponentInstance class.
|
delete |
|
delete |
ComponentInstance | ( | Circuit & | circuit, |
const SExpression & | node, | ||
const Version & | fileFormat | ||
) |
|
explicit |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
Set the name of this component instance in the circuit.
name | The new name of this component in the circuit |
|
noexcept |
Set the value of this component instance in the circuit.
value | The new value |
|
noexcept |
|
noexcept |
Set the default device of the component.
device | The new device UUID |
void addToCircuit | ( | ) |
void removeFromCircuit | ( | ) |
void registerSymbol | ( | SI_Symbol & | symbol | ) |
void unregisterSymbol | ( | SI_Symbol & | symbol | ) |
void registerDevice | ( | BI_Device & | device | ) |
void unregisterDevice | ( | BI_Device & | device | ) |
|
overridevirtual |
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.
|
overridevirtualnoexcept |
Get the value of a user defined attribute (if available)
key | The attribute name (e.g. "NAME" for "{{NAME}}") |
Reimplemented from AttributeProvider.
|
overridevirtualnoexcept |
Get the value of a built-in attribute (if available)
key | The attribute name (e.g. "NAME" for "{{NAME}}") |
Reimplemented from AttributeProvider.
|
overridevirtualnoexcept |
Get all parent attribute providers (fallback if attribute not found)
Reimplemented from AttributeProvider.
|
delete |
|
overridesignal |
This signal is emited when the value of attributes has changed.
All derived classes must emit this signal when some attributes have changed their values (only attributes which can be fetched with getAttributeValue(), inclusive all attributes from all "parent" classes).
|
private |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
|
private |
|
private |
|
private |
The unique UUID of this component instance in the circuit.
|
private |
The unique name of this component instance in the circuit (e.g. "R42")
|
private |
The value of this component instance in the circuit (e.g. the resistance of a resistor)
|
private |
THe default device when adding the component to a board.
|
private |
Pointer to the component in the project's library.
|
private |
Pointer to the used symbol variant of mLibComponent.
|
private |
All attributes of this component.
|
private |
All signal instances (Key: component signal UUID)
All registered symbols.
|
private |
All registered devices (of all boards)
|
private |
The ERC message for unplaced required symbols of this component.
|
private |
The ERC message for unplaced optional symbols of this component.