From 26a38797c78d9fc5d8def91dd3d5868a307ee465 Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Tue, 15 Nov 2022 23:02:01 +0100 Subject: [PATCH] router: log and replay the 'unfix' events too --- pcbnew/router/pns_logger.h | 3 ++- pcbnew/router/pns_router.cpp | 1 + qa/tools/pns/pns_log_player.cpp | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pcbnew/router/pns_logger.h b/pcbnew/router/pns_logger.h index 9cabd5ecb8..dac38ca01c 100644 --- a/pcbnew/router/pns_logger.h +++ b/pcbnew/router/pns_logger.h @@ -49,7 +49,8 @@ public: EVT_FIX, EVT_MOVE, EVT_ABORT, - EVT_TOGGLE_VIA + EVT_TOGGLE_VIA, + EVT_UNFIX }; struct EVENT_ENTRY { diff --git a/pcbnew/router/pns_router.cpp b/pcbnew/router/pns_router.cpp index db47e209b4..1883858e7a 100644 --- a/pcbnew/router/pns_router.cpp +++ b/pcbnew/router/pns_router.cpp @@ -884,6 +884,7 @@ void ROUTER::UndoLastSegment() if( !RoutingInProgress() ) return; + m_logger->Log( LOGGER::EVT_UNFIX ); m_placer->UnfixRoute(); } diff --git a/qa/tools/pns/pns_log_player.cpp b/qa/tools/pns/pns_log_player.cpp index 375c5d13e7..39af54b664 100644 --- a/qa/tools/pns/pns_log_player.cpp +++ b/qa/tools/pns/pns_log_player.cpp @@ -145,6 +145,16 @@ void PNS_LOG_PLAYER::ReplayLog( PNS_LOG_FILE* aLog, int aStartEventIndex, int aF break; } + case LOGGER::EVT_UNFIX: + { + m_debugDecorator->NewStage( "unfix", 0, PNSLOGINFO ); + m_viewTracker->SetStage( m_debugDecorator->GetStageCount() - 1 ); + m_debugDecorator->Message( wxString::Format( "unfix (%d, %d)", evt.p.x, evt.p.y ) ); + printf( " unfix\n" ); + m_router->UndoLastSegment(); + break; + } + case LOGGER::EVT_MOVE: { m_debugDecorator->NewStage( "move", 0, PNSLOGINFO ); @@ -232,6 +242,7 @@ bool PNS_LOG_PLAYER::CompareResults( PNS_LOG_FILE* aLog ) { auto cstate = GetRouterUpdatedItems(); + printf("Comparing %lu added/%lu removed items\n", cstate.m_addedItems.size(), cstate.m_removedIds.size() ); return cstate.Compare( aLog->GetExpectedResult() ); }