Update Eagle importer

Fixes arc orientation
Sets root schematic and page numbers

Fixes https://gitlab.com/kicad/code/kicad/issues/9907
This commit is contained in:
Seth Hillbrand 2021-12-10 15:40:31 -08:00
parent 8c5dd46861
commit 91dace3e5e
1 changed files with 13 additions and 3 deletions

View File

@ -455,6 +455,7 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema
{
m_rootSheet = new SCH_SHEET( aSchematic );
m_rootSheet->SetFileName( newFilename.GetFullPath() );
aSchematic->SetRoot( m_rootSheet );
}
if( !m_rootSheet->GetScreen() )
@ -708,6 +709,13 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
loadSheet( sheetNode, i );
m_rootSheet->GetScreen()->Append( sheet.release() );
SCH_SHEET_PATH sheetpath;
m_rootSheet->LocatePathOfScreen( m_currentSheet->GetScreen(), &sheetpath );
sheetpath.push_back( m_currentSheet );
m_rootSheet->AddInstance( sheetpath );
m_rootSheet->SetPageNumber( sheetpath, wxString::Format( "%d", i ) );
sheetNode = sheetNode->GetNext();
x += 2;
@ -727,6 +735,11 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
m_currentSheet = m_rootSheet;
loadSheet( sheetNode, 0 );
sheetNode = sheetNode->GetNext();
SCH_SHEET_PATH rootPath;
rootPath.push_back( m_rootSheet );
m_rootSheet->AddInstance( rootPath );
m_rootSheet->SetPageNumber( rootPath, wxT( "1" ) );
}
}
@ -1818,9 +1831,6 @@ LIB_ITEM* SCH_EAGLE_PLUGIN::loadSymbolWire( std::unique_ptr<LIB_SYMBOL>& aSymbol
arc->SetWidth( ewire.width.ToSchUnits() );
}
if( *ewire.curve <= 0 )
std::swap( begin, end );
arc->SetArcGeometry( begin, (wxPoint) CalcArcMid( begin, end, center ), end );
arc->SetUnit( aGateNumber );