qa: enable tool framework for the P&S debug tool

This commit is contained in:
Tomasz Wlostowski 2023-01-12 23:36:51 +01:00
parent 761e754294
commit 7da98a447a
2 changed files with 11 additions and 4 deletions

View File

@ -54,6 +54,7 @@
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tools/pcb_tool_base.h>
#include <tools/pcb_selection_tool.h>
#include <plugins/kicad/pcb_plugin.h>
#include "pcb_test_frame.h"
@ -81,8 +82,11 @@ void PCB_TEST_FRAME_BASE::SetBoard( std::shared_ptr<BOARD> b )
KI_TRACE( traceGalProfile, "%s\n", cntView.to_string() );
#ifdef USE_TOOL_MANAGER
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>();
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<PCBNEW_SETTINGS>();
m_toolManager = std::make_unique<TOOL_MANAGER>( );
m_toolManager->SetEnvironment( m_board.get(), m_galPanel->GetView(),
m_galPanel->GetViewControls(), nullptr );
m_galPanel->GetViewControls(), cfg, nullptr );
m_pcbActions = std::make_unique<TEST_ACTIONS>( );
m_toolDispatcher = std::make_unique<TOOL_DISPATCHER>( m_toolManager.get() );
//m_toolManager->RegisterTool( new PCB_SELECTION_TOOL );
m_toolManager->RegisterTool( new PCB_SELECTION_TOOL );
createUserTools();
m_toolManager->InitTools();

View File

@ -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