47    if( !aPinNumber.StartsWith( 
"[" ) || !aPinNumber.EndsWith( 
"]" ) )
 
   50    const int minPinTextWidth = 
schIUScale.MilsToIU( 50 );
 
   51    const int maxPinTextWidth = std::max( aPinLength, minPinTextWidth );
 
   53    VECTOR2D fontSize( aTextSize, aTextSize );
 
   57    if( textExtents.
x <= maxPinTextWidth )
 
   61    wxString      inner = aPinNumber.Mid( 1, aPinNumber.Length() - 2 );
 
   71    for( 
size_t i = 0; i < parts.size(); ++i )
 
   73        wxString line = parts[i];
 
   74        line.Trim( 
true ).Trim( 
false );
 
 
   88#define PIN_TEXT_MARGIN 4 
  129        m_isDangling( 
true ),
 
  130        m_layoutCache( std::make_unique<PIN_LAYOUT_CACHE>( *
this ) )
 
  134        m_length       = 
schIUScale.MilsToIU( cfg->m_Defaults.pin_length );
 
  135        m_numTextSize  = 
schIUScale.MilsToIU( cfg->m_Defaults.pin_num_size );
 
  136        m_nameTextSize = 
schIUScale.MilsToIU( cfg->m_Defaults.pin_name_size );
 
 
  145                  int aNameTextSize, 
int aNumTextSize, 
int aBodyStyle, 
const VECTOR2I& aPos,
 
 
  176    wxASSERT( aParentSymbol );
 
 
  187                  const KIID& aUuid ) :
 
  198    wxASSERT( aParentSymbol );
 
 
  259        return symbol->GetTransform().TransformCoordinate( 
m_position ) + symbol->GetPosition();
 
 
  280    if( !
m_alt.IsEmpty() )
 
 
  315    if( !
m_alt.IsEmpty() )
 
 
  346        return ::GetCanonicalElectricalTypeName( 
m_type );
 
  351    return m_libPin->GetCanonicalElectricalTypeName();
 
 
  363    return m_libPin->GetElectricalTypeName();
 
 
  403    if( !
m_alt.IsEmpty() )
 
 
  427    m_name.Replace( wxT( 
" " ), wxT( 
"_" ) );
 
 
  440        m_alt = wxEmptyString;
 
  446        wxFAIL_MSG( wxString::Format( wxS( 
"Pin '%s' has no corresponding lib_pin" ), 
m_number ) );
 
  447        m_alt = wxEmptyString;
 
  451    if( !
m_libPin->GetAlternates().contains( aAlt ) )
 
  453        wxFAIL_MSG( wxString::Format( wxS( 
"Pin '%s' has no alterate '%s'" ), 
m_number, aAlt ) );
 
  454        m_alt = wxEmptyString;
 
 
  488                             || isPassiveOrNic( aPin->
GetType() );
 
  491                wxString::Format( 
"IsStacked: this='%s/%s' other='%s/%s' sameParent=%d samePos=%d sameName=%d typeCompat=%d",
 
  493                                  samePos, sameName, typeCompat ) );
 
  495    return sameParent && samePos && sameName && typeCompat;
 
 
  528    bool isReplaced = 
false;
 
 
  552        aAccuracy = std::max( aAccuracy, 
Schematic()->Settings().m_PinSymbolSize / 4 );
 
 
  579    if( !
m_alt.IsEmpty() )
 
 
  598                wxString::Format( 
"GetStackedPinNumbers: shown='%s'", shown ) );
 
  604                wxString::Format( 
"Expanded '%s' to %zu pins", shown, numbers.size() ) );
 
  605    for( 
const wxString& num : numbers )
 
 
  626    if( valid && !numbers.empty() )
 
  627        return numbers.front();    
 
 
  649    m_number.Replace( wxT( 
" " ), wxT( 
"_" ) );
 
 
  686        return m_libPin->GetNumberTextSize();
 
 
  707        const TRANSFORM& t = symbol->GetTransform();
 
 
  729    int                  MapX1, MapY1, x1, y1;
 
  749    x1 = aPosition.
x; y1 = aPosition.
y;
 
  751    switch( aOrientation )
 
  785        aPlotter->
MoveTo( 
VECTOR2I( MapX1 * deco_size * 2 + x1, MapY1 * deco_size * 2 + y1 ) );
 
  821            aPlotter->
