From bcdec0dea705e2eda9d547ba9f74a1f43ab3d8b5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 12 Jun 2021 19:54:34 +0100 Subject: [PATCH] Move '~' pin name processing to LIB_PIN and SCH_PIN. This will also allow us to do variable processing in the future if desired. --- eeschema/connection_graph.cpp | 4 +- eeschema/lib_pin.cpp | 103 ++++++++++-------- eeschema/lib_pin.h | 2 + .../netlist_exporter_xml.cpp | 6 +- eeschema/sch_painter.cpp | 10 +- eeschema/sch_pin.cpp | 13 ++- eeschema/sch_pin.h | 3 + eeschema/tools/sch_editor_control.cpp | 2 +- 8 files changed, 84 insertions(+), 59 deletions(-) diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index 22a1871226..c8dac23797 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -945,7 +945,7 @@ void CONNECTION_GRAPH::buildConnectionGraph() if( connection->SubgraphCode() > 0 ) continue; - connection->SetName( pin->GetName() ); + connection->SetName( pin->GetShownName() ); int code = assignNewNetCode( *connection ); @@ -1241,7 +1241,7 @@ void CONNECTION_GRAPH::buildConnectionGraph() { auto pin = static_cast( driver ); - if( pin->IsPowerConnection() && pin->GetName() == test_name ) + if( pin->IsPowerConnection() && pin->GetShownName() == test_name ) { match = true; break; diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 3657372998..a2a433868c 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -168,6 +168,15 @@ int LIB_PIN::GetPenWidth() const } +wxString LIB_PIN::GetShownName() const +{ + if( m_name == "~" ) + return wxEmptyString; + else + return m_name; +} + + void LIB_PIN::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData, const TRANSFORM& aTransform ) { @@ -349,9 +358,15 @@ void LIB_PIN::printPinTexts( const RENDER_SETTINGS* aSettings, wxPoint& aPinPos, case PIN_RIGHT: x1 += m_length; break; } - if( m_name.IsEmpty() ) + wxString name = GetShownName(); + wxString number = GetShownNumber(); + + if( name.IsEmpty() ) aDrawPinName = false; + if( number.IsEmpty() ) + aDrawPinNum = false; + if( aTextInside ) // Draw the text inside, but the pin numbers outside. { if(( aPinOrient == PIN_LEFT) || ( aPinOrient == PIN_RIGHT) ) @@ -362,22 +377,22 @@ void LIB_PIN::printPinTexts( const RENDER_SETTINGS* aSettings, wxPoint& aPinPos, if( aPinOrient == PIN_RIGHT ) { x = x1 + aTextInside; - GRText( DC, wxPoint( x, y1 ), NameColor, m_name, TEXT_ANGLE_HORIZ, - PinNameSize, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, - namePenWidth, false, false ); + GRText( DC, wxPoint( x, y1 ), NameColor, name, TEXT_ANGLE_HORIZ, PinNameSize, + GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false, + false ); } else // Orient == PIN_LEFT { x = x1 - aTextInside; - GRText( DC, wxPoint( x, y1 ), NameColor, m_name, TEXT_ANGLE_HORIZ, - PinNameSize, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, - namePenWidth, false, false ); + GRText( DC, wxPoint( x, y1 ), NameColor, name, TEXT_ANGLE_HORIZ, PinNameSize, + GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false, + false ); } } if( aDrawPinNum ) { - GRText( DC, wxPoint(( x1 + aPinPos.x) / 2, y1 - num_offset ), NumColor, m_number, + GRText( DC, wxPoint(( x1 + aPinPos.x) / 2, y1 - num_offset ), NumColor, number, TEXT_ANGLE_HORIZ, PinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false ); } @@ -391,7 +406,7 @@ void LIB_PIN::printPinTexts( const RENDER_SETTINGS* aSettings, wxPoint& aPinPos, if( aDrawPinName ) { - GRText( DC, wxPoint( x1, y ), NameColor, m_name, TEXT_ANGLE_VERT, PinNameSize, + GRText( DC, wxPoint( x1, y ), NameColor, name, TEXT_ANGLE_VERT, PinNameSize, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false, false ); } @@ -399,7 +414,7 @@ void LIB_PIN::printPinTexts( const RENDER_SETTINGS* aSettings, wxPoint& aPinPos, if( aDrawPinNum ) { GRText( DC, wxPoint( x1 - num_offset, ( y1 + aPinPos.y) / 2 ), NumColor, - m_number, TEXT_ANGLE_VERT, PinNumSize, GR_TEXT_HJUSTIFY_CENTER, + number, TEXT_ANGLE_VERT, PinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false ); } } @@ -409,7 +424,7 @@ void LIB_PIN::printPinTexts( const RENDER_SETTINGS* aSettings, wxPoint& aPinPos, if( aDrawPinName ) { - GRText( DC, wxPoint( x1, y ), NameColor, m_name, TEXT_ANGLE_VERT, PinNameSize, + GRText( DC, wxPoint( x1, y ), NameColor, name, TEXT_ANGLE_VERT, PinNameSize, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false, false ); } @@ -417,7 +432,7 @@ void LIB_PIN::printPinTexts( const RENDER_SETTINGS* aSettings, wxPoint& aPinPos, if( aDrawPinNum ) { GRText( DC, wxPoint( x1 - num_offset, ( y1 + aPinPos.y) / 2 ), NumColor, - m_number, TEXT_ANGLE_VERT, PinNumSize, GR_TEXT_HJUSTIFY_CENTER, + number, TEXT_ANGLE_VERT, PinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false ); } } @@ -431,14 +446,14 @@ void LIB_PIN::printPinTexts( const RENDER_SETTINGS* aSettings, wxPoint& aPinPos, if( aDrawPinName ) { x = ( x1 + aPinPos.x) / 2; - GRText( DC, wxPoint( x, y1 - name_offset ), NameColor, m_name, TEXT_ANGLE_HORIZ, + GRText( DC, wxPoint( x, y1 - name_offset ), NameColor, name, TEXT_ANGLE_HORIZ, PinNameSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, namePenWidth, false, false ); } if( aDrawPinNum ) { x = ( x1 + aPinPos.x) / 2; - GRText( DC, wxPoint( x, y1 + num_offset ), NumColor, m_number, TEXT_ANGLE_HORIZ, + GRText( DC, wxPoint( x, y1 + num_offset ), NumColor, number, TEXT_ANGLE_HORIZ, PinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, numPenWidth, false, false ); } @@ -448,14 +463,14 @@ void LIB_PIN::printPinTexts( const RENDER_SETTINGS* aSettings, wxPoint& aPinPos, if( aDrawPinName ) { y = ( y1 + aPinPos.y) / 2; - GRText( DC, wxPoint( x1 - name_offset, y ), NameColor, m_name, TEXT_ANGLE_VERT, + GRText( DC, wxPoint( x1 - name_offset, y ), NameColor, name, TEXT_ANGLE_VERT, PinNameSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, namePenWidth, false, false ); } if( aDrawPinNum ) { - GRText( DC, wxPoint( x1 + num_offset, ( y1 + aPinPos.y) / 2 ), NumColor, m_number, + GRText( DC, wxPoint( x1 + num_offset, ( y1 + aPinPos.y) / 2 ), NumColor, number, TEXT_ANGLE_VERT, PinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, numPenWidth, false, false ); } @@ -650,10 +665,13 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie void LIB_PIN::PlotPinTexts( PLOTTER* aPlotter, const wxPoint& aPinPos, int aPinOrient, int aTextInside, bool aDrawPinNum, bool aDrawPinName ) const { - if( m_name.IsEmpty() || m_name == wxT( "~" ) ) + wxString name = GetShownName(); + wxString number = GetShownNumber(); + + if( name.IsEmpty() ) aDrawPinName = false; - if( m_number.IsEmpty() ) + if( number.IsEmpty() ) aDrawPinNum = false; if( !aDrawPinNum && !aDrawPinName ) @@ -705,14 +723,14 @@ void LIB_PIN::PlotPinTexts( PLOTTER* aPlotter, const wxPoint& aPinPos, int aPinO hjustify = GR_TEXT_HJUSTIFY_RIGHT; } - aPlotter->Text( wxPoint( x, y1 ), nameColor, m_name, TEXT_ANGLE_HORIZ, pinNameSize, + aPlotter->Text( wxPoint( x, y1 ), nameColor, name, TEXT_ANGLE_HORIZ, pinNameSize, hjustify, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false, false ); } if( aDrawPinNum ) { aPlotter->Text( wxPoint( ( x1 + aPinPos.x) / 2, y1 - num_offset ), numColor, - m_number, TEXT_ANGLE_HORIZ, pinNumSize, GR_TEXT_HJUSTIFY_CENTER, + number, TEXT_ANGLE_HORIZ, pinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false ); } } @@ -723,14 +741,14 @@ void LIB_PIN::PlotPinTexts( PLOTTER* aPlotter, const wxPoint& aPinPos, int aPinO y = y1 + aTextInside; if( aDrawPinName ) - aPlotter->Text( wxPoint( x1, y ), nameColor, m_name, TEXT_ANGLE_VERT, + aPlotter->Text( wxPoint( x1, y ), nameColor, name, TEXT_ANGLE_VERT, pinNameSize, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false, false ); if( aDrawPinNum ) { aPlotter->Text( wxPoint( x1 - num_offset, ( y1 + aPinPos.y) / 2 ), numColor, - m_number, TEXT_ANGLE_VERT, pinNumSize, GR_TEXT_HJUSTIFY_CENTER, + number, TEXT_ANGLE_VERT, pinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false ); } } @@ -740,7 +758,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* aPlotter, const wxPoint& aPinPos, int aPinO if( aDrawPinName ) { - aPlotter->Text( wxPoint( x1, y ), nameColor, m_name, TEXT_ANGLE_VERT, + aPlotter->Text( wxPoint( x1, y ), nameColor, name, TEXT_ANGLE_VERT, pinNameSize, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false, false ); } @@ -748,7 +766,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* aPlotter, const wxPoint& aPinPos, int aPinO if( aDrawPinNum ) { aPlotter->Text( wxPoint( x1 - num_offset, ( y1 + aPinPos.y) / 2 ), numColor, - m_number, TEXT_ANGLE_VERT, pinNumSize, GR_TEXT_HJUSTIFY_CENTER, + number, TEXT_ANGLE_VERT, pinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false ); } } @@ -762,7 +780,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* aPlotter, const wxPoint& aPinPos, int aPinO if( aDrawPinName ) { x = ( x1 + aPinPos.x) / 2; - aPlotter->Text( wxPoint( x, y1 - name_offset ), nameColor, m_name, + aPlotter->Text( wxPoint( x, y1 - name_offset ), nameColor, name, TEXT_ANGLE_HORIZ, pinNameSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, namePenWidth, false, false ); } @@ -770,7 +788,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* aPlotter, const wxPoint& aPinPos, int aPinO if( aDrawPinNum ) { x = ( x1 + aPinPos.x ) / 2; - aPlotter->Text( wxPoint( x, y1 + num_offset ), numColor, m_number, + aPlotter->Text( wxPoint( x, y1 + num_offset ), numColor, number, TEXT_ANGLE_HORIZ, pinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, numPenWidth, false, false ); } @@ -780,7 +798,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* aPlotter, const wxPoint& aPinPos, int aPinO if( aDrawPinName ) { y = ( y1 + aPinPos.y ) / 2; - aPlotter->Text( wxPoint( x1 - name_offset, y ), nameColor, m_name, + aPlotter->Text( wxPoint( x1 - name_offset, y ), nameColor, name, TEXT_ANGLE_VERT, pinNameSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, namePenWidth, false, false ); } @@ -788,7 +806,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* aPlotter, const wxPoint& aPinPos, int aPinO if( aDrawPinNum ) { aPlotter->Text( wxPoint( x1 + num_offset, ( y1 + aPinPos.y ) / 2 ), numColor, - m_number, TEXT_ANGLE_VERT, pinNumSize, GR_TEXT_HJUSTIFY_CENTER, + number, TEXT_ANGLE_VERT, pinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, numPenWidth, false, false ); } } @@ -1002,20 +1020,16 @@ void LIB_PIN::Plot( PLOTTER* aPlotter, const wxPoint& aPffset, bool aFill, void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) { - wxString text = m_number.IsEmpty() ? wxT( "?" ) : m_number; - LIB_ITEM::GetMsgPanelInfo( aFrame, aList ); - aList.push_back( MSG_PANEL_ITEM( _( "Name" ), m_name ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Number" ), text ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Name" ), GetShownName() ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Number" ), GetShownNumber() ) ); aList.push_back( MSG_PANEL_ITEM( _( "Type" ), ElectricalPinTypeGetText( m_type ) ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Style" ), PinShapeGetText( m_shape ) ) ); - text = PinShapeGetText( m_shape ); + wxString text = IsVisible() ? _( "Yes" ) : _( "No" ); aList.push_back( MSG_PANEL_ITEM( _( "Style" ), text ) ); - text = IsVisible() ? _( "Yes" ) : _( "No" ); - aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), text ) ); - // Display pin length text = StringFromValue( aFrame->GetUserUnits(), m_length ); aList.push_back( MSG_PANEL_ITEM( _( "Length" ), text ) ); @@ -1041,8 +1055,10 @@ const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles, bool aPinOnly ) wxPoint begin; wxPoint end; int nameTextOffset = 0; - bool showName = !m_name.IsEmpty() && ( m_name != wxT( "~" ) ); - bool showNum = !m_number.IsEmpty(); + wxString name = GetShownName(); + wxString number = GetShownNumber(); + bool showName = !name.IsEmpty(); + bool showNum = !number.IsEmpty(); int minsizeV = TARGET_PIN_RADIUS; if( !aIncludeInvisibles && !IsVisible() ) @@ -1066,7 +1082,7 @@ const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles, bool aPinOnly ) } // First, calculate boundary box corners position - int numberTextLength = showNum ? m_numTextSize * m_number.Len() : 0; + int numberTextLength = showNum ? m_numTextSize * number.Len() : 0; // Actual text height is bigger than text size int numberTextHeight = showNum ? KiROUND( m_numTextSize * 1.1 ) : 0; @@ -1085,12 +1101,9 @@ const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles, bool aPinOnly ) if( showName ) { - int length = m_name.Len(); - - // Don't count the line over text symbol. - if( m_name.Left( 1 ) == wxT( "~" ) ) - length -= 1; + int length = name.Len(); + // TODO: exclude markup characters! nameTextLength = ( m_nameTextSize * length ) + nameTextOffset; // Actual text height are bigger than text size @@ -1196,7 +1209,5 @@ void LIB_PIN::Show( int nestLevel, std::ostream& os ) const void LIB_PIN::CalcEdit( const wxPoint& aPosition ) { if( IsMoving() ) - { MoveTo( aPosition ); - } } diff --git a/eeschema/lib_pin.h b/eeschema/lib_pin.h index 63af9791b8..74a3a2d7d8 100644 --- a/eeschema/lib_pin.h +++ b/eeschema/lib_pin.h @@ -104,6 +104,7 @@ public: } const wxString& GetName() const { return m_name; } + wxString GetShownName() const; void SetName( const wxString& aName ) { m_name = aName; @@ -113,6 +114,7 @@ public: } const wxString& GetNumber() const { return m_number; } + wxString GetShownNumber() const { return m_number; } void SetNumber( const wxString& aNumber ) { m_number = aNumber; diff --git a/eeschema/netlist_exporters/netlist_exporter_xml.cpp b/eeschema/netlist_exporters/netlist_exporter_xml.cpp index be12d68be8..9519924218 100644 --- a/eeschema/netlist_exporters/netlist_exporter_xml.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_xml.cpp @@ -583,8 +583,8 @@ XNODE* NETLIST_EXPORTER_XML::makeLibParts() XNODE* pin; pins->AddChild( pin = node( "pin" ) ); - pin->AddAttribute( "num", pinList[i]->GetNumber() ); - pin->AddAttribute( "name", pinList[i]->GetName() ); + pin->AddAttribute( "num", pinList[i]->GetShownNumber() ); + pin->AddAttribute( "name", pinList[i]->GetShownName() ); pin->AddAttribute( "type", pinList[i]->GetCanonicalElectricalTypeName() ); // caution: construction work site here, drive slowly @@ -738,7 +738,7 @@ XNODE* NETLIST_EXPORTER_XML::makeListOfNets( unsigned aCtl ) xnode->AddAttribute( "ref", refText ); xnode->AddAttribute( "pin", pinText ); - wxString pinName = netNode.m_Pin->GetName(); + wxString pinName = netNode.m_Pin->GetShownName(); wxString pinType = netNode.m_Pin->GetCanonicalElectricalTypeName(); // ~ is a char used to code empty strings in libs. diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 27c3a438b2..412fd96e53 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -980,12 +980,12 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer ) size [INSIDE] = libEntry->ShowPinNames() ? aPin->GetNameTextSize() : 0; thickness[INSIDE] = nameLineWidth; colour [INSIDE] = getRenderColor( aPin, LAYER_PINNAM, drawingShadows ); - text [INSIDE] = aPin->GetName(); + text [INSIDE] = aPin->GetShownName(); size [ABOVE] = libEntry->ShowPinNumbers() ? aPin->GetNumberTextSize() : 0; thickness[ABOVE] = numLineWidth; colour [ABOVE] = getRenderColor( aPin, LAYER_PINNUM, drawingShadows ); - text [ABOVE] = aPin->GetNumber(); + text [ABOVE] = aPin->GetShownNumber(); } // Otherwise pin NAMES go above and pin NUMBERS go below else @@ -993,12 +993,12 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer ) size [ABOVE] = libEntry->ShowPinNames() ? aPin->GetNameTextSize() : 0; thickness[ABOVE] = nameLineWidth; colour [ABOVE] = getRenderColor( aPin, LAYER_PINNAM, drawingShadows ); - text [ABOVE] = aPin->GetName(); + text [ABOVE] = aPin->GetShownName(); size [BELOW] = libEntry->ShowPinNumbers() ? aPin->GetNumberTextSize() : 0; thickness[BELOW] = numLineWidth; colour [BELOW] = getRenderColor( aPin, LAYER_PINNUM, drawingShadows ); - text [BELOW] = aPin->GetNumber(); + text [BELOW] = aPin->GetShownNumber(); } if( m_schSettings.m_ShowPinsElectricalType ) @@ -1472,7 +1472,7 @@ void SCH_PAINTER::draw( SCH_SYMBOL* aSymbol, int aLayer ) tempPin->ClearFlags(); tempPin->SetFlags( symbolPin->GetFlags() ); // SELECTED, HIGHLIGHTED, BRIGHTENED - tempPin->SetName( symbolPin->GetName() ); + tempPin->SetName( symbolPin->GetShownName() ); tempPin->SetType( symbolPin->GetType() ); tempPin->SetShape( symbolPin->GetShape() ); diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index 702c6bbebf..b090cb3b04 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -85,6 +85,15 @@ wxString SCH_PIN::GetName() const } +wxString SCH_PIN::GetShownName() const +{ + if( !m_alt.IsEmpty() ) + return m_alt; + + return m_libPin->GetShownName(); +} + + ELECTRICAL_PINTYPE SCH_PIN::GetType() const { if( !m_alt.IsEmpty() ) @@ -174,8 +183,8 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) aList.push_back( MSG_PANEL_ITEM( _( "Converted" ), msg ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Name" ), GetName() ) ); - msg = GetNumber().IsEmpty() ? wxT( "?" ) : GetNumber(); + aList.push_back( MSG_PANEL_ITEM( _( "Name" ), GetShownName() ) ); + msg = GetNumber().IsEmpty() ? wxT( "?" ) : GetShownNumber(); aList.push_back( MSG_PANEL_ITEM( _( "Number" ), msg ) ); aList.push_back( MSG_PANEL_ITEM( _( "Type" ), ElectricalPinTypeGetText( GetType() ) ) ); diff --git a/eeschema/sch_pin.h b/eeschema/sch_pin.h index c9d88c05d7..2d6a303798 100644 --- a/eeschema/sch_pin.h +++ b/eeschema/sch_pin.h @@ -103,8 +103,11 @@ public: bool IsVisible() const { return m_libPin->IsVisible(); } wxString GetName() const; + wxString GetShownName() const; wxString GetNumber() const { return m_number; } + wxString GetShownNumber() const { return m_number; } + void SetNumber( const wxString& aNumber ) { m_number = aNumber; } ELECTRICAL_PINTYPE GetType() const; diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 8c15ee48a0..153e470a02 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -659,7 +659,7 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent ) else if( primitive == "d" ) param = wxT( "Id" ); else - param = wxString::Format( wxT( "I%s" ), pin->GetName().Lower() ); + param = wxString::Format( wxT( "I%s" ), pin->GetShownName().Lower() ); simFrame->AddCurrentPlot( symbol->GetRef( &m_frame->GetCurrentSheet() ), param );