KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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) 2022 CERN
7 * Copyright (C) 2004-2024 KiCad Developers, see change_log.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef LIB_SYMBOL_H
28#define LIB_SYMBOL_H
29
30#include <embedded_files.h>
31#include <symbol.h>
32#include <sch_field.h>
33#include <sch_pin.h>
34#include <lib_tree_item.h>
35#include <vector>
36#include <core/multivector.h>
37
38class LINE_READER;
39class OUTPUTFORMATTER;
40class REPORTER;
41class SYMBOL_LIB;
42class LIB_SYMBOL;
44
45
46typedef std::shared_ptr<LIB_SYMBOL> LIB_SYMBOL_SPTR;
47typedef std::weak_ptr<LIB_SYMBOL> LIB_SYMBOL_REF;
50
51
52/* values for member .m_options */
54{
55 ENTRY_NORMAL, // Libentry is a standard symbol (real or alias)
56 ENTRY_POWER // Libentry is a power symbol
57};
58
59
60extern bool operator<( const LIB_SYMBOL& aItem1, const LIB_SYMBOL& aItem2 );
61
62
64{
65 int m_unit;
67 std::vector<SCH_ITEM*> m_items;
68};
69
70
77class LIB_SYMBOL : public SYMBOL, public LIB_TREE_ITEM, public EMBEDDED_FILES
78{
79public:
80 LIB_SYMBOL( const wxString& aName, LIB_SYMBOL* aParent = nullptr,
81 SYMBOL_LIB* aLibrary = nullptr );
82
83 LIB_SYMBOL( const LIB_SYMBOL& aSymbol, SYMBOL_LIB* aLibrary = nullptr );
84
85 virtual ~LIB_SYMBOL()
86 {}
87
89 LIB_SYMBOL_SPTR SharedPtr() const { return m_me; }
90
94 virtual LIB_SYMBOL* Duplicate() const
95 {
96 LIB_SYMBOL* dupe = new LIB_SYMBOL( *this, m_library );
97 const_cast<KIID&>( dupe->m_Uuid ) = KIID();
98
99 for( SCH_ITEM& item : dupe->m_drawings )
100 const_cast<KIID&>( item.m_Uuid ) = KIID();
101
102 return dupe;
103 }
104
105 void SetParent( LIB_SYMBOL* aParent = nullptr );
107 const LIB_SYMBOL_REF& GetParent() const { return m_parent; }
108
114 unsigned GetInheritanceDepth() const;
115
125
126 virtual wxString GetClass() const override
127 {
128 return wxT( "LIB_SYMBOL" );
129 }
130
131 static inline bool ClassOf( const EDA_ITEM* aItem )
132 {
133 return aItem && aItem->Type() == LIB_SYMBOL_T;
134 }
135
136 virtual void SetName( const wxString& aName );
137 wxString GetName() const override { return m_name; }
138
139 LIB_ID GetLIB_ID() const override { return m_libId; }
140 wxString GetDesc() override { return GetDescription(); }
141 int GetSubUnitCount() const override { return GetUnitCount(); }
142
143 const LIB_ID& GetLibId() const override { return m_libId; }
144 void SetLibId( const LIB_ID& aLibId ) { m_libId = aLibId; }
145
147 void SetSourceLibId( const LIB_ID& aLibId ) { m_sourceLibId = aLibId; }
148
149 wxString GetLibNickname() const override { return GetLibraryName(); }
150
152 void SetDescription( const wxString& aDescription )
153 {
154 GetDescriptionField().SetText( aDescription );
155 }
156
158 wxString GetDescription() const override
159 {
160 if( GetDescriptionField().GetText().IsEmpty() && IsAlias() )
161 {
162 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
163 return parent->GetDescription();
164 }
165
166 return GetDescriptionField().GetText();
167 }
168
169 void SetKeyWords( const wxString& aKeyWords ) { m_keyWords = aKeyWords; }
170
171 wxString GetKeyWords() const override
172 {
173 if( m_keyWords.IsEmpty() && IsAlias() )
174 {
175 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
176 return parent->GetKeyWords();
177 }
178
179 return m_keyWords;
180 }
181
182 std::vector<SEARCH_TERM> GetSearchTerms() override;
183
184 wxString GetFootprint() override
185 {
186 return GetFootprintField().GetText();
187 }
188
189 void GetChooserFields( std::map<wxString , wxString>& aColumnMap ) override;
190
194 bool IsRoot() const override { return m_parent.use_count() == 0; }
195 bool IsAlias() const { return !m_parent.expired() && m_parent.use_count() > 0; }
196
197 const wxString GetLibraryName() const;
198
199 SYMBOL_LIB* GetLib() const { return m_library; }
200 void SetLib( SYMBOL_LIB* aLibrary ) { m_library = aLibrary; }
201
203
204 void SetFPFilters( const wxArrayString& aFilters ) { m_fpFilters = aFilters; }
205
206 wxArrayString GetFPFilters() const
207 {
208 if( m_fpFilters.IsEmpty() && IsAlias() )
209 {
210 if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
211 return parent->GetFPFilters();
212 }
213
214 return m_fpFilters;
215 }
216
227 const BOX2I GetUnitBoundingBox( int aUnit, int aBodyStyle,
228 bool aIgnoreHiddenFields = true ) const;
229
240 const BOX2I GetBodyBoundingBox( int aUnit, int aBodyStyle, bool aIncludePins,
241 bool aIncludePrivateItems ) const;
242
243 const BOX2I GetBoundingBox() const override
244 {
245 return GetUnitBoundingBox( 0, 0 );
246 }
247
248 bool IsPower() const override;
249 bool IsNormal() const override;
250
251 void SetPower();
252 void SetNormal();
253
258 void LockUnits( bool aLockUnits ) { m_unitsLocked = aLockUnits; }
259
264 bool UnitsLocked() const { return m_unitsLocked; }
265
271 void SetFields( const std::vector<SCH_FIELD>& aFieldsList );
272
278 void GetFields( std::vector<SCH_FIELD*>& aList );
279 void GetFields( std::vector<SCH_FIELD>& aList );
280
284 void AddField( SCH_FIELD* aField );
285
286 void AddField( SCH_FIELD& aField ) { AddField( new SCH_FIELD( aField ) ); }
287
296 SCH_FIELD* FindField( const wxString& aFieldName, bool aCaseInsensitive = false );
297
298 const SCH_FIELD* FindField( const wxString& aFieldName,
299 bool aCaseInsensitive = false ) const;
300
307 SCH_FIELD* GetFieldById( int aId ) const;
308
310 SCH_FIELD& GetValueField() const;
311
314
317
320
323
324 wxString GetPrefix();
325
326 const wxString GetRef( const SCH_SHEET_PATH* aSheet, bool aIncludeUnit = false ) const override
327 {
328 return GetReferenceField().GetText();
329 }
330
331 const wxString GetValue( bool aResolve, const SCH_SHEET_PATH* aPath,
332 bool aAllowExtraText ) const override
333 {
334 return GetValueField().GetText();
335 }
336
338 const EMBEDDED_FILES* GetEmbeddedFiles() const;
339
340 void EmbedFonts() override;
341
342 void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
343
352
353 int GetNextAvailableFieldId() const;
354
360 bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
361
362 void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
363 const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
364
365 void PrintBackground( const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle,
366 const VECTOR2I& aOffset, bool aDimmed ) override;
367
368 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
369 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
370
374 void PlotFields( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
375 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed );
376
383 void AddDrawItem( SCH_ITEM* aItem, bool aSort = true );
384
390 void RemoveDrawItem( SCH_ITEM* aItem );
391
392 void RemoveField( SCH_FIELD* aField ) { RemoveDrawItem( aField ); }
393
394 size_t GetFieldCount() const { return m_drawings.size( SCH_FIELD_T ); }
395
406 std::vector<SCH_PIN*> GetPins( int aUnit = 0, int aBodyStyle = 0 ) const;
407
412 std::vector<SCH_PIN*> GetAllLibPins() const;
413
417 int GetPinCount() override;
418
428 SCH_PIN* GetPin( const wxString& aNumber, int aUnit = 0, int aBodyStyle = 0 ) const;
429
441 bool PinsConflictWith( const LIB_SYMBOL& aOtherSymbol, bool aTestNums, bool aTestNames,
442 bool aTestType, bool aTestOrientation, bool aTestLength ) const;
443
449 void Move( const VECTOR2I& aOffset ) override;
450
456 bool HasAlternateBodyStyle() const override;
457
462 int GetMaxPinNumber() const;
463
467 void ClearTempFlags() override;
468 void ClearEditFlags() override;
469
479 SCH_ITEM* LocateDrawItem( int aUnit, int aBodyStyle, KICAD_T aType, const VECTOR2I& aPoint );
480
491 SCH_ITEM* LocateDrawItem( int aUnit, int aBodyStyle, KICAD_T aType, const VECTOR2I& aPoint,
492 const TRANSFORM& aTransform );
493
500 const LIB_ITEMS_CONTAINER& GetDrawItems() const { return m_drawings; }
501
506 void FixupDrawItems();
507
508 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
509 const std::vector<KICAD_T>& aScanTypes ) override;
510
522 void SetUnitCount( int aCount, bool aDuplicateDrawItems = true );
523 int GetUnitCount() const override;
524
528 wxString GetUnitReference( int aUnit ) override;
529
533 bool HasUnitDisplayName( int aUnit ) override;
534
538 wxString GetUnitDisplayName( int aUnit ) override;
539
543 void CopyUnitDisplayNames( std::map<int, wxString>& aTarget ) const;
544
548 void SetUnitDisplayName( int aUnit, const wxString& aName );
549
554 bool IsMulti() const override { return m_unitCount > 1; }
555
556 static wxString LetterSubReference( int aUnit, int aFirstId );
557
569 void SetHasAlternateBodyStyle( bool aHasAlternate, bool aDuplicatePins = true );
570
580 int Compare( const LIB_SYMBOL& aRhs, int aCompareFlags = 0,
581 REPORTER* aReporter = nullptr ) const;
582
583 const LIB_SYMBOL& operator=( const LIB_SYMBOL& aSymbol );
584
592 std::unique_ptr< LIB_SYMBOL > Flatten() const;
593
600 std::vector<struct LIB_SYMBOL_UNIT> GetUnitDrawItems();
601
612 std::vector<SCH_ITEM*> GetUnitDrawItems( int aUnit, int aBodyStyle );
613
620 double Similarity( const SCH_ITEM& aSymbol ) const override;
621#if defined(DEBUG)
622 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
623#endif
624
625private:
626 // We create a different set parent function for this class, so we hide the inherited one.
628
634 int compare( const SCH_ITEM& aOther,
635 int aCompareFlags = SCH_ITEM::COMPARE_FLAGS::EQUALITY ) const override;
636
637 void deleteAllFields();
638
639private:
645
649
651
653
655 wxString m_name;
656 wxString m_keyWords;
657 wxArrayString m_fpFilters;
659
660 std::map<int, wxString> m_unitDisplayNames;
661};
662
663#endif // CLASS_LIBENTRY_H
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
const KIID m_Uuid
Definition: eda_item.h:489
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:104
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:98
bool IsEmpty() const
Definition: kiid.h:49
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
Define a library symbol object.
Definition: lib_symbol.h:78
LIB_ITEMS_CONTAINER m_drawings
Definition: lib_symbol.h:652
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the symbol.
Definition: lib_symbol.cpp:466
wxString GetDescription() const override
Definition: lib_symbol.h:158
const LIB_ID & GetLibId() const override
Definition: lib_symbol.h:143
wxString GetKeyWords() const override
Definition: lib_symbol.h:171
bool IsMulti() const override
Definition: lib_symbol.h:554
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
LIBRENTRYOPTIONS m_options
Special symbol features such as POWER or NORMAL.)
Definition: lib_symbol.h:650
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
Definition: lib_symbol.cpp:567
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:878
bool IsPower() const override
Definition: lib_symbol.cpp:389
wxString GetPrefix()
void SetSourceLibId(const LIB_ID &aLibId)
Definition: lib_symbol.h:147
void SetUnitCount(int aCount, bool aDuplicateDrawItems=true)
Set the units per symbol count.
std::vector< SCH_PIN * > GetPins(int aUnit=0, int aBodyStyle=0) const
Return a list of pin object pointers from the draw item list.
Definition: lib_symbol.cpp:822
bool UnitsLocked() const
Check whether symbol units are interchangeable.
Definition: lib_symbol.h:264
const BOX2I GetUnitBoundingBox(int aUnit, int aBodyStyle, bool aIgnoreHiddenFields=true) const
Get the bounding box for the symbol.
Definition: lib_symbol.cpp:943
int GetNextAvailableFieldId() const
void GetFields(std::vector< SCH_FIELD * > &aList)
Return a list of fields within this symbol.
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
Definition: lib_symbol.h:194
std::vector< struct LIB_SYMBOL_UNIT > GetUnitDrawItems()
Return a list of SCH_ITEM objects separated by unit and convert number.
void RemoveField(SCH_FIELD *aField)
Definition: lib_symbol.h:392
std::map< int, wxString > m_unitDisplayNames
Definition: lib_symbol.h:660
void ClearTempFlags() override
Clears the status flag all draw objects in this symbol.
SYMBOL_LIB * m_library
Definition: lib_symbol.h:654
wxString GetFootprint() override
For items with footprint fields.
Definition: lib_symbol.h:184
wxString GetUnitDisplayName(int aUnit) override
Return the user-defined display name for aUnit for symbols with units.
Definition: lib_symbol.cpp:260
const wxString GetLibraryName() const
Definition: lib_symbol.cpp:380
void SetFields(const std::vector< SCH_FIELD > &aFieldsList)
Overwrite all the existing fields in this symbol with fields supplied in aFieldsList.
SCH_FIELD & GetValueField() const
Return reference to the value field.
std::vector< SEARCH_TERM > GetSearchTerms() override
Definition: lib_symbol.cpp:40
timestamp_t GetLastModDate() const
Definition: lib_symbol.h:202
LIB_ID GetSourceLibId() const
Definition: lib_symbol.h:146
bool IsAlias() const
Definition: lib_symbol.h:195
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:94
LIB_SYMBOL_SPTR m_me
Definition: lib_symbol.h:640
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
Definition: lib_symbol.cpp:660
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: lib_symbol.h:243
int Compare(const LIB_SYMBOL &aRhs, int aCompareFlags=0, REPORTER *aReporter=nullptr) const
Comparison test that can be used for operators.
void FixupDrawItems()
This function finds the filled draw items that are covering up smaller draw items and replaces their ...
Definition: lib_symbol.cpp:741
static wxString LetterSubReference(int aUnit, int aFirstId)
Definition: lib_symbol.cpp:447
SCH_PIN * GetPin(const wxString &aNumber, int aUnit=0, int aBodyStyle=0) const
Return pin object with the requested pin aNumber.
Definition: lib_symbol.cpp:866
bool IsNormal() const override
Definition: lib_symbol.cpp:419
wxString m_name
Definition: lib_symbol.h:655
std::vector< SCH_PIN * > GetAllLibPins() const
Return a list of pin pointers for all units / converts.
Definition: lib_symbol.cpp:854
void SetPower()
Definition: lib_symbol.cpp:405
bool HasAlternateBodyStyle() const override
Test if symbol has more than one body conversion type (DeMorgan).
static bool ClassOf(const EDA_ITEM *aItem)
Definition: lib_symbol.h:131
SCH_FIELD * GetFieldById(int aId) const
Return pointer to the requested field.
wxString m_keyWords
Search keywords.
Definition: lib_symbol.h:656
SCH_ITEM * LocateDrawItem(int aUnit, int aBodyStyle, KICAD_T aType, const VECTOR2I &aPoint)
Locate a draw object.
double Similarity(const SCH_ITEM &aSymbol) const override
Return a measure of similarity between this symbol and aSymbol.
void PlotFields(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed)
Plot symbol fields.
Definition: lib_symbol.cpp:702
SCH_FIELD & GetDatasheetField() const
Return reference to the datasheet field.
void LockUnits(bool aLockUnits)
Set interchangeable the property for symbol units.
Definition: lib_symbol.h:258
SCH_FIELD & GetFootprintField() const
Return reference to the footprint field.
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
Definition: lib_symbol.h:499
void SetParent(LIB_SYMBOL *aParent=nullptr)
Definition: lib_symbol.cpp:295
wxString GetName() const override
Definition: lib_symbol.h:137
void SetDescription(const wxString &aDescription)
Gets the Description field text value *‍/.
Definition: lib_symbol.h:152
const LIB_SYMBOL_REF & GetParent() const
Definition: lib_symbol.h:107
void SetKeyWords(const wxString &aKeyWords)
Definition: lib_symbol.h:169
SCH_FIELD & GetReferenceField() const
Return reference to the reference designator field.
void PrintBackground(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Print just the background fills.
Definition: lib_symbol.cpp:626
wxArrayString GetFPFilters() const
Definition: lib_symbol.h:206
void RemoveDrawItem(SCH_ITEM *aItem)
Remove draw aItem from list.
Definition: lib_symbol.cpp:783
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:71
int compare(const SCH_ITEM &aOther, int aCompareFlags=SCH_ITEM::COMPARE_FLAGS::EQUALITY) const override
The library symbol specific sort order is as follows:
timestamp_t m_lastModDate
Definition: lib_symbol.h:644
LIB_ID m_libId
Definition: lib_symbol.h:642
void SetLib(SYMBOL_LIB *aLibrary)
Definition: lib_symbol.h:200
SCH_FIELD & GetDescriptionField() const
Return reference to the description field.
int GetSubUnitCount() const override
For items with units, return the number of units.
Definition: lib_symbol.h:141
wxString GetLibNickname() const override
Sets the Description field text value.
Definition: lib_symbol.h:149
virtual ~LIB_SYMBOL()
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
Definition: lib_symbol.h:85
const LIB_SYMBOL & operator=(const LIB_SYMBOL &aSymbol)
Definition: lib_symbol.cpp:179
bool m_unitsLocked
True if symbol has multiple units and changing one unit does not automatically change another unit.
Definition: lib_symbol.h:647
wxArrayString m_fpFilters
List of suitable footprint names for the symbol (wild card names accepted).
Definition: lib_symbol.h:657
void Move(const VECTOR2I &aOffset) override
Move the symbol aOffset.
void SetFPFilters(const wxArrayString &aFilters)
Definition: lib_symbol.h:204
bool HasUnitDisplayName(int aUnit) override
Return true if the given unit aUnit has a display name defined.
Definition: lib_symbol.cpp:254
size_t GetFieldCount() const
Definition: lib_symbol.h:394
const BOX2I GetBodyBoundingBox(int aUnit, int aBodyStyle, bool aIncludePins, bool aIncludePrivateItems) const
Get the symbol bounding box excluding fields.
Definition: lib_symbol.cpp:969
LIB_SYMBOL_SPTR SharedPtr() const
Definition: lib_symbol.h:89
const wxString GetValue(bool aResolve, const SCH_SHEET_PATH *aPath, bool aAllowExtraText) const override
Definition: lib_symbol.h:331
wxString GetDesc() override
Definition: lib_symbol.h:140
SCH_FIELD * FindField(const wxString &aFieldName, bool aCaseInsensitive=false)
Find a field within this symbol matching aFieldName and returns it or NULL if not found.
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...
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
Definition: lib_symbol.h:326
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
Definition: lib_symbol.cpp:248
EMBEDDED_FILES * GetEmbeddedFiles() override
void AddField(SCH_FIELD &aField)
Definition: lib_symbol.h:286
int m_unitCount
Number of units (parts) per package.
Definition: lib_symbol.h:646
void SetHasAlternateBodyStyle(bool aHasAlternate, bool aDuplicatePins=true)
Set or clear the alternate body style (DeMorgan) for the symbol.
virtual wxString GetClass() const override
Return the class name.
Definition: lib_symbol.h:126
LIB_ID m_sourceLibId
For database library symbols; the original symbol.
Definition: lib_symbol.h:643
unsigned GetInheritanceDepth() const
Get the number of parents for this symbol.
Definition: lib_symbol.cpp:222
int GetUnitCount() const override
LIB_SYMBOL_REF m_parent
Use for inherited symbols.
Definition: lib_symbol.h:641
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Definition: lib_symbol.cpp:304
SYMBOL_LIB * GetLib() const
Definition: lib_symbol.h:199
int GetPinCount() override
Definition: lib_symbol.cpp:860
void SetLibId(const LIB_ID &aLibId)
Definition: lib_symbol.h:144
void AddField(SCH_FIELD *aField)
Add a field.
void ClearEditFlags() override
void deleteAllFields()
LIB_ID GetLIB_ID() const override
Definition: lib_symbol.h:139
LIB_SYMBOL_REF & GetParent()
Definition: lib_symbol.h:106
LIB_SYMBOL_SPTR GetRootSymbol() const
Get the parent symbol that does not have another parent.
Definition: lib_symbol.cpp:236
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:276
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
Definition: lib_symbol.cpp:808
void EmbedFonts() override
virtual void SetName(const wxString &aName)
Definition: lib_symbol.cpp:288
void SetNormal()
Definition: lib_symbol.cpp:433
void CopyUnitDisplayNames(std::map< int, wxString > &aTarget) const
Copy all unit display names into the given map aTarget.
Definition: lib_symbol.cpp:269
const LIB_ITEMS_CONTAINER & GetDrawItems() const
Definition: lib_symbol.h:500
A mix-in to provide polymorphism between items stored in libraries (symbols, aliases and footprints).
Definition: lib_tree_item.h:41
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:93
Multivector container type.
Definition: multivector.h:47
size_t size(int aType=UNDEFINED_TYPE) const
Definition: multivector.h:226
boost::ptr_vector< SCH_ITEM > ITEM_PTR_VECTOR
Helper for defining a list of library draw object pointers.
Definition: multivector.h:65
An interface used to output 8 bit text in a convenient way.
Definition: richio.h:322
Base plotter engine class.
Definition: plotter.h:105
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:72
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:51
void SetText(const wxString &aText) override
Definition: sch_field.cpp:1213
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:166
@ EQUALITY
Definition: sch_item.h:660
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Object used to load, save, search, and otherwise manipulate symbol library files.
A base class for LIB_SYMBOL and SCH_SYMBOL.
Definition: symbol.h:34
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:46
INSPECT_RESULT
Definition: eda_item.h:43
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:82
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:46
LIBRENTRYOPTIONS
Definition: lib_symbol.h:54
@ ENTRY_NORMAL
Definition: lib_symbol.h:55
@ ENTRY_POWER
Definition: lib_symbol.h:56
std::weak_ptr< LIB_SYMBOL > LIB_SYMBOL_REF
weak pointer to LIB_SYMBOL
Definition: lib_symbol.h:47
MULTIVECTOR< SCH_ITEM, SCH_SHAPE_T, SCH_PIN_T > LIB_ITEMS_CONTAINER
Definition: lib_symbol.h:48
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
Definition: lib_symbol.h:46
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
Definition: lib_symbol.h:49
bool operator<(const LIB_SYMBOL &aItem1, const LIB_SYMBOL &aItem2)
Definition: lib_symbol.cpp:83
int m_bodyStyle
The alternate body style of the unit.
Definition: lib_symbol.h:66
std::vector< SCH_ITEM * > m_items
The items unique to this unit and alternate body style.
Definition: lib_symbol.h:67
int m_unit
The unit number.
Definition: lib_symbol.h:65
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ LIB_SYMBOL_T
Definition: typeinfo.h:148
@ SCH_FIELD_T
Definition: typeinfo.h:150