42 std::vector<SEARCH_TERM> terms;
48 wxStringTokenizer keywordTokenizer(
GetKeyWords(),
" \t\r\n", wxTOKEN_STRTOK );
50 while( keywordTokenizer.HasMoreTokens() )
51 terms.emplace_back(
SEARCH_TERM( keywordTokenizer.GetNextToken(), 4 ) );
59 if( !footprint.IsEmpty() )
73 aColumnMap[field->
GetName()] = field->EDA_TEXT::GetShownText(
false );
106 [&](
FIELD_T id,
bool visible )
167 wxFAIL_MSG(
"Failed to clone SCH_ITEM." );
181 if( &aSymbol ==
this )
300 return aLabel ?
_(
"Alternate" ) : wxString(
_HKI(
"Alternate" ) );
302 return aLabel ?
_(
"Standard" ) : wxString(
_HKI(
"Standard" ) );
317 m_libId.SetLibItemName( aName );
332 std::unique_ptr< LIB_SYMBOL > retv;
338 wxCHECK_MSG( parent, retv,
339 wxString::Format(
"Parent of derived symbol '%s' undefined",
m_name ) );
345 retv = std::make_unique<LIB_SYMBOL>( *parent.get() );
393 retv = std::make_unique<LIB_SYMBOL>( *
this );
405 return m_libId.GetLibNickname();
411 std::shared_ptr<LIB_SYMBOL> parent;
415 if( parent->IsRoot() )
418 return parent->IsLocalPower();
429 if( parent->IsRoot() )
432 parent->SetLocalPower();
441 std::shared_ptr<LIB_SYMBOL> parent;
445 if( parent->IsRoot() )
448 return parent->IsGlobalPower();
465 if( parent->IsRoot() )
468 parent->SetGlobalPower();
479 if( parent->IsRoot() )
482 return parent->IsNormal();
493 if( parent->IsRoot() )
513 u = ( aUnit - 1 ) % 26;
514 suffix = wxChar( aInitialLetter + u ) + suffix;
515 aUnit = ( aUnit - u ) / 26;
516 }
while( aUnit > 0 );
533 footprint = field.
GetShownText(
nullptr,
false, aDepth + 1 );
536 || token->IsSameAs( field.
GetName(),
false ) )
538 *token = field.
GetShownText(
nullptr,
false, aDepth + 1 );
545 if( token->IsSameAs( wxT(
"SIM.DEVICE" ) )
546 || token->IsSameAs( wxT(
"SIM.TYPE" ) )
547 || token->IsSameAs( wxT(
"SIM.PINS" ) )
548 || token->IsSameAs( wxT(
"SIM.PARAMS" ) )
549 || token->IsSameAs( wxT(
"SIM.LIBRARY" ) )
550 || token->IsSameAs( wxT(
"SIM.NAME" ) ) )
552 *token = wxEmptyString;
556 if( token->IsSameAs( wxT(
"FOOTPRINT_LIBRARY" ) ) )
558 wxArrayString parts = wxSplit( footprint,
':' );
560 if( parts.Count() > 0 )
563 *token = wxEmptyString;
567 else if( token->IsSameAs( wxT(
"FOOTPRINT_NAME" ) ) )
569 wxArrayString parts = wxSplit( footprint,
':' );
571 if( parts.Count() > 1 )
572 *token = parts[ std::min( 1, (
int) parts.size() - 1 ) ];
574 *token = wxEmptyString;
578 else if( token->IsSameAs( wxT(
"SYMBOL_LIBRARY" ) ) )
580 *token =
m_libId.GetUniStringLibNickname();
583 else if( token->IsSameAs( wxT(
"SYMBOL_NAME" ) ) )
585 *token =
m_libId.GetUniStringLibItemName();
588 else if( token->IsSameAs( wxT(
"SYMBOL_DESCRIPTION" ) ) )
593 else if( token->IsSameAs( wxT(
"SYMBOL_KEYWORDS" ) ) )
598 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOM" ) ) )
603 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOARD" ) ) )
608 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_SIM" ) ) )
613 else if( token->IsSameAs( wxT(
"DNP" ) ) )
615 *token = this->
GetDNP() ?
_(
"DNP" ) : wxString(
"" );
624 int aUnit,
int aBodyStyle,
const VECTOR2I &aOffset,
bool aDimmed )
626 wxASSERT( aPlotter !=
nullptr );
646 if( item.IsPrivate() )
654 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
657 if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
660 item.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
666 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
668 wxASSERT( aPlotter !=
nullptr );
694 wxString tmp = field.
GetText();
697 item.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
706 std::vector<SCH_SHAPE*> potential_top_items;
707 std::vector<SCH_ITEM*> bottom_items;
716 potential_top_items.push_back( &shape );
718 bottom_items.push_back( &item );
722 bottom_items.push_back( &item );
726 std::sort( potential_top_items.begin(), potential_top_items.end(),
729 return a->GetBoundingBox().GetArea() > b->GetBoundingBox().GetArea();
732 for(
SCH_SHAPE* item : potential_top_items )
734 for(
SCH_ITEM* bottom_item : bottom_items )
736 if( item->GetBoundingBox().Contains( bottom_item->GetBoundingBox() ) )
748 wxASSERT( aItem !=
nullptr );
754 if(
static_cast<SCH_FIELD*
>( aItem )->IsMandatory() )
760 for( LIB_ITEMS::iterator i = items.begin(); i != items.end(); i++ )
787 std::vector<SCH_PIN*> pins;
802 if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
806 if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
811 wxLogTrace(
"KICAD_STACKED_PINS",
812 wxString::Format(
"GetGraphicalPins: lib='%s' unit=%d body=%d -> include pin name='%s' number='%s' shownNum='%s'",
814 pin->GetName(),
pin->GetNumber(),
pin->GetShownNumber() ) );
815 pins.push_back(
pin );
824 std::vector<LOGICAL_PIN> out;
829 std::vector<wxString> expanded =
pin->GetStackedPinNumbers( &valid );
831 if( valid && !expanded.empty() )
833 for(
const wxString& num : expanded )
836 wxLogTrace(
"KICAD_STACKED_PINS",
837 wxString::Format(
"GetLogicalPins: base='%s' -> '%s'",
838 pin->GetShownNumber(), num ) );
844 wxLogTrace(
"KICAD_STACKED_PINS",
845 wxString::Format(
"GetLogicalPins: base='%s' (no expansion)",
846 pin->GetShownNumber() ) );
861 std::vector<wxString> numbers =
pin->GetStackedPinNumbers( &valid );
862 wxLogTrace(
"CVPCB_PINCOUNT",
863 wxString::Format(
"LIB_SYMBOL::GetPinCount lib='%s' pin base='%s' shown='%s' valid=%d +%zu",
865 pin->GetShownNumber(), valid, numbers.size() ) );
866 count += numbers.size();
869 wxLogTrace(
"CVPCB_PINCOUNT",
870 wxString::Format(
"LIB_SYMBOL::GetPinCount total for lib='%s' => %d",
880 if( aNumber ==
pin->GetNumber() )
889 bool aTestType,
bool aTestOrientation,
bool aTestLength )
const
894 bool foundMatch =
false;
898 wxASSERT( otherPin );
901 if(
pin->GetUnit() != otherPin->GetUnit() )
905 if(
pin->GetBodyStyle() != otherPin->GetBodyStyle() )
909 if(
pin->GetPosition() != otherPin->GetPosition() )
913 if( aTestNums && (
pin->GetNumber() != otherPin->GetNumber() ) )
917 if( aTestNames && (
pin->GetName() != otherPin->GetName() ) )
921 if( aTestType && (
pin->GetType() != otherPin->GetType() ) )
926 && (
pin->GetOrientation() != otherPin->GetOrientation() ) )
930 if( aTestLength && (
pin->GetLength() != otherPin->GetLength() ) )
957 bool aIgnoreHiddenFields,
958 bool aIgnoreLabelsOnInvisiblePins )
const
964 if( item.m_unit > 0 &&
m_unitCount > 1 && aUnit > 0 && aUnit != item.m_unit )
967 if( item.m_bodyStyle > 0 && aBodyStyle > 0 && aBodyStyle != item.m_bodyStyle )
970 if( aIgnoreHiddenFields && item.Type() ==
SCH_FIELD_T )
972 if( !
static_cast<const SCH_FIELD&
>( item ).IsVisible() )
976 if( item.Type() ==
SCH_PIN_T && !aIgnoreLabelsOnInvisiblePins )
979 bBox.
Merge(
pin.GetBoundingBox(
true,
true,
false ) );
982 bBox.
Merge( item.GetBoundingBox() );
990 bool aIncludePrivateItems )
const
996 if( item.m_unit > 0 && aUnit > 0 && aUnit != item.m_unit )
999 if( item.m_bodyStyle > 0 && aBodyStyle > 0 && aBodyStyle != item.m_bodyStyle )
1002 if( item.IsPrivate() && !aIncludePrivateItems )
1012 if(
pin.IsVisible() )
1018 bbox.
Merge(
pin.GetBoundingBox(
false,
false,
false ) );
1025 bbox.
Merge( item.GetBoundingBox() );
1049 for(
const SCH_FIELD& src : aFieldsList )
1074 aList.push_back(
const_cast<SCH_FIELD*
>( field ) );
1077 std::sort( aList.begin(), aList.end(),
1080 return lhs->GetOrdinal() < rhs->GetOrdinal();
1087 std::vector<SCH_FIELD*> orderedFields;
1092 aList.emplace_back( *field );
1101 ordinal = std::max( ordinal,
static_cast<const SCH_FIELD*
>( &item )->GetOrdinal() + 1 );
1113 if( field->
GetId() == aFieldType )
1127 if( field->
GetId() == aFieldType )
1141 if( field.
GetName() == aFieldName )
1155 if( field.
GetName() == aFieldName )
1180 wxASSERT( field !=
nullptr );
1188 wxASSERT( field !=
nullptr );
1196 wxASSERT( field !=
nullptr );
1204 wxASSERT( field !=
nullptr );
1212 wxASSERT( field !=
nullptr );
1221 refDesignator.Replace( wxS(
"~" ), wxS(
" " ) );
1223 wxString prefix = refDesignator;
1225 while( prefix.Length() )
1227 wxUniCharRef last = prefix.Last();
1229 if( ( last >=
'0' && last <=
'9' ) || last ==
'?' || last ==
'*' )
1230 prefix.RemoveLast();
1236 prefix.Trim(
true );
1237 prefix.Trim(
false );
1253 item.Move( aOffset );
1271 for(
const SCH_ITEM& item : parent->GetDrawItems() )
1284 int maxPinNumber = 0;
1291 long currentPinNumber = 0;
1293 if(
pin->GetNumber().ToLong( ¤tPinNumber ) )
1294 maxPinNumber = std::max( maxPinNumber, (
int) currentPinNumber );
1297 return maxPinNumber;
1306 item.ClearTempFlags();
1315 item.ClearEditFlags();
1324 if( ( aUnit && item.m_unit && aUnit != item.m_unit )
1325 || ( aBodyStyle && item.m_bodyStyle && aBodyStyle != item.m_bodyStyle )
1331 if( item.HitTest( aPoint ) )
1360 const std::vector<KICAD_T>& aScanTypes )
1365 if( item.IsType( aScanTypes ) )
1390 if( it->m_unit > aCount )
1397 else if( aDuplicateDrawItems )
1404 std::vector<SCH_ITEM*> tmp;
1408 if( item.m_unit != 1 )
1411 for(
int j = prevCount + 1; j <= aCount; j++ )
1415 tmp.push_back( newItem );
1431 return parent->GetUnitCount();
1445 if( aDuplicateDrawItems || aDuplicatePins )
1447 std::vector<SCH_ITEM*> tmp;
1451 if( item.Type() !=
SCH_PIN_T && !aDuplicateDrawItems )
1454 if( item.m_bodyStyle == 1 )
1458 tmp.push_back( newItem );
1474 if( i->m_bodyStyle > 1 )
1487 std::vector<SCH_ITEM*> unitItems;
1494 if( ( aBodyStyle == -1 && item.GetUnit() == aUnit )
1495 || ( aUnit == -1 && item.GetBodyStyle() == aBodyStyle )
1496 || ( aUnit == item.GetUnit() && aBodyStyle == item.GetBodyStyle() ) )
1498 unitItems.push_back( &item );
1508 std::vector<LIB_SYMBOL_UNIT> units;
1515 int unit = item.GetUnit();
1516 int bodyStyle = item.GetBodyStyle();
1518 auto it = std::find_if( units.begin(), units.end(),
1521 return a.m_unit == unit && a.m_bodyStyle == bodyStyle;
1524 if( it == units.end() )
1527 newUnit.
m_unit = item.GetUnit();
1529 newUnit.
m_items.push_back( &item );
1530 units.emplace_back( newUnit );
1534 it->m_items.push_back( &item );
1544#define REPORT( msg ) { if( aReporter ) aReporter->Report( msg ); }
1545#define ITEM_DESC( item ) ( item )->GetItemDescription( &unitsProvider, false )
1574 REPORT(
_(
"Power flag differs." ) );
1583 REPORT(
_(
"Unit count differs." ) );
1591 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> aShapes;
1592 std::set<const SCH_FIELD*> aFields;
1593 std::set<const SCH_PIN*> aPins;
1598 aShapes.insert( &(*it) );
1600 aFields.insert(
static_cast<const SCH_FIELD*
>( &(*it) ) );
1602 aPins.insert(
static_cast<const SCH_PIN*
>( &(*it) ) );
1605 std::set<const SCH_ITEM*, SCH_ITEM::cmp_items> bShapes;
1606 std::set<const SCH_FIELD*> bFields;
1607 std::set<const SCH_PIN*> bPins;
1612 bShapes.insert( &(*it) );
1614 bFields.insert(
static_cast<const SCH_FIELD*
>( &(*it) ) );
1616 bPins.insert(
static_cast<const SCH_PIN*
>( &(*it) ) );
1619 if(
int tmp =
static_cast<int>( aShapes.size() - bShapes.size() ) )
1622 REPORT(
_(
"Graphic item count differs." ) );
1629 for(
auto aIt = aShapes.begin(), bIt = bShapes.begin(); aIt != aShapes.end(); aIt++, bIt++ )
1631 if(
int tmp2 = (*aIt)->compare( *(*bIt), aCompareFlags ) )
1634 REPORT( wxString::Format(
_(
"Graphic item differs: %s; %s." ),
1644 for(
const SCH_PIN* aPin : aPins )
1646 const SCH_PIN* bPin = aRhs.
GetPin( aPin->GetNumber(), aPin->GetUnit(), aPin->GetBodyStyle() );
1651 REPORT( wxString::Format(
_(
"Extra pin in schematic symbol: %s." ),
ITEM_DESC( aPin ) ) );
1656 else if(
int tmp = aPin->SCH_ITEM::compare( *bPin, aCompareFlags ) )
1659 REPORT( wxString::Format(
_(
"Pin %s differs: %s; %s" ),
1669 for(
const SCH_PIN* bPin : bPins )
1671 const SCH_PIN* aPin = aRhs.
GetPin( bPin->GetNumber(), bPin->GetUnit(), bPin->GetBodyStyle() );
1676 REPORT( wxString::Format(
_(
"Missing pin in schematic symbol: %s." ),
ITEM_DESC( bPin ) ) );
1683 for(
const SCH_FIELD* aField : aFields )
1687 if( aField->IsMandatory() )
1688 bField = aRhs.
GetField( aField->GetId() );
1690 bField = aRhs.
GetField( aField->GetName() );
1695 REPORT( wxString::Format(
_(
"Extra field in schematic symbol: %s." ),
ITEM_DESC( aField ) ) );
1709 tmp = aField->GetText().compare( bField->
GetText() );
1715 tmp = aField->SCH_ITEM::compare( *bField, aCompareFlags );
1721 REPORT( wxString::Format(
_(
"Field '%s' differs: %s; %s." ),
1722 aField->GetName(
false ),
1732 for(
const SCH_FIELD* bField : bFields )
1736 if( bField->IsMandatory() )
1737 aField = aRhs.
GetField( bField->GetId() );
1739 aField = aRhs.
GetField( bField->GetName() );
1744 REPORT( wxString::Format(
_(
"Missing field in schematic symbol: %s." ),
ITEM_DESC( bField ) ) );
1754 REPORT(
_(
"Footprint filter count differs." ) );
1761 for(
size_t i = 0; i <
m_fpFilters.GetCount(); i++ )
1766 REPORT(
_(
"Footprint filters differ." ) );
1777 REPORT(
_(
"Symbol keywords differ." ) );
1786 REPORT(
_(
"Symbol pin name offsets differ." ) );
1797 REPORT(
_(
"Show pin names settings differ." ) );
1806 REPORT(
_(
"Show pin numbers settings differ." ) );
1815 REPORT(
_(
"Exclude from simulation settings differ." ) );
1824 REPORT(
_(
"Exclude from bill of materials settings differ." ) );
1833 REPORT(
_(
"Exclude from board settings differ." ) );
1869 return Compare( *tmp, aCompareFlags );
1878 double similarity = 0.0;
1887 double max_similarity = 0.0;
1891 double temp_similarity = item.Similarity( otherItem );
1892 max_similarity = std::max( max_similarity, temp_similarity );
1894 if( max_similarity == 1.0 )
1898 similarity += max_similarity;
1904 double max_similarity = 0.0;
1908 double temp_similarity =
pin->Similarity( *otherPin );
1909 max_similarity = std::max( max_similarity, temp_similarity );
1911 if( max_similarity == 1.0 )
1915 similarity += max_similarity;
1918 if( totalItems == 0 )
1921 similarity /= totalItems;
1972 std::set<KIFONT::OUTLINE_FONT*>
fonts;
1980 if(
auto* font =
text.GetFont(); font && !font->IsStroke() )
1985 if( permission == EMBEDDING_PERMISSION::EDITABLE
1986 || permission == EMBEDDING_PERMISSION::INSTALLABLE )
1988 fonts.insert( outline );
2014 if(
group.contains( aPinNumber ) )
2018 return std::nullopt;
constexpr EDA_IU_SCALE schIUScale
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
static const COLOR4D WHITE
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
virtual void ClearEditFlags()
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
EDA_ITEM_FLAGS GetFlags() const
virtual void ClearTempFlags()
FILL_T GetFillMode() const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual bool IsVisible() const
virtual void SetVisible(bool aVisible)
EMBEDDED_FILES & operator=(EMBEDDED_FILES &&other) noexcept
EMBEDDED_FILE * AddFile(const wxFileName &aName, bool aOverwrite)
Load a file from disk and adds it to the collection.
Class OUTLINE_FONT implements outline font drawing.
EMBEDDING_PERMISSION GetEmbeddingPermission() const
A color representation with 4 components: red, green, blue, alpha.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
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
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.
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
SCH_FIELD & GetDatasheetField()
Return reference to the datasheet field.
std::vector< struct LIB_SYMBOL_UNIT > GetUnitDrawItems()
Return a list of SCH_ITEM objects separated by unit and convert number.
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()
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
bool IsMultiBodyStyle() const override
int GetMaxPinNumber() const
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.
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 ...
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
SCH_FIELD * FindFieldCaseInsensitive(const wxString &aFieldName)
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 SetParent(LIB_SYMBOL *aParent=nullptr)
wxString GetName() const override
void SetUnitCount(int aCount, bool aDuplicateDrawItems)
Set the units per symbol count.
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...
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
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.
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)
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.
int GetBodyStyleCount() const 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...
EMBEDDED_FILES * GetEmbeddedFiles() override
int m_unitCount
Number of units (parts) per package.
bool IsGlobalPower() const override
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.
int GetPinCount() override
void SetLibId(const LIB_ID &aLibId)
void AddField(SCH_FIELD *aField)
Add a field.
void ClearEditFlags() override
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.
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.
int GetNextFieldOrdinal() const
Return the next ordinal for a user field for this symbol.
static constexpr int FIRST_TYPE
ITERATOR_BASE< SCH_ITEM, MULTIVECTOR< SCH_ITEM, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::iterator > ITERATOR
ITERATOR end(int aType=UNDEFINED_TYPE)
static constexpr int LAST_TYPE
ITERATOR begin(int aType=UNDEFINED_TYPE)
Base plotter engine class.
bool GetColorMode() const
virtual void SetColor(const COLOR4D &color)=0
A pure virtual class used to derive REPORTER objects from.
wxString GetFullText(int unit=1) const
Return the text of a field.
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
bool ShowInChooser() const
void SetText(const wxString &aText) override
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
Object used to load, save, search, and otherwise manipulate symbol library files.
void SetExcludedFromBoard(bool aExcludeFromBoard) override
Set or clear exclude from board netlist flag.
void SetExcludedFromSim(bool aExcludeFromSim) override
Set or clear the exclude from simulation flag.
bool GetExcludedFromBoard() const override
void SetExcludedFromBOM(bool aExcludeFromBOM) override
Set or clear the exclude from schematic bill of materials flag.
bool GetDNP() const override
Set or clear the 'Do Not Populate' flag.
SYMBOL & operator=(const SYMBOL &aItem)
bool GetExcludedFromBOM() const override
int m_pinNameOffset
The offset in mils to draw the pin name.
bool GetExcludedFromSim() const override
#define DEFAULT_PIN_NAME_OFFSET
The intersheets references prefix string.
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
#define IGNORE_PARENT_GROUP
#define IS_NEW
New item, just created.
#define STRUCT_DELETED
flag indication structures to be erased
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
@ FILLED_WITH_BG_BODYCOLOR
TRANSFORM DefaultTransform
bool operator<(const LIB_SYMBOL &aItem1, const LIB_SYMBOL &aItem2)
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
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Logical pins: Return expanded logical pins based on stacked-pin notation.
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.
A structure for storing weighted search terms.
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
void operator()(void const *) const
Definition for symbol library class.
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