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. More... | |
int | ReplaceDuplicateTimeStamps () |
Test all sheet and symbol objects in the schematic for duplicate time stamps and replaces them as necessary. More... | |
void | DeleteAllMarkers (enum MARKER_BASE::TYPEMARKER aMarkerType, bool aIncludeExclusions) |
Delete all electronic rules check markers of aMarkerType from all the screens in the list. More... | |
void | DeleteMarkers (enum MARKER_BASE::TYPEMARKER aMarkerTyp, int aErrorCode, bool aIncludeExclusions=true) |
Delete all markers of a particular type and error code. More... | |
void | DeleteMarker (SCH_MARKER *aMarker) |
Delete a specific marker. More... | |
void | UpdateSymbolLinks (REPORTER *aReporter=nullptr) |
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in the full schematic. More... | |
void | ClearEditFlags () |
bool | HasNoFullyDefinedLibIds () |
Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set. More... | |
size_t | GetLibNicknames (wxArrayString &aLibNicknames) |
Fetch all of the symbol library nicknames into aLibNicknames. More... | |
int | ChangeSymbolLibNickname (const wxString &aFrom, const wxString &aTo) |
Change all of the symbol library nicknames. More... | |
bool | HasSchematic (const wxString &aSchematicFileName) |
Check if one of the schematics in the list of screens is aSchematicFileName. More... | |
void | BuildClientSheetPathList () |
built the list of sheet paths sharing a screen for each screen in use More... | |
bool | CanCauseCaseSensitivityIssue (const wxString &aSchematicFileName) const |
Check aSchematicFileName for a potential file name case sensitivity issue. More... | |
void | SetLegacySymbolInstanceData () |
Update the symbol value and footprint instance data for legacy designs. More... | |
void | FixLegacyPowerSymbolMismatches () |
Fix legacy power symbols that have mismatched value text fields and invisible power pin names. More... | |
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 672 of file sch_screen.h.
SCH_SCREENS::SCH_SCREENS | ( | SCH_SHEET * | aSheet | ) |
Definition at line 1652 of file sch_screen.cpp.
References buildScreenList(), and m_index.
|
inline |
Definition at line 676 of file sch_screen.h.
SCH_SCREENS::~SCH_SCREENS | ( | ) |
Definition at line 1659 of file sch_screen.cpp.
|
private |
Definition at line 1702 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 2003 of file sch_screen.cpp.
References SCH_SCREEN::GetClientSheetPaths(), GetFirst(), GetNext(), SCHEMATIC::GetSheets(), 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 1718 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().
bool SCH_SCREENS::CanCauseCaseSensitivityIssue | ( | const wxString & | aSchematicFileName | ) | const |
Check aSchematicFileName for a potential file name case sensitivity issue.
On platforms where file names are case sensitive, it is possible to schematic sheet file names that would cause issues on platforms where file name are case insensitive. File names foo.sch and Foo.sch are unique files on Linux and MacOS but on Windows this would result in a broken schematic.
[in] | aSchematicFileName | is the absolute path and file name of the file to test. |
Definition at line 1976 of file sch_screen.cpp.
References m_screens.
Referenced by SCH_EDIT_FRAME::AllowCaseSensitiveFileNameClashes().
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 1939 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(), and LIB_ID::SetLibNickname().
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 1734 of file sch_screen.cpp.
References BuildClientSheetPathList(), SCH_SCREEN::ClearAnnotation(), SCH_SCREEN::EnsureAlternateReferencesExist(), GetFirst(), SCHEMATIC::GetSheets(), SCHEMATIC::Root(), and SCH_SCREEN::Schematic().
Referenced by SCH_EDIT_TOOL::Properties().
void SCH_SCREENS::ClearEditFlags | ( | ) |
Definition at line 1818 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by SCH_ALTIUM_PLUGIN::LoadSchematicFile().
void SCH_SCREENS::DeleteAllMarkers | ( | enum MARKER_BASE::TYPEMARKER | 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 1870 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 1828 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::TYPEMARKER | aMarkerTyp, |
int | aErrorCode, | ||
bool | aIncludeExclusions = true |
||
) |
Delete all markers of a particular type and error code.
Definition at line 1844 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 2041 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by KI_TEST::SCHEMATIC_TEST_FIXTURE::LoadSchematic(), KI_TEST::LoadSchematic(), and EESCHEMA_HELPERS::LoadSchematic().
|
inline |
Definition at line 678 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 1664 of file sch_screen.cpp.
References m_index, and m_screens.
Referenced by SCH_EDIT_FRAME::AskToSaveChanges(), DIALOG_SYMBOL_REMAP::backupProject(), BuildClientSheetPathList(), ChangeSymbolLibNickname(), ClearAnnotationOfNewSheetPaths(), ClearEditFlags(), SCH_EDIT_FRAME::CreateArchiveLibrary(), DeleteMarker(), DeleteMarkers(), SCH_EDIT_FRAME::doCloseWindow(), SCH_SEARCH_HANDLER::FindAll(), SCH_FIND_REPLACE_TOOL::FindNext(), FixLegacyPowerSymbolMismatches(), GetLibNicknames(), getSymbols(), HasNoFullyDefinedLibIds(), HasSchematic(), KI_TEST::SCHEMATIC_TEST_FIXTURE::LoadSchematic(), KI_TEST::LoadSchematic(), EESCHEMA_HELPERS::LoadSchematic(), DIALOG_EESCHEMA_PAGE_SETTINGS::onSavePageSettings(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH::readSchematicFromFile(), SCHEMATIC::RecomputeIntersheetRefs(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), SCH_FIND_REPLACE_TOOL::ReplaceAll(), SCH_EDITOR_CONTROL::Revert(), SetLegacySymbolInstanceData(), SCHEMATIC::SetSheetNumberAndCount(), ERC_TESTER::TestConflictingBusAliases(), ERC_TESTER::TestDuplicateSheetNames(), ERC_TESTER::TestLibSymbolIssues(), ERC_TESTER::TestOffGridEndpoints(), PANEL_SETUP_BUSES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataToWindow(), PANEL_SETUP_BUSES::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 1921 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 1675 of file sch_screen.cpp.
References GetScreen(), m_index, and m_screens.
Referenced by SCH_EDIT_FRAME::AskToSaveChanges(), DIALOG_SYMBOL_REMAP::backupProject(), BuildClientSheetPathList(), ChangeSymbolLibNickname(), ClearEditFlags(), SCH_EDIT_FRAME::CreateArchiveLibrary(), DeleteMarker(), DeleteMarkers(), SCH_EDIT_FRAME::doCloseWindow(), SCH_SEARCH_HANDLER::FindAll(), SCH_FIND_REPLACE_TOOL::FindNext(), FixLegacyPowerSymbolMismatches(), GetLibNicknames(), getSymbols(), HasNoFullyDefinedLibIds(), HasSchematic(), KI_TEST::SCHEMATIC_TEST_FIXTURE::LoadSchematic(), KI_TEST::LoadSchematic(), EESCHEMA_HELPERS::LoadSchematic(), DIALOG_EESCHEMA_PAGE_SETTINGS::onSavePageSettings(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH::readSchematicFromFile(), SCHEMATIC::RecomputeIntersheetRefs(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), SCH_FIND_REPLACE_TOOL::ReplaceAll(), SCH_EDITOR_CONTROL::Revert(), SetLegacySymbolInstanceData(), SCHEMATIC::SetSheetNumberAndCount(), ERC_TESTER::TestConflictingBusAliases(), ERC_TESTER::TestDuplicateSheetNames(), ERC_TESTER::TestLibSymbolIssues(), ERC_TESTER::TestOffGridEndpoints(), PANEL_SETUP_BUSES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataToWindow(), PANEL_SETUP_BUSES::TransferDataToWindow(), and UpdateSymbolLinks().
SCH_SCREEN * SCH_SCREENS::GetScreen | ( | unsigned int | aIndex | ) | const |
Definition at line 1684 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 1693 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 1900 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 1964 of file sch_screen.cpp.
References GetFirst(), and GetNext().
Referenced by SCH_EDIT_FRAME::LoadSheetFromFile().
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 1780 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 2034 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 1877 of file sch_screen.cpp.
References SCHEMATIC::ConnectionGraph(), GetFirst(), GetNext(), SCHEMATIC::GetSheets(), CONNECTION_GRAPH::Recalculate(), and SCH_SCREEN::Schematic().
Referenced by SCH_ALTIUM_PLUGIN::LoadSchematicFile(), SCH_EAGLE_PLUGIN::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 814 of file sch_screen.h.
Referenced by GetFirst(), GetNext(), and SCH_SCREENS().
|
private |
Definition at line 812 of file sch_screen.h.
Referenced by addScreenToList(), CanCauseCaseSensitivityIssue(), GetCount(), GetFirst(), GetNext(), GetScreen(), and ReplaceDuplicateTimeStamps().
|
private |
Definition at line 813 of file sch_screen.h.
Referenced by addScreenToList(), and GetSheet().