20#ifndef LIBREPCB_CORE_BI_DEVICE_H
21#define LIBREPCB_CORE_BI_DEVICE_H
26#include "../../../attribute/attribute.h"
27#include "../../../geometry/stroketext.h"
28#include "../../../types/uuid.h"
29#include "../../../utils/signalslot.h"
42class ComponentInstance;
76 const Uuid& deviceUuid,
const Uuid& footprintUuid,
77 const Point& position,
const Angle& rotation,
bool mirror,
78 bool locked,
bool loadInitialStrokeTexts);
98 return mPads.value(padUuid);
100 const QMap<Uuid, BI_FootprintPad*>&
getPads() const noexcept {
return mPads; }
104 QVector<std::shared_ptr<const Part>>
getParts(
105 const std::optional<Uuid>& assemblyVariant)
const noexcept;
108 bool isUsed() const noexcept;
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
The Board Item Base (BI_Base) class.
Definition bi_base.h:45
The BI_Device class.
Definition bi_device.h:57
bool mLocked
Definition bi_device.h:162
bool getMirrored() const noexcept
Definition bi_device.h:94
void removeStrokeText(BI_StrokeText &text)
Definition bi_device.cpp:280
const PackageModel * mLibModel
nullptr if no model available/selected
Definition bi_device.h:156
const Angle & getRotation() const noexcept
Definition bi_device.h:93
ComponentInstance & getComponentInstance() const noexcept
Definition bi_device.h:83
const Package * mLibPackage
Definition bi_device.h:154
BI_Device & operator=(const BI_Device &rhs)=delete
std::optional< Uuid > getLibModelUuid() const noexcept
Definition bi_device.cpp:186
Signal< BI_Device, Event > onEdited
Definition bi_device.h:69
ComponentInstance & mCompInstance
Definition bi_device.h:152
void removeFromBoard() override
Definition bi_device.cpp:364
const Footprint & getLibFootprint() const noexcept
Definition bi_device.h:88
const QMap< Uuid, BI_StrokeText * > & getStrokeTexts() const noexcept
Definition bi_device.h:120
void addStrokeText(BI_StrokeText &text)
Definition bi_device.cpp:261
void strokeTextAdded(BI_StrokeText &strokeText)
void strokeTextRemoved(BI_StrokeText &strokeText)
void updateHoleStopMaskOffsets() noexcept
Definition bi_device.cpp:421
bool isUsed() const noexcept
Definition bi_device.cpp:235
Event
Definition bi_device.h:62
StrokeTextList getDefaultStrokeTexts() const noexcept
Definition bi_device.cpp:246
const Device * mLibDevice
Definition bi_device.h:153
QHash< Uuid, std::optional< Length > > mHoleStopMaskOffsets
Definition bi_device.h:167
const QHash< Uuid, std::optional< Length > > & getHoleStopMasks() const noexcept
Definition bi_device.h:101
bool checkAttributesValidity() const noexcept
Definition bi_device.cpp:415
const AttributeList & getAttributes() const noexcept
Definition bi_device.h:96
bool isInAssemblyVariant(const Uuid &assemblyVariant) const noexcept
Definition bi_device.cpp:218
const QMap< Uuid, BI_FootprintPad * > & getPads() const noexcept
Definition bi_device.h:100
~BI_Device() noexcept
Definition bi_device.cpp:171
bool isLocked() const noexcept
Definition bi_device.h:95
BI_Device(const BI_Device &other)=delete
const PackageModel * getLibModel() const noexcept
Definition bi_device.h:89
Angle mRotation
Definition bi_device.h:160
Slot< BI_Device, Event > OnEditedSlot
Definition bi_device.h:70
void setMirrored(bool mirror)
Definition bi_device.cpp:311
BI_FootprintPad * getPad(const Uuid &padUuid) const noexcept
Definition bi_device.h:97
QVector< std::shared_ptr< const Part > > getParts(const std::optional< Uuid > &assemblyVariant) const noexcept
Definition bi_device.cpp:198
const Package & getLibPackage() const noexcept
Definition bi_device.h:87
const Point & getPosition() const noexcept
Definition bi_device.h:92
QMap< Uuid, BI_FootprintPad * > mPads
key: footprint pad UUID
Definition bi_device.h:165
AttributeList mAttributes
Not used yet, but specified in file format.
Definition bi_device.h:163
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition bi_device.cpp:384
void setModel(const std::optional< Uuid > &uuid)
Definition bi_device.cpp:335
void setRotation(const Angle &rot) noexcept
Definition bi_device.cpp:303
void addToBoard() override
Definition bi_device.cpp:344
void setAttributes(const AttributeList &attributes) noexcept
Definition bi_device.cpp:328
const Device & getLibDevice() const noexcept
Definition bi_device.h:86
std::optional< Uuid > getDefaultLibModelUuid() const noexcept
Definition bi_device.cpp:190
const QStringList & getLocaleOrder() const noexcept
Definition bi_device.cpp:441
QMap< Uuid, BI_StrokeText * > mStrokeTexts
Definition bi_device.h:166
void setLocked(bool locked) noexcept
Definition bi_device.cpp:322
bool mMirrored
Definition bi_device.h:161
Point mPosition
Definition bi_device.h:159
void setPosition(const Point &pos) noexcept
Definition bi_device.cpp:295
const Footprint * mLibFootprint
Definition bi_device.h:155
bool doesPackageRequireAssembly(bool resolveAuto) const noexcept
Definition bi_device.cpp:230
const Uuid & getComponentInstanceUuid() const noexcept
Definition bi_device.cpp:182
The BI_StrokeText class.
Definition bi_stroketext.h:49
The Board class represents a PCB of a project and is always part of a circuit.
Definition board.h:73
The ComponentInstance class.
Definition componentinstance.h:54
The Device class represents an instance of a component (a "real" component)
Definition device.h:55
The Length class is used to represent a length (for example 12.75 millimeters)
Definition length.h:82
The Package class represents a package of a component (including footprint and 3D model)
Definition package.h:59
Represents a 3D model of a librepcb::Package.
Definition packagemodel.h:43
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The SExpression class.
Definition sexpression.h:69
The Signal class is used to emit signals on non-QObject derived classes.
Definition signalslot.h:65
The Slot class is used to receive signals from non-QObject derived classes.
Definition signalslot.h:170
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
Definition occmodel.cpp:76