35 wxASSERT( aParentSymbol );
37 m_alt = wxEmptyString;
52 wxASSERT( aParentSymbol );
97 if( !
m_alt.IsEmpty() )
108 if( !
m_alt.IsEmpty() )
111 if(
name == wxS(
"~" ) )
112 return wxEmptyString;
121 return wxEmptyString;
129 wxCHECK(
m_libPin, ELECTRICAL_PINTYPE::PT_NC );
131 if( !
m_alt.IsEmpty() )
140 wxCHECK(
m_libPin, GRAPHIC_PINSHAPE::LINE );
142 if( !
m_alt.IsEmpty() )
151 wxCHECK(
m_libPin, PIN_ORIENTATION::PIN_RIGHT );
196 bool isReplaced =
false;
225 wxString( wxS(
"Undefined library pin." ) );
226 return wxString::Format(
"Symbol %s %s",
237 aList.emplace_back(
_(
"Type" ),
_(
"Pin" ) );
241 if( libSymbol->GetUnitCount() )
244 wxString(
"Undefined library pin." );
245 aList.emplace_back(
_(
"Unit" ), msg );
248 if( libSymbol->HasAlternateBodyStyle() )
251 wxString(
"Undefined library pin." );
252 aList.emplace_back(
_(
"Body Style" ), msg );
261 aList.emplace_back(
_(
"Visible" ),
IsVisible() ?
_(
"Yes" ) :
_(
"No" ) );
271 aList.emplace_back( symbol->
GetRef( currentSheet ),
293 || ( aPin->
GetType() == ELECTRICAL_PINTYPE::PT_PASSIVE ) );
340 if( it->second.second == aForceNoConnect )
341 return it->second.first;
344 wxString
name =
"Net-(";
345 bool unconnected =
false;
347 if( aForceNoConnect ||
GetType() == ELECTRICAL_PINTYPE::PT_NC )
350 name = (
"unconnected-(" );
353 bool annotated =
true;
356 bool has_multiple =
false;
362 && unconnected == (
pin->GetType() == ELECTRICAL_PINTYPE::PT_NC ) )
378 name <<
"-Pad" << libPinNumber <<
")";
381 else if( !libPinShownName.IsEmpty() && ( libPinShownName != libPinShownNumber ) )
388 if( unconnected || has_multiple )
415 bool aIncludeElectricalType )
const
422 aIncludeElectricalType );
441 aAccuracy = std::max( aAccuracy,
Schematic()->Settings().m_PinSymbolSize / 4 );
478 wxCHECK(
pin,
false );
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
void Offset(coord_type dx, coord_type dy)
void RevertYAxis()
Mirror the rectangle from the X axis (negate Y pos and size).
bool Intersects(const BOX2< Vec > &aRect) const
bool Contains(const Vec &aPoint) const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
EDA_ITEM * GetParent() const
EDA_ITEM * m_parent
Linked list: Link (parent struct)
virtual const wxString & GetText() const
Return the string associated with the text object.
wxString AsString() const
static wxString GetUnitDescription(int aUnit)
static wxString GetBodyStyleDescription(int aBodyStyle)
bool IsGlobalPower() const
Return whether this pin forms a global power connection: i.e., is part of a power symbol and of type ...
ELECTRICAL_PINTYPE GetType() const
const BOX2I GetBoundingBox() const override
PIN_ORIENTATION GetOrientation() const
wxString GetShownNumber() const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
wxString GetShownName() const
VECTOR2I GetPosition() const override
const wxString & GetNumber() const
GRAPHIC_PINSHAPE GetShape() const
ALT GetAlt(const wxString &aAlt)
const wxString & GetName() const
double Similarity(const LIB_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
Define a library symbol object.
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
void AppendInfoToMsgPanel(std::vector< MSG_PANEL_ITEM > &aList) const
Adds information about the connection object to aList.
Schematic editor (Eeschema) main window.
SCH_SHEET_PATH & GetCurrentSheet() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_ITEM & operator=(const SCH_ITEM &aPin)
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
bool IsConnectivityDirty() const
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
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.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void SetPosition(const VECTOR2I &aPosition) override
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
SCH_PIN & operator=(const SCH_PIN &aPin)
wxString GetShownNumber() const
std::map< const SCH_SHEET_PATH, std::pair< wxString, bool > > m_net_name_map
bool IsGlobalPower() const
bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const override
Return true if this item should propagate connection info to aItem.
bool operator==(const SCH_ITEM &aItem) const override
LIB_PIN * GetLibPin() const
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
wxString GetNumber() const
std::recursive_mutex m_netmap_mutex
The name that this pin connection will drive onto a net.
PIN_ORIENTATION GetOrientation() const
VECTOR2I GetPosition() const override
SCH_PIN(LIB_PIN *aLibPin, SCH_SYMBOL *aParentSymbol)
bool Replace(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
const VECTOR2I GetLocalPosition() const
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
wxString GetShownName() const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
VECTOR2I GetTransformedPosition() const
void ClearDefaultNetName(const SCH_SHEET_PATH *aPath)
bool IsStacked(const SCH_PIN *aPin) const
SCH_SYMBOL * GetParentSymbol() const
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
wxString GetDefaultNetName(const SCH_SHEET_PATH &aPath, bool aForceNoConnect=false)
GRAPHIC_PINSHAPE GetShape() const
ELECTRICAL_PINTYPE GetType() const
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
VECTOR2I GetPosition() const override
TRANSFORM & GetTransform()
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
#define SHOW_ELEC_TYPE
Show pin electrical type. Shared with IS_ROLLOVER.
@ LAYER_SELECTION_SHADOWS
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE aType)
wxString PinShapeGetText(GRAPHIC_PINSHAPE aShape)
wxString PinOrientationName(PIN_ORIENTATION aOrientation)
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
PIN_ORIENTATION
The symbol library pin object orientations.
#define NO_SETTER(owner, type)
static struct SCH_PIN_DESC _SCH_PIN_DESC
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
wxString UnescapeString(const wxString &aSource)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
ELECTRICAL_PINTYPE m_Type
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".