router: report debug log events from DRAGGER

This commit is contained in:
Tomasz Wlostowski 2020-10-18 23:00:33 +02:00
parent 0306d16748
commit af95235f47
2 changed files with 20 additions and 5 deletions

View File

@ -157,6 +157,13 @@ bool ROUTER::StartDragging( const VECTOR2I& aP, ITEM_SET aStartItems, int aDragM
m_dragger->SetLogger( m_logger ); m_dragger->SetLogger( m_logger );
m_dragger->SetDebugDecorator ( m_iface->GetDebugDecorator () ); m_dragger->SetDebugDecorator ( m_iface->GetDebugDecorator () );
m_logger->Clear();
if( m_logger && aStartItems.Size() )
{
m_logger->Log( LOGGER::EVT_START_DRAG, aP, aStartItems[0] );
}
if( m_dragger->Start ( aP, aStartItems ) ) if( m_dragger->Start ( aP, aStartItems ) )
{ {
m_state = DRAG_SEGMENT; m_state = DRAG_SEGMENT;
@ -364,6 +371,8 @@ bool ROUTER::StartRouting( const VECTOR2I& aP, ITEM* aStartItem, int aLayer )
m_placer->SetDebugDecorator( m_iface->GetDebugDecorator () ); m_placer->SetDebugDecorator( m_iface->GetDebugDecorator () );
m_placer->SetLogger( m_logger ); m_placer->SetLogger( m_logger );
m_logger->Clear();
if( m_logger ) if( m_logger )
m_logger->Log( LOGGER::EVT_START_ROUTE, aP, aStartItem ); m_logger->Log( LOGGER::EVT_START_ROUTE, aP, aStartItem );
@ -513,8 +522,10 @@ void ROUTER::UpdateSizes( const SIZES_SETTINGS& aSizes )
// Change track/via size settings // Change track/via size settings
if( m_state == ROUTE_TRACK) if( m_state == ROUTE_TRACK)
{
m_placer->UpdateSizes( m_sizes ); m_placer->UpdateSizes( m_sizes );
} }
}
void ROUTER::movePlacing( const VECTOR2I& aP, ITEM* aEndItem ) void ROUTER::movePlacing( const VECTOR2I& aP, ITEM* aEndItem )

View File

@ -119,7 +119,7 @@ enum DRAG_MODE
class ROUTER class ROUTER
{ {
private: public:
enum RouterState enum RouterState
{ {
IDLE, IDLE,
@ -135,6 +135,10 @@ public:
void SetMode ( ROUTER_MODE aMode ); void SetMode ( ROUTER_MODE aMode );
ROUTER_MODE Mode() const { return m_mode; } ROUTER_MODE Mode() const { return m_mode; }
RouterState GetState() const { return m_state; }
DRAG_ALGO* GetDragger() { return m_dragger.get(); }
static ROUTER* GetInstance(); static ROUTER* GetInstance();
void ClearWorld(); void ClearWorld();