7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-14 13:09:35 +00:00

multichannel: put MC tool behind an ADVANCED_CFG flag

This commit is contained in:
Tomasz Wlostowski 2024-07-20 23:31:13 +02:00
parent b84da7be02
commit 54e5632a42
4 changed files with 31 additions and 6 deletions

View File

@ -72,6 +72,7 @@ static const wxChar HoleWallThickness[] = wxT( "HoleWallPlatingThickness" );
static const wxChar CoroutineStackSize[] = wxT( "CoroutineStackSize" );
static const wxChar ShowRouterDebugGraphics[] = wxT( "ShowRouterDebugGraphics" );
static const wxChar EnableRouterDump[] = wxT( "EnableRouterDump" );
static const wxChar EnableMultichannelTool[] = wxT( "EnableMultichannelTool" );
static const wxChar HyperZoom[] = wxT( "HyperZoom" );
static const wxChar CompactFileSave[] = wxT( "CompactSave" );
static const wxChar DrawArcAccuracy[] = wxT( "DrawArcAccuracy" );
@ -206,6 +207,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_CoroutineStackSize = AC_STACK::default_stack;
m_ShowRouterDebugGraphics = false;
m_EnableRouterDump = false;
m_EnableMultichannelTool = false;
m_HyperZoom = false;
m_DrawArcAccuracy = 10.0;
m_DrawArcCenterMaxAngle = 50.0;
@ -357,6 +359,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
&m_ShowRouterDebugGraphics,
m_ShowRouterDebugGraphics ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableMultichannelTool,
&m_EnableMultichannelTool, m_EnableMultichannelTool ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableRouterDump,
&m_EnableRouterDump, m_EnableRouterDump ) );

View File

@ -227,6 +227,15 @@ public:
*/
bool m_EnableRouterDump;
/**
* Enable Multichannel tool(s) (repeat layout, placement areas)
*
* Setting name: "EnableMultichannelTool"
* Valid values: 0 or 1
* Default value: 0
*/
bool m_EnableMultichannelTool;
/**
* Slide the zoom steps over for debugging things "up close".
*

View File

@ -432,13 +432,17 @@ void PCB_EDIT_FRAME::doReCreateMenuBar()
toolsMenu->Add( PCB_ACTIONS::showPythonConsole );
}
ACTION_MENU* multichannelSubmenu = new ACTION_MENU( false, selTool );
multichannelSubmenu->SetTitle( _( "Multi-Channel" ) );
multichannelSubmenu->SetIcon( BITMAPS::mode_module );
multichannelSubmenu->Add( PCB_ACTIONS::generatePlacementRuleAreas );
multichannelSubmenu->Add( PCB_ACTIONS::repeatLayout );
if( ADVANCED_CFG::GetCfg().m_EnableMultichannelTool )
{
printf("EnableMCTool\n");
ACTION_MENU* multichannelSubmenu = new ACTION_MENU( false, selTool );
multichannelSubmenu->SetTitle( _( "Multi-Channel" ) );
multichannelSubmenu->SetIcon( BITMAPS::mode_module );
multichannelSubmenu->Add( PCB_ACTIONS::generatePlacementRuleAreas );
multichannelSubmenu->Add( PCB_ACTIONS::repeatLayout );
toolsMenu->Add( multichannelSubmenu );
toolsMenu->Add( multichannelSubmenu );
}
ACTION_MENU* submenuActionPlugins = new ACTION_MENU( false, selTool );
submenuActionPlugins->SetTitle( _( "External Plugins" ) );

View File

@ -2390,10 +2390,17 @@ void PCB_IO_KICAD_SEXPR::format( const PCB_TRACK* aTrack, int aNestLevel ) const
void PCB_IO_KICAD_SEXPR::format( const ZONE* aZone, int aNestLevel ) const
{
// temporary safeguard for the multichannel tool (and placement area/room support). When the tool is off
// (default), KiCad will not write any placement info in the RAs (and won't break file format compatibility)
if( ! ADVANCED_CFG::GetCfg().m_EnableMultichannelTool && aZone->GetIsRuleArea() && aZone->GetRuleAreaType() == RULE_AREA_TYPE::PLACEMENT )
return;
// Save the NET info.
// For keepout and non copper zones, net code and net name are irrelevant
// so be sure a dummy value is stored, just for ZONE compatibility
// (perhaps netcode and netname should be not stored)
bool has_no_net = aZone->GetIsRuleArea() || !aZone->IsOnCopperLayer();
m_out->Print( aNestLevel, "(zone (net %d) (net_name %s)",