KiCad PCB EDA Suite
|
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened schematic hierarchy. More...
#include <sch_sheet_path.h>
Public Member Functions | |
SCH_SHEET_PATH () | |
SCH_SHEET_PATH (const SCH_SHEET_PATH &aOther) | |
SCH_SHEET_PATH & | operator= (const SCH_SHEET_PATH &aOther) |
SCH_SHEET_PATH | operator+ (const SCH_SHEET_PATH &aOther) |
~SCH_SHEET_PATH ()=default | |
SCH_SHEET * | at (size_t aIndex) const |
Forwarded method from std::vector. | |
void | clear () |
Forwarded method from std::vector. | |
bool | empty () const |
Forwarded method from std::vector. | |
void | pop_back () |
Forwarded method from std::vector. | |
void | push_back (SCH_SHEET *aSheet) |
Forwarded method from std::vector. | |
size_t | size () const |
Forwarded method from std::vector. | |
std::vector< SCH_SHEET * >::iterator | erase (std::vector< SCH_SHEET * >::const_iterator aPosition) |
void | Rehash () |
size_t | GetCurrentHash () const |
void | SetVirtualPageNumber (int aPageNumber) |
Set the sheet instance virtual page number. | |
int | GetVirtualPageNumber () const |
void | SetPageNumber (const wxString &aPageNumber) |
Set the sheet instance user definable page number. | |
wxString | GetPageNumber () const |
const SCH_SHEET * | GetSheet (unsigned aIndex) const |
bool | IsFullPath () const |
int | Cmp (const SCH_SHEET_PATH &aSheetPathToTest) const |
Compare if this is the same sheet path as aSheetPathToTest. | |
void | CachePageNumber () const |
wxString | GetCachedPageNumber () const |
int | ComparePageNum (const SCH_SHEET_PATH &aSheetPathToTest) const |
Compare sheets by their page number. | |
bool | IsContainedWithin (const SCH_SHEET_PATH &aSheetPathToTest) const |
Check if this path is contained inside aSheetPathToTest. | |
SCH_SHEET * | Last () const |
Return a pointer to the last SCH_SHEET of the list. | |
SCH_SCREEN * | LastScreen () |
SCH_SCREEN * | LastScreen () const |
bool | GetExcludedFromSim () const |
bool | GetExcludedFromBOM () const |
bool | GetExcludedFromBoard () const |
bool | GetDNP () const |
SCH_ITEM * | GetItem (const KIID &aID) const |
Fetch a SCH_ITEM by ID. | |
wxString | PathAsString () const |
Return the path of time stamps which do not changes even when editing sheet parameters. | |
KIID_PATH | Path () const |
Get the sheet path as an KIID_PATH. | |
wxString | PathHumanReadable (bool aUseShortRootName=true, bool aStripTrailingSeparator=false) const |
Return the sheet path in a human readable form made from the sheet names. | |
void | UpdateAllScreenReferences () const |
Update all the symbol references for this sheet path. | |
void | AppendSymbol (SCH_REFERENCE_LIST &aReferences, SCH_SYMBOL *aSymbol, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const |
Append a SCH_REFERENCE object to aReferences based on aSymbol. | |
void | GetSymbols (SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const |
Adds SCH_REFERENCE object to aReferences for each symbol in the sheet. | |
void | AppendMultiUnitSymbol (SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, SCH_SYMBOL *aSymbol, bool aIncludePowerSymbols=true) const |
Append a SCH_REFERENCE_LIST object to aRefList based on aSymbol, storing same-reference set of multi-unit parts together. | |
void | GetMultiUnitSymbols (SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, bool aIncludePowerSymbols=true) const |
Add a SCH_REFERENCE_LIST object to aRefList for each same-reference set of multi-unit parts in the sheet. | |
bool | TestForRecursion (const wxString &aSrcFileName, const wxString &aDestFileName) |
Test the SCH_SHEET_PATH file names to check adding the sheet stored in the file aSrcFileName to the sheet stored in file aDestFileName will cause a sheet path recursion. | |
void | MakeFilePathRelativeToParentSheet () |
Make the sheet file name relative to its parent sheet. | |
void | AddNewSymbolInstances (const SCH_SHEET_PATH &aPrefixSheetPath, const wxString &aProjectName) |
Attempt to add new symbol instances for all symbols in this sheet path prefixed with aPrefixSheetPath. | |
void | RemoveSymbolInstances (const SCH_SHEET_PATH &aPrefixSheetPath) |
void | CheckForMissingSymbolInstances (const wxString &aProjectName) |
bool | operator== (const SCH_SHEET_PATH &d1) const |
bool | operator!= (const SCH_SHEET_PATH &d1) const |
bool | operator< (const SCH_SHEET_PATH &d1) const |
Protected Attributes | |
std::vector< SCH_SHEET * > | m_sheets |
size_t | m_current_hash |
wxString | m_cached_page_number |
int | m_virtualPageNumber |
std::map< std::pair< wxString, wxString >, bool > | m_recursion_test_cache |
Page numbers are maintained by the sheet load order. | |
Private Member Functions | |
void | initFromOther (const SCH_SHEET_PATH &aOther) |
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened schematic hierarchy.
The SCH_SHEET objects are stored in a list from first (usually the root sheet) to a given sheet in last position. The last sheet is usually the sheet we want to select or reach (which is what the function Last() returns). Others sheets constitute the "path" from the first to the last sheet.
Definition at line 136 of file sch_sheet_path.h.
SCH_SHEET_PATH::SCH_SHEET_PATH | ( | ) |
Definition at line 107 of file sch_sheet_path.cpp.
References m_current_hash, and m_virtualPageNumber.
SCH_SHEET_PATH::SCH_SHEET_PATH | ( | const SCH_SHEET_PATH & | aOther | ) |
Definition at line 114 of file sch_sheet_path.cpp.
References initFromOther().
|
default |
void SCH_SHEET_PATH::AddNewSymbolInstances | ( | const SCH_SHEET_PATH & | aPrefixSheetPath, |
const wxString & | aProjectName | ||
) |
Attempt to add new symbol instances for all symbols in this sheet path prefixed with aPrefixSheetPath.
The new symbol instance data will be assigned by the following criteria:
aPrefixSheetPath | is the sheet path to prefix to this sheet path for the new symbol instance. |
aProjectName | is the name of the project for the new symbol instance data. |
Definition at line 602 of file sch_sheet_path.cpp.
References SCH_SYMBOL::AddHierarchicalReference(), SCH_SYMBOL::GetField(), SCH_SYMBOL::GetInstance(), SCH_SYMBOL::GetInstances(), EDA_TEXT::GetText(), SCH_ITEM::GetUnit(), LastScreen(), SCH_SYMBOL_INSTANCE::m_Path, SCH_SYMBOL_INSTANCE::m_ProjectName, SCH_SYMBOL_INSTANCE::m_Reference, SCH_SYMBOL_INSTANCE::m_Unit, Path(), REFERENCE_FIELD, and SCH_SYMBOL_T.
Referenced by SCH_SHEET_LIST::AddNewSymbolInstances().
void SCH_SHEET_PATH::AppendMultiUnitSymbol | ( | SCH_MULTI_UNIT_REFERENCE_MAP & | aRefList, |
SCH_SYMBOL * | aSymbol, | ||
bool | aIncludePowerSymbols = true |
||
) | const |
Append a SCH_REFERENCE_LIST object to aRefList based on aSymbol, storing same-reference set of multi-unit parts together.
The map key for each element will be the reference designator.
aRefList | Map of reference designators to reference lists |
aSymbol | A symbol to add to aRefList |
aIncludePowerSymbols | Set to false to only get normal symbols. |
Definition at line 462 of file sch_sheet_path.cpp.
References SCH_SYMBOL::GetLibSymbolRef(), SCH_REFERENCE::GetRef(), SCH_SYMBOL::GetRef(), LIB_SYMBOL::GetUnitCount(), m_virtualPageNumber, and SCH_REFERENCE::SetSheetNumber().
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), GetMultiUnitSymbols(), and TEST_SCH_REFERENCE_LIST_FIXTURE::loadTestCase().
void SCH_SHEET_PATH::AppendSymbol | ( | SCH_REFERENCE_LIST & | aReferences, |
SCH_SYMBOL * | aSymbol, | ||
bool | aIncludePowerSymbols = true , |
||
bool | aForceIncludeOrphanSymbols = false |
||
) | const |
Append a SCH_REFERENCE object to aReferences based on aSymbol.
aReferences | List of references to populate. |
aSymbol | A symbol to add to aReferences |
aIncludePowerSymbols | set to false to only get normal symbols. |
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 432 of file sch_sheet_path.cpp.
References SCH_REFERENCE_LIST::AddItem(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetRef(), m_virtualPageNumber, and SCH_REFERENCE::SetSheetNumber().
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), SCH_EDIT_FRAME::CheckAnnotate(), GetSymbols(), and TEST_SCH_REFERENCE_LIST_FIXTURE::loadTestCase().
|
inline |
Forwarded method from std::vector.
Definition at line 150 of file sch_sheet_path.h.
References m_sheets.
Referenced by SCH_SHEET_LIST::AddNewSheetInstances(), Cmp(), GetSheet(), SCHEMATIC::GetUniqueFilenameForCurrentSheet(), IsContainedWithin(), SCH_IO_KICAD_SEXPR::loadHierarchy(), operator+(), PathAsString(), PathHumanReadable(), and TestForRecursion().
|
inline |
Definition at line 232 of file sch_sheet_path.h.
References GetPageNumber(), and m_cached_page_number.
void SCH_SHEET_PATH::CheckForMissingSymbolInstances | ( | const wxString & | aProjectName | ) |
Definition at line 671 of file sch_sheet_path.cpp.
References SCH_SYMBOL::AddHierarchicalReference(), KIID::AsString(), SCH_SYMBOL::GetField(), SCH_SYMBOL::GetInstance(), SCH_SYMBOL::GetPrefix(), UTIL::GetRefDesUnannotated(), SCH_FIELD::GetShownText(), SCH_ITEM::GetUnit(), LastScreen(), SCH_SYMBOL_INSTANCE::m_Path, SCH_SYMBOL_INSTANCE::m_ProjectName, SCH_SYMBOL_INSTANCE::m_Reference, SCH_SYMBOL_INSTANCE::m_Unit, EDA_ITEM::m_Uuid, Path(), PathHumanReadable(), REFERENCE_FIELD, SCH_SYMBOL_T, and traceSchSheetPaths.
Referenced by SCH_SHEET_LIST::CheckForMissingSymbolInstances().
|
inline |
Forwarded method from std::vector.
Definition at line 153 of file sch_sheet_path.h.
References m_sheets, and Rehash().
Referenced by SCH_EDIT_FRAME::doCloseWindow(), SCHEMATIC::Reset(), SCHEMATIC::SetRoot(), and HIERARCHY_PANE::UpdateHierarchyTree().
int SCH_SHEET_PATH::Cmp | ( | const SCH_SHEET_PATH & | aSheetPathToTest | ) | const |
Compare if this is the same sheet path as aSheetPathToTest.
aSheetPathToTest | is the sheet path to compare. |
Definition at line 168 of file sch_sheet_path.cpp.
References at(), EDA_ITEM::m_Uuid, and size().
Referenced by HIERARCHY_PANE::renameIdenticalSheets(), HIERARCHY_PANE::setIdenticalSheetsHighlighted(), and SCH_REFERENCE_LIST::sortByTimeStamp().
int SCH_SHEET_PATH::ComparePageNum | ( | const SCH_SHEET_PATH & | aSheetPathToTest | ) | const |
Compare sheets by their page number.
If the actual page number is equal, use virtual page numbers to compare.
Definition at line 190 of file sch_sheet_path.cpp.
References SCH_SHEET::ComparePageNum(), GetPageNumber(), and GetVirtualPageNumber().
Referenced by HIERARCHY_TREE::OnCompareItems().
|
inline |
Forwarded method from std::vector.
Definition at line 160 of file sch_sheet_path.h.
References m_sheets.
Referenced by SCH_SHEET::findSelf(), Last(), SCH_IO_KICAD_SEXPR::loadHierarchy(), DIALOG_ERC::OnERCItemSelected(), and PathHumanReadable().
|
inline |
Definition at line 179 of file sch_sheet_path.h.
References m_sheets.
|
inline |
Definition at line 233 of file sch_sheet_path.h.
References m_cached_page_number.
Referenced by SCH_SHEET_LIST::SortByPageNumbers().
|
inline |
Definition at line 186 of file sch_sheet_path.h.
References m_current_hash.
Referenced by SCH_FIND_REPLACE_TOOL::FindNext(), SHEET_PATH_CMP::operator()(), operator==(), ERC_SCH_PIN_CONTEXT::rehash(), and SCH_SHEET_LIST::SortByPageNumbers().
bool SCH_SHEET_PATH::GetDNP | ( | ) | const |
Definition at line 302 of file sch_sheet_path.cpp.
References m_sheets.
Referenced by SCH_SHEET::ResolveTextVar(), and SCH_SYMBOL::ResolveTextVar().
bool SCH_SHEET_PATH::GetExcludedFromBoard | ( | ) | const |
Definition at line 290 of file sch_sheet_path.cpp.
References m_sheets.
Referenced by NETLIST_EXPORTER_XML::makeListOfNets(), SCH_SHEET::ResolveTextVar(), and SCH_SYMBOL::ResolveTextVar().
bool SCH_SHEET_PATH::GetExcludedFromBOM | ( | ) | const |
Definition at line 278 of file sch_sheet_path.cpp.
References m_sheets.
Referenced by NETLIST_EXPORTER_XML::makeListOfNets(), SCH_SHEET::ResolveTextVar(), and SCH_SYMBOL::ResolveTextVar().
bool SCH_SHEET_PATH::GetExcludedFromSim | ( | ) | const |
Definition at line 266 of file sch_sheet_path.cpp.
References m_sheets.
Referenced by NETLIST_EXPORTER_SPICE::BuildSheetList(), SCH_EDIT_FRAME::RefreshOperatingPointDisplay(), SCH_SHEET::ResolveTextVar(), and SCH_SYMBOL::ResolveTextVar().
Fetch a SCH_ITEM by ID.
Definition at line 932 of file sch_sheet_path.cpp.
References LastScreen(), EDA_ITEM::m_Uuid, and SCH_ITEM::RunOnChildren().
Referenced by SIMULATOR_FRAME_UI::applyTuners(), SCH_SHEET_LIST::GetItem(), and SIMULATOR_FRAME_UI::UpdateTunerValue().
void SCH_SHEET_PATH::GetMultiUnitSymbols | ( | SCH_MULTI_UNIT_REFERENCE_MAP & | aRefList, |
bool | aIncludePowerSymbols = true |
||
) | const |
Add a SCH_REFERENCE_LIST object to aRefList for each same-reference set of multi-unit parts in the sheet.
The map key for each element will be the reference designator.
aRefList | Map of reference designators to reference lists |
aIncludePowerSymbols | Set to false to only get normal symbols. |
Definition at line 451 of file sch_sheet_path.cpp.
References AppendMultiUnitSymbol(), LastScreen(), and SCH_SYMBOL_T.
Referenced by SCH_EDIT_FRAME::AnnotateSymbols().
wxString SCH_SHEET_PATH::GetPageNumber | ( | ) | const |
Definition at line 574 of file sch_sheet_path.cpp.
References SCH_SHEET::getPageNumber(), Last(), and Path().
Referenced by SCH_SHEET_LIST::AllSheetPageNumbersEmpty(), HIERARCHY_PANE::buildHierarchyTree(), CachePageNumber(), ComparePageNum(), SCH_EDIT_TOOL::EditPageNumber(), SYMBOL_SEARCH_HANDLER::getResultCell(), POWER_SEARCH_HANDLER::getResultCell(), TEXT_SEARCH_HANDLER::getResultCell(), LABEL_SEARCH_HANDLER::getResultCell(), HIERARCHY_PANE::getRootString(), HIERARCHY_PANE::onRightClick(), HIERARCHY_PANE::onTreeEditFinished(), SCH_SHEET_LIST::PageNumberExists(), SCH_PLOTTER::plotOneSheetDXF(), SCH_PLOTTER::plotOneSheetHpgl(), SCH_PLOTTER::plotOneSheetPS(), SCH_PLOTTER::plotOneSheetSVG(), HIERARCHY_PANE::renameIdenticalSheets(), SCH_SHEET::ResolveTextVar(), SCHEMATIC::ResolveTextVar(), DIALOG_SHEET_PROPERTIES::TransferDataToWindow(), SCH_SHEET_LIST::TrimToPageNumbers(), and HIERARCHY_PANE::UpdateLabelsHierarchyTree().
|
inline |
Definition at line 210 of file sch_sheet_path.h.
Referenced by NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), CONNECTION_GRAPH::generateBusAliasMembers(), IsFullPath(), NETLIST_EXPORTER_XML::makeListOfNets(), SCH_EDIT_FRAME::MakeNetNavigatorNode(), HIERARCHY_PANE::onTreeEditFinished(), HIERARCHY_PANE::renameIdenticalSheets(), SCH_SHEET_LIST::TestForRecursion(), NETLIST_EXPORTER_CADSTAR::writeListOfNets(), and NETLIST_EXPORTER_PADS::writeListOfNets().
void SCH_SHEET_PATH::GetSymbols | ( | SCH_REFERENCE_LIST & | aReferences, |
bool | aIncludePowerSymbols = true , |
||
bool | aForceIncludeOrphanSymbols = false |
||
) | const |
Adds SCH_REFERENCE object to aReferences for each symbol in the sheet.
aReferences | List of references to populate. |
aIncludePowerSymbols | set to false to only get normal symbols. |
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 421 of file sch_sheet_path.cpp.
References AppendSymbol(), LastScreen(), and SCH_SYMBOL_T.
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), SCH_EDIT_FRAME::CheckAnnotate(), CollectOtherUnits(), findSymbolsAndPins(), SCH_SHEET_LIST::GetSymbols(), SCH_SHEET_LIST::GetSymbolsWithinPath(), SCH_EDITOR_CONTROL::IncrementAnnotations(), sheetContainsOnlyWantedItems(), and SCH_EDITOR_CONTROL::updatePastedSheet().
|
inline |
Definition at line 199 of file sch_sheet_path.h.
References m_virtualPageNumber.
Referenced by SCH_NAVIGATE_TOOL::CanGoNext(), SCH_NAVIGATE_TOOL::CanGoPrevious(), ComparePageNum(), SCH_LABEL_BASE::GetIntersheetRefs(), SCH_SHEET_LIST::GetLastVirtualPageNumber(), SCH_NAVIGATE_TOOL::Next(), SCH_NAVIGATE_TOOL::Previous(), SCH_GLOBALLABEL::ResolveTextVar(), and SCH_SHEET_LIST::SortByPageNumbers().
|
private |
Definition at line 140 of file sch_sheet_path.cpp.
References m_cached_page_number, m_current_hash, m_sheets, and m_virtualPageNumber.
Referenced by operator=(), and SCH_SHEET_PATH().
bool SCH_SHEET_PATH::IsContainedWithin | ( | const SCH_SHEET_PATH & | aSheetPathToTest | ) | const |
Check if this path is contained inside aSheetPathToTest.
aSheetPathToTest | is the sheet path to compare against. |
Definition at line 212 of file sch_sheet_path.cpp.
References KIID_PATH::AsString(), at(), EDA_ITEM::m_Uuid, Path(), size(), and traceSchSheetPaths.
Referenced by findSymbolsAndPins(), SCH_SHEET_LIST::GetSheetsWithinPath(), SCH_SHEET_LIST::GetSymbolsWithinPath(), FIELDS_EDITOR_GRID_DATA_MODEL::RebuildRows(), and sheetContainsOnlyWantedItems().
bool SCH_SHEET_PATH::IsFullPath | ( | ) | const |
Definition at line 152 of file sch_sheet_path.cpp.
References GetSheet(), SCH_SHEET::IsRootSheet(), and m_sheets.
SCH_SHEET * SCH_SHEET_PATH::Last | ( | ) | const |
Return a pointer to the last SCH_SHEET of the list.
One can see the others sheet as the "path" to reach this last sheet.
Definition at line 235 of file sch_sheet_path.cpp.
References empty(), and m_sheets.
Referenced by NETLIST_EXPORTER_SPICE::BuildSheetList(), SCH_NAVIGATE_TOOL::CanGoUp(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::EditPageNumber(), SCH_SHEET::findSelf(), DIALOG_TABLE_PROPERTIES::getContextualTextVars(), DIALOG_TEXT_PROPERTIES::getContextualTextVars(), SCH_SHEET::GetContextualTextVars(), SCH_IO_EAGLE::getCurrentScreen(), SCH_IO_ALTIUM::getCurrentSheet(), SCH_IO_EAGLE::getCurrentSheet(), GetPageNumber(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_TEXT::GetShownText(), SCH_TEXTBOX::GetShownText(), SCH_DRAWING_TOOLS::ImportSheet(), EE_SELECTION_TOOL::Init(), SCH_DRAWING_TOOLS::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), LastScreen(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), MakeFilePathRelativeToParentSheet(), SCH_EDIT_FRAME::MakeNetNavigatorNode(), SCH_SHEET_LIST::NameExists(), HIERARCHY_PANE::onRightClick(), SCH_FIELD::OnScintillaCharAdded(), HIERARCHY_PANE::onTreeEditFinished(), SCH_IO_ALTIUM::ParseComponent(), SCH_IO_ALTIUM::ParseTemplate(), SCH_EDITOR_CONTROL::Paste(), SCH_PLOTTER::plotOneSheetDXF(), SCH_PLOTTER::plotOneSheetHpgl(), SCH_PLOTTER::plotOneSheetPDF(), SCH_PLOTTER::plotOneSheetPS(), SCH_PLOTTER::plotOneSheetSVG(), HIERARCHY_PANE::renameIdenticalSheets(), SCH_LABEL_BASE::ResolveTextVar(), SCH_SYMBOL::ResolveTextVar(), SCHEMATIC::ResolveTextVar(), SCH_EDITOR_CONTROL::Revert(), SCH_EDITOR_CONTROL::SaveCurrSheetCopyAs(), SCH_EDIT_FRAME::SaveSheetAsDesignBlock(), HIERARCHY_PANE::setIdenticalSheetsHighlighted(), SetPageNumber(), CONNECTION_GRAPH::updateItemConnectivity(), and HIERARCHY_PANE::UpdateLabelsHierarchyTree().
SCH_SCREEN * SCH_SHEET_PATH::LastScreen | ( | ) |
Definition at line 244 of file sch_sheet_path.cpp.
References SCH_SHEET::GetScreen(), and Last().
Referenced by AddNewSymbolInstances(), SCH_SHEET_LIST::AnnotatePowerSymbols(), SCH_EDIT_FRAME::AnnotateSymbols(), BACK_ANNOTATE::applyChangelist(), SCH_EDITOR_CONTROL::AssignNetclass(), HIERARCHY_PANE::buildHierarchyTree(), SCH_SHEET_LIST::BuildSheetList(), SCH_EDIT_FRAME::CheckAnnotate(), CheckForMissingSymbolInstances(), SCH_EDIT_FRAME::CheckSheetForRecursion(), SCH_SHEET_LIST::ClearModifyStatus(), SCH_EDIT_FRAME::CommonSettingsChanged(), SCH_IO_LTSPICE_PARSER::CreateArc(), SCH_IO_LTSPICE_PARSER::CreateBusEntry(), SCH_IO_LTSPICE_PARSER::CreateCircle(), SCH_PLOTTER::createDXFFiles(), SCH_PLOTTER::createHPGLFiles(), SCH_IO_LTSPICE_PARSER::CreateKicadSCH_ITEMs(), SCH_IO_LTSPICE_PARSER::CreateKicadSYMBOLs(), SCH_IO_LTSPICE_PARSER::CreateLine(), SCH_IO_LTSPICE_PARSER::CreateLines(), SCH_PLOTTER::createPDFFile(), SCH_IO_LTSPICE_PARSER::CreatePin(), SCH_PLOTTER::createPSFiles(), SCH_IO_LTSPICE_PARSER::CreateRect(), SCH_PLOTTER::createSVGFiles(), SCH_IO_LTSPICE_PARSER::CreateWire(), SCH_IO_LTSPICE_PARSER::CreateWires(), SCH_EDIT_FRAME::DeleteAnnotation(), SCH_EDIT_FRAME::DisplayCurrentSheet(), DESIGN_BLOCK_PREVIEW_WIDGET::DisplayDesignBlock(), SCH_DRAWING_TOOLS::doSyncSheetsPins(), SCH_EDIT_TOOL::EditPageNumber(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckDanglingWireEndpoints(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), CONNECTION_GRAPH::ercCheckSingleGlobalLabel(), SCH_SHEET_LIST::FillItemMap(), SCH_SHEET_LIST::FindAllSheetsForScreen(), findItemsFromSyncSelection(), NETLIST_EXPORTER_BASE::findNextSymbol(), SCH_SHEET_LIST::FindSheetForScreen(), SCHEMATIC::GetContextualTextVars(), SCH_IO_ALTIUM::getCurrentScreen(), GetItem(), GetMultiUnitSymbols(), SCH_EDIT_FRAME::GetScreen(), GetSymbols(), SCH_EDIT_FRAME::HardRedraw(), SCH_EDITOR_CONTROL::IncrementAnnotations(), DIALOG_EDIT_SYMBOLS_LIBID::initDlg(), SCH_SHEET_LIST::IsModified(), SCH_IO_KICAD_SEXPR::loadHierarchy(), MakeFilePathRelativeToParentSheet(), SCH_EDIT_FRAME::onNetNavigatorSelection(), SCH_PRINTOUT::OnPrintPage(), HIERARCHY_PANE::onRightClick(), DIALOG_ERC::OnRunERCClick(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), SCH_IO_LTSPICE_PARSER::Parse(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceSymbol(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), BACK_ANNOTATE::processNetNameChange(), SCHEMATIC::RecomputeIntersheetRefs(), RemoveSymbolInstances(), SCH_FIND_REPLACE_TOOL::ReplaceAndFindNext(), RESCUER::RESCUER(), SCHEMATIC::ResolveERCExclusionsPostUpdate(), SCHEMATIC::ResolveTextVar(), SCH_EDIT_FRAME::SaveSheetAsDesignBlock(), SCH_EDIT_FRAME::SetCurrentSheet(), SCHEMATIC::SetSheetNumberAndCount(), TestForRecursion(), ERC_TESTER::TestMissingNetclasses(), ERC_TESTER::TestMissingUnits(), ERC_TESTER::TestMultiunitFootprints(), ERC_TESTER::TestMultUnitPinConflicts(), ERC_TESTER::TestPinToPin(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_FIELDS_TABLE::TransferDataFromWindow(), SCH_LINE_WIRE_BUS_TOOL::TrimOverLappingWires(), UpdateAllScreenReferences(), CONNECTION_GRAPH::updateItemConnectivity(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), and SCH_SHEET_LIST::UpdateSymbolInstanceData().
SCH_SCREEN * SCH_SHEET_PATH::LastScreen | ( | ) | const |
Definition at line 255 of file sch_sheet_path.cpp.
References SCH_SHEET::GetScreen(), and Last().
void SCH_SHEET_PATH::MakeFilePathRelativeToParentSheet | ( | ) |
Make the sheet file name relative to its parent sheet.
This should only be called when changing the parent sheet path such performing a save as or a new schematic without a project in stand alone mode. The sheet file name is only made relative if the current file name is relative. Absolute sheet file name paths are a user choice so do not change them.
Sheet file name paths are set according to the following criteria:
Definition at line 714 of file sch_sheet_path.cpp.
References SCH_SCREEN::GetFileName(), SCH_SHEET::GetFileName(), Last(), LastScreen(), m_sheets, PathHumanReadable(), SCH_SHEET::SetFileName(), and tracePathsAndFiles.
|
inline |
Definition at line 416 of file sch_sheet_path.h.
SCH_SHEET_PATH SCH_SHEET_PATH::operator+ | ( | const SCH_SHEET_PATH & | aOther | ) |
Definition at line 127 of file sch_sheet_path.cpp.
References at(), push_back(), and size().
|
inline |
Definition at line 418 of file sch_sheet_path.h.
References m_sheets.
SCH_SHEET_PATH & SCH_SHEET_PATH::operator= | ( | const SCH_SHEET_PATH & | aOther | ) |
Definition at line 120 of file sch_sheet_path.cpp.
References initFromOther().
bool SCH_SHEET_PATH::operator== | ( | const SCH_SHEET_PATH & | d1 | ) | const |
Definition at line 488 of file sch_sheet_path.cpp.
References GetCurrentHash(), and m_current_hash.
KIID_PATH SCH_SHEET_PATH::Path | ( | ) | const |
Get the sheet path as an KIID_PATH.
Definition at line 329 of file sch_sheet_path.cpp.
References m_sheets, and path.
Referenced by SCH_SHEET_LIST::AddNewSheetInstances(), AddNewSymbolInstances(), SCH_EDIT_FRAME::AnnotateSymbols(), CheckForMissingSymbolInstances(), SCH_SYMBOL::ClearAnnotation(), findItemsFromSyncSelection(), SCH_SHEET_LIST::FindSheetForPath(), GetPageNumber(), SCH_SHEET_LIST::GetPaths(), SCH_SYMBOL::GetRef(), SCH_SHEET_LIST::GetSheetInstances(), SCH_SHEET_LIST::GetSheetPathByKIIDPath(), SCH_SYMBOL::GetUnitSelection(), SCH_SYMBOL::IsAnnotated(), IsContainedWithin(), SCH_REFERENCE::IsSameInstance(), SCH_IO_EAGLE::loadSchematic(), SCH_IO_ALTIUM::LoadSchematicFile(), SCH_EDIT_FRAME::mapExistingAnnotation(), SCH_IO_ALTIUM::ParseSheetSymbol(), SCH_SYMBOL::RemoveInstance(), SCH_IO_KICAD_SEXPR::saveSymbol(), SetPageNumber(), SCH_SYMBOL::SetRef(), SCHEMATIC::SetSheetNumberAndCount(), SCH_SYMBOL::SetUnitSelection(), SCH_EDITOR_CONTROL::updatePastedSymbol(), and SCH_SHEET_LIST::UpdateSymbolInstanceData().
wxString SCH_SHEET_PATH::PathAsString | ( | ) | const |
Return the path of time stamps which do not changes even when editing sheet parameters.
A path is something like / (root) or /34005677 or /34005677/00AE4523.
Definition at line 314 of file sch_sheet_path.cpp.
References KIID::AsString(), at(), EDA_ITEM::m_Uuid, and size().
Referenced by SCH_REFERENCE::GetFullPath(), SCH_REFERENCE::GetPath(), and SCH_EDIT_FRAME::SendSelectItemsToPcb().
wxString SCH_SHEET_PATH::PathHumanReadable | ( | bool | aUseShortRootName = true , |
bool | aStripTrailingSeparator = false |
||
) | const |
Return the sheet path in a human readable form made from the sheet names.
The "normal" path instead uses the KIID objects in the path that do not change even when editing sheet parameters.
Definition at line 341 of file sch_sheet_path.cpp.
References at(), empty(), SCH_SHEET::GetFields(), SCH_SCREEN::GetFileName(), SCH_SHEET::GetScreen(), SHEETNAME, and size().
Referenced by CheckForMissingSymbolInstances(), SCH_EDIT_TOOL::EditPageNumber(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), SCH_EDIT_FRAME::GetFullScreenDesc(), MakeFilePathRelativeToParentSheet(), SCH_EDIT_FRAME::MakeNetNavigatorNode(), HIERARCHY_PANE::onRightClick(), DIALOG_SHEET_PROPERTIES::OnUpdateUI(), SCH_PLOTTER::plotOneSheetDXF(), SCH_PLOTTER::plotOneSheetHpgl(), SCH_PLOTTER::plotOneSheetPDF(), SCH_PLOTTER::plotOneSheetPS(), SCH_PLOTTER::plotOneSheetSVG(), CONNECTION_GRAPH::propagateToNeighbors(), SCH_CONNECTION::recacheName(), SCH_SHEET::ResolveTextVar(), SCHEMATIC::ResolveTextVar(), and SCH_EDIT_FRAME::updateTitle().
|
inline |
Forwarded method from std::vector.
Definition at line 163 of file sch_sheet_path.h.
References m_sheets, and Rehash().
Referenced by HIERARCHY_PANE::buildHierarchyTree(), SCH_SHEET_LIST::BuildSheetList(), SCH_EDIT_TOOL::EditPageNumber(), SCH_SHEET::findSelf(), SCH_SHEET::GetContextualTextVars(), SCH_SHEET_LIST::GetSheetInstances(), SCH_NAVIGATE_TOOL::LeaveSheet(), SCH_IO_KICAD_SEXPR::loadHierarchy(), SCH_IO_EAGLE::loadModuleInstance(), SCH_IO_EAGLE::loadSchematic(), SCH_SHEET::LocatePathOfScreen(), SHEET_SYNCHRONIZATION_AGENT::ModifyItem(), HIERARCHY_PANE::onRightClick(), SCH_IO_ALTIUM::ParseAltiumSch(), SHEET_SYNCHRONIZATION_AGENT::PlaceSheetPin(), and SHEET_SYNCHRONIZATION_AGENT::RemoveItem().
|
inline |
Forwarded method from std::vector.
Definition at line 170 of file sch_sheet_path.h.
References m_sheets, and Rehash().
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), HIERARCHY_PANE::buildHierarchyTree(), SCH_SHEET_LIST::BuildSheetList(), SCH_EDIT_FRAME::CheckAnnotate(), SCH_EDIT_FRAME::CreateScreens(), SCH_EDIT_FRAME::DeleteAnnotation(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::EditPageNumber(), SCH_NAVIGATE_TOOL::EnterSheet(), CONNECTION_GRAPH::ercCheckHierSheets(), SCH_SHEET::findSelf(), HIERARCHY_PANE::getRootString(), DIALOG_SYMBOL_FIELDS_TABLE::getSheetSymbolReferences(), LTSPICE_SCHEMATIC::Load(), SCH_IO_KICAD_SEXPR::loadHierarchy(), SCH_IO_EAGLE::loadModuleInstance(), SCH_IO_EAGLE::loadSchematic(), LoadSchematic(), SCH_IO_ALTIUM::LoadSchematicFile(), SCH_IO_EASYEDAPRO::LoadSchematicFile(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheets(), SCH_SHEET::LocatePathOfScreen(), operator+(), SCH_IO_ALTIUM::ParseAltiumSch(), SCH_IO_ALTIUM::ParseHarnessConnector(), SCH_IO_KICAD_SEXPR_PARSER::parseSchSheetInstances(), SCH_IO_ALTIUM::ParseSheetSymbol(), CONNECTION_GRAPH::propagateToNeighbors(), SCHEMATIC::ResolveCrossReference(), SCH_EDITOR_CONTROL::Revert(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SCH_EDIT_FRAME(), SCHEMATIC::SetRoot(), SCH_DRAWING_TOOLS::SyncAllSheetsPins(), SCH_DRAWING_TOOLS::SyncSheetsPins(), TEST_SCH_SHEET_PATH_FIXTURE::TEST_SCH_SHEET_PATH_FIXTURE(), ERC_TESTER::TestTextVars(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), DIALOG_SHEET_PROPERTIES::TransferDataToWindow(), HIERARCHY_PANE::UpdateHierarchyTree(), and SCH_EDITOR_CONTROL::updatePastedSheet().
void SCH_SHEET_PATH::Rehash | ( | ) |
Definition at line 159 of file sch_sheet_path.cpp.
References hash_combine(), m_current_hash, and m_sheets.
Referenced by clear(), pop_back(), and push_back().
void SCH_SHEET_PATH::RemoveSymbolInstances | ( | const SCH_SHEET_PATH & | aPrefixSheetPath | ) |
Definition at line 653 of file sch_sheet_path.cpp.
References LastScreen(), SCH_SYMBOL::RemoveInstance(), and SCH_SYMBOL_T.
Referenced by SCH_SHEET_LIST::RemoveSymbolInstances().
void SCH_SHEET_PATH::SetPageNumber | ( | const wxString & | aPageNumber | ) |
Set the sheet instance user definable page number.
Definition at line 587 of file sch_sheet_path.cpp.
References SCH_SHEET::addInstance(), Last(), Path(), and SCH_SHEET::setPageNumber().
Referenced by SCH_SHEET_LIST::AddNewSheetInstances(), SCH_EDIT_FRAME::CreateScreens(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::EditPageNumber(), SCH_IO_EAGLE::loadModuleInstance(), SCH_IO_EAGLE::loadSchematic(), LoadSchematic(), SCH_IO_ALTIUM::LoadSchematicFile(), SCH_IO_EASYEDAPRO::LoadSchematicFile(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheets(), HIERARCHY_PANE::onRightClick(), SCH_IO_ALTIUM::ParseHarnessConnector(), SCH_IO_ALTIUM::ParseParameter(), SCH_IO_KICAD_SEXPR_PARSER::parseSchSheetInstances(), SCH_IO_ALTIUM::ParseSheetSymbol(), SCH_SHEET_LIST::SetInitialPageNumbers(), and DIALOG_SHEET_PROPERTIES::TransferDataFromWindow().
|
inline |
Set the sheet instance virtual page number.
Virtual page numbers are incremental integers set automatically when the sheet path hierarchy is created (
Definition at line 197 of file sch_sheet_path.h.
References m_virtualPageNumber.
Referenced by SCH_SHEET_LIST::AddNewSheetInstances(), SCH_SHEET_LIST::BuildSheetList(), SCHEMATIC::SetSheetNumberAndCount(), and SCH_SHEET_LIST::SortByPageNumbers().
|
inline |
Forwarded method from std::vector.
Definition at line 177 of file sch_sheet_path.h.
References m_sheets.
Referenced by SCH_SHEET_LIST::AddNewSheetInstances(), Cmp(), SCH_EDIT_TOOL::EditPageNumber(), SCH_SHEET::GetContextualTextVars(), GetSheet(), SCHEMATIC::GetUniqueFilenameForCurrentSheet(), IsContainedWithin(), HIERARCHY_PANE::onTreeEditFinished(), operator+(), PathAsString(), PathHumanReadable(), SCH_LABEL_BASE::Plot(), CONNECTION_GRAPH::propagateToNeighbors(), HIERARCHY_PANE::renameIdenticalSheets(), SCH_SHEET::ResolveTextVar(), SCH_SHEET_LIST::TestForRecursion(), and TestForRecursion().
bool SCH_SHEET_PATH::TestForRecursion | ( | const wxString & | aSrcFileName, |
const wxString & | aDestFileName | ||
) |
Test the SCH_SHEET_PATH file names to check adding the sheet stored in the file aSrcFileName to the sheet stored in file aDestFileName will cause a sheet path recursion.
aSrcFileName | is the source file name of the sheet add to aDestFileName. |
aDestFileName | is the file name of the destination sheet for aSrcFileName. |
Definition at line 494 of file sch_sheet_path.cpp.
References at(), SCH_SHEET::GetFileName(), SCHEMATIC::GetFileName(), LastScreen(), m_recursion_test_cache, SCH_SCREEN::Schematic(), and size().
Referenced by SCH_SHEET_LIST::BuildSheetList().
void SCH_SHEET_PATH::UpdateAllScreenReferences | ( | ) | const |
Update all the symbol references for this sheet path.
Mandatory in complex hierarchies because sheets may use the same screen (basic schematic) more than once but with different references and units according to the displayed sheet.
Definition at line 373 of file sch_sheet_path.cpp.
References SCH_LABEL_BASE::AutoplaceFields(), SCH_SYMBOL::GetField(), SCH_LABEL_BASE::GetFields(), SCH_FIELD::GetInternalName(), SCH_FIELD::GetPosition(), SCH_SYMBOL::GetRef(), SCH_SYMBOL::GetUnitSelection(), EDA_TEXT::IsVisible(), LastScreen(), SCHEMATIC_SETTINGS::m_IntersheetRefsShow, REFERENCE_FIELD, SCH_GLOBAL_LABEL_T, SCH_SYMBOL_T, SCH_ITEM::Schematic(), SCH_FIELD::SetText(), SCHEMATIC::Settings(), SCH_ITEM::SetUnit(), EDA_TEXT::SetVisible(), EDA_ITEM::Type(), and SCH_SCREEN::Update().
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), SCH_PLOTTER::createDXFFiles(), SCH_PLOTTER::createHPGLFiles(), SCH_PLOTTER::createPDFFile(), SCH_PLOTTER::createPSFiles(), SCH_PLOTTER::createSVGFiles(), SCH_EDIT_FRAME::DeleteAnnotation(), SCH_EDIT_FRAME::DisplayCurrentSheet(), ERC_TREE_MODEL::GetValue(), SCH_IO_EASYEDA::LoadSchematicFile(), SCH_IO_EASYEDAPRO::LoadSchematicFile(), SCH_IO_LTSPICE::LoadSchematicFile(), DIALOG_MIGRATE_BUSES::onItemSelected(), SCH_PRINTOUT::OnPrintPage(), DIALOG_UPDATE_FROM_PCB::OnUpdateClick(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceSymbol(), DIALOG_CHANGE_SYMBOLS::processMatchingSymbols(), SCH_FIND_REPLACE_TOOL::ReplaceAll(), SCH_FIND_REPLACE_TOOL::ReplaceAndFindNext(), and SCH_PLOTTER::restoreEnvironment().
|
mutableprotected |
Definition at line 427 of file sch_sheet_path.h.
Referenced by CachePageNumber(), GetCachedPageNumber(), and initFromOther().
|
protected |
Definition at line 426 of file sch_sheet_path.h.
Referenced by GetCurrentHash(), initFromOther(), operator==(), Rehash(), and SCH_SHEET_PATH().
|
protected |
Page numbers are maintained by the sheet load order.
Definition at line 431 of file sch_sheet_path.h.
Referenced by TestForRecursion().
|
protected |
Definition at line 424 of file sch_sheet_path.h.
Referenced by at(), clear(), empty(), erase(), GetDNP(), GetExcludedFromBoard(), GetExcludedFromBOM(), GetExcludedFromSim(), initFromOther(), IsFullPath(), Last(), MakeFilePathRelativeToParentSheet(), operator<(), Path(), pop_back(), push_back(), Rehash(), and size().
|
protected |
Definition at line 429 of file sch_sheet_path.h.
Referenced by AppendMultiUnitSymbol(), AppendSymbol(), GetVirtualPageNumber(), initFromOther(), SCH_SHEET_PATH(), and SetVirtualPageNumber().