From 6d06ed3579239e995b782257a717a69cebfc748e Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 3 Apr 2018 09:57:56 +0200 Subject: [PATCH] Eagle SCH importer: minor fixes - set correct reference for components - handle "pwr" direction for pins - discarded a redundant variable --- eeschema/sch_eagle_plugin.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_eagle_plugin.cpp b/eeschema/sch_eagle_plugin.cpp index 72808506ad..bf551486bb 100644 --- a/eeschema/sch_eagle_plugin.cpp +++ b/eeschema/sch_eagle_plugin.cpp @@ -828,7 +828,6 @@ void SCH_EAGLE_PLUGIN::loadSegments( wxXmlNode* aSegmentsNode, const wxString& n // this preserves the named net feature of Eagle schematics. if( !labelled && firstWire ) { - wxString netname = escapeName( netName ); std::unique_ptr label; // Add a global label if the net appears on more than one Eagle sheet @@ -840,7 +839,7 @@ void SCH_EAGLE_PLUGIN::loadSegments( wxXmlNode* aSegmentsNode, const wxString& n if( label ) { label->SetPosition( firstWire->GetStartPoint() ); - label->SetText( netname ); + label->SetText( escapeName( netName ) ); label->SetTextSize( wxSize( 10, 10 ) ); label->SetLabelSpinStyle( 0 ); screen->Append( label.release() ); @@ -1048,6 +1047,7 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode ) tstamp.Printf( "%8.8lX", (unsigned long) component->GetTimeStamp() ); current_sheetpath += tstamp; + component->GetField( REFERENCE )->SetText( reference ); component->AddHierarchicalReference( current_sheetpath, reference, unit ); if( epart->value ) @@ -1285,6 +1285,10 @@ bool SCH_EAGLE_PLUGIN::loadSymbol( wxXmlNode* aSymbolNode, std::unique_ptrSetType( PIN_TRISTATE ); } + else if( wxString( *ePin.direction ).Lower()== "pwr" ) + { + pin->SetType( PIN_POWER_IN ); + } else { pin->SetType( PIN_UNSPECIFIED );