KiCad PCB EDA Suite
|
Container class that holds multiple SCH_SCREEN objects in a hierarchy. More...
#include <sch_screen.h>
Public Member Functions | |
SCH_SCREENS (SCH_SHEET *aSheet) | |
SCH_SCREENS (SCH_SHEET &aSheet) | |
~SCH_SCREENS () | |
size_t | GetCount () const |
SCH_SCREEN * | GetFirst () |
SCH_SCREEN * | GetNext () |
SCH_SCREEN * | GetScreen (unsigned int aIndex) const |
SCH_SHEET * | GetSheet (unsigned int aIndex) const |
void | ClearAnnotationOfNewSheetPaths (SCH_SHEET_LIST &aInitialSheetPathList) |
Clear the annotation for the symbols inside new sheetpaths when a complex hierarchy is modified and new sheetpaths added when a screen shares more than one sheet path, missing alternate references are added and alternate references of new sheet paths are cleared. | |
int | ReplaceDuplicateTimeStamps () |
Test all sheet and symbol objects in the schematic for duplicate time stamps and replaces them as necessary. | |
void | DeleteAllMarkers (enum MARKER_BASE::MARKER_T aMarkerType, bool aIncludeExclusions) |
Delete all electronic rules check markers of aMarkerType from all the screens in the list. | |
void | DeleteMarkers (enum MARKER_BASE::MARKER_T aMarkerTyp, int aErrorCode, bool aIncludeExclusions=true) |
Delete all markers of a particular type and error code. | |
void | DeleteMarker (SCH_MARKER *aMarker) |
Delete a specific marker. | |
void | UpdateSymbolLinks (REPORTER *aReporter=nullptr) |
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in the full schematic. | |
void | ClearEditFlags () |
bool | HasNoFullyDefinedLibIds () |
Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set. | |
size_t | GetLibNicknames (wxArrayString &aLibNicknames) |
Fetch all of the symbol library nicknames into aLibNicknames. | |
int | ChangeSymbolLibNickname (const wxString &aFrom, const wxString &aTo) |
Change all of the symbol library nicknames. | |
bool | HasSchematic (const wxString &aSchematicFileName) |
Check if one of the schematics in the list of screens is aSchematicFileName. | |
void | BuildClientSheetPathList () |
Build the list of sheet paths sharing a screen for each screen in use. | |
void | SetLegacySymbolInstanceData () |
Update the symbol value and footprint instance data for legacy designs. | |
void | FixLegacyPowerSymbolMismatches () |
Fix legacy power symbols that have mismatched value text fields and invisible power pin names. | |
void | PruneOrphanedSymbolInstances (const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths) |
void | PruneOrphanedSheetInstances (const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths) |
bool | HasSymbolFieldNamesWithWhiteSpace () const |
Private Member Functions | |
void | addScreenToList (SCH_SCREEN *aScreen, SCH_SHEET *aSheet) |
void | buildScreenList (SCH_SHEET *aSheet) |
Private Attributes | |
std::vector< SCH_SCREEN * > | m_screens |
std::vector< SCH_SHEET * > | m_sheets |
unsigned int | m_index |
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Individual SCH_SCREEN objects are unique and correspond to .sch files.
Definition at line 733 of file sch_screen.h.
SCH_SCREENS::SCH_SCREENS | ( | SCH_SHEET * | aSheet | ) |
Definition at line 1655 of file sch_screen.cpp.
References buildScreenList(), and m_index.
|
inline |
Definition at line 737 of file sch_screen.h.
SCH_SCREENS::~SCH_SCREENS | ( | ) |
Definition at line 1662 of file sch_screen.cpp.
|
private |
Definition at line 1705 of file sch_screen.cpp.
References m_screens, and m_sheets.
Referenced by buildScreenList().
void SCH_SCREENS::BuildClientSheetPathList | ( | ) |
Build the list of sheet paths sharing a screen for each screen in use.
Definition at line 1979 of file sch_screen.cpp.
References SCH_SCREEN::GetClientSheetPaths(), GetFirst(), GetNext(), SCHEMATIC::Hierarchy(), and SCH_SCREEN::Schematic().
Referenced by ClearAnnotationOfNewSheetPaths(), SCH_SEARCH_HANDLER::FindAll(), SCH_FIND_REPLACE_TOOL::FindNext(), and SCH_EDIT_FRAME::SaveProject().
|
private |
Definition at line 1721 of file sch_screen.cpp.
References addScreenToList(), buildScreenList(), SCH_SHEET::GetScreen(), SCH_SCREEN::Items(), EE_RTREE::OfType(), SCH_SHEET_T, and EDA_ITEM::Type().
Referenced by buildScreenList(), and SCH_SCREENS().
int SCH_SCREENS::ChangeSymbolLibNickname | ( | const wxString & | aFrom, |
const wxString & | aTo | ||
) |
Change all of the symbol library nicknames.
[in] | aFrom | the current symbol library name to change. |
[in] | aTo | the new symbol library name. |
Definition at line 1942 of file sch_screen.cpp.
References GetFirst(), SCH_SYMBOL::GetLibId(), LIB_ID::GetLibNickname(), GetNext(), SCH_SCREEN::Items(), EE_RTREE::OfType(), SCH_SYMBOL_T, SCH_SYMBOL::SetLibId(), LIB_ID::SetLibNickname(), and UTF8::wx_str().
void SCH_SCREENS::ClearAnnotationOfNewSheetPaths | ( | SCH_SHEET_LIST & | aInitialSheetPathList | ) |
Clear the annotation for the symbols inside new sheetpaths when a complex hierarchy is modified and new sheetpaths added when a screen shares more than one sheet path, missing alternate references are added and alternate references of new sheet paths are cleared.
aInitialSheetPathList | is the initial sheet paths list of hierarchy before changes. |
Definition at line 1737 of file sch_screen.cpp.
References BuildClientSheetPathList(), SCH_SCREEN::ClearAnnotation(), SCH_SCREEN::EnsureAlternateReferencesExist(), GetFirst(), SCHEMATIC::Hierarchy(), SCHEMATIC::Root(), and SCH_SCREEN::Schematic().
Referenced by SCH_EDIT_TOOL::Properties().
void SCH_SCREENS::ClearEditFlags | ( | ) |
Definition at line 1821 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by SCH_IO_ALTIUM::LoadSchematicFile().
void SCH_SCREENS::DeleteAllMarkers | ( | enum MARKER_BASE::MARKER_T | aMarkerType, |
bool | aIncludeExclusions | ||
) |
Delete all electronic rules check markers of aMarkerType from all the screens in the list.
aMarkerType | Type of markers to be deleted. |
Definition at line 1873 of file sch_screen.cpp.
References DeleteMarkers(), and ERCE_UNSPECIFIED.
Referenced by DIALOG_ERC::deleteAllMarkers().
void SCH_SCREENS::DeleteMarker | ( | SCH_MARKER * | aMarker | ) |
Delete a specific marker.
Definition at line 1831 of file sch_screen.cpp.
References GetFirst(), GetNext(), and SCH_MARKER_T.
Referenced by SHEETLIST_ERC_ITEMS_PROVIDER::DeleteItem().
void SCH_SCREENS::DeleteMarkers | ( | enum MARKER_BASE::MARKER_T | aMarkerTyp, |
int | aErrorCode, | ||
bool | aIncludeExclusions = true |
||
) |
Delete all markers of a particular type and error code.
Definition at line 1847 of file sch_screen.cpp.
References ERCE_UNSPECIFIED, GetFirst(), MARKER_BASE::GetMarkerType(), GetNext(), MARKER_BASE::GetRCItem(), MARKER_BASE::IsExcluded(), and SCH_MARKER_T.
Referenced by DeleteAllMarkers(), and DIALOG_ERC::OnERCItemRClick().
void SCH_SCREENS::FixLegacyPowerSymbolMismatches | ( | ) |
Fix legacy power symbols that have mismatched value text fields and invisible power pin names.
Definition at line 2017 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by EESCHEMA_HELPERS::LoadSchematic(), and KI_TEST::LoadSchematic().
|
inline |
Definition at line 739 of file sch_screen.h.
References m_screens.
Referenced by SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::SaveProject(), and SCH_EDIT_FRAME::updateAutoSaveFile().
SCH_SCREEN * SCH_SCREENS::GetFirst | ( | ) |
Definition at line 1667 of file sch_screen.cpp.
References m_index, and m_screens.
Referenced by SCH_EDIT_FRAME::AskToSaveChanges(), DIALOG_SYMBOL_REMAP::backupProject(), BuildClientSheetPathList(), CONNECTION_GRAPH::buildConnectionGraph(), CONNECTION_GRAPH::buildItemSubGraphs(), ChangeSymbolLibNickname(), ClearAnnotationOfNewSheetPaths(), ClearEditFlags(), SCH_EDIT_FRAME::CreateArchiveLibrary(), DeleteMarker(), DeleteMarkers(), SCH_EDIT_FRAME::doCloseWindow(), SCH_SEARCH_HANDLER::FindAll(), SCH_FIND_REPLACE_TOOL::FindNext(), FixLegacyPowerSymbolMismatches(), SCHEMATIC::FixupJunctions(), GetLibNicknames(), SCHEMATIC::GetSchematicsSharedByMultipleProjects(), getSymbols(), HasNoFullyDefinedLibIds(), HasSchematic(), SCHEMATIC::IsComplexHierarchy(), PANEL_SETUP_BUSES::loadAliases(), SCH_IO_EAGLE::loadModuleInstance(), EESCHEMA_HELPERS::LoadSchematic(), KI_TEST::LoadSchematic(), SCH_IO_ALTIUM::LoadSchematicFile(), DIALOG_EESCHEMA_PAGE_SETTINGS::onSavePageSettings(), SCH_EDIT_FRAME::OpenProjectFiles(), PruneOrphanedSheetInstances(), PruneOrphanedSymbolInstances(), SCH::readSchematicFromFile(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), SCH_FIND_REPLACE_TOOL::ReplaceAll(), SCH_EDITOR_CONTROL::Revert(), SCH_EDIT_FRAME::SaveProject(), SetLegacySymbolInstanceData(), SCHEMATIC::SetSheetNumberAndCount(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), ERC_TESTER::TestConflictingBusAliases(), ERC_TESTER::TestDuplicateSheetNames(), ERC_TESTER::TestLibSymbolIssues(), ERC_TESTER::TestOffGridEndpoints(), PANEL_SETUP_BUSES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataToWindow(), and UpdateSymbolLinks().
size_t SCH_SCREENS::GetLibNicknames | ( | wxArrayString & | aLibNicknames | ) |
Fetch all of the symbol library nicknames into aLibNicknames.
[out] | aLibNicknames | is the array to populate with all of the unique library nicknames. |
Definition at line 1924 of file sch_screen.cpp.
References UTF8::empty(), GetFirst(), SCH_SYMBOL::GetLibId(), LIB_ID::GetLibNickname(), GetNext(), and SCH_SYMBOL_T.
Referenced by SCH_EDIT_FRAME::LoadSheetFromFile().
SCH_SCREEN * SCH_SCREENS::GetNext | ( | ) |
Definition at line 1678 of file sch_screen.cpp.
References GetScreen(), m_index, and m_screens.
Referenced by SCH_EDIT_FRAME::AskToSaveChanges(), DIALOG_SYMBOL_REMAP::backupProject(), BuildClientSheetPathList(), CONNECTION_GRAPH::buildConnectionGraph(), CONNECTION_GRAPH::buildItemSubGraphs(), ChangeSymbolLibNickname(), ClearEditFlags(), SCH_EDIT_FRAME::CreateArchiveLibrary(), DeleteMarker(), DeleteMarkers(), SCH_EDIT_FRAME::doCloseWindow(), SCH_SEARCH_HANDLER::FindAll(), SCH_FIND_REPLACE_TOOL::FindNext(), FixLegacyPowerSymbolMismatches(), SCHEMATIC::FixupJunctions(), GetLibNicknames(), SCHEMATIC::GetSchematicsSharedByMultipleProjects(), getSymbols(), HasNoFullyDefinedLibIds(), HasSchematic(), SCHEMATIC::IsComplexHierarchy(), PANEL_SETUP_BUSES::loadAliases(), SCH_IO_EAGLE::loadModuleInstance(), EESCHEMA_HELPERS::LoadSchematic(), KI_TEST::LoadSchematic(), SCH_IO_ALTIUM::LoadSchematicFile(), DIALOG_EESCHEMA_PAGE_SETTINGS::onSavePageSettings(), SCH_EDIT_FRAME::OpenProjectFiles(), PruneOrphanedSheetInstances(), PruneOrphanedSymbolInstances(), SCH::readSchematicFromFile(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), SCH_FIND_REPLACE_TOOL::ReplaceAll(), SCH_EDITOR_CONTROL::Revert(), SetLegacySymbolInstanceData(), SCHEMATIC::SetSheetNumberAndCount(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), ERC_TESTER::TestConflictingBusAliases(), ERC_TESTER::TestDuplicateSheetNames(), ERC_TESTER::TestLibSymbolIssues(), ERC_TESTER::TestOffGridEndpoints(), PANEL_SETUP_BUSES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataToWindow(), and UpdateSymbolLinks().
SCH_SCREEN * SCH_SCREENS::GetScreen | ( | unsigned int | aIndex | ) | const |
Definition at line 1687 of file sch_screen.cpp.
References m_screens.
Referenced by SCH_EDIT_FRAME::doAutoSave(), GetNext(), SCH_EDIT_FRAME::SaveProject(), and SCH_EDIT_FRAME::updateAutoSaveFile().
SCH_SHEET * SCH_SCREENS::GetSheet | ( | unsigned int | aIndex | ) | const |
Definition at line 1696 of file sch_screen.cpp.
References m_sheets.
Referenced by SCH_EDIT_FRAME::doAutoSave(), and SCH_EDIT_FRAME::SaveProject().
bool SCH_SCREENS::HasNoFullyDefinedLibIds | ( | ) |
Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set.
If none of the LIB_ID object library nicknames are not set, this indicates that the project was created before the symbol library implementation.
Definition at line 1903 of file sch_screen.cpp.
References UTF8::empty(), GetFirst(), SCH_SYMBOL::GetLibId(), LIB_ID::GetLibNickname(), GetNext(), and SCH_SYMBOL_T.
Referenced by SCH_EDIT_FRAME::checkForNoFullyDefinedLibIds(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDITOR_CONTROL::RescueSymbols(), and SCH_EDIT_FRAME::setupUIConditions().
bool SCH_SCREENS::HasSchematic | ( | const wxString & | aSchematicFileName | ) |
Check if one of the schematics in the list of screens is aSchematicFileName.
Schematic file names in SCH_SCREEN object are stored with the absolute path to the schematic file.
[in] | aSchematicFileName | is the schematic file name to search. |
Definition at line 1967 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by SCH_EDIT_FRAME::LoadSheetFromFile().
bool SCH_SCREENS::HasSymbolFieldNamesWithWhiteSpace | ( | ) | const |
Definition at line 2061 of file sch_screen.cpp.
References m_screens.
Referenced by SCH_EDIT_FRAME::OpenProjectFiles().
void SCH_SCREENS::PruneOrphanedSheetInstances | ( | const wxString & | aProjectName, |
const SCH_SHEET_LIST & | aValidSheetPaths | ||
) |
Definition at line 2050 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by SCH_EDIT_FRAME::OpenProjectFiles(), and SCH_EDITOR_CONTROL::Paste().
void SCH_SCREENS::PruneOrphanedSymbolInstances | ( | const wxString & | aProjectName, |
const SCH_SHEET_LIST & | aValidSheetPaths | ||
) |
Definition at line 2039 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by SCH_EDIT_FRAME::OpenProjectFiles(), and SCH_EDITOR_CONTROL::Paste().
int SCH_SCREENS::ReplaceDuplicateTimeStamps | ( | ) |
Test all sheet and symbol objects in the schematic for duplicate time stamps and replaces them as necessary.
Time stamps must be unique in order for complex hierarchies know which symbols go to which sheets.
Definition at line 1783 of file sch_screen.cpp.
References m_screens, and EDA_ITEM::m_Uuid.
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), SCH_EDIT_FRAME::LoadSheetFromFile(), and SCH_EDIT_FRAME::OpenProjectFiles().
void SCH_SCREENS::SetLegacySymbolInstanceData | ( | ) |
Update the symbol value and footprint instance data for legacy designs.
Definition at line 2010 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by SCHEMATIC::SetLegacySymbolInstanceData().
void SCH_SCREENS::UpdateSymbolLinks | ( | REPORTER * | aReporter = nullptr | ) |
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in the full schematic.
[in] | aReporter | An optional REPORTER object pointer to write warning and error messages into. |
Definition at line 1880 of file sch_screen.cpp.
References SCHEMATIC::ConnectionGraph(), GetFirst(), GetNext(), SCHEMATIC::Hierarchy(), CONNECTION_GRAPH::Recalculate(), and SCH_SCREEN::Schematic().
Referenced by SCH_IO_ALTIUM::LoadSchematicFile(), SCH_IO_EAGLE::LoadSchematicFile(), SCH_EDIT_FRAME::OpenProjectFiles(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), SCH_EDITOR_CONTROL::rescueProject(), LEGACY_RESCUER::WriteRescueLibrary(), and SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary().
|
private |
Definition at line 870 of file sch_screen.h.
Referenced by GetFirst(), GetNext(), and SCH_SCREENS().
|
private |
Definition at line 868 of file sch_screen.h.
Referenced by addScreenToList(), GetCount(), GetFirst(), GetNext(), GetScreen(), HasSymbolFieldNamesWithWhiteSpace(), and ReplaceDuplicateTimeStamps().
|
private |
Definition at line 869 of file sch_screen.h.
Referenced by addScreenToList(), and GetSheet().