router: annotate source locations of WALKAROUND debug items

This commit is contained in:
Tomasz Wlostowski 2021-05-30 00:32:38 +02:00
parent 8e2fb1bdb9
commit af2e163890
2 changed files with 14 additions and 13 deletions

View File

@ -91,6 +91,10 @@ private:
if( dbg && dbg->IsDebugEnabled() ) \
dbg->method( __VA_ARGS__, PNS::DEBUG_DECORATOR::SRC_LOCATION_INFO( __FILE__, __FUNCTION__, __LINE__ ) );
#define PNS_DBGN(dbg,method) \
if( dbg && dbg->IsDebugEnabled() ) \
dbg->method( PNS::DEBUG_DECORATOR::SRC_LOCATION_INFO( __FILE__, __FUNCTION__, __LINE__ ) );
} // namespace PNS
#endif

View File

@ -65,19 +65,16 @@ WALKAROUND::WALKAROUND_STATUS WALKAROUND::singleStep( LINE& aPath, bool aWinding
bool s_cw = aPath.Walkaround( current_obs->m_hull, path_walk,
aWindingDirection );
if ( Dbg() )
{
Dbg()->BeginGroup("hull/walk");
PNS_DBG( Dbg(), BeginGroup, "hull/walk" );
char name[128];
snprintf(name, sizeof(name), "hull-%s-%d", aWindingDirection ? "cw" : "ccw", m_iteration );
Dbg()->AddLine( current_obs->m_hull, RED, 1, name);
PNS_DBG( Dbg(), AddLine, current_obs->m_hull, RED, 1, name);
snprintf(name, sizeof(name), "path-%s-%d", aWindingDirection ? "cw" : "ccw", m_iteration );
Dbg()->AddLine( aPath.CLine(), GREEN, 1, name );
PNS_DBG( Dbg(), AddLine, aPath.CLine(), GREEN, 1, name );
snprintf(name, sizeof(name), "result-%s-%d", aWindingDirection ? "cw" : "ccw", m_iteration );
Dbg()->AddLine( path_walk, BLUE, 10000, name );
Dbg()->Message( wxString::Format( "Stat cw %d", !!s_cw ) );
Dbg()->EndGroup();
}
PNS_DBG( Dbg(), AddLine, path_walk, BLUE, 10000, name );
PNS_DBG( Dbg(), Message, wxString::Format( "Stat cw %d", !!s_cw ) );
PNS_DBGN( Dbg(), EndGroup );
current_obs = nearestObstacle( LINE( aPath, path_walk ) );