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);
88 mSchematicOnly = schematicOnly;
104 mPrefixes = prefixes;
113 return mSymbolVariants;
116 return mSymbolVariants;
120 std::shared_ptr<ComponentSignal> getSignalOfPin(
const Uuid& symbVar,
123 std::shared_ptr<const ComponentSignal> getSignalOfPin(
const Uuid& symbVar,
125 const Uuid& pin)
const;
126 int getSymbolVariantIndexByNorm(
const QStringList& normOrder)
const noexcept;
127 std::shared_ptr<ComponentSymbolVariantItem> getSymbVarItem(
128 const Uuid& symbVar,
const Uuid& item);
129 std::shared_ptr<const ComponentSymbolVariantItem> getSymbVarItem(
130 const Uuid& symbVar,
const Uuid& item)
const;
139 static std::unique_ptr<Component> open(
140 std::unique_ptr<TransactionalDirectory> directory);
142 return QStringLiteral(
"cmp");
145 return QStringLiteral(
"component");
152 Component(std::unique_ptr<TransactionalDirectory> directory,
154 static QString cleanNorm(QString norm) noexcept;
158 QString mDefaultValue;
The Version class represents a version number in the format "1.42.7".
Definition: version.h:58
const ComponentSymbolVariantList & getSymbolVariants() const noexcept
Definition: component.h:115
void setDefaultValue(const QString &value) noexcept
Definition: component.h:97
void setIsSchematicOnly(bool schematicOnly) noexcept
Definition: component.h:87
const AttributeList & getAttributes() const noexcept
Definition: component.h:93
ComponentSymbolVariantList & getSymbolVariants() noexcept
Definition: component.h:112
Definition: component.h:46
Definition: occmodel.cpp:76
bool mSchematicOnly
Definition: component.h:157
QVector< std::shared_ptr< const RuleCheckMessage > > RuleCheckMessageList
Definition: rulecheckmessage.h:104
static constexpr const char * tagname
Definition: component.h:48
bool isSchematicOnly() const noexcept
Definition: component.h:86
type_safe::constrained_type< QString, ComponentPrefixConstraint, ComponentPrefixVerifier > ComponentPrefix
Definition: componentprefix.h:78
NormDependentPrefixMap mPrefixes
Definition: component.h:160
ComponentSignalList & getSignals() noexcept
Definition: component.h:108
static QString getShortElementName() noexcept
Definition: component.h:141
The Component class represents a "generic" device in the library.
Definition: component.h:73
static QString getLongElementName() noexcept
Definition: component.h:144
const ComponentSignalList & getSignals() const noexcept
Definition: component.h:109
The LibraryElement class extends the LibraryBaseElement class with some attributes and methods which ...
Definition: libraryelement.h:44
static constexpr const char * keyname
Definition: component.h:49
ComponentSymbolVariantList mSymbolVariants
Definition: component.h:163
ComponentSignalList mSignals
Definition: component.h:162
AttributeList mAttributes
all attributes in a specific order
Definition: component.h:161
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:56
SExpression serialize(const AttributeKey &obj)
Definition: attributekey.h:99
AttributeList & getAttributes() noexcept
Definition: component.h:92
ComponentPrefix ValueType
Definition: component.h:47
The SExpression class.
Definition: sexpression.h:66
const QString & getDefaultValue() const noexcept
Definition: component.h:96
const NormDependentPrefixMap & getPrefixes() const noexcept
Definition: component.h:100
void setPrefixes(const NormDependentPrefixMap &prefixes) noexcept
Definition: component.h:103
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:93