Pcbnew: Allow to skip layer mapping using advanced config

Clicking Automap/OK was fun for a bit.
This commit is contained in:
John Beard
2026-03-04 20:12:32 +08:00
parent 0365973c0b
commit 6c5b1bbc8b
3 changed files with 23 additions and 2 deletions
+5
View File
@@ -138,6 +138,7 @@ static const wxChar MaxPastedTextLength[] = wxT( "MaxPastedTextLength" );
static const wxChar PNSProcessClusterTimeout[] = wxT( "PNSProcessClusterTimeout" );
static const wxChar FollowBranchTimeout[] = wxT( "FollowBranchTimeoutMs" );
static const wxChar ImportSkipComponentBodies[] = wxT( "ImportSkipComponentBodies" );
static const wxChar ImportSkipLayerMapping[] = wxT( "ImportSkipLayerMapping" );
static const wxChar ScreenDPI[] = wxT( "ScreenDPI" );
static const wxChar EnableUseAuiPerspective[] = wxT( "EnableUseAuiPerspective" );
static const wxChar HistoryLockStaleTimeout[] = wxT( "HistoryLockStaleTimeout" );
@@ -331,6 +332,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_FollowBranchTimeout = 500; // Default: 500 ms
m_ImportSkipComponentBodies = false;
m_ImportSkipLayerMapping = false;
m_ScreenDPI = 91;
@@ -643,6 +645,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ImportSkipComponentBodies,
&m_ImportSkipComponentBodies, m_ImportSkipComponentBodies ) );
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ImportSkipLayerMapping,
&m_ImportSkipLayerMapping, m_ImportSkipLayerMapping ) );
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ScreenDPI, &m_ScreenDPI, m_ScreenDPI, 50, 500 ) );
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableUseAuiPerspective,
+12
View File
@@ -866,6 +866,18 @@ public:
*/
bool m_ImportSkipComponentBodies;
/**
* Skip the layer mapping step when importing.
*
* This can be convenient to speed up imports when testing other aspects of the import,
* as you don't need to interact with the layer mapping dialog.
*
* Setting name: "ImportSkipLayerMapping"
* Valid values: 0 or 1
* Default value: 0
*/
bool m_ImportSkipLayerMapping;
/**
* Screen DPI setting for display calculations.
*
+6 -2
View File
@@ -27,6 +27,7 @@
#include <string>
#include <vector>
#include <advanced_config.h>
#include <confirm.h>
#include <kidialog.h>
#include <core/arraydim.h>
@@ -625,8 +626,11 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
if( LAYER_MAPPABLE_PLUGIN* mappable_pi = dynamic_cast<LAYER_MAPPABLE_PLUGIN*>( pi.get() ) )
{
mappable_pi->RegisterCallback( std::bind( DIALOG_MAP_LAYERS::RunModal,
this, std::placeholders::_1 ) );
if( !ADVANCED_CFG::GetCfg().m_ImportSkipLayerMapping )
{
mappable_pi->RegisterCallback( std::bind( DIALOG_MAP_LAYERS::RunModal,
this, std::placeholders::_1 ) );
}
}
if( PROJECT_CHOOSER_PLUGIN* chooser_pi = dynamic_cast<PROJECT_CHOOSER_PLUGIN*>( pi.get() ) )