139 return wxT(
"LIB_SYMBOL" );
147 virtual void SetName(
const wxString& aName );
174 return parent->GetDescription();
187 return parent->GetKeyWords();
200 void GetChooserFields( std::map<wxString , wxString>& aColumnMap )
override;
222 return parent->GetFPFilters();
241 bool aIgnoreHiddenFields =
true,
242 bool aIgnoreLabelsOnInvisiblePins =
true )
const;
260 bool aIncludePrivateItems )
const;
298 void SetFields(
const std::vector<SCH_FIELD>& aFieldsList );
305 void GetFields( std::vector<SCH_FIELD*>& aList,
bool aVisibleOnly =
false )
const override;
310 void CopyFields( std::vector<SCH_FIELD>& aList );
363 bool aAllowExtraText )
const override
368 std::set<KIFONT::OUTLINE_FONT*>
GetFonts()
const override;
393 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
override;
399 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed );
426 std::vector<SCH_PIN*>
GetGraphicalPins(
int aUnit = 0,
int aBodyStyle = 0 )
const;
442 std::vector<LOGICAL_PIN>
GetLogicalPins(
int aUnit,
int aBodyStyle )
const;
456 std::vector<SCH_PIN*>
GetPins()
const override;
471 SCH_PIN*
GetPin(
const wxString& aNumber,
int aUnit = 0,
int aBodyStyle = 0 )
const;
485 bool aTestType,
bool aTestOrientation,
bool aTestLength )
const;
553 const std::vector<KICAD_T>& aScanTypes )
override;
566 void SetUnitCount(
int aCount,
bool aDuplicateDrawItems );
595 std::optional<const std::set<wxString>>
GetJumperPinGroup(
const wxString& aPinNumber )
const;
632 void SetBodyStyleCount(
int aCount,
bool aDuplicateDrawItems,
bool aDuplicatePins );
644 REPORTER* aReporter =
nullptr )
const;
655 std::unique_ptr< LIB_SYMBOL >
Flatten()
const;
685 void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
virtual const wxString & GetText() const
Return the string associated with the text object.
Class OUTLINE_FONT implements outline font drawing.
A logical library item identifier and consists of various portions much like a URI.
Define a library symbol object.
LIB_ITEMS_CONTAINER m_drawings
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the symbol.
SCH_FIELD & GetDescriptionField()
Return reference to the description field.
wxString GetDescription() const override
const LIB_ID & GetLibId() const override
const BOX2I GetUnitBoundingBox(int aUnit, int aBodyStyle, bool aIgnoreHiddenFields=true, bool aIgnoreLabelsOnInvisiblePins=true) const
Get the bounding box for the symbol.
wxString GetKeyWords() const override
virtual ~LIB_SYMBOL()=default
LIBRENTRYOPTIONS m_options
Special symbol features such as POWER or NORMAL.
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.
const std::map< int, wxString > & GetUnitDisplayNames() const
void GetFields(std::vector< SCH_FIELD * > &aList, bool aVisibleOnly=false) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
bool IsPower() const override
void SetSourceLibId(const LIB_ID &aLibId)
bool UnitsLocked() const
Check whether symbol units are interchangeable.
SCH_FIELD & GetDatasheetField()
Return reference to the datasheet field.
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
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)
std::map< int, wxString > m_unitDisplayNames
std::vector< std::set< wxString > > m_jumperPinGroups
A list of jumper pin groups, each of which is a set of pin numbers that should be jumpered together (...
void ClearTempFlags() override
Clears the status flag all draw objects in this symbol.
std::map< int, wxString > & GetUnitDisplayNames()
void SetDuplicatePinNumbersAreJumpers(bool aEnabled)
bool m_demorgan
True if there are two body styles: normal and De Morgan If false, the body style count is taken from ...
wxString GetFootprint() override
For items with footprint fields.
const wxString GetLibraryName() const
void SetFields(const std::vector< SCH_FIELD > &aFieldsList)
Overwrite all the existing fields in this symbol with fields supplied in aFieldsList.
std::vector< SEARCH_TERM > GetSearchTerms() override
timestamp_t GetLastModDate() const
LIB_ID GetSourceLibId() const
bool IsMultiBodyStyle() const override
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.
LIB_SYMBOL(const wxString &aName, LIB_SYMBOL *aParent=nullptr, SYMBOL_LIB *aLibrary=nullptr)
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.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
SCH_FIELD * GetField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName; return nullptr if not found.
SCH_FIELD & GetFootprintField()
Return reference to the footprint field.
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 ...
void SetBodyStyleNames(const std::vector< wxString > &aBodyStyleNames)
SCH_PIN * GetPin(const wxString &aNumber, int aUnit=0, int aBodyStyle=0) const
Return pin object with the requested pin aNumber.
bool IsNormal() const override
std::set< KIFONT::OUTLINE_FONT * > GetFonts() const override
static bool ClassOf(const EDA_ITEM *aItem)
SCH_FIELD * FindFieldCaseInsensitive(const wxString &aFieldName)
const std::vector< std::set< wxString > > & JumperPinGroups() const
wxString m_keyWords
Search keywords.
SCH_ITEM * LocateDrawItem(int aUnit, int aBodyStyle, KICAD_T aType, const VECTOR2I &aPoint)
Locate a draw object.
static wxString LetterSubReference(int aUnit, wxChar aInitialLetter)
double Similarity(const SCH_ITEM &aSymbol) const override
Return a measure of similarity between this symbol and aSymbol.
static LIB_SYMBOL * GetDummy()
Returns a dummy LIB_SYMBOL, used when one is missing in the schematic.
void PlotFields(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed)
Plot symbol fields.
void LockUnits(bool aLockUnits)
Set interchangeable the property for symbol units.
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
void SetParent(LIB_SYMBOL *aParent=nullptr)
std::vector< UNIT_PIN_INFO > GetUnitPinInfo() const
Return pin-number lists for each unit, ordered consistently for gate swapping.
wxString GetUnitName(int aUnit) const override
For items with units, return an identifier for unit x.
wxString GetName() const override
void SetUnitCount(int aCount, bool aDuplicateDrawItems)
Set the units per symbol count.
void SetDescription(const wxString &aDescription)
Gets the Description field text value */.
const LIB_SYMBOL_REF & GetParent() const
void SetKeyWords(const wxString &aKeyWords)
SCH_FIELD & GetValueField()
Return reference to the value field.
bool IsLocalPower() const override
wxArrayString GetFPFilters() const
void RemoveDrawItem(SCH_ITEM *aItem)
Remove draw aItem from list.
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...
bool HasLegacyAlternateBodyStyle() const
Before V10 we didn't store the number of body styles in a symbol – we just looked through all its dra...
void SetHasDeMorganBodyStyles(bool aFlag)
const std::vector< wxString > & GetBodyStyleNames() const
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
std::optional< const std::set< wxString > > GetJumperPinGroup(const wxString &aPinNumber) const
Retrieves the jumper group containing the specified pin number, if one exists.
void SetLib(SYMBOL_LIB *aLibrary)
std::vector< SCH_PIN * > GetPins() const override
int GetSubUnitCount() const override
For items with units, return the number of units.
void SetBodyStyleCount(int aCount, bool aDuplicateDrawItems, bool aDuplicatePins)
Set or clear the alternate body style (DeMorgan) for the symbol.
wxString GetLibNickname() const override
Sets the Description field text value.
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
Automatically orient all the fields in the symbol.
std::vector< LOGICAL_PIN > GetLogicalPins(int aUnit, int aBodyStyle) const
Return all logical pins (expanded) filtered by unit/body.
bool HasDeMorganBodyStyles() const override
const LIB_SYMBOL & operator=(const LIB_SYMBOL &aSymbol)
bool m_unitsLocked
True if symbol has multiple units and changing one unit does not automatically change another unit.
wxArrayString m_fpFilters
List of suitable footprint names for the symbol (wild card names accepted).
void Move(const VECTOR2I &aOffset) override
Move the symbol aOffset.
void SetFPFilters(const wxArrayString &aFilters)
bool IsMultiUnit() const override
void CopyFields(std::vector< SCH_FIELD > &aList)
Create a copy of the SCH_FIELDs, sorted in ordinal order.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode) override
std::vector< SCH_PIN * > GetGraphicalPins(int aUnit=0, int aBodyStyle=0) const
Graphical pins: Return schematic pin objects as drawn (unexpanded), filtered by unit/body.
LIB_SYMBOL_SPTR SharedPtr() const
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared.
const wxString GetValue(bool aResolve, const SCH_SHEET_PATH *aPath, bool aAllowExtraText) const override
int GetBodyStyleCount() const override
wxString GetDesc() override
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
EMBEDDED_FILES * GetEmbeddedFiles() override
void AddField(SCH_FIELD &aField)
int m_unitCount
Number of units (parts) per package.
virtual wxString GetClass() const override
Return the class name.
bool IsGlobalPower() const override
LIB_ID m_sourceLibId
For database library symbols; the original symbol.
wxString GetBodyStyleDescription(int aBodyStyle, bool aLabel) const override
unsigned GetInheritanceDepth() const
Get the number of parents for this symbol.
int GetUnitCount() const override
LIB_SYMBOL_REF m_parent
Use for inherited symbols.
std::vector< wxString > m_bodyStyleNames
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
BOX2I GetBodyBoundingBox() const override
Return a bounding box for the symbol body but not the pins or fields.
SYMBOL_LIB * GetLib() const
int GetPinCount() override
BOX2I GetBodyAndPinsBoundingBox() const override
Return a bounding box for the symbol body and pins but not the fields.
void SetLibId(const LIB_ID &aLibId)
void AddField(SCH_FIELD *aField)
Add a field.
void ClearEditFlags() override
bool GetDuplicatePinNumbersAreJumpers() const
LIB_ID GetLIB_ID() const override
LIB_SYMBOL_REF & GetParent()
bool m_duplicatePinNumbersAreJumpers
Flag that this symbol should automatically treat sets of two or more pins with the same number as jum...
LIB_SYMBOL_SPTR GetRootSymbol() const
Get the parent symbol that does not have another parent.
std::vector< std::set< wxString > > & JumperPinGroups()
Each jumper pin group is a set of pin numbers that should be treated as internally connected.
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
wxString GetUnitDisplayName(int aUnit, bool aLabel) const override
Return the user-defined display name for aUnit for symbols with units.
void EmbedFonts() override
virtual void SetName(const wxString &aName)
SCH_FIELD & GetReferenceField()
Return reference to the reference designator field.
const LIB_ITEMS_CONTAINER & GetDrawItems() const
int GetNextFieldOrdinal() const
Return the next ordinal for a user field for this symbol.
A mix-in to provide polymorphism between items stored in libraries (symbols, aliases and footprints).
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Multivector container type.
boost::ptr_vector< SCH_ITEM > ITEM_PTR_VECTOR
Base plotter engine class.
A pure virtual class used to derive REPORTER objects from.
void SetText(const wxString &aText) override
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
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.
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
std::weak_ptr< LIB_SYMBOL > LIB_SYMBOL_REF
weak pointer to LIB_SYMBOL
MULTIVECTOR< SCH_ITEM, SCH_SHAPE_T, SCH_PIN_T > LIB_ITEMS_CONTAINER
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
LIB_ITEMS_CONTAINER::ITEM_PTR_VECTOR LIB_ITEMS
bool operator<(const LIB_SYMBOL &aItem1, const LIB_SYMBOL &aItem2)
Logical pins: Return expanded logical pins based on stacked-pin notation.
wxString number
expanded logical pin number
SCH_PIN * pin
pointer to the base graphical pin
std::vector< wxString > m_pinNumbers
int m_bodyStyle
The alternate body style of the unit.
std::vector< SCH_ITEM * > m_items
The items unique to this unit and alternate body style.
int m_unit
The unit number.
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
@ DESCRIPTION
Field Description of part, i.e. "1/4W 1% Metal Film Resistor".
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ DATASHEET
name of datasheet
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
VECTOR2< int32_t > VECTOR2I