Eeschema: SCH_SHEET_LIST improvements.
* Derive SCH_SHEET_LIST from std::vector rather than using internal array management. Change all internal code to use iterators or array operator in loops. * Allow creation of empty SCH_SHEET_LIST for external population for plotting and printing. * Clean up print an plot code to take advantage of new SCH_SHEET_LIST behavior. * Make BuildSheetList() public so list can be populated after creation. * Update all instances of SCH_SHEET_LIST with the appropriate SCH_SHEET object on initialization. * Create const and non-const version of SCH_SHEET_PATH::GetSheet().
This commit is contained in:
@@ -40,7 +40,6 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||
{
|
||||
SCH_EDIT_FRAME* schframe = m_parent;
|
||||
SCH_SCREEN* screen = schframe->GetScreen();
|
||||
SCH_SHEET_PATH* sheetpath;
|
||||
SCH_SHEET_PATH oldsheetpath = schframe->GetCurrentSheet();
|
||||
|
||||
/* When printing all pages, the printed page is not the current page.
|
||||
@@ -49,26 +48,21 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||
* because in complex hierarchies a SCH_SCREEN (a schematic drawings)
|
||||
* is shared between many sheets
|
||||
*/
|
||||
SCH_SHEET_LIST SheetList( NULL );
|
||||
SCH_SHEET_LIST sheetList;
|
||||
|
||||
if( aPlotAll )
|
||||
sheetList.BuildSheetList( g_RootSheet );
|
||||
else
|
||||
sheetList.push_back( schframe->GetCurrentSheet() );
|
||||
|
||||
sheetpath = SheetList.GetFirst();
|
||||
SCH_SHEET_PATH list;
|
||||
REPORTER& reporter = m_MessagesBox->Reporter();
|
||||
|
||||
while( true )
|
||||
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||
{
|
||||
if( aPlotAll )
|
||||
{
|
||||
if( sheetpath == NULL )
|
||||
break;
|
||||
|
||||
list = *sheetpath;
|
||||
schframe->SetCurrentSheet( list );
|
||||
schframe->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
schframe->SetSheetNumberAndCount();
|
||||
screen = schframe->GetCurrentSheet().LastScreen();
|
||||
sheetpath = SheetList.GetNext();
|
||||
}
|
||||
schframe->SetCurrentSheet( sheetList[i] );
|
||||
schframe->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
schframe->SetSheetNumberAndCount();
|
||||
screen = schframe->GetCurrentSheet().LastScreen();
|
||||
|
||||
wxPoint plot_offset;
|
||||
wxString msg;
|
||||
@@ -102,10 +96,6 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||
schframe->SetSheetNumberAndCount();
|
||||
return;
|
||||
}
|
||||
if( !aPlotAll )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
schframe->SetCurrentSheet( oldsheetpath );
|
||||
|
||||
Reference in New Issue
Block a user