Browse Source

Reset connection graph when loading new root sheet

pull/16/head
Jon Evans 5 years ago
parent
commit
cc47082566
  1. 10
      eeschema/schematic.cpp
  2. 11
      eeschema/schematic.h

10
eeschema/schematic.cpp

@ -55,6 +55,16 @@ void SCHEMATIC::Reset()
}
void SCHEMATIC::SetRoot( SCH_SHEET* aRootSheet )
{
wxCHECK_RET( aRootSheet, "Call to SetRoot with null SCH_SHEET!" );
m_rootSheet = aRootSheet;
m_connectionGraph->Reset();
}
SCH_SCREEN* SCHEMATIC::RootScreen() const
{
return IsValid() ? m_rootSheet->GetScreen() : nullptr;

11
eeschema/schematic.h

@ -106,10 +106,13 @@ public:
return *m_rootSheet;
}
void SetRoot( SCH_SHEET* aRootSheet )
{
m_rootSheet = aRootSheet;
}
/**
* Initializes the schematic with a new root sheet.
* This is typically done by calling a file loader that returns the new root sheet
* As a side-effect, takes care of some post-load initialization.
* @param aRootSheet is the new root sheet for this schematic.
*/
void SetRoot( SCH_SHEET* aRootSheet );
/// A simple test if the schematic is loaded, not a complete one
bool IsValid() const

Loading…
Cancel
Save