LineTo( 
VECTOR2I( x1 + MapX1 * deco_size * 2, y1 - deco_size * 2 ) );
 
  827            aPlotter->
LineTo( 
VECTOR2I( x1 - deco_size * 2, y1 + MapY1 * deco_size * 2 ) );
 
  851                                    y1 - ( MapY1 - MapX1 ) * deco_size ) );
 
  853                                      y1 + ( MapY1 - MapX1 ) * deco_size ) );
 
  855                                    y1 - ( MapY1 + MapX1 ) * deco_size ) );
 
  857                                      y1 + ( MapY1 + MapX1 ) * deco_size ) );
 
  863        const int ex1 = aPosition.
x;
 
  864        const int ey1 = aPosition.
y;
 
 
  874                            int aTextInside, 
bool aDrawPinNum, 
bool aDrawPinName,
 
  883    if( aDrawPinNum && !number.IsEmpty() )
 
  890        aDrawPinName = 
false;
 
  893    if( !aDrawPinNum && !aDrawPinName )
 
  910        nameColor = nameColor.
Mix( bg, 0.5f );
 
  911        numColor = numColor.
Mix( bg, 0.5f );
 
  927                               int penWidth, 
const COLOR4D& col )
 
  939    auto plotMultiLineWithBraces = [&]( 
int anchorX, 
int anchorY, 
bool vertical, 
bool  )
 
  942        if( !number.StartsWith( 
"[" ) || !number.EndsWith( 
"]" ) || !number.Contains( 
"\n" ) )
 
  950        wxString content = number.Mid( 1, number.Length() - 2 );
 
  954        if( lines.size() <= 1 )
 
  963        int lineSpacing = 
KiROUND( textSize * 1.3 );
 
  967        int maxLineWidth = 0;
 
  968        for( 
const wxString& rawLine : lines )
 
  970            wxString trimmed = rawLine; trimmed.Trim(
true).Trim(
false);
 
  973            if( ext.
x > maxLineWidth )
 
  974                maxLineWidth = ext.
x;
 
  978        int startX = anchorX;
 
  979        int startY = anchorY;
 
  983            int totalWidth = ( (int) lines.size() - 1 ) * lineSpacing;
 
  984            startX -= totalWidth;
 
  988            int totalHeight = ( (int) lines.size() - 1 ) * lineSpacing;
 
  989            startY -= totalHeight;
 
  992        for( 
size_t i = 0; i < lines.size(); ++i )
 
  994            wxString l = lines[i]; l.Trim( 
true ).Trim( 
false );
 
  995            int lx = startX + ( vertical ? (int) i * lineSpacing : 0 );
 
  996            int ly = startY + ( vertical ? 0 : (int) i * lineSpacing );
 
  999                            textSize, numPenWidth, numColor );
 
 1003        auto plotBrace = [&]( 
const VECTOR2I& top, 
const VECTOR2I& bottom, 
bool leftOrTop, 
bool isVerticalText )
 
 1006            VECTOR2I mid = ( top + bottom ) / 2;
 
 1007            int braceWidth = textSize / 3; 
 
 1013            int offset = leftOrTop ? -braceWidth : braceWidth;
 
 1015            if( isVerticalText )
 
 1038        int braceWidth = textSize / 3;
 
 1039        int extraHeight = textSize / 3; 
 
 1044            int totalWidth = ( (int) lines.size() - 1 ) * lineSpacing;
 
 1045            VECTOR2I braceStart( startX - 2 * extraHeight, anchorY );
 
 1046            VECTOR2I braceEnd( startX + totalWidth + extraHeight, anchorY );
 
 1047            int braceSpacing = maxLineWidth / 2 + braceWidth;
 
 1049            VECTOR2I topStart = braceStart; topStart.
y -= braceSpacing;
 
 1050            VECTOR2I topEnd   = braceEnd;   topEnd.
y   -= braceSpacing;
 
 1051            VECTOR2I bottomStart = braceStart; bottomStart.
y += braceSpacing;
 
 1052            VECTOR2I bottomEnd   = braceEnd;   bottomEnd.
