LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BI_Device Class Referencefinal

The BI_Device class. More...

#include <bi_device.h>

+ Inheritance diagram for BI_Device:
+ Collaboration diagram for BI_Device:

Signals

void attributesChanged () override
 This signal is emited when the value of attributes has changed. More...
 
void moved (const Point &newPos)
 
void rotated (const Angle &newRotation)
 
void mirrored (bool newIsMirrored)
 
- Signals inherited from AttributeProvider
virtual void attributesChanged ()=0
 This signal is emited when the value of attributes has changed. More...
 

Public Member Functions

 BI_Device ()=delete
 
 BI_Device (const BI_Device &other)=delete
 
 BI_Device (Board &board, const BI_Device &other)
 
 BI_Device (Board &board, const SExpression &node)
 
 BI_Device (Board &board, ComponentInstance &compInstance, const Uuid &deviceUuid, const Uuid &footprintUuid, const Point &position, const Angle &rotation, bool mirror)
 
 ~BI_Device () noexcept
 
const UuidgetComponentInstanceUuid () const noexcept
 
ComponentInstancegetComponentInstance () const noexcept
 
const library::DevicegetLibDevice () const noexcept
 
const library::PackagegetLibPackage () const noexcept
 
const library::FootprintgetLibFootprint () const noexcept
 
BI_FootprintgetFootprint () const noexcept
 
const AnglegetRotation () const noexcept
 
bool isSelectable () const noexceptoverride
 
bool isUsed () const noexcept
 
void setPosition (const Point &pos) noexcept
 
void setRotation (const Angle &rot) noexcept
 
void setIsMirrored (bool mirror)
 
void addToBoard () override
 
void removeFromBoard () override
 
void serialize (SExpression &root) const override
 Serialize the object into an existing S-Expression node. More...
 
QString getUserDefinedAttributeValue (const QString &key) const noexceptoverride
 Get the value of a user defined attribute (if available) More...
 
QString getBuiltInAttributeValue (const QString &key) const noexceptoverride
 Get the value of a built-in attribute (if available) More...
 
QVector< const
AttributeProvider * > 
getAttributeProviderParents () const noexceptoverride
 Get all parent attribute providers (fallback if attribute not found) More...
 
Type_t getType () const noexceptoverride
 
const PointgetPosition () const noexceptoverride
 
bool getIsMirrored () const noexceptoverride
 
QPainterPath getGrabAreaScenePx () const noexceptoverride
 
void setSelected (bool selected) noexceptoverride
 
BI_Deviceoperator= (const BI_Device &rhs)=delete
 
- Public Member Functions inherited from BI_Base
 BI_Base ()=delete
 
 BI_Base (const BI_Base &other)=delete
 
 BI_Base (Board &board) noexcept
 
virtual ~BI_Base () noexcept
 
ProjectgetProject () const noexcept
 
CircuitgetCircuit () const noexcept
 
BoardgetBoard () const noexcept
 
virtual bool isAddedToBoard () const noexcept
 
virtual bool isSelected () const noexcept
 
BI_Baseoperator= (const BI_Base &rhs)=delete
 
- Public Member Functions inherited from AttributeProvider
 AttributeProvider () noexcept
 
 AttributeProvider (const AttributeProvider &other)=delete
 
AttributeProvideroperator= (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...
 
- Public Member Functions inherited from IF_ErcMsgProvider
 IF_ErcMsgProvider ()
 
virtual ~IF_ErcMsgProvider ()
 
virtual const char * getErcMsgOwnerClassName () const noexcept=0
 
- Public Member Functions inherited from SerializableObject
 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 initDeviceAndPackageAndFootprint (const Uuid &deviceUuid, const Uuid &footprintUuid)
 
void init ()
 
bool checkAttributesValidity () const noexcept
 
void updateErcMessages () noexcept
 
const QStringList & getLocaleOrder () const noexcept
 

Private Attributes

ComponentInstancemCompInstance
 
const library::DevicemLibDevice
 
const library::PackagemLibPackage
 
const library::FootprintmLibFootprint
 
QScopedPointer< BI_FootprintmFootprint
 
Point mPosition
 
Angle mRotation
 
bool mIsMirrored
 
AttributeList mAttributes
 not yet used, but already specified in file format More...
 

Additional Inherited Members

- Public Types inherited from BI_Base
enum  Type_t
 
- Static Public Member Functions inherited from SerializableObject
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)
 
- Protected Member Functions inherited from BI_Base
void addToBoard (QGraphicsItem *item) noexcept
 
void removeFromBoard (QGraphicsItem *item) noexcept
 
