26 #ifndef CLASS_LIBENTRY_H 27 #define CLASS_LIBENTRY_H 129 return wxT(
"LIB_SYMBOL" );
132 virtual void SetName(
const wxString& aName );
147 return parent->GetDescription();
160 return parent->GetKeyWords();
188 return parent->GetFPFilters();
194 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
252 void SetFields(
const std::vector <LIB_FIELD>& aFieldsList );
259 void GetFields( std::vector<LIB_FIELD*>& aList );
260 void GetFields( std::vector<LIB_FIELD>& aList );
328 void Plot(
PLOTTER* aPlotter,
int aUnit,
int aConvert,
const wxPoint& aOffset,
401 void GetPins(
LIB_PINS& aList,
int aUnit = 0,
int aConvert = 0 )
const;
413 LIB_PIN*
GetPin(
const wxString& aNumber,
int aUnit = 0,
int aConvert = 0 )
const;
428 bool aTestType,
bool aTestOrientation,
bool aTestLength )
const;
435 void SetOffset(
const wxPoint& aOffset );
500 void SetUnitCount(
int aCount,
bool aDuplicateDrawItems =
true );
522 static wxString
SubReference(
int aUnit,
bool aAddSeparator =
true );
562 void SetConversion(
bool aSetConvert,
bool aDuplicatePins =
true );
620 return Compare( aSymbol, LIB_ITEM::COMPARE_FLAGS::EQUALITY ) == 0;
625 return Compare( aSymbol, LIB_ITEM::COMPARE_FLAGS::EQUALITY ) != 0;
637 std::unique_ptr< LIB_SYMBOL >
Flatten()
const;
670 void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
715 #endif // CLASS_LIBENTRY_H
LIB_FIELD * FindField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName and returns it or NULL if not found.
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
bool operator<(const LIB_SYMBOL &aItem1, const LIB_SYMBOL &aItem2)
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0) const
Return a list of pin object pointers from the draw item list.
LIB_SYMBOL_REF & GetParent()
int GetPinNameOffset() const
std::vector< LIB_ITEM * > m_items
The items unique to this unit and alternate body style.
LIB_SYMBOL_SPTR SharedPtr() const
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
timestamp_t GetLastModDate() const
void SetFields(const std::vector< LIB_FIELD > &aFieldsList)
Overwrite all the existing fields in this symbol with fields supplied in aFieldsList.
void AddField(LIB_FIELD *aField)
Add a field.
LIB_FIELD & GetFootprintField()
Return reference to the footprint field.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetIncludeOnBoard(bool aIncludeOnBoard)
Set or clear include in board netlist flag.
int GetNextAvailableFieldId() const
Object used to load, save, search, and otherwise manipulate symbol library files.
wxString GetName() const override
void SetOffset(const wxPoint &aOffset)
Move the symbol aOffset.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
A mix-in to provide polymorphism between items stored in libraries (symbols, aliases and footprints).
bool operator!=(const LIB_SYMBOL &aSymbol) const
const LIB_ITEMS_CONTAINER & GetDrawItems() const
void SetConversion(bool aSetConvert, bool aDuplicatePins=true)
Set or clear the alternate body style (DeMorgan) for the symbol.
Field object used in symbol libraries.
wxString GetLibNickname() const override
void SetUnitCount(int aCount, bool aDuplicateDrawItems=true)
Set the units per symbol count.
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
bool ShowPinNumbers() const
bool GetIncludeOnBoard() const
size_t GetPinCount() const
virtual wxString GetClass() const override
Return the class name.
static int * SubpartFirstIdPtr()
Return a reference to m_subpartFirstId, only for read/save setting functions.
std::vector< struct LIB_SYMBOL_UNIT > GetUniqueUnits()
Return a list of unit numbers that are unique to this symbol.
static wxString SubReference(int aUnit, bool aAddSeparator=true)
void SetLib(SYMBOL_LIB *aLibrary)
LIB_FIELD & GetValueField()
Return reference to the value field.
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.
A logical library item identifier and consists of various portions much like a URI.
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
Define a library symbol object.
void PlotLibFields(PLOTTER *aPlotter, int aUnit, int aConvert, const wxPoint &aOffset, const TRANSFORM &aTransform)
Plot Lib Fields only of the symbol to plotter.
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
LIB_FIELD & GetReferenceField()
Return reference to the reference designator field.
int m_unit
The unit number.
const INSPECTOR_FUNC & INSPECTOR
SYMBOL_LIB * GetLib() const
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
virtual void SetParent(EDA_ITEM *aParent)
std::vector< struct LIB_SYMBOL_UNIT > GetUnitDrawItems()
Return a list of LIB_ITEM objects separated by unit and convert number.
The base class for drawable items used by schematic library symbols.
void GetFields(std::vector< LIB_FIELD * > &aList)
Return a list of fields within this symbol.
bool PinsConflictWith(const LIB_SYMBOL &aOtherSymbol, bool aTestNums, bool aTestNames, bool aTestType, bool aTestOrientation, bool aTestLength) const
Return true if this symbol's pins do not match another symbol's pins.
timestamp_t m_lastModDate
const EDA_RECT GetBodyBoundingBox(int aUnit, int aConvert, bool aIncludePins) const
Get the symbol bounding box excluding fields.
std::weak_ptr< LIB_SYMBOL > LIB_SYMBOL_REF
weak pointer to LIB_SYMBOL
LIB_SYMBOL_REF m_parent
Use for inherited symbols.
wxString GetSearchText() override
const LIB_SYMBOL & operator=(const LIB_SYMBOL &aSymbol)
bool HasConversion() const
Test if symbol has more than one body conversion type (DeMorgan).
static int GetSubpartFirstId()
int m_convert
The alternate body style of the unit.
void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
void RemoveDuplicateDrawItems()
Remove duplicate draw items from list.
wxString GetKeyWords() const
MULTIVECTOR< LIB_ITEM, LIB_SHAPE_T, LIB_FIELD_T > LIB_ITEMS_CONTAINER
LIB_ID GetLibId() const override
bool m_unitsLocked
True if symbol has multiple units and changing one unit does not automatically change another unit.
virtual void SetName(const wxString &aName)
int GetUnitCount() const override
For items with units, return the number of units.
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
int UpdateFieldOrdinals()
Order optional field indices.
void SetDescription(const wxString &aDescription)
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
bool ShowPinNames() const
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
void SetParent(LIB_SYMBOL *aParent=nullptr)
void SetLibId(const LIB_ID &aLibId)
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
static int GetSubpartIdSeparator()
bool UnitsLocked() const
Check whether symbol units are interchangeable.
void ClearTempFlags()
Clears the status flag all draw objects in this symbol.
bool operator==(const LIB_SYMBOL *aSymbol) const
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, int aMulti, int aConvert, const LIB_SYMBOL_OPTIONS &aOpts)
Print symbol.
LIB_ITEMS_CONTAINER m_drawings
Base plotter engine class.
LIB_ITEM * LocateDrawItem(int aUnit, int aConvert, KICAD_T aType, const wxPoint &aPoint)
Locate a draw object.
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
size_t GetFieldCount() const
TRANSFORM DefaultTransform
void SetIncludeInBom(bool aIncludeInBom)
Set or clear the include in schematic bill of materials flag.
static int * SubpartIdSeparatorPtr()
Return a reference to m_subpartIdSeparator, only for read/save setting functions.
void SetFPFilters(const wxArrayString &aFilters)
static int m_subpartFirstId
the ASCII char value to calculate the subpart symbol id from the symbol number: only 'A',...
LIB_FIELD & GetDatasheetField()
Return reference to the datasheet field.
Handle the component boundary box.
void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
A base class for most all the KiCad significant classes used in schematics and boards.
const wxString GetLibraryName() const
wxArrayString GetFPFilters() const
boost::ptr_vector< LIB_ITEM > ITEM_PTR_VECTOR
Helper for defining a list of library draw object pointers.
bool operator==(const LIB_SYMBOL &aSymbol) const
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
LIB_SYMBOL(const wxString &aName, LIB_SYMBOL *aParent=nullptr, SYMBOL_LIB *aLibrary=nullptr)
LIB_PIN * GetNextPin(LIB_PIN *aItem=nullptr)
Return the next pin object from the draw list.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
LIB_ITEM * GetNextDrawItem(const LIB_ITEM *aItem=nullptr, KICAD_T aType=TYPE_NOT_INIT)
Return the next draw object pointer.
virtual ~LIB_SYMBOL()
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
int m_pinNameOffset
The offset in mils to draw the pin name.
wxArrayString m_fpFilters
List of suitable footprint names for the symbol (wild card names accepted).
const LIB_SYMBOL_REF & GetParent() const
wxString m_keyWords
Search keywords.
wxString GetDescription() override
static void SetSubpartIdNotation(int aSep, int aFirstId)
Set the separator char between the subpart id and the reference 0 (no separator) or '.
void Plot(PLOTTER *aPlotter, int aUnit, int aConvert, const wxPoint &aOffset, const TRANSFORM &aTransform) const
Plot lib symbol to plotter.
LIBRENTRYOPTIONS m_options
Special symbol features such as POWER or NORMAL.)
int m_unitCount
Number of units (parts) per package.
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...
size_t size(int aType=UNDEFINED_TYPE) const
LIB_PIN * GetPin(const wxString &aNumber, int aUnit=0, int aConvert=0) const
Return pin object with the requested pin aNumber.
virtual LIB_SYMBOL * Duplicate() const
Create a copy of a LIB_SYMBOL and assigns unique KIIDs to the copy and its children.
void SetKeyWords(const wxString &aKeyWords)
void LockUnits(bool aLockUnits)
Set interchangeable the property for symbol units.
int Compare(const LIB_SYMBOL &aRhs, int aCompareFlags=0) const
Comparison test that can be used for operators.
bool GetIncludeInBom() const