y   += braceSpacing;
 
 1054            plotBrace( topStart, topEnd, 
true,  
true );  
 
 1055            plotBrace( bottomStart, bottomEnd, 
false, 
true );
 
 1060            int totalHeight = ( (int) lines.size() - 1 ) * lineSpacing;
 
 1061            VECTOR2I braceStart( anchorX, startY - 2 * extraHeight );
 
 1062            VECTOR2I braceEnd( anchorX, startY + totalHeight + extraHeight );
 
 1063            int braceSpacing = maxLineWidth / 2 + braceWidth;
 
 1065            VECTOR2I leftTop = braceStart;   leftTop.
x  -= braceSpacing;
 
 1066            VECTOR2I leftBot = braceEnd;     leftBot.
x  -= braceSpacing;
 
 1067            VECTOR2I rightTop = braceStart;  rightTop.
x += braceSpacing;
 
 1068            VECTOR2I rightBot = braceEnd;    rightBot.
x += braceSpacing;
 
 1070            plotBrace( leftTop, leftBot, 
true,  
false );
 
 1071            plotBrace( rightTop, rightBot, 
false, 
false );
 
 1090                plotMultiLineWithBraces( ( x1 + aPinPos.
x ) / 2, y1 - num_offset, 
false, 
true );
 
 1100                    plotMultiLineWithBraces( x1 - num_offset, ( y1 + aPinPos.
y ) / 2, 
true, 
true );
 
 1108                    plotMultiLineWithBraces( x1 - num_offset, ( y1 + aPinPos.
y ) / 2, 
true, 
true );
 
 1116            if( aDrawPinName && aDrawPinNum )
 
 1121                plotMultiLineWithBraces( ( x1 + aPinPos.
x ) / 2, y1 + num_offset, 
false, 
true );
 
 1123            else if( aDrawPinName )
 
 1129            else if( aDrawPinNum )
 
 1131                plotMultiLineWithBraces( ( x1 + aPinPos.
x ) / 2, y1 - name_offset, 
false, 
true );
 
 1136            if( aDrawPinName && aDrawPinNum )
 
 1138                plotSimpleText( x1 - name_offset, ( y1 + aPinPos.
y ) / 2, 
ANGLE_VERTICAL,
 
 1141                plotMultiLineWithBraces( x1 + num_offset, ( y1 + aPinPos.
y ) / 2, 
true, 
true );
 
 1143            else if( aDrawPinName )
 
 1145                plotSimpleText( x1 - name_offset, ( y1 + aPinPos.
y ) / 2, 
ANGLE_VERTICAL,
 
 1149            else if( aDrawPinNum )
 
 1151                plotMultiLineWithBraces( x1 - num_offset, ( y1 + aPinPos.
y ) / 2, 
true, 
true );
 
 
 1204    int lengthChange = 
GetLength() - aLength;
 
 1212        offsetX = lengthChange;
 
 1215        offsetX = -1 * lengthChange;
 
 1218        offsetY = -1 * lengthChange;
 
 1221        offsetY = lengthChange;
 
 
 1315                    int aUnit, 
int aBodyStyle, 
const VECTOR2I& aOffset, 
bool aDimmed )
 
 
 1340    aList.emplace_back( 
_( 
"Type" ), 
_( 
"Pin" ) );
 
 1349    aList.emplace_back( 
_( 
"Visible" ), 
IsVisible() ? 
_( 
"Yes" ) : 
_( 
"No" ) );
 
 1367        aList.emplace_back( symbol->
GetRef( currentSheet ),
 
 
 1422        if( it->second.second == aForceNoConnect )
 
 1423            return it->second.first;
 
 1426    wxString 
name = 
"Net-(";
 
 1427    bool unconnected = 
false;
 
 1432        name = ( 
"unconnected-(" );
 
 1435    bool annotated = 
true;
 
 1437    std::vector<SCH_PIN*> pins = symbol->
GetPins( &aPath );
 
 1438    bool has_multiple = 
false;
 
 1446            has_multiple = 
true;
 
 1451    wxString libPinShownName   = 
m_libPin ? 
m_libPin->GetShownName()   : wxString( 
"??" );
 
 1452    wxString libPinShownNumber = 
m_libPin ? 
m_libPin->GetShownNumber() : wxString( 
"??" );
 
 1453    wxString effectivePadNumber = 
m_libPin ? 
m_libPin->GetEffectivePadNumber() : libPinShownNumber;
 
 1455    if( effectivePadNumber != libPinShownNumber )
 
 1458                    wxString::Format( 
"GetDefaultNetName: stacked pin shown='%s' -> using smallest logical='%s'",
 
 1459                                      libPinShownNumber, effectivePadNumber ) );
 
 1463    if( symbol->
GetRef( &aPath, 
false ).Last() == 
'?' )
 
 1467        wxString libPinNumber = 
m_libPin ? 
m_libPin->GetNumber() : wxString( 
"??" );
 
 1469        if( effectivePadNumber != libPinShownNumber && !effectivePadNumber.IsEmpty() )
 
 1470            libPinNumber = effectivePadNumber;
 
 1472        name << 
"-Pad" << libPinNumber << 
")";
 
 1475    else if( !libPinShownName.IsEmpty() && ( libPinShownName != libPinShownNumber ) )
 
 1482        if( unconnected || has_multiple )
 
 
 1520    if( aCache->
m_Font == aFont
 
 
 1539                               bool aIncludeElectricalType )
 const 
 1542    return m_layoutCache->GetPinBoundingBox( aIncludeLabelsOnInvisiblePins, aIncludeNameAndNumber,
 
 1543                                             aIncludeElectricalType );
 
 
 1557    wxCHECK( 
pin, 
false );
 
 
 1597        if( !
m_alt.IsEmpty() )
 
 1600            alt = &localStorage;
 
 1603        wxString itemDesc = 
m_libPin ? 
m_libPin->GetItemDescription( aUnitsProvider, alt )
 
 1604                                     : wxString( wxS( 
"Undefined library pin." ) );
 
 1608        return wxString::Format( 
"Symbol %s %s",
 
 
 1625        if ( !
name.IsEmpty() )
 
 1627            return wxString::Format( 
_( 
"Pin %s [%s, %s, %s]" ),
 
 1635            return wxString::Format( 
_( 
"Pin %s [%s, %s]" ),
 
 1643        if( !
name.IsEmpty() )
 
 1645            return wxString::Format( 
_( 
"Hidden pin %s [%s, %s, %s]" ),
 
 1653            return wxString::Format( 
_( 
"Hidden pin %s [%s, %s]" ),
 
 
 1713            return static_cast<int>( 
m_shape ) - 
static_cast<int>( tmp->
m_shape );
 
 1716            return static_cast<int>( 
m_type ) - 
static_cast<int>( tmp->
m_type );
 
 1735            const ALT& lhsAlt = lhsItem->second;
 
 1736            const ALT& rhsAlt = rhsItem->second;
 
 1744                return static_cast<int>( lhsAlt.
m_Type ) - 
static_cast<int>( rhsAlt.
m_Type );
 
 1747                return static_cast<int>( lhsAlt.
m_Shape ) - 
static_cast<int>( rhsAlt.
m_Shape );
 
 
 1820    aStream << 
"SCH_PIN:" << std::endl
 
 1821            << 
"  Name: \"" << 
m_name << 
"\"" << std::endl
 
 1822            << 
"  Number: \"" << 
m_number << 
"\"" << std::endl
 
 1824            << 
"  Length: " << 
GetLength() << std::endl
 
 
 1837void SCH_PIN::Show( 
int nestLevel, std::ostream& os )
 const 
 1839    NestedSpace( nestLevel, os ) << 
'<' << 
GetClass().Lower().mb_str()
 
 1860        if( pinTypeEnum.Choices().GetCount() == 0 )
 
 1878        if( pinShapeEnum.Choices().GetCount() == 0 )
 
 1893        if( orientationEnum.Choices().GetCount() == 0 )
 
 1901        auto isSymbolEditor =
 
 1905                        return dynamic_cast<LIB_SYMBOL*
>( 
pin->GetParentSymbol() ) != 
nullptr;
 
 
 
constexpr EDA_IU_SCALE schIUScale
 
BITMAPS
A list of all bitmap identifiers.
 
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
 
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
 
constexpr bool Contains(const Vec &aPoint) const
 
constexpr bool Intersects(const BOX2< Vec > &aRect) const
 
static const COLOR4D WHITE
 
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
 
The base class for create windows for drawing purpose.
 
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
Owner.
 
static bool Replace(const EDA_SEARCH_DATA &aSearchData, wxString &aText)
Perform a text replace on aText using the find and replace criteria in aSearchData on items that supp...
 
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.
 
static ENUM_MAP< T > & Instance()
 
Class that other classes need to inherit from, in order to be inspectable.
 
FONT is an abstract base class for both outline and stroke fonts.
 
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
 
VECTOR2I StringBoundaryLimits(const wxString &aText, const VECTOR2I &aSize, int aThickness, bool aBold, bool aItalic, const METRICS &aFontMetrics) const
Compute the boundary limits of aText (the bounding box of all shapes).
 
A color representation with 4 components: red, green, blue, alpha.
 
COLOR4D & Desaturate()
Removes color (in HSL model)
 
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
 
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
 
int GetDefaultPenWidth() const
 
const wxString & GetDefaultFont() const
 
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
 
virtual const COLOR4D & GetBackgroundColor() const =0
Return current background color settings.
 
wxString AsString() const
 
Define a library symbol object.
 
A pin layout helper is a class that manages the layout of the parts of a pin on a schematic symbol:
 
Base plotter engine class.
 
virtual void Circle(const VECTOR2I &pos, int diametre, FILL_T fill, int width)=0
 
void MoveTo(const VECTOR2I &pos)
 
void FinishTo(const VECTOR2I &pos)
 
RENDER_SETTINGS * RenderSettings()
 
bool GetColorMode() const
 
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
 
void LineTo(const VECTOR2I &pos)
 
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont=nullptr, const KIFONT::METRICS &aFontMetrics=KIFONT::METRICS::Default(), void *aData=nullptr)
 
virtual void SetColor(const COLOR4D &color)=0
 
PROPERTY_BASE & SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Set a callback function to determine whether an object provides this property.
 
PROPERTY_BASE & SetWriteableFunc(std::function< bool(INSPECTABLE *)> aFunc)
 
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.
 
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
 
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
 
wxString GetNetName() const
 
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,...
 
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.
 
SCH_ITEM & operator=(const SCH_ITEM &aPin)
 
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
 
const SYMBOL * GetParentSymbol() const
 
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
 
virtual int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const
Provide the draw object specific comparison called by the == and < operators.
 
bool IsConnectivityDirty() const
 
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
 
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
 
const KIFONT::METRICS & GetFontMetrics() const
 
int GetEffectivePenWidth(const SCH_RENDER_SETTINGS *aSettings) const
 
double SimilarityBase(const SCH_ITEM &aItem) const
Calculate the boilerplate similarity for all LIB_ITEMs without preventing the use above of a pure vir...
 
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW=true) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
 
std::ostream & operator<<(std::ostream &aStream)
 
void SetAlt(const wxString &aAlt)
Set the name of the alternate pin.
 
void PlotPinTexts(PLOTTER *aPlotter, const VECTOR2I &aPinPos, PIN_ORIENTATION aPinOrient, int aTextInside, bool aDrawPinNum, bool aDrawPinName, bool aDimmed) const
Plot the pin name and number.
 
int GetNumberTextSize() const
 
std::optional< bool > m_hidden
 
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.
 
std::unique_ptr< PIN_LAYOUT_CACHE > m_layoutCache
The layout cache for this pin.
 
void MirrorVerticallyPin(int aCenter)
 
void validateExtentsCache(KIFONT::FONT *aFont, int aSize, const wxString &aText, EXTENTS_CACHE *aCache) const
 
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
 
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
 
void CalcEdit(const VECTOR2I &aPosition) override
Calculate the attributes of an item at aPosition when it is being edited.
 
void SetNumber(const wxString &aNumber)
 
std::optional< int > m_nameTextSize
 
PIN_ORIENTATION PinDrawOrient(const TRANSFORM &aTransform) const
Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), according to its orientation...
 
void SetVisible(bool aVisible)
 
void ChangeLength(int aLength)
Change the length of a pin and adjust its position based on orientation.
 
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::optional< wxString > GetSmallestLogicalNumber() const
Return the smallest logical pin number if this pin uses stacked notation and it is valid.
 
void Move(const VECTOR2I &aOffset) override
Move the item by aMoveVector to a new position.
 
std::map< const SCH_SHEET_PATH, std::pair< wxString, bool > > m_net_name_map
 
PIN_ORIENTATION m_orientation
 
void SetOrientation(PIN_ORIENTATION aOrientation)
 
void SetName(const wxString &aName)
 
bool IsGlobalPower() const
Return whether this pin forms a global power connection: i.e., is part of a power symbol and of type ...
 
wxString getItemDescription(ALT *aAlt) const
 
bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const override
Return true if this item should propagate connection info to aItem.
 
std::optional< int > m_numTextSize
 
VECTOR2I GetPinRoot() const
 
bool IsLocalPower() const
Local power pin is the same except that it is sheet-local and it does not support the legacy hidden p...
 
ELECTRICAL_PINTYPE m_type
 
wxString GetEffectivePadNumber() const
Return the pin number to be used for deterministic operations such as auto‑generated net names.
 
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
 
SCH_PIN * GetLibPin() const
 
void SetPosition(const VECTOR2I &aPos) override
 
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
 
void SetIsDangling(bool aIsDangling)
 
wxString GetElectricalTypeName() const
 
std::vector< wxString > GetStackedPinNumbers(bool *aValid=nullptr) const
 
std::map< wxString, ALT > m_alternates
 
const wxString & GetName() const
 
int GetStackedPinCount(bool *aValid=nullptr) const
Return the count of logical pins represented by this pin's stacked notation.
 
bool IsDangling() const override
 
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.
 
void MirrorHorizontally(int aCenter) override
These transforms have effect only if the pin has a LIB_SYMBOL as parent.
 
std::recursive_mutex m_netmap_mutex
The name that this pin connection will drive onto a net.
 
PIN_ORIENTATION GetOrientation() const
 
wxString GetClass() const override
Return the class name.
 
void SetNumberTextSize(int aSize)
 
void SetShape(GRAPHIC_PINSHAPE aShape)
 
void RotatePin(const VECTOR2I &aCenter, bool aRotateCCW=true)
 
VECTOR2I GetPosition() const override
 
wxString GetCanonicalElectricalTypeName() const
 
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 ...
 
int GetNameTextSize() const
 
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
 
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
The pin specific sort order is as follows:
 
wxString GetShownName() const
 
void MirrorHorizontallyPin(int aCenter)
These transforms have always effects.
 
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
 
void SetType(ELECTRICAL_PINTYPE aType)
 
const wxString & GetBaseName() const
Get the name without any alternates.
 
void ClearDefaultNetName(const SCH_SHEET_PATH *aPath)
 
SCH_PIN(LIB_SYMBOL *aParentSymbol)
 
bool IsStacked(const SCH_PIN *aPin) const
 
const wxString & GetNumber() 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)
 
std::optional< int > m_length
 
GRAPHIC_PINSHAPE GetShape() const
 
void PlotPinType(PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation, bool aDimmed) const
 
bool IsPower() const
Check if the pin is either a global or local power pin.
 
ELECTRICAL_PINTYPE GetType() const
 
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
 
void SetNameTextSize(int aSize)
 
VECTOR2I TransformCoordinate(const VECTOR2I &aPoint) const
 
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
 
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
 
const wxString GetValue(bool aResolve, const SCH_SHEET_PATH *aPath, bool aAllowExtraText) const override
 
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet) const
Retrieve a list of the SCH_PINs for the given sheet path.
 
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
 
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
 
A base class for LIB_SYMBOL and SCH_SYMBOL.
 
virtual bool IsGlobalPower() const =0
 
virtual bool IsLocalPower() const =0
 
virtual const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const =0
 
int GetPinNameOffset() const
 
virtual bool GetShowPinNames() const
 
virtual bool GetShowPinNumbers() const
 
GR_TEXT_H_ALIGN_T m_Halign
 
GR_TEXT_V_ALIGN_T m_Valign
 
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
 
#define DEFAULT_PINNUM_SIZE
The default pin name size when creating pins(can be changed in preference menu)
 
#define DEFAULT_PINNAME_SIZE
The default selection highlight thickness (can be changed in preference menu)
 
#define DEFAULT_PIN_LENGTH
The default pin number size when creating pins(can be changed in preference menu)
 
static constexpr EDA_ANGLE ANGLE_90
 
static constexpr EDA_ANGLE ANGLE_VERTICAL
 
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
 
#define STRUCT_DELETED
flag indication structures to be erased
 
#define SKIP_STRUCT
flag indicating that the structure should be ignored
 
#define SHOW_ELEC_TYPE
Show pin electrical type.
 
int GetPenSizeForNormal(int aTextSize)
 
const wxChar *const traceStackedPins
Flag to enable debug output for stacked pins handling in symbol/pin code.
 
@ LAYER_SELECTION_SHADOWS
 
static int externalPinDecoSize(const SCHEMATIC_SETTINGS *aSettings, const SCH_PIN &aPin)
 
static int internalPinDecoSize(const SCHEMATIC_SETTINGS *aSettings, const SCH_PIN &aPin)
 
wxString FormatStackedPinForDisplay(const wxString &aPinNumber, int aPinLength, int aTextSize, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics)
 
wxString PinShapeGetText(GRAPHIC_PINSHAPE shape)
 
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
 
@ PT_INPUT
usual pin input: must be connected
 
@ PT_NC
not connected (must be left open)
 
@ PT_TRISTATE
tri state bus pin
 
@ PT_NIC
not internally connected (may be connected to anything)
 
@ PT_BIDI
input or output (like port for a microprocessor)
 
@ PT_OPENEMITTER
pin type open emitter
 
@ PT_POWER_OUT
output of a regulator: intended to be connected to power input pins
 
@ PT_OPENCOLLECTOR
pin type open collector
 
@ PT_POWER_IN
power input (GND, VCC for ICs). Must be connected to a power output.
 
@ PT_UNSPECIFIED
unknown electrical properties: creates always a warning when connected
 
@ PT_PASSIVE
pin for passive symbols: must be connected, and can be connected to any pin.
 
BITMAPS ElectricalPinTypeGetBitmap(ELECTRICAL_PINTYPE)
 
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE)
 