- Protected Attributes inherited from BI_Base
BoardmBoard
 

Detailed Description

The BI_Device class.

Constructor & Destructor Documentation

BI_Device ( )
delete
BI_Device ( const BI_Device other)
delete
BI_Device ( Board board,
const BI_Device other 
)

+ Here is the call graph for this function:

BI_Device ( Board board,
const SExpression node 
)

+ Here is the call graph for this function:

BI_Device ( Board board,
ComponentInstance compInstance,
const Uuid deviceUuid,
const Uuid footprintUuid,
const Point position,
const Angle rotation,
bool  mirror 
)

+ Here is the call graph for this function:

~BI_Device ( )
noexcept

Member Function Documentation

const Uuid & getComponentInstanceUuid ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ComponentInstance& getComponentInstance ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const library::Device& getLibDevice ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const library::Package& getLibPackage ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const library::Footprint& getLibFootprint ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

BI_Footprint& getFootprint ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const Angle& getRotation ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

bool isSelectable ( ) const
overridevirtualnoexcept

Implements BI_Base.

bool isUsed ( ) const
noexcept

+ Here is the caller graph for this function:

void setPosition ( const Point pos)
noexcept

+ Here is the caller graph for this function:

void setRotation ( const Angle rot)
noexcept

+ Here is the caller graph for this function:

void setIsMirrored ( bool  mirror)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void addToBoard ( )
overridevirtual

Implements BI_Base.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void removeFromBoard ( )
overridevirtual

Implements BI_Base.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize ( SExpression root) const
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.

Note
The generated S-Expression node has always the format of the application's major version (it's not possible to generate DOMs of older versions).
Parameters
rootThe target DOM root node
Exceptions
ExceptionThis method throws an exception if an error occurs.

Implements SerializableObject.

+ Here is the call graph for this function:

QString getUserDefinedAttributeValue ( const QString &  key) const
overridevirtualnoexcept

Get the value of a user defined attribute (if available)

Parameters
keyThe attribute name (e.g. "NAME" for "{{NAME}}")
Returns
The value of the attribute (empty string if not found)

Reimplemented from AttributeProvider.

QString getBuiltInAttributeValue ( const QString &  key) const
overridevirtualnoexcept

Get the value of a built-in attribute (if available)

Parameters
keyThe attribute name (e.g. "NAME" for "{{NAME}}")
Returns
The value of the attribute (empty string if not found)

Reimplemented from AttributeProvider.

QVector< const AttributeProvider * > getAttributeProviderParents ( ) const
overridevirtualnoexcept

Get all parent attribute providers (fallback if attribute not found)

Returns
All parent attribute provider objects (empty and nullptr are allowed)

Reimplemented from AttributeProvider.

Type_t getType ( ) const
inlineoverridevirtualnoexcept

Implements BI_Base.

const Point& getPosition ( ) const
inlineoverridevirtualnoexcept

Implements BI_Base.

+ Here is the caller graph for this function:

bool getIsMirrored ( ) const
inlineoverridevirtualnoexcept

Implements BI_Base.

+ Here is the caller graph for this function:

QPainterPath getGrabAreaScenePx ( ) const
overridevirtualnoexcept

Implements BI_Base.

void setSelected ( bool  selected)
overridevirtualnoexcept

Reimplemented from BI_Base.

+ Here is the call graph for this function:

BI_Device& operator= ( const BI_Device rhs)
delete
void attributesChanged ( )
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).

+ Here is the caller graph for this function:

void moved ( const Point newPos)
signal

+ Here is the caller graph for this function:

void rotated ( const Angle newRotation)
signal

+ Here is the caller graph for this function:

void mirrored ( bool  newIsMirrored)
signal

+ Here is the caller graph for this function:

void initDeviceAndPackageAndFootprint ( const Uuid deviceUuid,
const Uuid footprintUuid 
)
private

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void init ( )
private

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool checkAttributesValidity ( ) const
privatenoexcept

+ Here is the caller graph for this function:

void updateErcMessages ( )
privatenoexcept

+ Here is the caller graph for this function:

const QStringList & getLocaleOrder ( ) const
privatenoexcept

+ Here is the call graph for this function:

Member Data Documentation

ComponentInstance* mCompInstance
private
const library::Device* mLibDevice
private
const library::Package* mLibPackage
private
const library::Footprint* mLibFootprint
private
QScopedPointer<BI_Footprint> mFootprint
private
Point mPosition
private
Angle mRotation
private
bool mIsMirrored
private
AttributeList mAttributes
private

not yet used, but already specified in file format


The documentation for this class was generated from the following files: