Horizon
|
A Component is an instanced Entity in a Block. More...
#include <component.hpp>
Public Member Functions | |
Component (const UUID &uu, const json &j, class Pool &pool, class Block *block=nullptr) | |
Component (const UUID &uu) | |
virtual UUID | get_uuid () const |
std::string | replace_text (const std::string &t, bool *replaced=nullptr) const |
json | serialize () const |
Public Attributes | |
UUID | uuid |
const class Entity * | entity |
const class Part * | part = nullptr |
std::string | refdes |
std::string | value |
UUID | group |
UUID | tag |
std::map< UUIDPath< 2 >, Connection > | connections |
which Nins are connected to which Net the UUIDPath consists of Gate and Pin UUID | |
std::map< UUIDPath< 2 >, std::set< int > > | pin_names |
used to select alternate pin names | |
std::map< UUIDPath< 2 >, std::string > | custom_pin_names |
A Component is an instanced Entity in a Block.
Like in other places around horizon, a Component is identified by its UUID, not by its reference designator. Ensuring unique refdes is up to other parts of the application.
Usually, a Component will be assigned a Part to map it to a real-world thing one can order and put on a PCB. The Part must have the same Entity as the Component. The assignment can be changed at any time. This simplifies exchanging parts for logically identical parts of the same kind. When a part Pis assigned, the value of the Component gets overriden by the Part.