Hook up excluded ERC marker persistence.

Fixes https://gitlab.com/kicad/code/kicad/issues/6425
This commit is contained in:
Jeff Young 2020-11-19 18:22:26 +00:00
parent 876b87b64e
commit 826e47dde3
2 changed files with 14 additions and 2 deletions

View File

@ -533,6 +533,9 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
GetScreen()->m_Initialized = true;
}
// Load any exclusions from the project file
ResolveERCExclusions();
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
SetSheetNumberAndCount();

View File

@ -648,6 +648,8 @@ void SCH_EDIT_FRAME::doCloseWindow()
if( m_toolManager )
m_toolManager->ShutdownAllTools();
RecordERCExclusions();
// Close the find dialog and preserve it's setting if it is displayed.
if( m_findReplaceDialog )
{
@ -719,10 +721,17 @@ void SCH_EDIT_FRAME::RecordERCExclusions()
void SCH_EDIT_FRAME::ResolveERCExclusions()
{
SCH_SHEET_LIST sheetList = Schematic().GetSheets();
for( SCH_MARKER* marker : Schematic().ResolveERCExclusions() )
{
// JEY TODO: need to get the right screen....
GetScreen()->Append( marker );
SCH_SHEET_PATH errorPath;
(void) sheetList.GetItem( marker->GetRCItem()->GetMainItemID(), &errorPath );
if( errorPath.LastScreen() )
errorPath.LastScreen()->Append( marker );
else
Schematic().RootScreen()->Append( marker );
}
// Update the view for the current screen