From 6f9ef9c20e6493f987ca369d32444e4daf209062 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 14 May 2014 16:53:49 +0200 Subject: [PATCH] PNS routing settings are stored between router invocations. --- pcbnew/router/pns_router.h | 11 +++++++++++ pcbnew/router/router_tool.cpp | 3 +++ pcbnew/router/router_tool.h | 2 ++ 3 files changed, 16 insertions(+) diff --git a/pcbnew/router/pns_router.h b/pcbnew/router/pns_router.h index 53c0905487..9c867c585d 100644 --- a/pcbnew/router/pns_router.h +++ b/pcbnew/router/pns_router.h @@ -172,6 +172,17 @@ public: */ void ApplySettings(); + /** + * Changes routing settings to ones passed in the parameter. + * @param aSettings are the new settings. + */ + void LoadSettings( const PNS_ROUTING_SETTINGS& aSettings ) + { + m_settings = aSettings; + + ApplySettings(); + } + void EnableSnapping ( bool aEnable ) { m_snappingEnabled = aEnable; diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 4220aa4035..db2c996a34 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -244,6 +244,7 @@ void ROUTER_TOOL::Reset( RESET_REASON aReason ) m_router->ClearWorld(); m_router->SetBoard( getModel( PCB_T ) ); m_router->SyncWorld(); + m_router->LoadSettings( m_settings ); m_needsSync = false; if( getView() ) @@ -620,6 +621,8 @@ void ROUTER_TOOL::performRouting() m_needsSync = true; } + m_settings = m_router->Settings(); + ctls->SetAutoPan( false ); ctls->ForceCursorPosition( false ); highlightNet( false ); diff --git a/pcbnew/router/router_tool.h b/pcbnew/router/router_tool.h index db9db3ea6a..e516222470 100644 --- a/pcbnew/router/router_tool.h +++ b/pcbnew/router/router_tool.h @@ -34,6 +34,7 @@ #include #include "pns_layerset.h" +#include "pns_routing_settings.h" class PNS_ROUTER; class PNS_ITEM; @@ -68,6 +69,7 @@ private: MSG_PANEL_ITEMS m_panelItems; PNS_ROUTER* m_router; + PNS_ROUTING_SETTINGS m_settings; ///< Stores routing settings between router invocations PNS_ITEM* m_startItem; int m_startLayer;