7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 08:51:42 +00:00

Cache full schematic sheet list sorted by sheet page number.

The sheet list is returned as a copy of the cached list rather than a
reference to prevent external code from changing the list.  While not as
performant, it eliminates the risk of the sheet list being altered in
ways that could break the schematic.  The sheet list should only be
updated by calling SCHEMATIC::RefreshHierarchy() when any appropriate
sheet changes are made.

Note to developers: there is something inherently different about how the
QA tests are loading and handling schematics versus the schematic editor.
Using the cached sheet list for the SCHEMATIC object will cause some QA
test to fail.  This is why SCHEMATIC::Hierarchy() has not replaced
SCHEMATIC::BuildSheetListSortedByPageNumbers() everywhere.
This commit is contained in:
Wayne Stambaugh 2024-10-08 13:51:09 -04:00
parent eae84fd5f3
commit a6923b3de3
44 changed files with 171 additions and 129 deletions

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -39,7 +39,7 @@
void SCH_EDIT_FRAME::mapExistingAnnotation( std::map<wxString, wxString>& aMap )
{
SCH_REFERENCE_LIST references;
Schematic().BuildUnorderedSheetList().GetSymbols( references );
Schematic().Hierarchy().GetSymbols( references );
for( size_t i = 0; i < references.GetCount(); i++ )
{
@ -61,7 +61,7 @@ void SCH_EDIT_FRAME::DeleteAnnotation( ANNOTATE_SCOPE_T aAnnotateScope, bool aRe
REPORTER& aReporter )
{
SCH_SHEET_LIST sheets = Schematic().BuildUnorderedSheetList();
SCH_SHEET_LIST sheets = Schematic().Hierarchy();
SCH_SCREEN* screen = GetScreen();
SCH_SHEET_PATH currentSheet = GetCurrentSheet();
SCH_COMMIT commit( this );
@ -219,7 +219,7 @@ void SCH_EDIT_FRAME::AnnotateSymbols( SCH_COMMIT* aCommit, ANNOTATE_SCOPE_T aAn
SCH_REFERENCE_LIST references;
SCH_SCREENS screens( Schematic().Root() );
SCH_SHEET_LIST sheets = Schematic().BuildSheetListSortedByPageNumbers();
SCH_SHEET_LIST sheets = Schematic().Hierarchy();
SCH_SHEET_PATH currentSheet = GetCurrentSheet();
@ -463,7 +463,7 @@ int SCH_EDIT_FRAME::CheckAnnotate( ANNOTATION_ERROR_HANDLER aErrorHandler,
{
SCH_REFERENCE_LIST referenceList;
constexpr bool includePowerSymbols = false;
SCH_SHEET_LIST sheets = Schematic().BuildSheetListSortedByPageNumbers();
SCH_SHEET_LIST sheets = Schematic().Hierarchy();
SCH_SHEET_PATH currentSheet = GetCurrentSheet();
// Build the list of symbols

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -54,7 +54,7 @@ SCH_ITEM* SCH_EDITOR_CONTROL::FindSymbolAndItem( const wxString* aPath, const wx
if( !aSearchHierarchy )
sheetList.push_back( m_frame->GetCurrentSheet() );
else
sheetList = m_frame->Schematic().BuildSheetListSortedByPageNumbers();
sheetList = m_frame->Schematic().Hierarchy();
for( SCH_SHEET_PATH& sheet : sheetList )
{
@ -620,7 +620,7 @@ findItemsFromSyncSelection( const SCHEMATIC& aSchematic, const std::string aSync
std::optional<std::pair<wxString, wxString>> focusPin;
std::unordered_map<SCH_SHEET_PATH, std::vector<SCH_ITEM*>> focusItemResults;
const SCH_SHEET_LIST allSheetsList = aSchematic.BuildUnorderedSheetList();
const SCH_SHEET_LIST allSheetsList = aSchematic.Hierarchy();
// In orderedSheets, the current sheet comes first.
std::vector<SCH_SHEET_PATH> orderedSheets;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020-2021 CERN
* Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2021-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Wayne Stambaugh <stambaughw@gmail.com>
*
@ -289,7 +289,7 @@ void DIALOG_CHANGE_SYMBOLS::updateFieldsList()
std::vector<SCH_FIELD*> libFields;
std::set<wxString> fieldNames;
for( SCH_SHEET_PATH& instance : frame->Schematic().BuildUnorderedSheetList() )
for( SCH_SHEET_PATH& instance : frame->Schematic().Hierarchy() )
{
SCH_SCREEN* screen = instance.LastScreen();
@ -495,7 +495,7 @@ int DIALOG_CHANGE_SYMBOLS::processMatchingSymbols( SCH_COMMIT* aCommit )
std::map<SCH_SYMBOL*, SYMBOL_CHANGE_INFO> symbols;
for( SCH_SHEET_PATH& instance : frame->Schematic().BuildSheetListSortedByPageNumbers() )
for( SCH_SHEET_PATH& instance : frame->Schematic().Hierarchy() )
{
SCH_SCREEN* screen = instance.LastScreen();
@ -796,7 +796,7 @@ wxString DIALOG_CHANGE_SYMBOLS::getSymbolReferences( SCH_SYMBOL& aSymbol,
wxCHECK( parent, msg );
SCH_SHEET_LIST sheets = parent->Schematic().BuildUnorderedSheetList();
SCH_SHEET_LIST sheets = parent->Schematic().Hierarchy();
for( const SCH_SYMBOL_INSTANCE& instance : aSymbol.GetInstances() )
{

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright 2017 Jean-Pierre Charras, jp.charras@wanadoo.fr
* Copyright 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright 1992-2022, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -395,9 +395,9 @@ void DIALOG_EDIT_SYMBOLS_LIBID::initDlg()
// build the full list of symbols including symbol having no symbol in loaded libs
// (orphan symbols)
GetParent()->Schematic().BuildUnorderedSheetList().GetSymbols( references,
true /* include power symbols */,
true /* include orphan symbols */ );
GetParent()->Schematic().Hierarchy().GetSymbols( references,
true /* include power symbols */,
true /* include orphan symbols */ );
for( unsigned ii = 0; ii < references.GetCount(); ii++ )
{

View File

@ -680,7 +680,7 @@ void DIALOG_FIELD_PROPERTIES::UpdateField( SCH_COMMIT* aCommit, SCH_FIELD* aFiel
int unit = symbol->GetUnit();
LIB_ID libId = symbol->GetLibId();
for( SCH_SHEET_PATH& sheet : editFrame->Schematic().BuildUnorderedSheetList() )
for( SCH_SHEET_PATH& sheet : editFrame->Schematic().Hierarchy() )
{
SCH_SCREEN* screen = sheet.LastScreen();
std::vector<SCH_SYMBOL*> otherUnits;

View File

@ -583,7 +583,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow()
SCH_COMMIT commit( m_parent );
// Go through sheets
for( const SCH_SHEET_PATH& sheetPath : m_parent->Schematic().BuildUnorderedSheetList() )
for( const SCH_SHEET_PATH& sheetPath : m_parent->Schematic().Hierarchy() )
{
SCH_SCREEN* screen = sheetPath.LastScreen();

View File

@ -437,7 +437,7 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena
// Sheet file names are relative to the path of the current sheet. This allows for
// nesting of schematic files in subfolders. Screen file names are always absolute.
SCHEMATIC& schematic = m_frame->Schematic();
SCH_SHEET_LIST fullHierarchy = schematic.GetFullHierarchy();
SCH_SHEET_LIST fullHierarchy = schematic.Hierarchy();
wxFileName screenFileName( sheetFileName );
wxFileName tmp( sheetFileName );
SCH_SCREEN* currentScreen = m_frame->GetCurrentSheet().LastScreen();

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Oliver Walters
* Copyright (C) 2017-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -176,7 +176,7 @@ DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE( SCH_EDIT_FRAME* parent )
m_schSettings( parent->Schematic().Settings() )
{
// Get all symbols from the list of schematic sheets
m_parent->Schematic().BuildUnorderedSheetList().GetSymbols( m_symbolsList, false );
m_parent->Schematic().Hierarchy().GetSymbols( m_symbolsList, false );
m_bRefresh->SetBitmap( KiBitmapBundle( BITMAPS::small_refresh ) );
m_bRefreshPreview->SetBitmap( KiBitmapBundle( BITMAPS::small_refresh ) );
@ -2217,7 +2217,7 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnSchItemsAdded( SCHEMATIC& aSch,
std::vector<SCH_ITEM*>& aSchItem )
{
SCH_REFERENCE_LIST allRefs;
m_parent->Schematic().BuildUnorderedSheetList().GetSymbols( allRefs );
m_parent->Schematic().Hierarchy().GetSymbols( allRefs );
for( SCH_ITEM* item : aSchItem )
{
@ -2286,7 +2286,7 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnSchItemsChanged( SCHEMATIC& aSch
std::vector<SCH_ITEM*>& aSchItem )
{
SCH_REFERENCE_LIST allRefs;
m_parent->Schematic().BuildUnorderedSheetList().GetSymbols( allRefs );
m_parent->Schematic().Hierarchy().GetSymbols( allRefs );
for( SCH_ITEM* item : aSchItem )
{
@ -2383,7 +2383,7 @@ DIALOG_SYMBOL_FIELDS_TABLE::getSymbolReferences( SCH_SYMBOL* aSymbol,
SCH_REFERENCE_LIST DIALOG_SYMBOL_FIELDS_TABLE::getSheetSymbolReferences( SCH_SHEET& aSheet )
{
SCH_SHEET_LIST allSheets = m_parent->Schematic().BuildUnorderedSheetList();
SCH_SHEET_LIST allSheets = m_parent->Schematic().Hierarchy();
SCH_REFERENCE_LIST sheetRefs;
// We need to operate on all instances of the sheet

View File

@ -242,7 +242,7 @@ void DIALOG_TABLE_PROPERTIES::getContextualTextVars( const wxString& aCrossRef,
SCH_REFERENCE_LIST refs;
SCH_SYMBOL* refSymbol = nullptr;
m_frame->Schematic().BuildUnorderedSheetList().GetSymbols( refs );
m_frame->Schematic().Hierarchy().GetSymbols( refs );
for( int jj = 0; jj < (int) refs.GetCount(); jj++ )
{

View File

@ -166,7 +166,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( SCH_BASE_FRAME* aParent, SCH_ITE
{
const SCHEMATIC& schematic = schematicEditor->Schematic();
for( const SCH_SHEET_PATH& sheet : schematic.BuildSheetListSortedByPageNumbers() )
for( const SCH_SHEET_PATH& sheet : schematic.Hierarchy() )
{
wxString sheetPageNum = sheet.GetPageNumber();
wxString sheetName = sheet.size() == 1 ? _( "<root sheet>" )
@ -230,7 +230,7 @@ void DIALOG_TEXT_PROPERTIES::getContextualTextVars( const wxString& aCrossRef,
if( schematic )
{
SCH_REFERENCE_LIST refs;
schematic->BuildUnorderedSheetList().GetSymbols( refs );
schematic->Hierarchy().GetSymbols( refs );
for( int jj = 0; jj < (int) refs.GetCount(); jj++ )
{

View File

@ -94,7 +94,7 @@ static std::unique_ptr<SCHEMATIC> readSchematicFromFile( const std::string& aFil
for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
screen->UpdateLocalLibSymbolLinks();
SCH_SHEET_LIST sheets = schematic->BuildSheetListSortedByPageNumbers();
SCH_SHEET_LIST sheets = schematic->Hierarchy();
// Restore all of the loaded symbol instances from the root sheet screen.
sheets.UpdateSymbolInstanceData( schematic->RootScreen()->GetSymbolInstances() );
@ -704,4 +704,4 @@ int IFACE::HandleJob( JOB* aJob )
bool IFACE::HandleJobConfig( JOB* aJob, wxWindow* aParent )
{
return m_jobHandler->HandleJobConfig( aJob, aParent );
}
}

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2022 KiCad Developers, see AUTHORS.TXT for contributors.
* Copyright (C) 2022, 2024 KiCad Developers, see AUTHORS.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2022 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -348,7 +348,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportNetlist( JOB* aJob )
// Annotation warning check
SCH_REFERENCE_LIST referenceList;
sch->BuildUnorderedSheetList().GetSymbols( referenceList );
sch->Hierarchy().GetSymbols( referenceList );
if( referenceList.GetCount() > 0 )
{
@ -458,7 +458,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportBom( JOB* aJob )
// Annotation warning check
SCH_REFERENCE_LIST referenceList;
sch->BuildUnorderedSheetList().GetSymbols( referenceList, false, false );
sch->Hierarchy().GetSymbols( referenceList, false, false );
if( referenceList.GetCount() > 0 )
{
@ -711,7 +711,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPythonBom( JOB* aJob )
// Annotation warning check
SCH_REFERENCE_LIST referenceList;
sch->BuildUnorderedSheetList().GetSymbols( referenceList );
sch->Hierarchy().GetSymbols( referenceList );
if( referenceList.GetCount() > 0 )
{

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -121,7 +121,7 @@ bool ERC_REPORT::WriteJsonReport( const wxString& aFullFileName )
reportHead.kicad_version = GetMajorMinorPatchVersion();
reportHead.coordinate_units = EDA_UNIT_UTILS::GetLabel( m_reportUnits );
SCH_SHEET_LIST sheetList = m_sch->BuildSheetListSortedByPageNumbers();
SCH_SHEET_LIST sheetList = m_sch->Hierarchy();
sheetList.FillItemMap( itemMap );
ERC_SETTINGS& settings = m_sch->ErcSettings();
@ -156,4 +156,4 @@ bool ERC_REPORT::WriteJsonReport( const wxString& aFullFileName )
jsonFileStream.close();
return true;
}
}

View File

@ -334,7 +334,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// It's possible the schematic parser fixed errors due to bugs so warn the user
// that the schematic has been fixed (modified).
SCH_SHEET_LIST sheetList = Schematic().BuildSheetListSortedByPageNumbers();
SCH_SHEET_LIST sheetList = Schematic().Hierarchy();
if( sheetList.IsModified() )
{
@ -1022,7 +1022,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
}
// Attempt to make sheet file name paths relative to the new root schematic path.
for( SCH_SHEET_PATH& sheet : Schematic().BuildUnorderedSheetList() )
for( SCH_SHEET_PATH& sheet : Schematic().Hierarchy() )
{
if( !sheet.Last()->IsRootSheet() )
sheet.MakeFilePathRelativeToParentSheet();
@ -1185,7 +1185,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
std::vector<FILE_INFO_PAIR>& sheets = Prj().GetProjectFile().GetSheets();
sheets.clear();
for( SCH_SHEET_PATH& sheetPath : Schematic().BuildUnorderedSheetList() )
for( SCH_SHEET_PATH& sheetPath : Schematic().Hierarchy() )
{
SCH_SHEET* sheet = sheetPath.Last();

View File

@ -260,7 +260,7 @@ void SCH_EDIT_FRAME::RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelect
if( !m_netNavigator->IsShown() )
return;
bool singleSheetSchematic = m_schematic->BuildUnorderedSheetList().size() == 1;
bool singleSheetSchematic = m_schematic->Hierarchy().size() == 1;
size_t nodeCnt = 0;
m_netNavigator->Freeze();

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -136,7 +136,7 @@ void NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo()
m_referencesAlreadyFound.Clear();
m_libParts.clear();
for( const SCH_SHEET_PATH& sheet : m_schematic->BuildSheetListSortedByPageNumbers() )
for( const SCH_SHEET_PATH& sheet : m_schematic->Hierarchy() )
{
m_schematic->SetCurrentSheet( sheet );

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 1992-2017 jp.charras at wanadoo.fr
* Copyright (C) 2013-2017 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -241,7 +241,7 @@ void NETLIST_EXPORTER_BASE::findAllUnitsOfSymbol( SCH_SYMBOL* aSchSymbol,
CONNECTION_GRAPH* graph = m_schematic->ConnectionGraph();
for( const SCH_SHEET_PATH& sheet : m_schematic->BuildSheetListSortedByPageNumbers() )
for( const SCH_SHEET_PATH& sheet : m_schematic->Hierarchy() )
{
for( SCH_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
{

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 1992-2018 jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -65,7 +65,7 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName,
// Create netlist footprints section
m_referencesAlreadyFound.Clear();
for( const SCH_SHEET_PATH& sheet : m_schematic->BuildSheetListSortedByPageNumbers() )
for( const SCH_SHEET_PATH& sheet : m_schematic->Hierarchy() )
{
for( SCH_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
{

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 1992-2018 jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -62,7 +62,7 @@ bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName,
// Create netlist footprints section
m_referencesAlreadyFound.Clear();
for( const SCH_SHEET_PATH& sheet : m_schematic->BuildSheetListSortedByPageNumbers() )
for( const SCH_SHEET_PATH& sheet : m_schematic->Hierarchy() )
{
// Process symbol attributes
for( EDA_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )

View File

@ -55,7 +55,7 @@ bool NETLIST_EXPORTER_PADS::WriteNetlist( const wxString& aOutFileName,
// Create netlist footprints section
m_referencesAlreadyFound.Clear();
for( const SCH_SHEET_PATH& sheet : m_schematic->BuildSheetListSortedByPageNumbers() )
for( const SCH_SHEET_PATH& sheet : m_schematic->Hierarchy() )
{
for( SCH_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
{

View File

@ -706,7 +706,7 @@ SCH_SHEET_LIST NETLIST_EXPORTER_SPICE::BuildSheetList( unsigned aNetlistOptions
if( aNetlistOptions & OPTION_CUR_SHEET_AS_ROOT )
sheets = SCH_SHEET_LIST( m_schematic->CurrentSheet().Last() );
else
sheets = m_schematic->BuildSheetListSortedByPageNumbers();
sheets = m_schematic->Hierarchy();
alg::delete_if( sheets,
[&]( const SCH_SHEET_PATH& sheet )

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
* Copyright (C) 2013-2017 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -247,7 +247,7 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
m_libParts.clear();
SCH_SHEET_PATH currentSheet = m_schematic->CurrentSheet();
SCH_SHEET_LIST sheetList = m_schematic->BuildSheetListSortedByPageNumbers();
SCH_SHEET_LIST sheetList = m_schematic->Hierarchy();
// Output is xml, so there is no reason to remove spaces from the field values.
// And XML element names need not be translated to various languages.
@ -535,7 +535,7 @@ XNODE* NETLIST_EXPORTER_XML::makeDesignHeader()
*/
unsigned sheetIndex = 1; // Human readable index
for( const SCH_SHEET_PATH& sheet : m_schematic->BuildSheetListSortedByPageNumbers() )
for( const SCH_SHEET_PATH& sheet : m_schematic->Hierarchy() )
{
screen = sheet.LastScreen();

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 1992-2018 jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2021 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 1992-2021, 2024 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -51,7 +51,7 @@ bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileNam
unsigned aNetlistOptions, REPORTER* aReporter )
{
// Ensure all power symbols have a valid reference
Schematic().BuildSheetListSortedByPageNumbers().AnnotatePowerSymbols();
Schematic().Hierarchy().AnnotatePowerSymbols();
if( !ReadyToNetlist( _( "Exporting netlist requires a fully annotated schematic." ) ) )
return false;
@ -193,7 +193,7 @@ bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileNam
bool SCH_EDIT_FRAME::ReadyToNetlist( const wxString& aAnnotateMessage )
{
// Ensure all power symbols have a valid reference
Schematic().BuildSheetListSortedByPageNumbers().AnnotatePowerSymbols();
Schematic().Hierarchy().AnnotatePowerSymbols();
// Symbols must be annotated
if( CheckAnnotate( []( ERCE_T, const wxString&, SCH_REFERENCE*, SCH_REFERENCE* ) {} ) )

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -71,7 +71,7 @@ bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage )
bool SCH_PRINTOUT::OnPrintPage( int page )
{
SCH_SHEET_LIST sheetList = m_parent->Schematic().BuildSheetListSortedByPageNumbers();
SCH_SHEET_LIST sheetList = m_parent->Schematic().Hierarchy();
sheetList.SortByPageNumbers( false );
wxCHECK_MSG( page >= 1 && page <= (int)sheetList.size(), false,

Some files were not shown because too many files have changed in this diff Show More