diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index 2bc544f686..06702b6817 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -269,6 +269,10 @@ void TOOL_DISPATCHER::DispatchWxCommand( wxCommandEvent &aEvent ) switch( aEvent.GetId() ) { + case ID_PNS_ROUTER_TOOL: + toolName = "pcbnew.InteractiveRouter"; + activateTool = true; + break; case ID_SELECTION_TOOL: toolName = "pcbnew.InteractiveSelection"; activateTool = true; diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 79b78b9b1a..176bb6a04d 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -1,4 +1,5 @@ add_definitions(-DPCBNEW) +add_subdirectory(router) if (KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripting) @@ -117,6 +118,7 @@ set(PCBNEW_AUTOROUTER_SRCS autorouter/work.cpp ) + set(PCBNEW_CLASS_SRCS tool_modview.cpp modview.cpp @@ -324,6 +326,7 @@ if (KICAD_SCRIPTING_MODULES) swig_link_libraries(pcbnew 3d-viewer pcbcommon + pnsrouter common pcad2kicadpcb polygon @@ -420,6 +423,7 @@ endif(APPLE) target_link_libraries(pcbnew 3d-viewer pcbcommon + pnsrouter common pcad2kicadpcb polygon diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 1308addc82..5aeb153541 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -815,7 +815,7 @@ void PCB_BASE_FRAME::LoadSettings() { // Copper layers are required for netname layers view->SetRequired( GetNetnameLayer( layer ), layer ); - view->SetLayerTarget( layer, KiGfx::TARGET_CACHED ); + view->SetLayerTarget( layer, KiGfx::TARGET_NONCACHED ); } else if( IsNetnameLayer( layer ) ) { diff --git a/pcbnew/menubar_pcbframe.cpp b/pcbnew/menubar_pcbframe.cpp index 5eb3b28a96..03793ca68b 100644 --- a/pcbnew/menubar_pcbframe.cpp +++ b/pcbnew/menubar_pcbframe.cpp @@ -305,6 +305,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() _( "Interactive selection and drag&drop tool." ), KiBitmap( tools_xpm ) ); + AddMenuItem( editMenu, ID_PNS_ROUTER_TOOL, + _( "Interactive router" ), + _( "Interactive router drag&drop tool." ), + KiBitmap( tools_xpm ) ); + /** Create View menu **/ wxMenu* viewMenu = new wxMenu; diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index fe9e5ee01d..640399172b 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -120,8 +120,10 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) // menu Config /* Tom's hacks start */ - EVT_MENU ( ID_SELECTION_TOOL, PCB_EDIT_FRAME::onGenericCommand ) + EVT_MENU ( ID_SELECTION_TOOL, PCB_EDIT_FRAME::onGenericCommand ) EVT_TOOL ( ID_SELECTION_TOOL, PCB_EDIT_FRAME::onGenericCommand ) + EVT_MENU ( ID_PNS_ROUTER_TOOL, PCB_EDIT_FRAME::onGenericCommand ) + EVT_TOOL ( ID_PNS_ROUTER_TOOL, PCB_EDIT_FRAME::onGenericCommand ) /* Tom's hacks end */ EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, PCB_EDIT_FRAME::OnConfigurePcbOptions ) diff --git a/pcbnew/pcbnew_id.h b/pcbnew/pcbnew_id.h index ba479ffe65..ff4bb6062f 100644 --- a/pcbnew/pcbnew_id.h +++ b/pcbnew/pcbnew_id.h @@ -366,7 +366,8 @@ enum pcbnew_ids ID_FOOTPRINT_WIZARD_SELECT_WIZARD, ID_FOOTPRINT_WIZARD_EXPORT_TO_BOARD, - ID_SELECTION_TOOL + ID_SELECTION_TOOL, + ID_PNS_ROUTER_TOOL }; #endif // PCBNEW_ID_H_ diff --git a/pcbnew/tools/pcb_tools.cpp b/pcbnew/tools/pcb_tools.cpp index 4ee70cde94..3137f00628 100644 --- a/pcbnew/tools/pcb_tools.cpp +++ b/pcbnew/tools/pcb_tools.cpp @@ -35,6 +35,7 @@ #include #include "selection_tool.h" +#include void PCB_EDIT_FRAME::setupTools() { @@ -45,6 +46,7 @@ void PCB_EDIT_FRAME::setupTools() // register our selection tool. m_toolManager->RegisterTool( new SELECTION_TOOL ); + m_toolManager->RegisterTool( new ROUTER_TOOL ); }