![]() |
LibrePCB Developers Documentation
|
The ComponentInstance class. More...
#include <componentinstance.h>
Signals | |
void | attributesChanged () override |
This signal is emitted when the value of attributes has changed. More... | |
void | primaryDeviceChanged (const BI_Device *device) |
![]() | |
virtual void | attributesChanged ()=0 |
This signal is emitted when the value of attributes has changed. More... | |
Public Member Functions | |
ComponentInstance ()=delete | |
ComponentInstance (const ComponentInstance &other)=delete | |
ComponentInstance (Circuit &circuit, const Uuid &uuid, const 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 QPointer< const BI_Device > & | getPrimaryDevice () const noexcept |
const Component & | getLibComponent () const noexcept |
const ComponentSymbolVariant & | getSymbolVariant () const noexcept |
const QMap< Uuid, ComponentSignalInstance * > & | getSignals () const noexcept |
ComponentSignalInstance * | getSignalInstance (const Uuid &signalUuid) const noexcept |
const AttributeList & | getAttributes () const noexcept |
Circuit & | getCircuit () const noexcept |
const QHash< Uuid, SI_Symbol * > & | getSymbols () const noexcept |
int | getRegisteredElementsCount () const noexcept |
bool | isUsed () const noexcept |
bool | isAddedToCircuit () 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 |
Serialize into librepcb::SExpression 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... | |
Private Member Functions | |
void | updatePrimaryDevice () noexcept |
bool | checkAttributesValidity () const 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 Component & | mLibComponent |
Reference to the component in the project's library. More... | |
const 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... | |
QPointer< const BI_Device > | mPrimaryDevice |
The ComponentInstance class.
|
delete |
|
delete |
|
explicit |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
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 | ) |
void serialize | ( | SExpression & | root | ) | const |
Serialize into librepcb::SExpression node.
root | Root node to serialize into. |
|
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 emitted 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).
|
signal |
|
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 |
Reference 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 |