Remove some duplicate work when loading a board
This commit is contained in:
parent
5e6da9f964
commit
6ecdbbb1da
|
@ -747,7 +747,8 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
|||
// compiled.
|
||||
Raise();
|
||||
|
||||
SetBoard( loadedBoard );
|
||||
// Skip (possibly expensive) connectivity build here; we build it below after load
|
||||
SetBoard( loadedBoard, false );
|
||||
|
||||
if( GFootprintList.GetCount() == 0 )
|
||||
GFootprintList.ReadCacheFromFile( Prj().GetProjectPath() + "fp-info-cache" );
|
||||
|
@ -911,7 +912,6 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
|||
|
||||
// Rebuild list of nets (full ratsnest rebuild)
|
||||
GetBoard()->BuildConnectivity();
|
||||
Compile_Ratsnest( true );
|
||||
|
||||
// Load project settings after setting up board; some of them depend on the nets list
|
||||
LoadProjectSettings();
|
||||
|
|
|
@ -387,7 +387,7 @@ PCB_EDIT_FRAME::~PCB_EDIT_FRAME()
|
|||
}
|
||||
|
||||
|
||||
void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
|
||||
void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard, bool aBuildConnectivity )
|
||||
{
|
||||
if( m_pcb )
|
||||
m_pcb->ClearProject();
|
||||
|
@ -395,7 +395,9 @@ void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
|
|||
PCB_BASE_EDIT_FRAME::SetBoard( aBoard );
|
||||
|
||||
aBoard->SetProject( &Prj() );
|
||||
aBoard->GetConnectivity()->Build( aBoard );
|
||||
|
||||
if( aBuildConnectivity )
|
||||
aBoard->GetConnectivity()->Build( aBoard );
|
||||
|
||||
// reload the drawing-sheet
|
||||
SetPageSettings( aBoard->GetPageSettings() );
|
||||
|
|
|
@ -398,7 +398,12 @@ public:
|
|||
bool Clear_Pcb( bool aQuery, bool aFinal = false );
|
||||
|
||||
///< @copydoc PCB_BASE_FRAME::SetBoard()
|
||||
void SetBoard( BOARD* aBoard ) override;
|
||||
void SetBoard( BOARD* aBoard ) override
|
||||
{
|
||||
SetBoard( aBoard, true );
|
||||
}
|
||||
|
||||
void SetBoard( BOARD* aBoard, bool aBuildConnectivity );
|
||||
|
||||
///< @copydoc PCB_BASE_FRAME::GetModel()
|
||||
BOARD_ITEM_CONTAINER* GetModel() const override;
|
||||
|
|
Loading…
Reference in New Issue