KiCad PCB EDA Suite
sch_component.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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2014 Dick Hollenbeck, dick@softplc.com
6  * Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
7  * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.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 COMPONENT_CLASS_H
28 #define COMPONENT_CLASS_H
29 
30 #include <base_struct.h>
31 #include <common.h>
32 #include <core/typeinfo.h>
34 #include <lib_id.h>
35 #include <msgpanel.h>
36 
37 #include <memory>
38 #include <string>
39 #include <unordered_map>
40 #include <vector>
41 #include <wx/arrstr.h>
42 #include <wx/chartype.h>
43 #include <wx/fdrepdlg.h>
44 #include <wx/gdicmn.h>
45 #include <wx/string.h>
46 
47 #include <bitmaps.h>
48 #include <sch_field.h>
49 #include <sch_item.h>
50 #include <sch_pin.h>
51 #include <sch_sheet_path.h> // COMPONENT_INSTANCE_REFERENCE
52 #include <symbol_lib_table.h>
53 #include <transform.h>
54 
55 struct COMPONENT_SELECTION;
56 class SCH_SCREEN;
57 class LIB_ITEM;
58 class LIB_PIN;
59 class LIB_PART;
60 class NETLIST_OBJECT_LIST;
61 class PART_LIB;
62 class PART_LIBS;
63 class EE_COLLECTOR;
64 class SCH_SCREEN;
66 
67 
69 typedef std::vector<SCH_FIELD> SCH_FIELDS;
70 
71 typedef std::weak_ptr<LIB_PART> PART_REF;
72 
73 
74 extern std::string toUTFTildaText( const wxString& txt );
75 
76 
80 class SCH_COMPONENT : public SCH_ITEM
81 {
82 private:
85  int m_unit;
86  int m_convert;
87  wxString m_prefix;
90 
102 
105 
106  std::unique_ptr< LIB_PART > m_part; // a flattened copy of the LIB_PART from
107  // the PROJECT's libraries.
108  std::vector<std::unique_ptr<SCH_PIN>> m_pins; // a SCH_PIN for every LIB_PIN (all units)
109  std::unordered_map<LIB_PIN*, unsigned> m_pinMap; // library pin pointer to SCH_PIN's index
110 
112  bool m_inBom;
113  bool m_onBoard;
114 
115  // Defines the hierarchical path and reference of the component. This allows support
116  // for multiple references to a single sub-sheet.
117  std::vector<COMPONENT_INSTANCE_REFERENCE> m_instanceReferences;
118 
119  void Init( const wxPoint& pos = wxPoint( 0, 0 ) );
120 
121 public:
122  SCH_COMPONENT( const wxPoint& pos = wxPoint( 0, 0 ), SCH_ITEM* aParent = NULL );
123 
137  SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* aSheet,
138  int unit = 0, int convert = 0,
139  const wxPoint& pos = wxPoint( 0, 0 ) );
140 
142  const wxPoint& pos = wxPoint( 0, 0 ) );
152  SCH_COMPONENT( const SCH_COMPONENT& aComponent );
153 
155 
156  static inline bool ClassOf( const EDA_ITEM* aItem )
157  {
158  return aItem && SCH_COMPONENT_T == aItem->Type();
159  }
160 
161  wxString GetClass() const override
162  {
163  return wxT( "SCH_COMPONENT" );
164  }
165 
166  const std::vector<COMPONENT_INSTANCE_REFERENCE>& GetInstanceReferences()
167  {
168  return m_instanceReferences;
169  }
170 
171  void ViewGetLayers( int aLayers[], int& aCount ) const override;
172 
186  bool IsMovableFromAnchorPoint() override { return true; }
187 
188  void SetLibId( const LIB_ID& aName );
189 
190  const LIB_ID& GetLibId() const { return m_lib_id; }
191 
203  void SetSchSymbolLibraryName( const wxString& aName ) { m_schLibSymbolName = aName; }
204  wxString GetSchSymbolLibraryName() const;
205  bool UseLibIdLookup() const { return m_schLibSymbolName.IsEmpty(); }
206 
207  std::unique_ptr< LIB_PART >& GetPartRef() { return m_part; }
208 
225  void SetLibSymbol( LIB_PART* aLibSymbol );
226 
230  wxString GetDescription() const;
231 
235  wxString GetDatasheet() const;
236 
237  int GetUnit() const { return m_unit; }
238 
242  void UpdatePins();
243 
253  void SetUnit( int aUnit );
254 
263  void UpdateUnit( int aUnit );
264 
265  int GetConvert() const { return m_convert; }
266 
267  void SetConvert( int aConvert );
268 
269  wxString GetPrefix() const { return m_prefix; }
270 
271  void SetPrefix( const wxString& aPrefix ) { m_prefix = aPrefix; }
272 
273  TRANSFORM& GetTransform() const { return const_cast< TRANSFORM& >( m_transform ); }
274 
275  void SetTransform( const TRANSFORM& aTransform );
276 
282  int GetUnitCount() const;
283 
290  void SetOrientation( int aOrientation );
291 
307  int GetOrientation();
308 
312  void GetContextualTextVars( wxArrayString* aVars ) const;
313 
318  bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
319 
320  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
321 
330  void ClearAnnotation( const SCH_SHEET_PATH* aSheetPath );
331 
343  bool AddSheetPathReferenceEntryIfMissing( const KIID_PATH& aSheetPath );
344 
354  bool ReplaceInstanceSheetPath( const KIID_PATH& aOldSheetPath, const KIID_PATH& aNewSheetPath );
355 
356  const EDA_RECT GetBoundingBox() const override;
357 
358  const EDA_RECT GetBoundingBox( bool aIncludeInvisibleText ) const;
359 
364 
365 
366  //-----<Fields>-----------------------------------------------------------
367 
375  SCH_FIELD* GetField( int aFieldNdx );
376 
377  const SCH_FIELD* GetField( int aFieldNdx ) const;
378 
384  wxString GetFieldText( const wxString& aFieldName, SCH_EDIT_FRAME* aFrame ) const;
385 
392  void GetFields( std::vector<SCH_FIELD*>& aVector, bool aVisibleOnly );
393 
397  std::vector<SCH_FIELD>& GetFields() { return m_Fields; }
398 
406  SCH_FIELD* AddField( const SCH_FIELD& aField );
407 
413  void RemoveField( const wxString& aFieldName );
414 
423  SCH_FIELD* FindField( const wxString& aFieldName, bool aIncludeDefaultFields = true );
424 
430  void SetFields( const SCH_FIELDS& aFields )
431  {
432  m_Fields = aFields; // vector copying, length is changed possibly
433  }
434 
440  void UpdateFields( bool aResetStyle, bool aResetRef = false );
441 
445  int GetFieldCount() const { return (int)m_Fields.size(); }
446 
456  void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
457 
458 
459  //-----</Fields>----------------------------------------------------------
460 
461 
469  SCH_PIN* GetPin( const wxString& number );
470 
476  void GetLibPins( std::vector<LIB_PIN*>& aPinsList );
477 
478  SCH_PIN* GetPin( LIB_PIN* aLibPin );
479 
486  std::vector<SCH_PIN*> GetPins( const SCH_SHEET_PATH* aSheet = nullptr ) const;
487 
488  std::vector<std::unique_ptr<SCH_PIN>>& GetRawPins() { return m_pins; }
489 
497  void Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
498 
499  void SwapData( SCH_ITEM* aItem ) override;
500 
510  static bool IsReferenceStringValid( const wxString& aReferenceString );
511 
517  const wxString GetRef( const SCH_SHEET_PATH* aSheet, bool aIncludeUnit = false ) const;
518 
525  void SetRef( const SCH_SHEET_PATH* aSheet, const wxString& aReference );
526 
532  bool IsAnnotated( const SCH_SHEET_PATH* aSheet );
533 
545  void AddHierarchicalReference( const KIID_PATH& aPath,
546  const wxString& aRef,
547  int aUnit,
548  const wxString& aValue = wxEmptyString,
549  const wxString& aFootprint = wxEmptyString );
550 
551  // Returns the instance-specific unit selection for the given sheet path.
552  int GetUnitSelection( const SCH_SHEET_PATH* aSheet ) const;
553  void SetUnitSelection( const SCH_SHEET_PATH* aSheet, int aUnitSelection );
554 
555  // Returns the instance-specific value for the given sheet path.
556  const wxString GetValue( const SCH_SHEET_PATH* sheet ) const;
557  void SetValue( const SCH_SHEET_PATH* sheet, const wxString& aValue );
558 
559  // Set the value for all instances (the default GUI behaviour)
560  void SetValue( const wxString& aValue )
561  {
562  SetValue( nullptr, aValue );
563  }
564 
565  // Returns the instance-specific footprint assignment for the given sheet path.
566  const wxString GetFootprint( const SCH_SHEET_PATH* sheet ) const;
567  void SetFootprint( const SCH_SHEET_PATH* sheet, const wxString& aFootprint );
568 
569  // Set the value for all instances (the default GUI behaviour)
570  void SetFootprint( const wxString& aFootprint )
571  {
572  SetFootprint( nullptr, aFootprint );
573  }
574 
575  // Geometric transforms (used in block operations):
576 
577  void Move( const wxPoint& aMoveVector ) override
578  {
579  if( aMoveVector == wxPoint( 0, 0 ) )
580  return;
581 
582  m_Pos += aMoveVector;
583 
584  for( SCH_FIELD& field : m_Fields )
585  field.Move( aMoveVector );
586 
587  SetModified();
588  }
589 
590  void MirrorY( int aYaxis_position ) override;
591  void MirrorX( int aXaxis_position ) override;
592  void Rotate( wxPoint aPosition ) override;
593 
594  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override;
595 
596  void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList ) override;
597 
609  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
610  const SCH_SHEET_PATH* aPath = nullptr ) override;
611 
612  wxPoint GetPinPhysicalPosition( const LIB_PIN* Pin ) const;
613 
614  bool IsConnectable() const override { return m_onBoard; }
615 
616  bool CanConnect( const SCH_ITEM* aItem ) const override
617  {
618  return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE ) ||
619  ( aItem->Type() == SCH_NO_CONNECT_T ) ||
620  ( aItem->Type() == SCH_JUNCTION_T ) ||
621  ( aItem->Type() == SCH_COMPONENT_T ) ;
622  }
623 
629  bool IsInNetlist() const;
630 
631  std::vector<wxPoint> GetConnectionPoints() const override;
632 
633  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
634 
643  LIB_ITEM* GetDrawItem( const wxPoint& aPosition, KICAD_T aType = TYPE_NOT_INIT );
644 
645  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
646 
647  BITMAP_DEF GetMenuImage() const override;
648 
649  bool operator <( const SCH_ITEM& aItem ) const override;
650 
651  bool operator==( const SCH_COMPONENT& aComponent) const;
652  bool operator!=( const SCH_COMPONENT& aComponent) const;
653 
654  SCH_COMPONENT& operator=( const SCH_ITEM& aItem );
655 
656  bool IsReplaceable() const override { return true; }
657 
658  wxPoint GetPosition() const override { return m_Pos; }
659  void SetPosition( const wxPoint& aPosition ) override { Move( aPosition - m_Pos ); }
660 
661  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
662  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
663 
664  void Plot( PLOTTER* aPlotter ) override;
665 
666  EDA_ITEM* Clone() const override;
667 
668 #if defined(DEBUG)
669  void Show( int nestLevel, std::ostream& os ) const override;
670 #endif
671 
672  void ClearBrightenedPins();
673 
674  bool HasBrightenedPins();
675 
676  bool GetIncludeInBom() const { return m_inBom; }
677  void SetIncludeInBom( bool aIncludeInBom ) { m_inBom = aIncludeInBom; }
678 
679  bool GetIncludeOnBoard() const { return m_onBoard; }
680  void SetIncludeOnBoard( bool aIncludeOnBoard ) { m_onBoard = aIncludeOnBoard; }
681 
682 private:
683  bool doIsConnected( const wxPoint& aPosition ) const override;
684 };
685 
686 #endif /* COMPONENT_CLASS_H */
bool operator!=(const SCH_COMPONENT &aComponent) const
void UpdateFields(bool aResetStyle, bool aResetRef=false)
Restores fields to the original library values.
EDA_UNITS
Definition: common.h:198
bool ReplaceInstanceSheetPath(const KIID_PATH &aOldSheetPath, const KIID_PATH &aNewSheetPath)
Replace aOldSheetPath with aNewSheetPath in the instance list.
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
void SetModified()
Definition: base_struct.cpp:87
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
static bool ClassOf(const EDA_ITEM *aItem)
std::vector< std::unique_ptr< SCH_PIN > > & GetRawPins()
SCH_FIELD * FindField(const wxString &aFieldName, bool aIncludeDefaultFields=true)
Search for a SCH_FIELD with aFieldName.
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 SetTransform(const TRANSFORM &aTransform)
PNG memory record (file in memory).
Definition: bitmap_def.h:29
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.
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
void SetIncludeInBom(bool aIncludeInBom)
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData) override
Function Matches compares the item against the search criteria in aSearchData.
bool operator==(const SCH_COMPONENT &aComponent) const
bool GetIncludeOnBoard() const
std::string toUTFTildaText(const wxString &txt)
Convert a wxString to UTF8 and replace any control characters with a ~, where a control character is ...
SCH_FIELDS m_Fields
Variable length list of fields.
bool IsConnectable() const override
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.
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.
wxString GetPrefix() const
bool IsInNetlist() const
void ClearBrightenedPins()
std::vector< COMPONENT_INSTANCE_REFERENCE > m_instanceReferences
SCH_PIN * GetPin(const wxString &number)
Find a symbol pin by number.
EE_COLLECTOR.
Definition: ee_collectors.h:42
void SetPosition(const wxPoint &aPosition) override
const wxString GetValue(const SCH_SHEET_PATH *sheet) const
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 SetSchSymbolLibraryName(const wxString &aName)
The name of the symbol in the schematic library symbol list.
void SetIncludeOnBoard(bool aIncludeOnBoard)
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
The base class for create windows for drawing purpose.
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
bool CanConnect(const SCH_ITEM *aItem) const override
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
void SetConvert(int aConvert)
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:105
bool UseLibIdLookup() const
int GetUnit() const
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
bool IsMovableFromAnchorPoint() override
Return true for items which are moved with the anchor point at mouse cursor and false for items moved...
void SetFields(const SCH_FIELDS &aFields)
Set multiple schematic fields.
wxString m_schLibSymbolName
The name used to look up a symbol in the symbol library embedded in a schematic.
#define NULL
const wxString GetFootprint(const SCH_SHEET_PATH *sheet) const
bool m_isInNetlist
True if the component should appear in the netlist.
TRANSFORM & GetTransform() 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.
std::vector< SCH_FIELD > SCH_FIELDS
A container for several SCH_FIELD items.
Definition: sch_component.h:65
bool operator<(const SCH_ITEM &aItem) const override
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
const std::vector< COMPONENT_INSTANCE_REFERENCE > & GetInstanceReferences()
SCH_COMPONENT(const wxPoint &pos=wxPoint(0, 0), SCH_ITEM *aParent=NULL)
Define a library symbol object.
SCH_FIELD * AddField(const SCH_FIELD &aField)
Add a field to the symbol.
wxString GetDatasheet() const
Return the documentation text for the given part alias.
bool IsAnnotated(const SCH_SHEET_PATH *aSheet)
Checks if the component has a valid annotation (reference) for the given sheet path.
void SetUnit(int aUnit)
Change the unit number to aUnit.
SCH_SHEET_PATH.
std::unique_ptr< LIB_PART > & GetPartRef()
bool IsReplaceable() const override
Function IsReplaceable.
std::unique_ptr< LIB_PART > m_part
bool GetIncludeInBom() const
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
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.
std::weak_ptr< LIB_PART > PART_REF
Definition: sch_component.h:71
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:279
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
SCH_FIELD * GetField(int aFieldNdx)
Returns a field in this symbol.
A collection of PART_LIB objects.
int m_unit
The unit for multiple part per package components.
Definition: sch_component.h:85
void SetValue(const wxString &aValue)
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.
Definition: plotter.h:114
void SetUnitSelection(const SCH_SHEET_PATH *aSheet, int aUnitSelection)
void Print(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a component.
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
Function HitTest tests 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.
Definition: sch_component.h:84
Board layer functions and definitions.
void MirrorY(int aYaxis_position) override
Mirror item relative to the Y axis about aYaxis_position.
bool HasBrightenedPins()
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Automatically orient all the fields in the component.
Schematic symbol object.
Definition: sch_component.h:80
void SetPrefix(const wxString &aPrefix)
wxPoint GetPosition() const override
void RemoveField(const wxString &aFieldName)
Removes a user field from the symbol.
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
bool m_inBom
True to include in bill of materials export.
The common library.
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.
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
int GetConvert() const
int m_convert
The alternate body style for components that have more than one body style defined.
Definition: sch_component.h:86
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.
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
void SetValue(const SCH_SHEET_PATH *sheet, const wxString &aValue)
SEARCH_RESULT
Definition: base_struct.h:51
void GetLibPins(std::vector< LIB_PIN * > &aPinsList)
Populate a vector with all the pins from the library object.
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
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
wxString GetClass() const override
Function GetClass returns the class name.
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.
Definition: sch_component.h:89
const LIB_ID & GetLibId() const
SCH_COMPONENT & operator=(const SCH_ITEM &aItem)
wxPoint GetPinPhysicalPosition(const LIB_PIN *Pin) const
Object used to load, save, search, and otherwise manipulate symbol library files.
TRANSFORM m_transform
The rotation/mirror transformation matrix.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
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
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
std::unordered_map< LIB_PIN *, unsigned > m_pinMap
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...
void SetFootprint(const wxString &aFootprint)