Add sheetpath instances when importing sheets from Altium.

This commit is contained in:
Jeff Young 2021-07-07 18:30:59 +01:00
parent a81c6b21b6
commit db91908c18
1 changed files with 15 additions and 0 deletions

View File

@ -179,6 +179,13 @@ SCH_SHEET* SCH_ALTIUM_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchem
{
m_rootSheet = new SCH_SHEET( aSchematic );
m_rootSheet->SetFileName( fileName.GetFullPath() );
SCH_SHEET_PATH sheetpath;
sheetpath.push_back( m_rootSheet );
m_rootSheet->AddInstance( sheetpath.Path() );
m_rootSheet->SetPageNumber( sheetpath, "#" ); // We'll update later if we find a
// pageNumber record for it
}
if( !m_rootSheet->GetScreen() )
@ -1447,6 +1454,14 @@ void SCH_ALTIUM_PLUGIN::ParseSheetSymbol( int aIndex, const std::map<wxString,
sheet->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( sheet );
SCH_SHEET_PATH sheetpath;
m_rootSheet->LocatePathOfScreen( m_currentSheet->GetScreen(), &sheetpath );
sheetpath.push_back( sheet );
sheet->AddInstance( sheetpath.Path() );
sheet->SetPageNumber( sheetpath, "#" ); // We'll update later if we find a pageNumber
// record for it
m_sheets.insert( { aIndex, sheet } );
}