wxString PinOrientationName(PIN_ORIENTATION aOrientation)
 
PIN_ORIENTATION
The symbol library pin object orientations.
 
@ PIN_UP
The pin extends upwards from the connection point: Probably on the bottom side of the symbol.
 
@ PIN_RIGHT
The pin extends rightwards from the connection point.
 
@ PIN_LEFT
The pin extends leftwards from the connection point: Probably on the right side of the symbol.
 
@ PIN_DOWN
The pin extends downwards from the connection: Probably on the top side of the symbol.
 
#define ENUM_TO_WXANY(type)
Macro to define read-only fields (no setter method available)
 
@ PT_COORD
Coordinate expressed in distance units (mm/inch)
 
@ PT_SIZE
Size expressed in distance units (mm/inch)
 
wxString FormatStackedPinForDisplay(const wxString &aPinNumber, int aPinLength, int aTextSize, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics)
 
static int externalPinDecoSize(const RENDER_SETTINGS *aSettings, const SCH_PIN &aPin)
Utility for getting the size of the 'external' pin decorators (as a radius) i.e.
 
static int internalPinDecoSize(const RENDER_SETTINGS *aSettings, const SCH_PIN &aPin)
Utility for getting the size of the 'internal' pin decorators (as a radius) i.e.
 
static struct SCH_PIN_DESC _SCH_PIN_DESC
 
#define TARGET_PIN_RADIUS
 
T * GetAppSettings(const char *aFilename)
 
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase)
Compare two strings with alphanumerical content.
 
std::vector< wxString > ExpandStackedPinNotation(const wxString &aPinName, bool *aValid)
Expand stacked pin notation like [1,2,3], [1-4], [A1-A4], or [AA1-AA3,AB4,CD12-CD14] into individual ...
 
wxString UnescapeString(const wxString &aSource)
 
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
 
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
 
int CountStackedPinNotation(const wxString &aPinName, bool *aValid)
Count the number of pins represented by stacked pin notation without allocating strings.
 
ELECTRICAL_PINTYPE m_Type
 
@ REFERENCE
Field Reference of part, i.e. "IC21".
 
@ VALUE
Field Value of part, i.e. "3.3K".
 
wxString result
Test unit parsing edge cases and error handling.
 
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
 
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.
 
wxLogTrace helper definitions.
 
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
 
VECTOR2< int32_t > VECTOR2I
 
VECTOR2< double > VECTOR2D