45 std::string ret =
TO_UTF8( txt );
47 for( std::string::iterator it = ret.begin(); it!=ret.end(); ++it )
49 if( (
unsigned char) *it <=
' ' )
75 part =
new LIB_PART( wxEmptyString );
79 square->MoveTo( wxPoint( Mils2iu( -200 ), Mils2iu( 200 ) ) );
80 square->SetEndPosition( wxPoint( Mils2iu( 200 ), Mils2iu( -200 ) ) );
84 text->
SetTextSize( wxSize( Mils2iu( 150 ), Mils2iu( 150 ) ) );
85 text->
SetText( wxString( wxT(
"??" ) ) );
103 int unit,
int convert,
const wxPoint& pos ) :
112 std::unique_ptr< LIB_PART > part;
123 SetRef( sheet,
m_part->GetReferenceField().GetText() + wxT(
"?" ) );
134 const wxPoint& pos ) :
138 for(
auto const& i : aSel.
Fields )
140 auto field = this->
GetField( i.first );
143 field->SetText( i.second );
172 field.SetParent(
this );
243 wxCHECK2( ( aLibSymbol ==
nullptr ) || ( aLibSymbol->
IsRoot() ), aLibSymbol =
nullptr );
245 m_part.reset( aLibSymbol );
253 return m_part->GetDescription();
255 return wxEmptyString;
262 return m_part->GetDatasheetField().GetText();
264 return wxEmptyString;
270 std::map<wxString, wxString> altPinMap;
272 for(
const std::unique_ptr<SCH_PIN>& pin :
m_pins )
274 if( !pin->GetAlt().IsEmpty() )
275 altPinMap[ pin->GetNumber() ] = pin->GetAlt();
286 for(
LIB_PIN* libPin =
m_part->GetNextPin(); libPin; libPin =
m_part->GetNextPin( libPin ) )
293 m_pins.push_back( std::make_unique<SCH_PIN>( libPin,
this ) );
295 auto ii = altPinMap.find( libPin->GetNumber() );
297 if( ii != altPinMap.end() )
298 m_pins.back()->SetAlt( ii->second );
349 return m_part->GetUnitCount();
372 field.Print( aSettings, aOffset );
377 int aUnit,
const wxString& aValue,
378 const wxString& aFootprint )
387 " reference %s, unit %d from symbol %s.",
407 " reference %s, unit %d to symbol %s.",
424 if( instance.m_Path == path )
426 ref = instance.m_Reference;
453 wxString text = aReferenceString;
457 while( !text.IsEmpty() && ( text.Last() ==
'?' || wxIsdigit( text.Last() ) ) )
470 bool notInArray =
true;
475 if( instance.m_Path == path )
477 instance.m_Reference = ref;
485 for( std::unique_ptr<SCH_PIN>& pin :
m_pins )
486 pin->ClearDefaultNetName( sheet );
502 wxString prefix = ref;
506 while( prefix.Last() ==
'?' || wxIsdigit( prefix.Last() ) )
528 if( instance.m_Path == path )
529 return instance.m_Reference.Last() !=
'?';
542 if( instance.m_Path == path )
543 return instance.m_Unit;
559 if( instance.m_Path == path )
561 instance.m_Unit = aUnitSelection;
577 if( instance.m_Path == path && !instance.m_Value.IsEmpty() )
581 return instance.m_Value;
594 if( sheet ==
nullptr )
598 instance.m_Value = wxEmptyString;
609 if( instance.m_Path == path )
611 instance.m_Value = aValue;
627 if( instance.m_Path == path && !instance.m_Footprint.IsEmpty() )
631 return instance.m_Footprint;
644 if( sheet ==
nullptr )
648 instance.m_Footprint = wxEmptyString;
659 if( instance.m_Path == path )
661 instance.m_Footprint = aFootprint;
673 if( (
unsigned) aFieldNdx <
m_fields.size() )
682 if( (
unsigned) aFieldNdx <
m_fields.size() )
693 if( aFieldName == field.GetName() || aFieldName == field.GetCanonicalName() )
694 return field.GetText();
697 return wxEmptyString;
705 if( !aVisibleOnly || ( field.IsVisible() && !field.IsVoid() ) )
706 aVector.push_back( &field );
724 if( aFieldName ==
m_fields[i].GetName(
false ) )
737 for(
unsigned i = start; i <
m_fields.size(); ++i )
739 if( aFieldName ==
m_fields[i].GetName(
false ) )
752 std::vector<LIB_FIELD*> fields;
754 m_part->GetFields( fields );
756 for(
const LIB_FIELD* libField : fields )
758 int idx = libField->GetId();
770 schField =
FindField( libField->GetCanonicalName() );
797 schField->
SetText( libField->GetText() );
806 for(
const std::unique_ptr<SCH_PIN>& pin :
m_pins )
807 aFunction( pin.get() );
816 for(
const std::unique_ptr<SCH_PIN>& pin :
m_pins )
818 if( pin->GetNumber() == aNumber )
835 wxASSERT(
m_pinMap.count( aLibPin ) );
842 std::vector<SCH_PIN*> pins;
844 if( aSheet ==
nullptr )
846 wxCHECK_MSG(
Schematic(), pins,
"Can't call GetPins on a component with no schematic" );
853 for(
const auto& p :
m_pins )
855 if( unit && p->GetLibPin()->GetUnit() && ( p->GetLibPin()->GetUnit() != unit ) )
858 pins.push_back( p.get() );
868 wxT(
"Cannot swap data with invalid component." ) );
872 std::swap(
m_lib_id, component->m_lib_id );
874 LIB_PART* part = component->m_part.release();
875 component->m_part.reset(
m_part.release() );
876 component->UpdatePins();
880 std::swap(
m_pos, component->m_pos );
881 std::swap(
m_unit, component->m_unit );
882 std::swap(
m_convert, component->m_convert );
884 m_fields.swap( component->m_fields );
886 for(
SCH_FIELD& field : component->m_fields )
895 component->m_transform = tmp;
904 aVars->push_back(
m_fields[i].GetCanonicalName().Upper() );
907 aVars->push_back(
m_fields[i].GetName() );
909 aVars->push_back( wxT(
"FOOTPRINT_LIBRARY" ) );
910 aVars->push_back( wxT(
"FOOTPRINT_NAME" ) );
911 aVars->push_back( wxT(
"UNIT" ) );
921 if( token->IsSameAs(
m_fields[ i ].GetCanonicalName().Upper() ) )
930 *token =
m_fields[ i ].GetShownText( aDepth + 1 );
938 if( token->IsSameAs(
m_fields[ i ].GetName() )
939 || token->IsSameAs(
m_fields[ i ].GetName().Upper() ) )
941 *token =
m_fields[ i ].GetShownText( aDepth + 1 );
946 if( token->IsSameAs( wxT(
"FOOTPRINT_LIBRARY" ) ) )
955 wxArrayString parts = wxSplit( footprint,
':' );
960 else if( token->IsSameAs( wxT(
"FOOTPRINT_NAME" ) ) )
969 wxArrayString parts = wxSplit( footprint,
':' );
971 *token = parts[ std::min( 1, (
int) parts.size() - 1 ) ];
974 else if( token->IsSameAs( wxT(
"UNIT" ) ) )
1002 while( defRef.Last() ==
'?' )
1003 defRef.RemoveLast();
1005 defRef.Append( wxT(
"?" ) );
1013 if( instance.m_Path == path )
1014 instance.m_Reference = defRef;
1020 instance.m_Reference = defRef;
1023 for( std::unique_ptr<SCH_PIN>& pin :
m_pins )
1024 pin->ClearDefaultNetName( aSheetPath );
1037 wxCHECK( aSheetPath.size() > 0, false );
1039 wxString reference_path;
1044 if( instance.m_Path == aSheetPath )
1060 return aOldSheetPath == r.m_Path;
1067 "Replacing sheet path %s\n with sheet path %s\n for symbol %s.",
1070 it->m_Path = aNewSheetPath;
1075 "Could not find sheet path %s\n to replace with sheet path %s\n for symbol %s.",
1085 bool transform =
false;
1087 switch( aOrientation )
1097 temp.
x1 = temp.
y2 = 0;
1104 temp.
x1 = temp.
y2 = 0;
1113 temp.
y1 = temp.
x2 = 0;
1120 temp.
y1 = temp.
x2 = 0;
1182 wxFAIL_MSG(
"Invalid schematic symbol orientation type." );
1211 int rotate_values[] =
1230 for(
int type_rotate : rotate_values )
1239 wxFAIL_MSG(
"Schematic symbol orientation matrix internal error." );
1248 void SCH_COMPONENT::Show(
int nestLevel, std::ostream& os )
const 1251 NestedSpace( nestLevel, os ) <<
'<' <<
GetClass().Lower().mb_str()
1253 <<
'"' <<
" chipName=\"" 1263 if( !value.IsEmpty() )
1265 NestedSpace( nestLevel + 1, os ) <<
"<field" <<
" name=\"" 1267 <<
'"' <<
" value=\"" 1268 <<
TO_UTF8( value ) <<
"\"/>\n";
1272 NestedSpace( nestLevel, os ) <<
"</" <<
TO_UTF8(
GetClass().Lower() ) <<
">\n";
1287 int x0 = bBox.
GetX();
1293 int y0 = -bBox.
GetY();
1318 bbox.
Merge( field.GetBoundingBox() );
1330 if( field.IsVisible() || aIncludeInvisibleText )
1331 bbox.
Merge( field.GetBoundingBox() );
1342 SCH_EDIT_FRAME* schframe = dynamic_cast<SCH_EDIT_FRAME*>( aFrame );
1352 msg =
m_part->IsPower() ?
_(
"Power symbol" ) :
_(
"Value" );
1356 #if 0 // Display component flags, for debug only 1366 msg =
_(
"Missing parent" );
1368 std::shared_ptr< LIB_PART > parent =
m_part->GetParent().lock();
1371 msg = parent->GetName();
1388 msg =
_(
"<Unknown>" );
1407 if( libNickname.empty() )
1409 aList.push_back(
MSG_PANEL_ITEM(
_(
"Library" ),
_(
"No library defined!" ) ) );
1413 msg.Printf(
_(
"Symbol not found in %s!" ), libNickname );
1437 wxPoint pos = field.GetTextPos();
1439 field.SetTextPos( pos );
1455 wxPoint pos = field.GetTextPos();
1457 field.SetTextPos( pos );
1464 wxPoint prev =
m_pos;
1473 wxPoint pos = field.GetTextPos();
1474 pos.x -= prev.x -
m_pos.x;
1475 pos.y -= prev.y -
m_pos.y;
1476 field.SetTextPos( pos );
1492 for(
auto& pin :
m_pins )
1494 LIB_PIN* lib_pin = pin->GetLibPin();
1500 aItemList.push_back( item );
1508 bool changed =
false;
1510 for( std::unique_ptr<SCH_PIN>& pin :
m_pins )
1512 bool previousState = pin->IsDangling();
1513 pin->SetIsDangling(
true );
1523 if( each_item.GetParent() == this )
1526 switch( each_item.GetType() )
1536 if( pos == each_item.GetPosition() )
1537 pin->SetIsDangling(
false );
1545 if( !pin->IsDangling() )
1549 changed = ( changed || ( previousState != pin->IsDangling() ) );
1559 wxT(
"Cannot get physical position of pin." ) );
1567 std::vector<wxPoint> retval;
1569 for(
const std::unique_ptr<SCH_PIN>& pin :
m_pins )
1573 int pin_unit = pin->GetLibPin()->GetUnit();
1574 int pin_convert = pin->GetLibPin()->GetConvert();
1576 if( pin_unit > 0 && pin_unit !=
GetUnit() )
1579 if( pin_convert > 0 && pin_convert !=
GetConvert() )
1594 wxPoint libPosition = aPosition -
m_pos;
1607 GetLibId().GetLibItemName().wx_str() );
1612 const KICAD_T aFilterTypes[] )
1616 for(
const KICAD_T* p = aFilterTypes; (stype = *p) !=
EOT; ++p )
1662 for(
const std::unique_ptr<SCH_PIN>& pin :
m_pins )
1666 int pin_unit = pin->GetLibPin()->GetUnit();
1667 int pin_convert = pin->GetLibPin()->GetConvert();
1669 if( pin_unit > 0 && pin_unit !=
GetUnit() )
1672 if( pin_convert > 0 && pin_convert !=
GetConvert() )
1690 auto component = static_cast<const SCH_COMPONENT*>( &aItem );
1694 if( rect.
GetArea() != component->GetBodyBoundingBox().GetArea() )
1695 return rect.
GetArea() < component->GetBodyBoundingBox().GetArea();
1697 if(
m_pos.x != component->m_pos.x )
1698 return m_pos.x < component->m_pos.x;
1700 if(
m_pos.y != component->m_pos.y )
1701 return m_pos.y < component->m_pos.y;
1724 return !( *
this == aComponent );
1730 wxCHECK_MSG(
Type() == aItem.
Type(), *
this,
1731 wxT(
"Cannot assign object type " ) + aItem.
GetClass() + wxT(
" to type " ) +
1734 if( &aItem !=
this )
1744 m_part.reset( libSymbol );
1756 field.SetParent(
this );
1797 for(
const auto& pin :
m_pins )
1804 int pin_unit = pin->GetLibPin()->GetUnit();
1805 int pin_convert = pin->GetLibPin()->GetConvert();
1807 if( pin_unit > 0 && pin_unit !=
GetUnit() )
1810 if( pin_convert > 0 && pin_convert !=
GetConvert() )
1813 if( pin->GetLocalPosition() == new_pos )
1837 field.Plot( aPlotter );
1846 for(
const auto& pin :
m_pins )
1848 if( pin->IsBrightened() )
1858 for(
auto& pin :
m_pins )
1859 pin->ClearBrightened();
bool operator!=(const SCH_COMPONENT &aComponent) const
void UpdateFields(bool aResetStyle, bool aResetRef=false)
Restores fields to the original library values.
bool ReplaceInstanceSheetPath(const KIID_PATH &aOldSheetPath, const KIID_PATH &aNewSheetPath)
Replace aOldSheetPath with aNewSheetPath in the instance list.
void Offset(int dx, int dy)
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
const wxChar *const traceSchSheetPaths
Flag to enable debug output of schematic symbol sheet path manipulation code.
EDA_ITEM * m_parent
Linked list: Link (parent struct)
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
SCH_FIELD * FindField(const wxString &aFieldName, bool aIncludeDefaultFields=true)
Search for a SCH_FIELD with aFieldName.
const UTF8 & GetLibItemName() const
void SetLibSymbol(LIB_PART *aLibSymbol)
Set this schematic symbol library symbol reference to aLibSymbol.
void SetLibId(const LIB_ID &aName)
void Plot(PLOTTER *aPlotter) override
Plot the schematic item to aPlotter.
void Merge(const EDA_RECT &aRect)
Modify the position and size of the rectangle in order to contain aRect.
void SetTransform(const TRANSFORM &aTransform)
virtual void EndBlock(void *aData)
calling this function allows one to define the end of a group of drawing items for instance in SVG or...
PNG memory record (file in memory).
void UpdateUnit(int aUnit)
Change the unit number to aUnit without setting any internal flags.
int GetOrientation()
Get the display symbol orientation.
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the component.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Holds all the data relating to one schematic A schematic may consist of one or more sheets (and one r...
bool operator==(const SCH_COMPONENT &aComponent) const
Define a symbol library graphical text item.
void ImportValues(const LIB_FIELD &aSource)
Function ImportValues copy parameters from a LIB_FIELD source.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
Field object used in symbol libraries.
wxString GetSchSymbolLibraryName() const
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
void SetTextPos(const wxPoint &aPoint)
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
bool m_onBoard
True to include in netlist when updating board.
int GetUnitCount() const
Return the number of units per package of the symbol.
void MirrorX(int aXaxis_position) override
Mirror item relative to the X axis about aXaxis_position.
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
void ClearBrightenedPins()
wxString AsString() const
const BITMAP_OPAQUE add_component_xpm[1]
wxString GetDescription() const
Return information about the aliased parts.
Schematic editor (Eeschema) main window.
LIB_ITEM * GetDrawItem(const wxPoint &aPosition, KICAD_T aType=TYPE_NOT_INIT)
Return the component library item at aPosition that is part of this component.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void SetTextSize(const wxSize &aNewSize)
void RotatePoint(int *pX, int *pY, double angle)
A logical library item identifier and consists of various portions much like a URI.
The base class for create windows for drawing purpose.
bool Contains(const wxPoint &aPoint) const
FIELDS_AUTOPLACED m_fieldsAutoplaced
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
const INSPECTOR_FUNC & INSPECTOR
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
virtual void SetParent(EDA_ITEM *aParent)
The base class for drawable items used by schematic library components.
Field Value of part, i.e. "3.3K".
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
void SetConvert(int aConvert)
const wxString GetFootprint(const SCH_SHEET_PATH *sheet, bool aResolve) const
void AddDrawItem(LIB_ITEM *aItem)
Add a new draw aItem to the draw object list.
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
virtual void SetText(const wxString &aText)
wxString m_schLibSymbolName
The name used to look up a symbol in the symbol library embedded in a schematic.
const wxString GetValue(const SCH_SHEET_PATH *sheet, bool aResolve) const
bool m_isInNetlist
True if the component should appear in the netlist.
STATUS_FLAGS GetEditFlags() const
EDA_RECT GetBodyBoundingBox() const
Return a bounding box for the symbol body but not the fields.
std::vector< SCH_FIELD > & GetFields()
Returns a vector of fields from the component.
bool operator<(const SCH_ITEM &aItem) const override
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a component.
SCH_COMPONENT(const wxPoint &pos=wxPoint(0, 0), SCH_ITEM *aParent=NULL)
std::string toUTFTildaText(const wxString &txt)
Convert a wxString to UTF8 and replace any control characters with a ~, where a control character is ...
Define a library symbol object.
SCH_FIELD * AddField(const SCH_FIELD &aField)
Add a field to the symbol.
A simple container for schematic symbol instance infromation.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
wxString GetDatasheet() const
Return the documentation text for the given part alias.
wxLogTrace helper definitions.
bool IsAnnotated(const SCH_SHEET_PATH *aSheet)
Checks if the component has a valid annotation (reference) for the given sheet path.
#define STRUCT_DELETED
flag indication structures to be erased
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslate=true)
Return a default symbol field name for field aFieldNdx for all components.
void SetUnit(int aUnit)
Change the unit number to aUnit.
TRANSFORM & GetTransform()
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
std::unique_ptr< LIB_PART > m_part
double GetArea() const
Return the area of the rectangle.
std::unique_ptr< LIB_PART > Flatten() const
Return a flattened symbol inheritance to the caller.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
int GetFieldCount() const
Return the number of fields in this symbol.
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieves a list of the SCH_PINs for the given sheet path.
Field Name Module PCB, i.e. "16DIP300".
wxPoint GetPosition() const override
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
SCH_FIELD * GetField(int aFieldNdx)
Returns a field in this symbol.
void Normalize()
Ensures that the height ant width are positive.
int m_unit
The unit for multiple part per package components.
void Init(const wxPoint &pos=wxPoint(0, 0))
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
Base plotter engine class.
void SetUnitSelection(const SCH_SHEET_PATH *aSheet, int aUnitSelection)
wxString GetFieldText(const wxString &aFieldName, SCH_EDIT_FRAME *aFrame) const
Search for a field named aFieldName and returns text associated with this field.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
LIB_ID m_lib_id
Name and library the symbol was loaded from, i.e. 74xx:74LS00.
const wxChar *const traceFindItem
Flag to enable find debug tracing.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
void MirrorY(int aYaxis_position) override
Mirror item relative to the Y axis about aYaxis_position.
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, int aMulti, int aConvert, const PART_DRAW_OPTIONS &aOpts)
Print part.
wxString AsString() const
Handle the component boundary box.
static wxString SubReference(int aUnit, bool aAddSeparator=true)
bool GetIncludeOnBoard() const
void RemoveField(const wxString &aFieldName)
Removes a user field from the symbol.
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
A base class for most all the KiCad significant classes used in schematics and boards.
bool m_inBom
True to include in bill of materials export.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
Test if the component's dangling state has changed for all pins.
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
bool Intersects(const EDA_RECT &aRect) const
Test for a common area between rectangles.
virtual wxString GetClass() const override
Return the class name.
const wxPoint & GetTextPos() const
SCH_SHEET_PATH & GetCurrentSheet() const
T Convert(const wxString &aValue)
Function Convert converts a wxString to a generic type T.
std::vector< SYMBOL_INSTANCE_REFERENCE > m_instanceReferences
void GetLibPins(std::vector< LIB_PIN * > &aPinsList) const
Populate a vector with all the pins from the library object.
int m_convert
The alternate body style for components that have more than one body style defined.
Helper class used to store the state of schematic items that can be connected to other schematic item...
void AddHierarchicalReference(const KIID_PATH &aPath, const wxString &aRef, int aUnit, const wxString &aValue=wxEmptyString, const wxString &aFootprint=wxEmptyString)
Add a full hierarchical reference to this symbol.
void UpdatePins()
Updates the cache of SCH_PIN objects for each pin.
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
std::vector< std::unique_ptr< SCH_PIN > > m_pins
#define SKIP_STRUCT
flag indicating that the structure should be ignored
void SetValue(const SCH_SHEET_PATH *sheet, const wxString &aValue)
static bool IsReferenceStringValid(const wxString &aReferenceString)
Tests for an acceptable reference string.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
not connected (must be left open)
wxString GetClass() const override
Return the class name.
bool GetIncludeInBom() const
Message panel definition file.
void ClearAnnotation(const SCH_SHEET_PATH *aSheetPath)
Clear exiting component annotation.
wxString m_prefix
C, R, U, Q etc - the first character which typically indicates what the component is.
const LIB_ID & GetLibId() const
SCH_COMPONENT & operator=(const SCH_ITEM &aItem)
Field Reference of part, i.e. "IC21".
const EDA_RECT GetBodyBoundingBox(int aUnit, int aConvert) const
Get the symbol bounding box excluding fields.
wxPoint GetPinPhysicalPosition(const LIB_PIN *Pin) const
TRANSFORM m_transform
The rotation/mirror transformation matrix.
std::vector< std::pair< int, wxString > > Fields
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_FIELDS m_fields
Variable length list of fields.
virtual const wxString & GetText() const
Return the string associated with the text object.
void SetFootprint(const SCH_SHEET_PATH *sheet, const wxString &aFootprint)
bool AddSheetPathReferenceEntryIfMissing(const KIID_PATH &aSheetPath)
Add an instance to the alternate references list (m_instanceReferences), if this entry does not alrea...
int GetUnitSelection(const SCH_SHEET_PATH *aSheet) const
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
std::unordered_map< LIB_PIN *, unsigned > m_pinMap
KICAD_T Type() const
Returns the type of object.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
SCH_SHEET_PATH & CurrentSheet() const
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...
SCH_PIN * GetPin(const wxString &number) const
Find a symbol pin by number.