20#ifndef LIBREPCB_CORE_COMPONENT_H
21#define LIBREPCB_CORE_COMPONENT_H
26#include "../../attribute/attribute.h"
27#include "../../serialization/serializablekeyvaluemap.h"
28#include "../libraryelement.h"
48 static constexpr const char*
tagname =
"prefix";
49 static constexpr const char*
keyname =
"norm";
81 const ElementName& name_en_US,
const QString& description_en_US,
82 const QString& keywords_en_US);
125 const Uuid& pin)
const;
128 const Uuid& symbVar,
const Uuid& item);
130 const Uuid& symbVar,
const Uuid& item)
const;
139 static std::unique_ptr<Component>
open(
140 std::unique_ptr<TransactionalDirectory> directory,
141 bool abortBeforeMigration =
false);
143 return QStringLiteral(
"cmp");
146 return QStringLiteral(
"component");
153 Component(std::unique_ptr<TransactionalDirectory> directory,
155 static QString
cleanNorm(QString norm)
noexcept;
The Component class represents a "generic" device in the library.
Definition: component.h:73
ComponentSymbolVariantList & getSymbolVariants() noexcept
Definition: component.h:112
std::shared_ptr< ComponentSymbolVariantItem > getSymbVarItem(const Uuid &symbVar, const Uuid &item)
Definition: component.cpp:109
const ComponentSymbolVariantList & getSymbolVariants() const noexcept
Definition: component.h:115
ComponentSignalList mSignals
Definition: component.h:163
ComponentSymbolVariantList mSymbolVariants
Definition: component.h:164
virtual RuleCheckMessageList runChecks() const override
Definition: component.cpp:123
std::shared_ptr< ComponentSignal > getSignalOfPin(const Uuid &symbVar, const Uuid &item, const Uuid &pin)
Definition: component.cpp:69
static std::unique_ptr< Component > open(std::unique_ptr< TransactionalDirectory > directory, bool abortBeforeMigration=false)
Definition: component.cpp:128
const ComponentSignalList & getSignals() const noexcept
Definition: component.h:109
Component & operator=(const Component &rhs)=delete
AttributeList & getAttributes() noexcept
Definition: component.h:92
void setDefaultValue(const QString &value) noexcept
Definition: component.h:97
static QString cleanNorm(QString norm) noexcept
Definition: component.cpp:183
const AttributeList & getAttributes() const noexcept
Definition: component.h:93
QString mDefaultValue
Definition: component.h:160
Component(const Component &other)=delete
const QString & getDefaultValue() const noexcept
Definition: component.h:96
bool isSchematicOnly() const noexcept
Definition: component.h:86
NormDependentPrefixMap mPrefixes
Definition: component.h:161
bool mSchematicOnly
Definition: component.h:158
AttributeList mAttributes
all attributes in a specific order
Definition: component.h:162
~Component() noexcept
Definition: component.cpp:62
static QString getLongElementName() noexcept
Definition: component.h:145
ComponentSignalList & getSignals() noexcept
Definition: component.h:108
const NormDependentPrefixMap & getPrefixes() const noexcept
Definition: component.h:100
int getSymbolVariantIndexByNorm(const QStringList &normOrder) const noexcept
Definition: component.cpp:96
void setIsSchematicOnly(bool schematicOnly) noexcept
Definition: component.h:87
virtual void serialize(SExpression &root) const override
Serialize into librepcb::SExpression node.
Definition: component.cpp:160
static QString getShortElementName() noexcept
Definition: component.h:142
void setPrefixes(const NormDependentPrefixMap &prefixes) noexcept
Definition: component.h:103
The LibraryElement class extends the LibraryBaseElement class with some attributes and methods which ...
Definition: libraryelement.h:45
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
The Version class represents a version number in the format "1.42.7".
Definition: version.h:58
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, ComponentPrefixConstraint, ComponentPrefixVerifier > ComponentPrefix
Definition: componentprefix.h:85
QVector< std::shared_ptr< const RuleCheckMessage > > RuleCheckMessageList
Definition: rulecheckmessage.h:104
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:84
Definition: component.h:46
static constexpr const char * keyname
Definition: component.h:49
ComponentPrefix ValueType
Definition: component.h:47
static constexpr const char * tagname
Definition: component.h:48