Browse Source

router: log and replay the 'unfix' events too

7.0
Tomasz Wlostowski 3 years ago
parent
commit
26a38797c7
  1. 3
      pcbnew/router/pns_logger.h
  2. 1
      pcbnew/router/pns_router.cpp
  3. 11
      qa/tools/pns/pns_log_player.cpp

3
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 {

1
pcbnew/router/pns_router.cpp

@ -884,6 +884,7 @@ void ROUTER::UndoLastSegment()
if( !RoutingInProgress() )
return;
m_logger->Log( LOGGER::EVT_UNFIX );
m_placer->UnfixRoute();
}

11
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() );
}

Loading…
Cancel
Save