Add a "hyperzoom" mode for debugging "up close".

This commit is contained in:
Jeff Young 2023-06-20 14:15:56 +01:00
parent a9fff82664
commit 8c29091001
5 changed files with 28 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -110,6 +110,11 @@ static const wxChar CoroutineStackSize[] = wxT( "CoroutineStackSize" );
*/ */
static const wxChar ShowRouterDebugGraphics[] = wxT( "ShowRouterDebugGraphics" ); static const wxChar ShowRouterDebugGraphics[] = wxT( "ShowRouterDebugGraphics" );
/**
* Slide the zoom steps over for debugging things "up close".
*/
static const wxChar HyperZoom[] = wxT( "HyperZoom" );
/** /**
* When set to true, this will wrap polygon point sets at 4 points per line rather * When set to true, this will wrap polygon point sets at 4 points per line rather
* than a single point per line. Single point per line helps with version control systems * than a single point per line. Single point per line helps with version control systems
@ -290,6 +295,7 @@ ADVANCED_CFG::ADVANCED_CFG()
// then the values will remain as set here. // then the values will remain as set here.
m_CoroutineStackSize = AC_STACK::default_stack; m_CoroutineStackSize = AC_STACK::default_stack;
m_ShowRouterDebugGraphics = false; m_ShowRouterDebugGraphics = false;
m_HyperZoom = false;
m_DrawArcAccuracy = 10.0; m_DrawArcAccuracy = 10.0;
m_DrawArcCenterMaxAngle = 50.0; m_DrawArcCenterMaxAngle = 50.0;
m_MaxTangentAngleDeviation = 1.0; m_MaxTangentAngleDeviation = 1.0;
@ -409,6 +415,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRouterDebugGraphics, configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRouterDebugGraphics,
&m_ShowRouterDebugGraphics, m_ShowRouterDebugGraphics ) ); &m_ShowRouterDebugGraphics, m_ShowRouterDebugGraphics ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HyperZoom,
&m_HyperZoom, m_HyperZoom ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::CompactFileSave, configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::CompactFileSave,
&m_CompactSave, m_CompactSave ) ); &m_CompactSave, m_CompactSave ) );

View File

@ -140,6 +140,11 @@ public:
*/ */
bool m_ShowRouterDebugGraphics; bool m_ShowRouterDebugGraphics;
/**
* Slide the zoom steps over for debugging things "up close".
*/
bool m_HyperZoom;
/** /**
* Save files in compact display mode * Save files in compact display mode
* When is is not specified, points are written one per line * When is is not specified, points are written one per line

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2012-2016 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2012-2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -32,6 +32,9 @@
#define ZOOM_LIST_PCBNEW 0.13, 0.22, 0.35, 0.6, 1.0, 1.5, 2.2, 3.5, 5.0, 8.0, 13.0,\ #define ZOOM_LIST_PCBNEW 0.13, 0.22, 0.35, 0.6, 1.0, 1.5, 2.2, 3.5, 5.0, 8.0, 13.0,\
20.0, 35.0, 50.0, 80.0, 130.0, 220.0, 300.0 20.0, 35.0, 50.0, 80.0, 130.0, 220.0, 300.0
#define ZOOM_LIST_PCBNEW_HYPER 0.6, 1.0, 1.5, 2.2, 3.5, 5.0, 8.0, 13.0, 20.0, 35.0, 50.0,\
80.0, 130.0, 220.0, 350.0, 600.0, 900.0, 1500.0
#define ZOOM_LIST_PL_EDITOR 0.022, 0.035, 0.05, 0.08, 0.13, 0.22, 0.35, 0.6, 1.0, 2.2,\ #define ZOOM_LIST_PL_EDITOR 0.022, 0.035, 0.05, 0.08, 0.13, 0.22, 0.35, 0.6, 1.0, 2.2,\
3.5, 5.0, 8.0, 13.0, 22.0, 35.0, 50.0, 80.0, 130.0, 220.0 3.5, 5.0, 8.0, 13.0, 22.0, 35.0, 50.0, 80.0, 130.0, 220.0

View File

@ -23,6 +23,7 @@
#include <utility> #include <utility>
#include "pcbnew_settings.h" #include "pcbnew_settings.h"
#include <advanced_config.h>
#include <base_units.h> #include <base_units.h>
#include <board.h> #include <board.h>
#include <footprint.h> #include <footprint.h>
@ -255,7 +256,10 @@ FOOTPRINT_PREVIEW_PANEL* FOOTPRINT_PREVIEW_PANEL::New( KIWAY* aKiway, wxWindow*
// change this config // change this config
//if( cfg->m_Window.zoom_factors.empty() ) //if( cfg->m_Window.zoom_factors.empty() )
{ {
cfg->m_Window.zoom_factors = { ZOOM_LIST_PCBNEW }; if( ADVANCED_CFG::GetCfg().m_HyperZoom )
cfg->m_Window.zoom_factors = { ZOOM_LIST_PCBNEW_HYPER };
else
cfg->m_Window.zoom_factors = { ZOOM_LIST_PCBNEW };
} }
std::unique_ptr<KIGFX::GAL_DISPLAY_OPTIONS> gal_opts; std::unique_ptr<KIGFX::GAL_DISPLAY_OPTIONS> gal_opts;

View File

@ -897,7 +897,10 @@ void PCB_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
// change this config // change this config
// if( aCfg->m_Window.zoom_factors.empty() ) // if( aCfg->m_Window.zoom_factors.empty() )
{ {
aCfg->m_Window.zoom_factors = { ZOOM_LIST_PCBNEW }; if( ADVANCED_CFG::GetCfg().m_HyperZoom )
aCfg->m_Window.zoom_factors = { ZOOM_LIST_PCBNEW_HYPER };
else
aCfg->m_Window.zoom_factors = { ZOOM_LIST_PCBNEW };
} }
// Some, but not all, derived classes have a PCBNEW_SETTINGS. // Some, but not all, derived classes have a PCBNEW_SETTINGS.