KiCad PCB EDA Suite
lib_symbol.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
6 * Copyright (C) 2004-2022 KiCad Developers, see change_log.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#ifndef CLASS_LIBENTRY_H
27#define CLASS_LIBENTRY_H
28
29#include <general.h>
30#include <lib_tree_item.h>
31#include <lib_item.h>
32#include <lib_field.h>
33#include <vector>
34#include <multivector.h>
35
36class LINE_READER;
37class OUTPUTFORMATTER;
38class SYMBOL_LIB;
39class LIB_SYMBOL;
40class LIB_FIELD;
42
43
44typedef std::shared_ptr<LIB_SYMBOL> LIB_SYMBOL_SPTR;
45typedef std::weak_ptr<LIB_SYMBOL> LIB_SYMBOL_REF;
48
49
50/* values for member .m_options */
52{
53 ENTRY_NORMAL, // Libentry is a standard symbol (real or alias)
54 ENTRY_POWER // Libentry is a power symbol
55};
56
57
58extern bool operator<( const LIB_SYMBOL& aItem1, const LIB_SYMBOL& aItem2 );
59
60
62{
63 TRANSFORM transform; // Coordinate adjustment settings
64 bool force_draw_pin_text; // Whether or not to force the drawing of pin names and numbers
65 bool draw_visible_fields; // Whether to draw "visible" fields
66 bool draw_hidden_fields; // Whether to draw "hidden" fields
67 bool show_elec_type; // Whether to show the pin electrical type
68 bool show_connect_point; // Whether to show the pin connect point marker (small circle)
69 // useful in dialog pin properties
70
72 {
74 force_draw_pin_text = false;
76 draw_hidden_fields = true;
77 show_elec_type = false;
78 show_connect_point = false;
79 }
80};
81
82
84{
85 int m_unit;
87 std::vector<LIB_ITEM*> m_items;
88};
89
90
97class LIB_SYMBOL : public EDA_ITEM, public LIB_TREE_ITEM
98{
99public:
100 LIB_SYMBOL( const wxString& aName, LIB_SYMBOL* aParent = nullptr,
101 SYMBOL_LIB* aLibrary = nullptr );
102
103 LIB_SYMBOL( const LIB_SYMBOL& aSymbol, SYMBOL_LIB* aLibrary = nullptr );
104
105 virtual ~LIB_SYMBOL();
106
108 LIB_SYMBOL_SPTR SharedPtr() const { return m_me; }
109
113 virtual LIB_SYMBOL* Duplicate() const
114 {
115 LIB_SYMBOL* dupe = new LIB_SYMBOL( *this, m_library );
116 const_cast<KIID&>( dupe->m_Uuid ) = KIID();
117
118 for( LIB_ITEM& item : dupe->m_drawings )
119 const_cast<KIID&>( item.m_Uuid ) = KIID();
120
121 return dupe;
122 }
123
124 void SetParent( LIB_SYMBOL* aParent = nullptr );
126 const LIB_SYMBOL_REF& GetParent() const { return m_parent; }
127
128 void ClearCaches();
129
130 virtual wxString GetClass() const override
131 {
132 return wxT( "LIB_SYMBOL" );
133 }
134
135 virtual void SetName( const wxString& aName );
136 wxString GetName() const override { return m_name; }
137
138 LIB_ID& LibId() { return m_libId; }
139 LIB_ID GetLibId() const override { return m_libId; }
140 void SetLibId( const LIB_ID& aLibId ) { m_libId = aLibId; }
141
142 wxString GetLibNickname() const override { return GetLibraryName(); }
143
144 void SetDescription( const wxString& aDescription ) { m_description = aDescription; }
145
146 wxString GetDescription() override
147 {
148 if( m_description.IsEmpty() && IsAlias() )
149 {
150 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
151 return parent->GetDescription();
152 }
153
154 return m_description;
155 }
156
157 void SetKeyWords( const wxString& aKeyWords ) { m_keyWords = aKeyWords; }
158
159 wxString GetKeyWords() const
160 {
161 if( m_keyWords.IsEmpty() && IsAlias() )
162 {
163 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
164 return parent->GetKeyWords();
165 }
166
167 return m_keyWords;
168 }
169
170 wxString GetSearchText() override;
171
172 wxString GetFootprint() override
173 {
174 return GetFootprintField().GetText();
175 }
176
177 void GetChooserFields( std::map<wxString , wxString>& aColumnMap ) override;
178
182 bool IsRoot() const override { return m_parent.use_count() == 0; }
183 bool IsAlias() const { return !m_parent.expired() && m_parent.use_count() > 0; }
184
185 const wxString GetLibraryName() const;
186
187 SYMBOL_LIB* GetLib() const { return m_library; }
188 void SetLib( SYMBOL_LIB* aLibrary ) { m_library = aLibrary; }
189
191
192 void SetFPFilters( const wxArrayString& aFilters ) { m_fpFilters = aFilters; }
193
194 wxArrayString GetFPFilters() const
195 {
196 if( m_fpFilters.IsEmpty() && IsAlias() )
197 {
198 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
199 return parent->GetFPFilters();
200 }
201
202 return m_fpFilters;
203 }
204
205 void ViewGetLayers( int aLayers[], int& aCount ) const override;
206
217 const BOX2I GetUnitBoundingBox( int aUnit, int aConvert ) const;
218
229 const BOX2I GetBodyBoundingBox( int aUnit, int aConvert, bool aIncludePins,
230 bool aIncludePrivateItems ) const;
231
232 const BOX2I GetBoundingBox() const override
233 {
234 return GetUnitBoundingBox( 0, 0 );
235 }
236
237 bool IsPower() const;
238 bool IsNormal() const;
239
240 void SetPower();
241 void SetNormal();
242
247 void LockUnits( bool aLockUnits ) { m_unitsLocked = aLockUnits; }
248
253 bool UnitsLocked() const { return m_unitsLocked; }
254
264 void SetFields( const std::vector <LIB_FIELD>& aFieldsList );
265
271 void GetFields( std::vector<LIB_FIELD*>& aList );
272 void GetFields( std::vector<LIB_FIELD>& aList );
273
277 void AddField( LIB_FIELD* aField );
278
283 LIB_FIELD* FindField( const wxString& aFieldName );
284
285 const LIB_FIELD* FindField( const wxString& aFieldName ) const;
286
293 LIB_FIELD* GetFieldById( int aId ) const;
294
297
300
303
306
315
316 int GetNextAvailableFieldId() const;
317
327 void Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset, int aMulti, int aConvert,
328 const LIB_SYMBOL_OPTIONS& aOpts, bool aDimmed );
329
339 void PrintBackground( const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, int aMulti,
340 int aConvert, const LIB_SYMBOL_OPTIONS &aOpts, bool aDimmed );
341
355 void Plot( PLOTTER* aPlotter, int aUnit, int aConvert, bool aBackground,
356 const VECTOR2I& aOffset, const TRANSFORM& aTransform, bool aDimmed ) const;
357
370 void PlotLibFields( PLOTTER* aPlotter, int aUnit, int aConvert, bool aBackground,
371 const VECTOR2I& aOffset, const TRANSFORM& aTransform, bool aDimmed );
372
379 void AddDrawItem( LIB_ITEM* aItem, bool aSort = true );
380
386 void RemoveDrawItem( LIB_ITEM* aItem );
387
397 LIB_ITEM* GetNextDrawItem( const LIB_ITEM* aItem = nullptr, KICAD_T aType = TYPE_NOT_INIT );
398
399 size_t GetPinCount() const { return m_drawings.size( LIB_PIN_T ); }
400
401 size_t GetFieldCount() const { return m_drawings.size( LIB_FIELD_T ); }
402
412 LIB_PIN* GetNextPin( LIB_PIN* aItem = nullptr )
413 {
414 return (LIB_PIN*) GetNextDrawItem( (LIB_ITEM*) aItem, LIB_PIN_T );
415 }
416
430 void GetPins( LIB_PINS& aList, int aUnit = 0, int aConvert = 0 ) const;
431
442 LIB_PIN* GetPin( const wxString& aNumber, int aUnit = 0, int aConvert = 0 ) const;
443
456 bool PinsConflictWith( const LIB_SYMBOL& aOtherSymbol, bool aTestNums, bool aTestNames,
457 bool aTestType, bool aTestOrientation, bool aTestLength ) const;
458
464 void SetOffset( const VECTOR2I& aOffset );
465
470
476 bool HasConversion() const;
477
482 int GetMaxPinNumber() const;
483
487 void ClearTempFlags();
488 void ClearEditFlags();
489
499 LIB_ITEM* LocateDrawItem( int aUnit, int aConvert, KICAD_T aType, const VECTOR2I& aPoint );
500
511 LIB_ITEM* LocateDrawItem( int aUnit, int aConvert, KICAD_T aType, const VECTOR2I& aPoint,
512 const TRANSFORM& aTransform );
513
520 const LIB_ITEMS_CONTAINER& GetDrawItems() const { return m_drawings; }
521
522 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
523 const std::vector<KICAD_T>& aScanTypes ) override;
524
536 void SetUnitCount( int aCount, bool aDuplicateDrawItems = true );
537 int GetUnitCount() const override;
538
542 wxString GetUnitReference( int aUnit ) override;
543
547 bool HasUnitDisplayName( int aUnit ) override;
548
552 wxString GetUnitDisplayName( int aUnit ) override;
553
557 void CopyUnitDisplayNames( std::map<int, wxString>& aTarget ) const;
558
562 void SetUnitDisplayName( int aUnit, const wxString& aName );
563
568 bool IsMulti() const { return m_unitCount > 1; }
569
578 static wxString SubReference( int aUnit, bool aAddSeparator = true );
579
580 // Accessors to sub ref parameters
582
587 static int GetSubpartFirstId() { return m_subpartFirstId; }
588
592 static int* SubpartFirstIdPtr() { return &m_subpartFirstId; }
593
604 static void SetSubpartIdNotation( int aSep, int aFirstId );
605
618 void SetConversion( bool aSetConvert, bool aDuplicatePins = true );
619
627 void SetPinNameOffset( int aOffset ) { m_pinNameOffset = aOffset; }
628 int GetPinNameOffset() const { return m_pinNameOffset; }
629
635 void SetShowPinNames( bool aShow ) { m_showPinNames = aShow; }
636 bool ShowPinNames() const { return m_showPinNames; }
637
643 void SetShowPinNumbers( bool aShow ) { m_showPinNumbers = aShow; }
644 bool ShowPinNumbers() const { return m_showPinNumbers; }
645
651 void SetIncludeInBom( bool aIncludeInBom ) { m_includeInBom = aIncludeInBom; }
652 bool GetIncludeInBom() const { return m_includeInBom; }
653
659 void SetIncludeOnBoard( bool aIncludeOnBoard ) { m_includeOnBoard = aIncludeOnBoard; }
660 bool GetIncludeOnBoard() const { return m_includeOnBoard; }
661
671 int Compare( const LIB_SYMBOL& aRhs, int aCompareFlags = 0 ) const;
672
673 bool operator==( const LIB_SYMBOL* aSymbol ) const { return this == aSymbol; }
674 bool operator==( const LIB_SYMBOL& aSymbol ) const
675 {
676 return Compare( aSymbol, LIB_ITEM::COMPARE_FLAGS::EQUALITY ) == 0;
677 }
678
679 bool operator!=( const LIB_SYMBOL& aSymbol ) const
680 {
681 return Compare( aSymbol, LIB_ITEM::COMPARE_FLAGS::EQUALITY ) != 0;
682 }
683
684 const LIB_SYMBOL& operator=( const LIB_SYMBOL& aSymbol );
685
693 std::unique_ptr< LIB_SYMBOL > Flatten() const;
694
701 std::vector<struct LIB_SYMBOL_UNIT> GetUnitDrawItems();
702
711 std::vector<struct LIB_SYMBOL_UNIT> GetUniqueUnits();
712
723 std::vector<LIB_ITEM*> GetUnitDrawItems( int aUnit, int aConvert );
724
725#if defined(DEBUG)
726 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
727#endif
728
729private:
730 // We create a different set parent function for this class, so we hide the inherited one.
732
733 void deleteAllFields();
734
735private:
740
744
749
753
755
757 wxString m_name;
759 wxString m_keyWords;
760 wxArrayString m_fpFilters;
762
766 static int m_subpartFirstId;
769 std::map<int, wxString> m_unitDisplayNames;
770};
771
772#endif // CLASS_LIBENTRY_H
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
const KIID m_Uuid
Definition: eda_item.h:492
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:100
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:87
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Definition: kiid.h:48
Field object used in symbol libraries.
Definition: lib_field.h:60
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
The base class for drawable items used by schematic library symbols.
Definition: lib_item.h:61
Define a library symbol object.
Definition: lib_symbol.h:98
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:754
void SetIncludeOnBoard(bool aIncludeOnBoard)
Set or clear include in board netlist flag.
Definition: lib_symbol.h:659
void Plot(PLOTTER *aPlotter, int aUnit, int aConvert, bool aBackground, const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed) const
Plot lib symbol to plotter.
Definition: lib_symbol.cpp:707
void PrintBackground(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, int aMulti, int aConvert, const LIB_SYMBOL_OPTIONS &aOpts, bool aDimmed)
Print just the background fills of a symbol.
Definition: lib_symbol.cpp:622
bool operator!=(const LIB_SYMBOL &aSymbol) const
Definition: lib_symbol.h:679
void ClearTempFlags()
Clears the status flag all draw objects in this symbol.
static int GetSubpartIdSeparator()
Definition: lib_symbol.h:581
LIBRENTRYOPTIONS m_options
Special symbol features such as POWER or NORMAL.)
Definition: lib_symbol.h:752
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.
Definition: lib_symbol.cpp:790
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.
Definition: lib_symbol.cpp:901
void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
Definition: lib_symbol.h:635
bool IsMulti() const
Definition: lib_symbol.h:568
int GetPinNameOffset() const
Definition: lib_symbol.h:628
wxString GetKeyWords() const
Definition: lib_symbol.h:159
void SetConversion(bool aSetConvert, bool aDuplicatePins=true)
Set or clear the alternate body style (DeMorgan) for the symbol.
LIB_FIELD & GetReferenceField()
Return reference to the reference designator field.
void SetUnitCount(int aCount, bool aDuplicateDrawItems=true)
Set the units per symbol count.
static int m_subpartFirstId
the ASCII char value to calculate the subpart symbol id from the symbol number: only 'A',...
Definition: lib_symbol.h:766
bool UnitsLocked() const
Check whether symbol units are interchangeable.
Definition: lib_symbol.h:253
int GetNextAvailableFieldId() const
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
Definition: lib_symbol.h:182
bool operator==(const LIB_SYMBOL *aSymbol) const
Definition: lib_symbol.h:673
std::map< int, wxString > m_unitDisplayNames
Definition: lib_symbol.h:769
SYMBOL_LIB * m_library
Definition: lib_symbol.h:756
wxString GetFootprint() override
For items with footprint fields.
Definition: lib_symbol.h:172
LIB_ITEM * GetNextDrawItem(const LIB_ITEM *aItem=nullptr, KICAD_T aType=TYPE_NOT_INIT)
Return the next draw object pointer.
Definition: lib_symbol.cpp:827
wxString GetUnitDisplayName(int aUnit) override
Return the user-defined display name for aUnit for symbols with units.
Definition: lib_symbol.cpp:403
const wxString GetLibraryName() const
Definition: lib_symbol.cpp:543
LIB_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
Definition: lib_symbol.h:627
timestamp_t GetLastModDate() const
Definition: lib_symbol.h:190
bool IsAlias() const
Definition: lib_symbol.h:183
std::vector< struct LIB_SYMBOL_UNIT > GetUnitDrawItems()
Return a list of LIB_ITEM objects separated by unit and convert number.
int GetMaxPinNumber() const
virtual LIB_SYMBOL * Duplicate() const
Create a copy of a LIB_SYMBOL and assigns unique KIIDs to the copy and its children.
Definition: lib_symbol.h:113
LIB_SYMBOL(const wxString &aName, LIB_SYMBOL *aParent=nullptr, SYMBOL_LIB *aLibrary=nullptr)
Definition: lib_symbol.cpp:100
LIB_SYMBOL_SPTR m_me
Definition: lib_symbol.h:736
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: lib_symbol.cpp:995
bool IsPower() const
Definition: lib_symbol.cpp:552
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: lib_symbol.h:232
bool GetIncludeOnBoard() const
Definition: lib_symbol.h:660
wxString m_name
Definition: lib_symbol.h:757
bool operator==(const LIB_SYMBOL &aSymbol) const
Definition: lib_symbol.h:674
void SetPower()
Definition: lib_symbol.cpp:561
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:759
bool m_includeInBom
Definition: lib_symbol.h:750
LIB_FIELD & GetFootprintField()
Return reference to the footprint field.
bool ShowPinNames() const
Definition: lib_symbol.h:636
void RemoveDuplicateDrawItems()
Remove duplicate draw items from list.
void LockUnits(bool aLockUnits)
Set interchangeable the property for symbol units.
Definition: lib_symbol.h:247
void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
Definition: lib_symbol.h:643
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
Definition: lib_symbol.h:519
LIB_ID GetLibId() const override
Definition: lib_symbol.h:139
void SetParent(LIB_SYMBOL *aParent=nullptr)
Definition: lib_symbol.cpp:451
wxString GetName() const override
Definition: lib_symbol.h:136
void SetDescription(const wxString &aDescription)
Definition: lib_symbol.h:144
static int m_subpartIdSeparator
the separator char between the subpart id and the reference like U1A ( m_subpartIdSeparator = 0 ) or ...
Definition: lib_symbol.h:763
const LIB_SYMBOL_REF & GetParent() const
Definition: lib_symbol.h:126
void ClearEditFlags()
int m_pinNameOffset
The offset in mils to draw the pin name.
Definition: lib_symbol.h:745
void SetKeyWords(const wxString &aKeyWords)
Definition: lib_symbol.h:157
bool m_showPinNumbers
Definition: lib_symbol.h:748
void GetFields(std::vector< LIB_FIELD * > &aList)
Return a list of fields within this symbol.
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
Definition: lib_symbol.cpp:816
LIB_FIELD * FindField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName and returns it or NULL if not found.
wxArrayString GetFPFilters() const
Definition: lib_symbol.h:194
void GetChooserFields(std::map< wxString, wxString > &aColumnMap) override
Retrieves a key/value map of the fields on this item that should be exposed to the library browser/ch...
Definition: lib_symbol.cpp:73
LIB_PIN * GetNextPin(LIB_PIN *aItem=nullptr)
Return the next pin object from the draw list.
Definition: lib_symbol.h:412
static wxString SubReference(int aUnit, bool aAddSeparator=true)
Definition: lib_symbol.cpp:588
virtual ~LIB_SYMBOL()
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
Definition: lib_symbol.cpp:183
timestamp_t m_lastModDate
Definition: lib_symbol.h:739
bool m_includeOnBoard
Definition: lib_symbol.h:751
LIB_ID m_libId
Definition: lib_symbol.h:738
void SetLib(SYMBOL_LIB *aLibrary)
Definition: lib_symbol.h:188
static int GetSubpartFirstId()
Definition: lib_symbol.h:587
wxString m_description
Definition: lib_symbol.h:758
std::vector< struct LIB_SYMBOL_UNIT > GetUniqueUnits()
Return a list of unit numbers that are unique to this symbol.
wxString GetLibNickname() const override
Definition: lib_symbol.h:142
const BOX2I GetBodyBoundingBox(int aUnit, int aConvert, bool aIncludePins, bool aIncludePrivateItems) const
Get the symbol bounding box excluding fields.
static void SetSubpartIdNotation(int aSep, int aFirstId)
Set the separator char between the subpart id and the reference 0 (no separator) or '.
const LIB_SYMBOL & operator=(const LIB_SYMBOL &aSymbol)
Definition: lib_symbol.cpp:188
LIB_FIELD & GetValueField()
Return reference to the value field.
bool m_unitsLocked
True if symbol has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:742
wxArrayString m_fpFilters
List of suitable footprint names for the symbol (wild card names accepted).
Definition: lib_symbol.h:760
void SetFPFilters(const wxArrayString &aFilters)
Definition: lib_symbol.h:192
bool HasUnitDisplayName(int aUnit) override
Return true if the given unit aUnit has a display name defined.
Definition: lib_symbol.cpp:397
bool IsNormal() const
Definition: lib_symbol.cpp:570
size_t GetFieldCount() const
Definition: lib_symbol.h:401
LIB_SYMBOL_SPTR SharedPtr() const
Definition: lib_symbol.h:108
size_t GetPinCount() const
Definition: lib_symbol.h:399
LIB_ITEM * LocateDrawItem(int aUnit, int aConvert, KICAD_T aType, const VECTOR2I &aPoint)
Locate a draw object.
bool GetIncludeInBom() const
Definition: lib_symbol.h:652
int UpdateFieldOrdinals()
Order optional field indices.
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
Definition: lib_symbol.cpp:391
static int * SubpartIdSeparatorPtr()
Return a reference to m_subpartIdSeparator, only for read/save setting functions.
Definition: lib_symbol.h:586
wxString GetDescription() override
Definition: lib_symbol.h:146
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:741
virtual wxString GetClass() const override
Return the class name.
Definition: lib_symbol.h:130
void ClearCaches()
Definition: lib_symbol.cpp:530
int GetUnitCount() const override
For items with units, return the number of units.
void AddField(LIB_FIELD *aField)
Add a field.
LIB_SYMBOL_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:737
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0) const
Return a list of pin object pointers from the draw item list.
Definition: lib_symbol.cpp:856
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Definition: lib_symbol.cpp:460
LIB_ID & LibId()
Definition: lib_symbol.h:138
int Compare(const LIB_SYMBOL &aRhs, int aCompareFlags=0) const
Comparison test that can be used for operators.
Definition: lib_symbol.cpp:237
SYMBOL_LIB * GetLib() const
Definition: lib_symbol.h:187
LIB_FIELD & GetDatasheetField()
Return reference to the datasheet field.
void SetIncludeInBom(bool aIncludeInBom)
Set or clear the include in schematic bill of materials flag.
Definition: lib_symbol.h:651
void SetLibId(const LIB_ID &aLibId)
Definition: lib_symbol.h:140
const BOX2I GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
Definition: lib_symbol.cpp:968
void deleteAllFields()
bool HasConversion() const
Test if symbol has more than one body conversion type (DeMorgan).
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, int aMulti, int aConvert, const LIB_SYMBOL_OPTIONS &aOpts, bool aDimmed)
Print symbol.
Definition: lib_symbol.cpp:656
LIB_SYMBOL_REF & GetParent()
Definition: lib_symbol.h:125
void PlotLibFields(PLOTTER *aPlotter, int aUnit, int aConvert, bool aBackground, const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed)
Plot Lib Fields only of the symbol to plotter.
Definition: lib_symbol.cpp:745
LIB_PIN * GetPin(const wxString &aNumber, int aUnit=0, int aConvert=0) const
Return pin object with the requested pin aNumber.
Definition: lib_symbol.cpp:883
void SetFields(const std::vector< LIB_FIELD > &aFieldsList)
Overwrite all the existing fields in this symbol with fields supplied in aFieldsList.
void SetUnitDisplayName(int aUnit, const wxString &aName)
Set the user-defined display name for aUnit to aName for symbols with units.
Definition: lib_symbol.cpp:425
void SetOffset(const VECTOR2I &aOffset)
Move the symbol aOffset.
wxString GetSearchText() override
Definition: lib_symbol.cpp:48
virtual void SetName(const wxString &aName)
Definition: lib_symbol.cpp:441
bool m_showPinNames
Definition: lib_symbol.h:747
void SetNormal()
Definition: lib_symbol.cpp:579
void CopyUnitDisplayNames(std::map< int, wxString > &aTarget) const
Copy all unit display names into the given map aTarget.
Definition: lib_symbol.cpp:416
bool ShowPinNumbers() const
Definition: lib_symbol.h:644
static int * SubpartFirstIdPtr()
Return a reference to m_subpartFirstId, only for read/save setting functions.
Definition: lib_symbol.h:592
const LIB_ITEMS_CONTAINER & GetDrawItems() const
Definition: lib_symbol.h:520
A mix-in to provide polymorphism between items stored in libraries (symbols, aliases and footprints).
Definition: lib_tree_item.h:40
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:81
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:225
boost::ptr_vector< LIB_ITEM > ITEM_PTR_VECTOR
Helper for defining a list of library draw object pointers.
Definition: multivector.h:64
An interface used to output 8 bit text in a convenient way.
Definition: richio.h:310
Base plotter engine class.
Definition: plotter.h:110
Object used to load, save, search, and otherwise manipulate symbol library files.
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:47
INSPECT_RESULT
Definition: eda_item.h:42
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:78
TRANSFORM DefaultTransform
Definition: eeschema.cpp:68
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
Definition: kiid.h:45
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:54
MULTIVECTOR< LIB_ITEM, LIB_SHAPE_T, LIB_FIELD_T > LIB_ITEMS_CONTAINER
Definition: lib_symbol.h:46
LIBRENTRYOPTIONS
Definition: lib_symbol.h:52
@ ENTRY_NORMAL
Definition: lib_symbol.h:53
@ ENTRY_POWER
Definition: lib_symbol.h:54
std::weak_ptr< LIB_SYMBOL > LIB_SYMBOL_REF
weak pointer to LIB_SYMBOL
Definition: lib_symbol.h:45
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
Definition: lib_symbol.h:44
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
Definition: lib_symbol.h:47
bool operator<(const LIB_SYMBOL &aItem1, const LIB_SYMBOL &aItem2)
Definition: lib_symbol.cpp:85
bool draw_visible_fields
Definition: lib_symbol.h:65
bool force_draw_pin_text
Definition: lib_symbol.h:64
TRANSFORM transform
Definition: lib_symbol.h:63
std::vector< LIB_ITEM * > m_items
The items unique to this unit and alternate body style.
Definition: lib_symbol.h:87
int m_convert
The alternate body style of the unit.
Definition: lib_symbol.h:86
int m_unit
The unit number.
Definition: lib_symbol.h:85
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ TYPE_NOT_INIT
Definition: typeinfo.h:81
@ LIB_PIN_T
Definition: typeinfo.h:203
@ LIB_FIELD_T
Definition: typeinfo.h:209