From 7da98a447a2466b6d6a3ffa96e7681d4149d0dd1 Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Thu, 12 Jan 2023 23:36:51 +0100 Subject: [PATCH] qa: enable tool framework for the P&S debug tool --- qa/qa_utils/pcb_test_frame.cpp | 13 ++++++++++--- qa/tools/pns/CMakeLists.txt | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/qa/qa_utils/pcb_test_frame.cpp b/qa/qa_utils/pcb_test_frame.cpp index 11d7c3b605..f11b27c70b 100644 --- a/qa/qa_utils/pcb_test_frame.cpp +++ b/qa/qa_utils/pcb_test_frame.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include "pcb_test_frame.h" @@ -81,8 +82,11 @@ void PCB_TEST_FRAME_BASE::SetBoard( std::shared_ptr b ) KI_TRACE( traceGalProfile, "%s\n", cntView.to_string() ); #ifdef USE_TOOL_MANAGER + SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); + PCBNEW_SETTINGS* cfg = mgr.GetAppSettings(); + m_toolManager->SetEnvironment( m_board.get(), m_galPanel->GetView(), - m_galPanel->GetViewControls(), nullptr ); + m_galPanel->GetViewControls(), cfg, nullptr ); m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); #endif @@ -142,14 +146,17 @@ void PCB_TEST_FRAME_BASE::createView( wxWindow *aParent, PCB_DRAW_PANEL_GAL::GAL m_galPanel->GetViewControls()->ShowCursor( true ); #ifdef USE_TOOL_MANAGER + SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); + PCBNEW_SETTINGS* cfg = mgr.GetAppSettings(); + m_toolManager = std::make_unique( ); m_toolManager->SetEnvironment( m_board.get(), m_galPanel->GetView(), - m_galPanel->GetViewControls(), nullptr ); + m_galPanel->GetViewControls(), cfg, nullptr ); m_pcbActions = std::make_unique( ); m_toolDispatcher = std::make_unique( m_toolManager.get() ); - //m_toolManager->RegisterTool( new PCB_SELECTION_TOOL ); + m_toolManager->RegisterTool( new PCB_SELECTION_TOOL ); createUserTools(); m_toolManager->InitTools(); diff --git a/qa/tools/pns/CMakeLists.txt b/qa/tools/pns/CMakeLists.txt index 113c284b71..b040285099 100644 --- a/qa/tools/pns/CMakeLists.txt +++ b/qa/tools/pns/CMakeLists.txt @@ -25,7 +25,7 @@ find_package(Boost COMPONENTS unit_test_framework REQUIRED) find_package( wxWidgets 3.0.0 COMPONENTS gl aui adv html core net base xml stc REQUIRED ) -add_definitions(-DBOOST_TEST_DYN_LINK -DPCBNEW) +add_definitions(-DBOOST_TEST_DYN_LINK -DPCBNEW -DUSE_TOOL_MANAGER) set( COMMON_SRCS