Add advance config variable to skip bounding box loading on footprints
This commit is contained in:
parent
bb753aaadf
commit
9e115a548e
|
@ -140,6 +140,8 @@ static const wxChar MinPlotPenWidth[] = wxT( "MinPlotPenWidth" );
|
|||
|
||||
static const wxChar DebugZoneFiller[] = wxT( "DebugZoneFiller" );
|
||||
|
||||
static const wxChar SkipBoundingBoxFpLoad[] = wxT( "SkipBoundingBoxFpLoad" );
|
||||
|
||||
} // namespace KEYS
|
||||
|
||||
|
||||
|
@ -237,6 +239,8 @@ ADVANCED_CFG::ADVANCED_CFG()
|
|||
|
||||
m_DebugZoneFiller = false;
|
||||
|
||||
m_SkipBoundingBoxOnFpLoad = false;
|
||||
|
||||
loadFromConfigFile();
|
||||
}
|
||||
|
||||
|
@ -314,6 +318,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
|||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DebugZoneFiller,
|
||||
&m_DebugZoneFiller, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::SkipBoundingBoxFpLoad,
|
||||
&m_SkipBoundingBoxOnFpLoad, false ) );
|
||||
|
||||
wxConfigLoadSetups( &aCfg, configParams );
|
||||
|
||||
for( PARAM_CFG* param : configParams )
|
||||
|
|
|
@ -142,6 +142,11 @@ public:
|
|||
*/
|
||||
bool m_DebugZoneFiller;
|
||||
|
||||
/**
|
||||
* Skip bounding box calculation when loading footprints
|
||||
*/
|
||||
bool m_SkipBoundingBoxOnFpLoad;
|
||||
|
||||
private:
|
||||
ADVANCED_CFG();
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <title_block.h>
|
||||
#include <trigo.h>
|
||||
|
||||
#include <advanced_config.h>
|
||||
#include <class_board.h>
|
||||
#include <class_dimension.h>
|
||||
#include <class_drawsegment.h>
|
||||
|
@ -3083,7 +3084,16 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments )
|
|||
|
||||
module->SetFPID( fpid );
|
||||
module->SetProperties( properties );
|
||||
module->CalculateBoundingBox();
|
||||
|
||||
// We want to calculate the bounding box in most cases except
|
||||
// if the advanced config is set and its a general footprint load
|
||||
// This improves debugging greatly under MSVC where full std iterator debugging
|
||||
// is present and loading a massive amount of footprints can lead to 2 minute load times
|
||||
if( !ADVANCED_CFG::GetCfg().m_SkipBoundingBoxOnFpLoad || m_board != nullptr
|
||||
|| reader->GetSource().Contains( "clipboard" ) )
|
||||
{
|
||||
module->CalculateBoundingBox();
|
||||
}
|
||||
|
||||
return module.release();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue