From 8c29091001cb3c2766347b16c68fedbf26c6f69d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 20 Jun 2023 14:15:56 +0100 Subject: [PATCH] Add a "hyperzoom" mode for debugging "up close". --- common/advanced_config.cpp | 11 ++++++++++- include/advanced_config.h | 5 +++++ include/zoom_defines.h | 5 ++++- pcbnew/footprint_preview_panel.cpp | 6 +++++- pcbnew/pcb_base_frame.cpp | 5 ++++- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index 2efe838e96..fcf4e7d63b 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -1,7 +1,7 @@ /* * 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 * 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" ); +/** + * 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 * 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. m_CoroutineStackSize = AC_STACK::default_stack; m_ShowRouterDebugGraphics = false; + m_HyperZoom = false; m_DrawArcAccuracy = 10.0; m_DrawArcCenterMaxAngle = 50.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, &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, &m_CompactSave, m_CompactSave ) ); diff --git a/include/advanced_config.h b/include/advanced_config.h index 97d3cd83a3..2dfef6c308 100644 --- a/include/advanced_config.h +++ b/include/advanced_config.h @@ -140,6 +140,11 @@ public: */ bool m_ShowRouterDebugGraphics; + /** + * Slide the zoom steps over for debugging things "up close". + */ + bool m_HyperZoom; + /** * Save files in compact display mode * When is is not specified, points are written one per line diff --git a/include/zoom_defines.h b/include/zoom_defines.h index 411189b51b..6704e1aa15 100644 --- a/include/zoom_defines.h +++ b/include/zoom_defines.h @@ -2,7 +2,7 @@ * 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) 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 * 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,\ 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,\ 3.5, 5.0, 8.0, 13.0, 22.0, 35.0, 50.0, 80.0, 130.0, 220.0 diff --git a/pcbnew/footprint_preview_panel.cpp b/pcbnew/footprint_preview_panel.cpp index 73a105c820..7cb94f8ad8 100644 --- a/pcbnew/footprint_preview_panel.cpp +++ b/pcbnew/footprint_preview_panel.cpp @@ -23,6 +23,7 @@ #include #include "pcbnew_settings.h" +#include #include #include #include @@ -255,7 +256,10 @@ FOOTPRINT_PREVIEW_PANEL* FOOTPRINT_PREVIEW_PANEL::New( KIWAY* aKiway, wxWindow* // change this config //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 gal_opts; diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index f6dde9ff86..0110d955e2 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -897,7 +897,10 @@ void PCB_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) // change this config // 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.