PNS: Only log events when EnableRouterDump is true

This commit is contained in:
Roberto Fernandez Bautista 2023-08-07 18:58:41 +02:00
parent 3bf9797620
commit 6ebc2fca15
3 changed files with 9 additions and 9 deletions

View File

@ -33,7 +33,7 @@ ROUTING_SETTINGS& ALGO_BASE::Settings() const
LOGGER* ALGO_BASE::Logger() LOGGER* ALGO_BASE::Logger()
{ {
return nullptr; return m_logger;
} }

View File

@ -27,6 +27,7 @@
#include <view/view_group.h> #include <view/view_group.h>
#include <gal/graphics_abstraction_layer.h> #include <gal/graphics_abstraction_layer.h>
#include <advanced_config.h>
#include <settings/settings_manager.h> #include <settings/settings_manager.h>
#include <pcb_painter.h> #include <pcb_painter.h>
@ -64,7 +65,10 @@ ROUTER::ROUTER()
m_state = IDLE; m_state = IDLE;
m_mode = PNS_MODE_ROUTE_SINGLE; m_mode = PNS_MODE_ROUTE_SINGLE;
m_logger = new LOGGER; m_logger = nullptr;
if( ADVANCED_CFG::GetCfg().m_EnableRouterDump )
m_logger = new LOGGER;
// Initialize all other variables: // Initialize all other variables:
m_lastNode = nullptr; m_lastNode = nullptr;
@ -899,7 +903,9 @@ std::optional<VECTOR2I> ROUTER::UndoLastSegment()
if( !RoutingInProgress() ) if( !RoutingInProgress() )
return std::nullopt; return std::nullopt;
m_logger->Log( LOGGER::EVT_UNFIX ); if( m_logger )
m_logger->Log( LOGGER::EVT_UNFIX );
return m_placer->UnfixRoute(); return m_placer->UnfixRoute();
} }

View File

@ -58,11 +58,6 @@ public:
SHOVE( NODE* aWorld, ROUTER* aRouter ); SHOVE( NODE* aWorld, ROUTER* aRouter );
~SHOVE(); ~SHOVE();
virtual LOGGER* Logger() override
{
return &m_logger;
}
SHOVE_STATUS ShoveLines( const LINE& aCurrentHead ); SHOVE_STATUS ShoveLines( const LINE& aCurrentHead );
SHOVE_STATUS ShoveMultiLines( const ITEM_SET& aHeadSet ); SHOVE_STATUS ShoveMultiLines( const ITEM_SET& aHeadSet );
@ -176,7 +171,6 @@ private:
OPT_LINE m_newHead; OPT_LINE m_newHead;
LOGGER m_logger;
VIA* m_draggedVia; VIA* m_draggedVia;
int m_iter; int m_iter;