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 () |
built 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.
NOTE: It may be desirable to fold the functionality of SCH_SCREENS into the new SCHEMATIC class at some point, since SCHEMATIC can also be thought of as owning the collection of all the SCH_SCREEN objects.
Definition at line 711 of file sch_screen.h.
SCH_SCREENS::SCH_SCREENS | ( | SCH_SHEET * | aSheet | ) |
Definition at line 1600 of file sch_screen.cpp.
References buildScreenList(), and m_index.
|
inline |
Definition at line 715 of file sch_screen.h.
SCH_SCREENS::~SCH_SCREENS | ( | ) |
Definition at line 1607 of file sch_screen.cpp.
|
private |
Definition at line 1650 of file sch_screen.cpp.
References m_screens, and m_sheets.
Referenced by buildScreenList().
void SCH_SCREENS::BuildClientSheetPathList | ( | ) |
built the list of sheet paths sharing a screen for each screen in use
Definition at line 1924 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 1666 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 1887 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 1682 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 1766 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 1818 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 1776 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 1792 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 1962 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by EESCHEMA_HELPERS::LoadSchematic(), and KI_TEST::LoadSchematic().
|
inline |
Definition at line 717 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 1612 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(), 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().
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 1869 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 1623 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(), 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 1632 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 1641 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 1848 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 1912 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by SCH_EDIT_FRAME::LoadSheetFromFile().
bool SCH_SCREENS::HasSymbolFieldNamesWithWhiteSpace | ( | ) | const |
Definition at line 2006 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 1995 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 1984 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 1728 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 1955 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 1825 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 848 of file sch_screen.h.
Referenced by GetFirst(), GetNext(), and SCH_SCREENS().
|
private |
Definition at line 846 of file sch_screen.h.
Referenced by addScreenToList(), GetCount(), GetFirst(), GetNext(), GetScreen(), HasSymbolFieldNamesWithWhiteSpace(), and ReplaceDuplicateTimeStamps().
|
private |
Definition at line 847 of file sch_screen.h.
Referenced by addScreenToList(), and GetSheet().