From e379329ee66ad111fd15e54ab9c3151daeeede13 Mon Sep 17 00:00:00 2001 From: Russell Oliver Date: Mon, 24 Jul 2017 23:49:38 +1000 Subject: [PATCH] Eeschema Eagle Import: Better conversion between ! and ~ in text and pin names --- eeschema/sch_eagle_plugin.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/eeschema/sch_eagle_plugin.cpp b/eeschema/sch_eagle_plugin.cpp index 453ec182e4..dfae08a60f 100644 --- a/eeschema/sch_eagle_plugin.cpp +++ b/eeschema/sch_eagle_plugin.cpp @@ -869,6 +869,7 @@ SCH_TEXT* SCH_EAGLE_PLUGIN::loadLabel( wxXmlNode* aLabelNode, const wxString& aN wxPoint elabelpos( elabel.x * EUNIT_TO_MIL, -elabel.y * EUNIT_TO_MIL ); wxString netname = elabel.netname; + netname.Replace("~", "~~"); netname.Replace("!", "~"); if(m_NetCounts[aNetName.ToStdString()]>1){ @@ -1307,11 +1308,10 @@ void SCH_EAGLE_PLUGIN::loadSymbol( wxXmlNode* aSymbolNode, pin->SetUnit( gateNumber ); - string pinname = pin->GetName().ToStdString(); - if(pinname[0] == '!'){ - pinname[0] = '~'; - pin->SetName( pinname ); - } + wxString pinname = pin->GetName(); + pinname.Replace("~", "~~"); + pinname.Replace("!", "~"); + pin->SetName( pinname ); aPart->AddDrawItem( pin ); break; @@ -1601,7 +1601,10 @@ SCH_TEXT* SCH_EAGLE_PLUGIN::loadplaintext( wxXmlNode* aSchText ) schtext->SetItalic( false ); schtext->SetPosition( wxPoint( etext.x * EUNIT_TO_MIL, -etext.y * EUNIT_TO_MIL ) ); - schtext->SetText( aSchText->GetNodeContent() ); + wxString thetext = aSchText->GetNodeContent(); + thetext.Replace("~", "~~"); + thetext.Replace("!", "~"); + schtext->SetText( thetext ); if( etext.ratio ) {