diff --git a/pcbnew/router/pns_debug_decorator.h b/pcbnew/router/pns_debug_decorator.h index ffd6207c6b..1f70d905a8 100644 --- a/pcbnew/router/pns_debug_decorator.h +++ b/pcbnew/router/pns_debug_decorator.h @@ -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 diff --git a/pcbnew/router/pns_walkaround.cpp b/pcbnew/router/pns_walkaround.cpp index 9c5f3c6cb8..444e2cb2ea 100644 --- a/pcbnew/router/pns_walkaround.cpp +++ b/pcbnew/router/pns_walkaround.cpp @@ -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"); - char name[128]; - snprintf(name, sizeof(name), "hull-%s-%d", aWindingDirection ? "cw" : "ccw", m_iteration ); - 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 ); - 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(), BeginGroup, "hull/walk" ); + char name[128]; + snprintf(name, sizeof(name), "hull-%s-%d", aWindingDirection ? "cw" : "ccw", m_iteration ); + PNS_DBG( Dbg(), AddLine, current_obs->m_hull, RED, 1, name); + snprintf(name, sizeof(name), "path-%s-%d", aWindingDirection ? "cw" : "ccw", m_iteration ); + PNS_DBG( Dbg(), AddLine, aPath.CLine(), GREEN, 1, name ); + snprintf(name, sizeof(name), "result-%s-%d", aWindingDirection ? "cw" : "ccw", m_iteration ); + 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 ) );