|
KiCad PCB EDA Suite
|
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy. More...
#include <sch_sheet_path.h>
Public Member Functions | |
| SCH_SHEET_LIST (SCH_SHEET *aSheet=nullptr) | |
| Construct a flattened list of SCH_SHEET_PATH objects from aSheet. | |
| ~SCH_SHEET_LIST () | |
| bool | IsModified () const |
| Check the entire hierarchy for any modifications. | |
| void | ClearModifyStatus () |
| SCH_ITEM * | ResolveItem (const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr, bool aAllowNullptrReturn=false) const |
| Fetch a SCH_ITEM by ID. | |
| void | FillItemMap (std::unordered_map< KIID, EDA_ITEM * > &aMap) const |
| Fill an item cache for temporary use when many items need to be fetched. | |
| void | GetSymbols (SCH_REFERENCE_LIST &aReferences, SYMBOL_FILTER aSymbolFilter, bool aForceIncludeOrphanSymbols=false) const |
| Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets. | |
| void | GetSymbolsWithinPath (SCH_REFERENCE_LIST &aReferences, const SCH_SHEET_PATH &aSheetPath, SYMBOL_FILTER aSymbolFilter, bool aForceIncludeOrphanSymbols=false) const |
| Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets that are contained within aSheetPath as well as recursively downwards inside aSheetPath. | |
| void | GetSheetsWithinPath (std::vector< SCH_SHEET_PATH > &aSheets, const SCH_SHEET_PATH &aSheetPath) const |
| Add a SCH_SHEET_PATH object to aSheets for each sheet in the list that are contained within aSheetPath as well as recursively downwards inside aSheetPath. | |
| std::optional< SCH_SHEET_PATH > | GetSheetPathByKIIDPath (const KIID_PATH &aPath, bool aIncludeLastSheet=true) const |
| Finds a SCH_SHEET_PATH that matches the provided KIID_PATH. | |
| void | GetMultiUnitSymbols (SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, SYMBOL_FILTER aSymbolFilter) const |
| Add a SCH_REFERENCE_LIST object to aRefList for each same-reference set of multi-unit parts in the list of sheets. | |
| bool | TestForRecursion (const SCH_SHEET_LIST &aSrcSheetHierarchy, const wxString &aDestFileName) |
| Test every SCH_SHEET_PATH in this SCH_SHEET_LIST to verify if adding the sheets stored in aSrcSheetHierarchy to the sheet stored in aDestFileName will cause recursion. | |
| SCH_SHEET_PATH * | FindSheetForPath (const SCH_SHEET_PATH *aPath) |
| Return a pointer to the first SCH_SHEET_PATH object (not necessarily the only one) matching the provided path. | |
| SCH_SHEET_PATH | FindSheetForScreen (const SCH_SCREEN *aScreen) |
| Return the first SCH_SHEET_PATH object (not necessarily the only one) using a particular screen. | |
| SCH_SHEET_LIST | FindAllSheetsForScreen (const SCH_SCREEN *aScreen) const |
| Return a SCH_SHEET_LIST with a copy of all the SCH_SHEET_PATH using a particular screen. | |
| void | BuildSheetList (SCH_SHEET *aSheet, bool aCheckIntegrity) |
| Build the list of sheets and their sheet path from aSheet. | |
| void | SortByPageNumbers (bool aUpdateVirtualPageNums=true) |
| Sort the list of sheets by page number. | |
| void | SortByHierarchicalPageNumbers (bool aUpdateVirtualPageNums=true) |
| This works like SortByPageNumbers, but it sorts the sheets first by their hierarchical depth and then by their page numbers. | |
| bool | NameExists (const wxString &aSheetName) const |
| bool | PageNumberExists (const wxString &aPageNumber) const |
| void | TrimToPageNumbers (const std::vector< wxString > &aPageInclusions) |
| Truncates the list by removing sheet's with page numbers not in the given list. | |
| wxString | GetNextPageNumber () const |
| void | UpdateSymbolInstanceData (const std::vector< SCH_SYMBOL_INSTANCE > &aSymbolInstances) |
| Update all of the symbol instance information using aSymbolInstances. | |
| void | UpdateSheetInstanceData (const std::vector< SCH_SHEET_INSTANCE > &aSheetInstances) |
| Update all of the sheet instance information using aSheetInstances. | |
| std::vector< KIID_PATH > | GetPaths () const |
| std::vector< SCH_SHEET_INSTANCE > | GetSheetInstances () const |
| Fetch the instance information for all of the sheets in the hierarchy. | |
| bool | AllSheetPageNumbersEmpty () const |
| Check all of the sheet instance for empty page numbers. | |
| void | SetInitialPageNumbers () |
| Set initial sheet page numbers. | |
| bool | RepairPageNumbers () |
| Assign valid page numbers to sheet paths whose stored page number is missing or collides with an earlier sheet. | |
| void | AddNewSymbolInstances (const SCH_SHEET_PATH &aPrefixSheetPath, const wxString &aProjectName, bool aStripRefSuffixes=false) |
| Attempt to add new symbol instances for all symbols in this list of sheet paths prefixed with aPrefixSheetPath. | |
| wxString | SourceRefSuffix (const SCH_SYMBOL &aSymbol, const KIID_PATH &aInstancePath) const |
| Return the suffix the source project composed into the instance of aSymbol at aInstancePath, which this list holds as loaded from that project's file. | |
| void | AddNewSheetInstances (const SCH_SHEET_PATH &aPrefixSheetPath, int aLastVirtualPageNumber) |
| int | GetLastVirtualPageNumber () const |
| void | RemoveSymbolInstances (const SCH_SHEET_PATH &aPrefixSheetPath) |
| void | CheckForMissingSymbolInstances (const wxString &aProjectName) |
| void | StripRefSuffixes () |
| Recover the base references from the composed references a file stores. | |
| void | RecoverPackageRefs () |
| Give a unit loaded by StripRefSuffixes() the base of a package in another top level sheet. | |
| int | ShareReusedSheetRef (SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aSource) const |
| Give every other instance of aSymbol's sheet the base reference and unit it has on aSource. | |
| bool | HasPath (const KIID_PATH &aPath) const |
| bool | ContainsSheet (const SCH_SHEET *aSheet) const |
| std::optional< SCH_SHEET_PATH > | GetOrdinalPath (const SCH_SCREEN *aScreen) const |
| Return the ordinal sheet path of aScreen. | |
Public Attributes | |
| T | elements |
| STL member. | |
Private Attributes | |
| SCH_SHEET_PATH | m_currentSheetPath |
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
SCH_SHEET objects are not unique, there can be many sheets with the same filename and that share the same SCH_SCREEN reference. Each The schematic file (SCH_SCREEN) may be shared between these sheets and symbol references are specific to a sheet path. When a sheet is entered, symbol references and sheet page number are updated.
Definition at line 637 of file sch_sheet_path.h.
| SCH_SHEET_LIST::SCH_SHEET_LIST | ( | SCH_SHEET * | aSheet = nullptr | ) |
Construct a flattened list of SCH_SHEET_PATH objects from aSheet.
If aSheet == NULL, then this is an empty hierarchy which the user can populate.
Definition at line 1108 of file sch_sheet_path.cpp.
References BuildSheetList().
Referenced by AddNewSheetInstances(), FindAllSheetsForScreen(), and TestForRecursion().
|
inline |
Definition at line 647 of file sch_sheet_path.h.
| void SCH_SHEET_LIST::AddNewSheetInstances | ( | const SCH_SHEET_PATH & | aPrefixSheetPath, |
| int | aLastVirtualPageNumber ) |
Definition at line 1805 of file sch_sheet_path.cpp.
References SCH_SHEET::addInstance(), SCH_SHEET_PATH::at(), SCH_SHEET::getInstance(), SCH_SHEET_INSTANCE::m_PageNumber, SCH_SHEET_PATH::Path(), path, SCH_SHEET_LIST(), SCH_SHEET_PATH::SetPageNumber(), SCH_SHEET_PATH::SetVirtualPageNumber(), and SCH_SHEET_PATH::size().
Referenced by SCH_EDIT_FRAME::ChangeSheetFile(), SCH_IO_DIPTRACE::LoadSchematicFile(), SCH_IO_PCAD::LoadSchematicFile(), SCH_IO_TARGET3001::LoadSchematicFile(), and SCH_EDIT_FRAME::LoadSheetFromFile().
| void SCH_SHEET_LIST::AddNewSymbolInstances | ( | const SCH_SHEET_PATH & | aPrefixSheetPath, |
| const wxString & | aProjectName, | ||
| bool | aStripRefSuffixes = false ) |
Attempt to add new symbol instances for all symbols in this list of sheet paths prefixed with aPrefixSheetPath.
| aPrefixSheetPath | is the sheet path to append the new symbol instances to. |
| aProjectName | is the name of the project for the new symbol instance data. |
| aStripRefSuffixes | strips the suffix another project composed into a copied reference. |
Definition at line 1790 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::AddNewSymbolInstances().
Referenced by BOOST_AUTO_TEST_CASE(), SCH_EDIT_FRAME::ChangeSheetFile(), SCH_IO_DIPTRACE::LoadSchematicFile(), SCH_IO_EASYPC::LoadSchematicFile(), SCH_IO_PCAD::LoadSchematicFile(), SCH_IO_TARGET3001::LoadSchematicFile(), and SCH_EDIT_FRAME::LoadSheetFromFile().
| bool SCH_SHEET_LIST::AllSheetPageNumbersEmpty | ( | ) | const |
Check all of the sheet instance for empty page numbers.
Definition at line 1704 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::GetPageNumber().
Referenced by BOOST_AUTO_TEST_CASE(), EESCHEMA_HELPERS::LoadSchematic(), SCH_IO_DIPTRACE::LoadSchematicFile(), SCH_IO_PCAD::LoadSchematicFile(), SCH_IO_TARGET3001::LoadSchematicFile(), SCH_EDIT_FRAME::OpenProjectFiles(), and SetInitialPageNumbers().
| void SCH_SHEET_LIST::BuildSheetList | ( | SCH_SHEET * | aSheet, |
| bool | aCheckIntegrity ) |
Build the list of sheets and their sheet path from aSheet.
If aSheet is the root sheet, the full sheet path and sheet list are built.
The list will be ordered as per SCH_SHEET_LIST::BuildSheetList which results in sheets being ordered in the legacy way of using the X and Y positions of the sheets.
| aSheet | is the starting sheet from which the list is built, or NULL indicating that g_RootSheet should be used. |
| aCheckIntegrity |
| std::bad_alloc | if the memory for the sheet path list could not be allocated. |
Definition at line 1115 of file sch_sheet_path.cpp.
References KIID::AsString(), BuildSheetList(), SCH_SHEET::GetFileName(), SCH_SHEET::GetName(), SCH_SHEET::GetScreen(), SCH_SCREEN::GetSheets(), SCH_SHEET::IsVirtualRootSheet(), m_currentSheetPath, EDA_ITEM::m_Uuid, niluuid, and traceSchSheetPaths.
Referenced by BuildSheetList(), SCHEMATIC::BuildSheetListSortedByPageNumbers(), SCHEMATIC::BuildUnorderedSheetList(), SCH_EDIT_FRAME::ChangeSheetFile(), SCH_PLOTTER::createDXFFiles(), SCH_PLOTTER::createPDFFile(), SCH_PLOTTER::createPNGFiles(), SCH_PLOTTER::createPSFiles(), SCH_PLOTTER::createSVGFiles(), SCH_EDIT_TOOL::EditProperties(), DIALOG_PRINT::printViaPdf(), SCH_SHEET_LIST(), and DIALOG_SHEET_PROPERTIES::TransferDataFromWindow().
| void SCH_SHEET_LIST::CheckForMissingSymbolInstances | ( | const wxString & | aProjectName | ) |
Definition at line 2092 of file sch_sheet_path.cpp.
References KIID_PATH::AsString(), SCH_SHEET_PATH::CheckForMissingSymbolInstances(), SCH_SHEET_PATH::Path(), SCH_SHEET_PATH::PathHumanReadable(), SCH_SHEET_PATH::size(), and traceSchSheetPaths.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), EESCHEMA_HELPERS::LoadSchematic(), and SCH_EDIT_FRAME::OpenProjectFiles().
| void SCH_SHEET_LIST::ClearModifyStatus | ( | ) |
Definition at line 1368 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::LastScreen(), and BASE_SCREEN::SetContentModified().
Referenced by SCH_EDIT_FRAME::doCloseWindow().
| bool SCH_SHEET_LIST::ContainsSheet | ( | const SCH_SHEET * | aSheet | ) | const |
Definition at line 2136 of file sch_sheet_path.cpp.
References path.
Referenced by ORCAD_CONVERTER::assignRemainingUuids(), and SCH_EDITOR_CONTROL::updatePastedSheet().
Fill an item cache for temporary use when many items need to be fetched.
Definition at line 1429 of file sch_sheet_path.cpp.
References SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), EDA_ITEM::m_Uuid, and NO_RECURSE.
Referenced by SCH_EDITOR_CONTROL::Paste().
| SCH_SHEET_LIST SCH_SHEET_LIST::FindAllSheetsForScreen | ( | const SCH_SCREEN * | aScreen | ) | const |
Return a SCH_SHEET_LIST with a copy of all the SCH_SHEET_PATH using a particular screen.
Definition at line 1581 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::LastScreen(), and SCH_SHEET_LIST().
Referenced by API_HANDLER_SCH::handlePlaceSymbolFromLibrary(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceSymbol(), and SCH_FIND_REPLACE_TOOL::ReplaceAll().
| SCH_SHEET_PATH * SCH_SHEET_LIST::FindSheetForPath | ( | const SCH_SHEET_PATH * | aPath | ) |
Return a pointer to the first SCH_SHEET_PATH object (not necessarily the only one) matching the provided path.
Returns nullptr if not found.
Definition at line 1557 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::Path(), and path.
Referenced by SCH_REFERENCE_LIST::ReannotateByOptions().
| SCH_SHEET_PATH SCH_SHEET_LIST::FindSheetForScreen | ( | const SCH_SCREEN * | aScreen | ) |
Return the first SCH_SHEET_PATH object (not necessarily the only one) using a particular screen.
Definition at line 1569 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::LastScreen().
Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().
| int SCH_SHEET_LIST::GetLastVirtualPageNumber | ( | ) | const |
Definition at line 2110 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::GetVirtualPageNumber().
Referenced by SCH_EDIT_FRAME::ChangeSheetFile(), SCH_EDIT_FRAME::LoadSheetFromFile(), and SCH_EDITOR_CONTROL::Paste().
| void SCH_SHEET_LIST::GetMultiUnitSymbols | ( | SCH_MULTI_UNIT_REFERENCE_MAP & | aRefList, |
| SYMBOL_FILTER | aSymbolFilter ) const |
Add a SCH_REFERENCE_LIST object to aRefList for each same-reference set of multi-unit parts in the list of sheets.
The map key for each element will be the reference designator.
| aRefList | Map of reference designators to reference lists |
| aSymbolFilter | controls which symbols are included. |
Definition at line 1498 of file sch_sheet_path.cpp.
References end.
Referenced by REF_SUFFIX_FIXTURE::AnnotateAll(), SCH_EDIT_FRAME::AnnotateSymbols(), BACK_ANNOTATE::BackAnnotateSymbols(), and BOOST_AUTO_TEST_CASE().
| wxString SCH_SHEET_LIST::GetNextPageNumber | ( | ) | const |
Definition at line 1329 of file sch_sheet_path.cpp.
References path.
Referenced by SCH_DRAWING_TOOLS::DrawSheet(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), and SCH_IO_ALTIUM::NormalizeRepeatedSheetInstances().
| std::optional< SCH_SHEET_PATH > SCH_SHEET_LIST::GetOrdinalPath | ( | const SCH_SCREEN * | aScreen | ) | const |
Return the ordinal sheet path of aScreen.
Definition at line 2151 of file sch_sheet_path.cpp.
References path.
Referenced by BOOST_AUTO_TEST_CASE().
| std::vector< KIID_PATH > SCH_SHEET_LIST::GetPaths | ( | ) | const |
Definition at line 1669 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::Path().
| std::vector< SCH_SHEET_INSTANCE > SCH_SHEET_LIST::GetSheetInstances | ( | ) | const |
Fetch the instance information for all of the sheets in the hierarchy.
Definition at line 1680 of file sch_sheet_path.cpp.
References SCH_SHEET_INSTANCE::m_PageNumber, SCH_SHEET_INSTANCE::m_Path, SCH_SHEET_PATH::Path(), path, and SCH_SHEET_PATH::pop_back().
| std::optional< SCH_SHEET_PATH > SCH_SHEET_LIST::GetSheetPathByKIIDPath | ( | const KIID_PATH & | aPath, |
| bool | aIncludeLastSheet = true ) const |
Finds a SCH_SHEET_PATH that matches the provided KIID_PATH.
| aPath | The KIID_PATH to search for. |
| aIncludeLastSheet | includes the last sheet in path for comparison. |
Definition at line 1480 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::Path().
Referenced by SCH_INSPECTION_TOOL::CompareSchematicWithHistory(), SCHEMATIC::ConvertKIIDsToRefs(), findItemsFromSyncSelection(), SCH_MARKER::FromProto(), ERC_ITEM::getItemDescription(), ERC_TREE_MODEL::GetValue(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), API_HANDLER_SCH::handleGetDocumentModifiedState(), API_HANDLER_SCH::handleGetItems(), API_HANDLER_SCH::handleGetItemsById(), API_HANDLER_SCH::handlePlaceSymbolFromLibrary(), ISSUE21821_FIXTURE::ISSUE21821_FIXTURE(), EESCHEMA_JOBS_HANDLER::JobExportPlot(), BACK_ANNOTATE::processNetNameChange(), SCH_SCREEN::PruneOrphanedSheetInstances(), SCH_SCREEN::PruneOrphanedSymbolInstances(), SCHEMATIC::resolveCrossReference(), ResolveFocusItems(), EESCHEMA_JOBS_HANDLER::runSchMerge(), SCH_IO_KICAD_SEXPR::saveSheet(), SCH_WRITER_V10::saveSheet(), SCH_WRITER_V9::saveSheet(), SCH_IO_KICAD_SEXPR::saveSymbol(), SCH_WRITER_V10::saveSymbol(), SCH_WRITER_V9::saveSymbol(), and SCH_INSPECTION_TOOL::showSchematicComparison().
| void SCH_SHEET_LIST::GetSheetsWithinPath | ( | std::vector< SCH_SHEET_PATH > & | aSheets, |
| const SCH_SHEET_PATH & | aSheetPath ) const |
Add a SCH_SHEET_PATH object to aSheets for each sheet in the list that are contained within aSheetPath as well as recursively downwards inside aSheetPath.
| aSheets | List of sheets to populate. |
| aSheetPath | Path to return sheets from |
Definition at line 1469 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::IsContainedWithin().
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SCH_EDIT_FRAME::CheckAnnotate(), SCH_EDIT_FRAME::DeleteAnnotation(), DIALOG_SYMBOL_FIELDS_TABLE::getSheetSymbolReferences(), and NETLIST_EXPORTER_XML::makeGroups().
| void SCH_SHEET_LIST::GetSymbols | ( | SCH_REFERENCE_LIST & | aReferences, |
| SYMBOL_FILTER | aSymbolFilter, | ||
| bool | aForceIncludeOrphanSymbols = false ) const |
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
| aReferences | List of references to populate. |
| aSymbolFilter | controls which symbols are included. |
| aForceIncludeOrphanSymbols | Set to true to include symbols having no symbol found in lib. The normal option is false, and set to true only to build the full list of symbols. |
Definition at line 1450 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::GetSymbols().
Referenced by REF_SUFFIX_FIXTURE::AnnotateAll(), REF_SUFFIX_FIXTURE::AnnotatePlaced(), AnnotateReferences(), SCH_EDIT_FRAME::AnnotateSymbols(), BACK_ANNOTATE::BackAnnotateSymbols(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), SCHEMATIC::CacheExistingAnnotation(), SCH_EDIT_FRAME::CheckAnnotate(), SCHEMATIC::Contains(), SCHEMATIC::ConvertRefsToKIIDs(), SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), FindSymbolByRefAndUnit(), DIALOG_TABLECELL_PROPERTIES::getContextualTextVars(), DIALOG_TEXT_PROPERTIES::getContextualTextVars(), GetUnplacedUnitsForSymbol(), API_HANDLER_SCH::handlePlaceSymbolFromLibrary(), SCH_EDITOR_CONTROL::IncrementAnnotations(), DIALOG_EDIT_SYMBOLS_LIBID::initDlg(), EESCHEMA_JOBS_HANDLER::JobExportBom(), EESCHEMA_JOBS_HANDLER::JobExportNetlist(), EESCHEMA_JOBS_HANDLER::JobExportPythonBom(), SCH_EDIT_FRAME::mapExistingAnnotation(), SCH_FIELD::OnScintillaCharAdded(), SCH_EDITOR_CONTROL::Paste(), and SCH_DRAWING_TOOLS::PlaceSymbol().
| void SCH_SHEET_LIST::GetSymbolsWithinPath | ( | SCH_REFERENCE_LIST & | aReferences, |
| const SCH_SHEET_PATH & | aSheetPath, | ||
| SYMBOL_FILTER | aSymbolFilter, | ||
| bool | aForceIncludeOrphanSymbols = false ) const |
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets that are contained within aSheetPath as well as recursively downwards inside aSheetPath.
| aReferences | List of references to populate. |
| aSheetPath | Path to return symbols from |
| aSymbolFilter | controls which symbols are included. |
| aForceIncludeOrphanSymbols | Set to true to include symbols having no symbol found in lib. The normal option is false, and set to true only to build the full list of symbols. |
Definition at line 1458 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::GetSymbols(), and SCH_SHEET_PATH::IsContainedWithin().
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and DIALOG_SYMBOL_FIELDS_TABLE::getSheetSymbolReferences().
| bool SCH_SHEET_LIST::HasPath | ( | const KIID_PATH & | aPath | ) | const |
Definition at line 2124 of file sch_sheet_path.cpp.
References path.
Referenced by SCHEMATIC::GetSchematicsSharedByMultipleProjects(), DIALOG_CHANGE_SYMBOLS::getSymbolReferences(), SCH_SCREEN::HasInstanceDataFromOtherProjects(), SCH_EDITOR_CONTROL::Paste(), and HIERARCHY_PANE::UpdateHierarchyTree().
| bool SCH_SHEET_LIST::IsModified | ( | ) | const |
Check the entire hierarchy for any modifications.
Definition at line 1356 of file sch_sheet_path.cpp.
References BASE_SCREEN::IsContentModified(), and SCH_SHEET_PATH::LastScreen().
Referenced by SCH_EDIT_FRAME::OpenProjectFiles().
| bool SCH_SHEET_LIST::NameExists | ( | const wxString & | aSheetName | ) | const |
Definition at line 1291 of file sch_sheet_path.cpp.
References SCH_SHEET::GetName(), and SCH_SHEET_PATH::Last().
| bool SCH_SHEET_LIST::PageNumberExists | ( | const wxString & | aPageNumber | ) | const |
Definition at line 1303 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::GetPageNumber().
Referenced by HIERARCHY_PANE::onRightClick(), and SCH_EDITOR_CONTROL::Paste().
| void SCH_SHEET_LIST::RecoverPackageRefs | ( | ) |
Give a unit loaded by StripRefSuffixes() the base of a package in another top level sheet.
Each top level sheet strips its references as it loads, before the others exist, so a unit of a package owned elsewhere keeps its whole reference or loses only its own suffix.
Definition at line 1984 of file sch_sheet_path.cpp.
References claimPackageUnit(), LIB_ID::Format(), SCH_SYMBOL::GetInstance(), SCH_SYMBOL::GetLibId(), SCH_SYMBOL::GetUnitCount(), SCH_SYMBOL_INSTANCE::m_Reference, SCH_SYMBOL_INSTANCE::m_RefLacksSuffix, SCH_SYMBOL_INSTANCE::m_Unit, path, PENDING, and SCH_SYMBOL_T.
| void SCH_SHEET_LIST::RemoveSymbolInstances | ( | const SCH_SHEET_PATH & | aPrefixSheetPath | ) |
Definition at line 1798 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::RemoveSymbolInstances().
| bool SCH_SHEET_LIST::RepairPageNumbers | ( | ) |
Assign valid page numbers to sheet paths whose stored page number is missing or collides with an earlier sheet.
Existing, unique numeric page numbers and any non-numeric page numbers are preserved so user-chosen numbering is respected. Blank sheets and the second and subsequent sheets sharing a number are reassigned to the next unused positive integer.
Definition at line 1736 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::GetPageNumber(), SCH_SHEET::IsVirtualRootSheet(), SCH_SHEET_PATH::Last(), and SCH_SHEET_PATH::SetPageNumber().
Referenced by EESCHEMA_HELPERS::LoadSchematic(), and SCH_EDIT_FRAME::OpenProjectFiles().
| SCH_ITEM * SCH_SHEET_LIST::ResolveItem | ( | const KIID & | aID, |
| SCH_SHEET_PATH * | aPathOut = nullptr, | ||
| bool | aAllowNullptrReturn = false ) const |
Fetch a SCH_ITEM by ID.
Also returns the sheet the item was found on in aPathOut.
Definition at line 1378 of file sch_sheet_path.cpp.
References DELETED_SHEET_ITEM::GetInstance(), and SCH_SHEET_PATH::ResolveItem().
Referenced by API_HANDLER_SCH::deleteItemsInternal(), SCH_MARKER::FromProto(), API_HANDLER_SCH::getItemFromDocument(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), API_HANDLER_SCH::handleGetItemsById(), SCHEMATIC::ResolveERCExclusionsPostUpdate(), and SCH_EDIT_FRAME::SaveSymbolToSchematic().
| void SCH_SHEET_LIST::SetInitialPageNumbers | ( | ) |
Set initial sheet page numbers.
The number scheme is base on the old pseudo sheet numbering algorithm prior to the implementation of user definable sheet page numbers.
Definition at line 1716 of file sch_sheet_path.cpp.
References AllSheetPageNumbersEmpty(), SCH_SHEET::IsVirtualRootSheet(), SCH_SHEET_PATH::Last(), and SCH_SHEET_PATH::SetPageNumber().
Referenced by BOOST_AUTO_TEST_CASE(), EESCHEMA_HELPERS::LoadSchematic(), SCH_IO_DIPTRACE::LoadSchematicFile(), SCH_IO_PCAD::LoadSchematicFile(), SCH_IO_TARGET3001::LoadSchematicFile(), and SCH_EDIT_FRAME::OpenProjectFiles().
| int SCH_SHEET_LIST::ShareReusedSheetRef | ( | SCH_SYMBOL * | aSymbol, |
| const SCH_SHEET_PATH & | aSource ) const |
Give every other instance of aSymbol's sheet the base reference and unit it has on aSource.
Definition at line 2044 of file sch_sheet_path.cpp.
References SCH_SYMBOL::GetBaseRef(), SCH_SYMBOL::GetUnitSelection(), SCH_SHEET_PATH::LastScreen(), path, SCH_SYMBOL::SetRef(), and SCH_SYMBOL::SetUnitSelection().
Referenced by AnnotateReferences().
| void SCH_SHEET_LIST::SortByHierarchicalPageNumbers | ( | bool | aUpdateVirtualPageNums = true | ) |
This works like SortByPageNumbers, but it sorts the sheets first by their hierarchical depth and then by their page numbers.
This ensures that printouts follow the hierarchical structure of the schematic.
Definition at line 1194 of file sch_sheet_path.cpp.
References SCH_SHEET_PATH::at(), SCH_SHEET::ComparePageNum(), end, SCH_SHEET_PATH::GetCurrentHash(), SCH_SHEET::getPageNumber(), SCH_SHEET_PATH::GetVirtualPageNumber(), EDA_ITEM::m_Uuid, path, SCH_SHEET_PATH::SetVirtualPageNumber(), and SCH_SHEET_PATH::size().
Referenced by SCH_PLOTTER::createDXFFiles(), SCH_PLOTTER::createPDFFile(), SCH_PLOTTER::createPNGFiles(), SCH_PLOTTER::createPSFiles(), SCH_PLOTTER::createSVGFiles(), and DIALOG_PRINT::printViaPdf().
| void SCH_SHEET_LIST::SortByPageNumbers | ( | bool | aUpdateVirtualPageNums = true | ) |
Sort the list of sheets by page number.
This should be called after BuildSheetList
If page numbers happen to be equal, then it compares the sheet names to ensure deterministic ordering.
| aUpdateVirtualPageNums | If true, updates the virtual page numbers to match the new ordering |
Definition at line 1256 of file sch_sheet_path.cpp.
References SCH_SHEET::ComparePageNum(), end, SCH_SHEET_PATH::GetCachedPageNumber(), SCH_SHEET_PATH::GetCurrentHash(), SCH_SHEET_PATH::GetVirtualPageNumber(), path, and SCH_SHEET_PATH::SetVirtualPageNumber().
Referenced by ORCAD_CONVERTER::assignRemainingUuids(), SCHEMATIC::BuildSheetListSortedByPageNumbers(), SCH_FIND_REPLACE_TOOL::FindNext(), API_HANDLER_SCH::handlePlaceSymbolFromLibrary(), SCH_PRINTOUT::OnPrintPage(), SCH_EDITOR_CONTROL::Paste(), and SCH_DRAWING_TOOLS::PlaceSymbol().
| wxString SCH_SHEET_LIST::SourceRefSuffix | ( | const SCH_SYMBOL & | aSymbol, |
| const KIID_PATH & | aInstancePath ) const |
Return the suffix the source project composed into the instance of aSymbol at aInstancePath, which this list holds as loaded from that project's file.
Ancestors above the loaded root are not in the file, so their part of the suffix is unknown.
Definition at line 2064 of file sch_sheet_path.cpp.
References KIID_PATH::EndsWith(), SCHEMATIC::IsInstancePathInProject(), path, SCH_ITEM::Schematic(), and source.
Referenced by SCH_SHEET_PATH::AddNewSymbolInstances().
| void SCH_SHEET_LIST::StripRefSuffixes | ( | ) |
Recover the base references from the composed references a file stores.
Run once after loading a project, before CheckForMissingSymbolInstances() copies references to new paths. A unit whose package an older version stored with another sheet's suffix loses that suffix; any other reference that lacks its path's suffix is kept whole.
Definition at line 1904 of file sch_sheet_path.cpp.
References claimPackageUnit(), LIB_ID::Format(), SCH_SYMBOL::GetInstance(), SCH_SYMBOL::GetLibId(), SCH_SYMBOL::GetUnitCount(), SCH_SYMBOL_INSTANCE::m_Reference, SCH_SYMBOL_INSTANCE::m_Unit, path, SCH_SYMBOL_T, SCH_SYMBOL::SetRef(), SCH_SYMBOL::SetRefLacksSuffix(), and stripRefSuffix().
Referenced by SCH_IO_KICAD_SEXPR::LoadSchematicFile().
| bool SCH_SHEET_LIST::TestForRecursion | ( | const SCH_SHEET_LIST & | aSrcSheetHierarchy, |
| const wxString & | aDestFileName ) |
Test every SCH_SHEET_PATH in this SCH_SHEET_LIST to verify if adding the sheets stored in aSrcSheetHierarchy to the sheet stored in aDestFileName will cause recursion.
| aSrcSheetHierarchy | is the SCH_SHEET_LIST of the source sheet add to aDestFileName. |
| aDestFileName | is the file name of the destination sheet for aSrcFileName. |
Definition at line 1517 of file sch_sheet_path.cpp.
References empty(), SCH_SHEET::GetFileName(), SCHEMATIC::GetFileName(), SCH_SHEET_PATH::GetSheet(), SCH_SHEET_LIST(), SCH_SHEET_PATH::size(), and TestForRecursion().
Referenced by SCH_EDIT_FRAME::CheckSheetForRecursion(), SCH_MOVE_TOOL::dropWouldRecurse(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), SCH_EDITOR_CONTROL::Paste(), and TestForRecursion().
| void SCH_SHEET_LIST::TrimToPageNumbers | ( | const std::vector< wxString > & | aPageInclusions | ) |
Truncates the list by removing sheet's with page numbers not in the given list.
| aPageInclusions | List of Page Numbers (non-virtual) to keep |
Definition at line 1315 of file sch_sheet_path.cpp.
References end, and SCH_SHEET_PATH::GetPageNumber().
Referenced by SCH_PLOTTER::createDXFFiles(), SCH_PLOTTER::createPDFFile(), SCH_PLOTTER::createPNGFiles(), SCH_PLOTTER::createPSFiles(), and SCH_PLOTTER::createSVGFiles().
| void SCH_SHEET_LIST::UpdateSheetInstanceData | ( | const std::vector< SCH_SHEET_INSTANCE > & | aSheetInstances | ) |
Update all of the sheet instance information using aSheetInstances.
| aSheetInstances | is the sheet path information loaded from the root schematic. |
Definition at line 1639 of file sch_sheet_path.cpp.
References SCH_SHEET::GetName(), path, and traceSchSheetPaths.
Referenced by EESCHEMA_HELPERS::LoadSchematic(), KI_TEST::LoadSchematic(), SCH_EDIT_FRAME::OpenProjectFiles(), and KI_TEST::ReadSchematicFromStream().
| void SCH_SHEET_LIST::UpdateSymbolInstanceData | ( | const std::vector< SCH_SYMBOL_INSTANCE > & | aSymbolInstances | ) |
Update all of the symbol instance information using aSymbolInstances.
| aSymbolInstances | is the symbol path information loaded from the root schematic. |
Definition at line 1595 of file sch_sheet_path.cpp.
References SCH_SYMBOL::AddHierarchicalReference(), KIID_PATH::AsString(), SCH_SYMBOL::GetField(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), EDA_ITEM::m_Uuid, EE_RTREE::OfType(), SCH_SHEET_PATH::Path(), REFERENCE, SCH_SYMBOL_T, SCH_SYMBOL::SetFootprintFieldText(), SCH_FIELD::SetText(), SCH_SYMBOL::SetValueFieldText(), traceSchSheetPaths, and SCH_SYMBOL::UpdatePrefix().
Referenced by EESCHEMA_HELPERS::LoadSchematic(), KI_TEST::LoadSchematic(), SCH_EDIT_FRAME::LoadSheetFromFile(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH::readSchematicFromFile(), and KI_TEST::ReadSchematicFromStream().
|
private |
Definition at line 935 of file sch_sheet_path.h.
Referenced by BuildSheetList().