Extra debugging info for pns regression tests.
This commit is contained in:
parent
ac778163ab
commit
05135eed66
|
@ -1298,11 +1298,10 @@ SHOVE::SHOVE_STATUS SHOVE::shoveIteration( int aIter )
|
|||
SHOVE_STATUS st = SH_NULL;
|
||||
|
||||
if( Dbg() )
|
||||
{
|
||||
Dbg()->SetIteration( aIter );
|
||||
}
|
||||
Dbg()->SetIteration( aIter );
|
||||
|
||||
PNS_DBG( Dbg(), AddItem, ¤tLine, RED, currentLine.Width(), wxString::Format( wxT( "current-coll-chk rank %d" ), currentLine.Rank() ) );
|
||||
PNS_DBG( Dbg(), AddItem, ¤tLine, RED, currentLine.Width(),
|
||||
wxString::Format( wxT( "current-coll-chk rank %d" ), currentLine.Rank() ) );
|
||||
|
||||
for( ITEM::PnsKind search_order : { ITEM::HOLE_T, ITEM::SOLID_T, ITEM::VIA_T, ITEM::SEGMENT_T } )
|
||||
{
|
||||
|
@ -1340,10 +1339,10 @@ SHOVE::SHOVE_STATUS SHOVE::shoveIteration( int aIter )
|
|||
ITEM* ni = nearest->m_item;
|
||||
|
||||
UNITS_PROVIDER up( pcbIUScale, EDA_UNITS::MILLIMETRES );
|
||||
PNS_DBG( Dbg(), Message,
|
||||
wxString::Format( wxT( "NI: %s (%s)" ), ni->Format(), ni->Parent()
|
||||
? ni->Parent()->GetItemDescription( &up )
|
||||
: wxString( wxT( "null" ) ) ) );
|
||||
PNS_DBG( Dbg(), Message, wxString::Format( wxT( "NI: %s (%s)" ),
|
||||
ni->Format(),
|
||||
ni->Parent() ? ni->Parent()->GetItemDescription( &up )
|
||||
: wxString( wxT( "null" ) ) ) );
|
||||
|
||||
unwindLineStack( ni );
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ void PNS_LOG_PLAYER::createRouter()
|
|||
m_router->Settings().SetMode( PNS::RM_Walkaround );
|
||||
m_router->Sizes().SetTrackWidth( 250000 );
|
||||
|
||||
m_debugDecorator = new PNS_TEST_DEBUG_DECORATOR;
|
||||
m_debugDecorator = new PNS_TEST_DEBUG_DECORATOR( m_reporter );
|
||||
m_debugDecorator->Clear();
|
||||
m_iface->SetDebugDecorator( m_debugDecorator );
|
||||
}
|
||||
|
|
|
@ -24,8 +24,13 @@
|
|||
|
||||
#include "pns_test_debug_decorator.h"
|
||||
|
||||
#include <reporter.h>
|
||||
#include <router/pns_item.h>
|
||||
|
||||
|
||||
#define VERBOSE // Sends PSN_DBG message output to the console
|
||||
|
||||
|
||||
PNS_DEBUG_SHAPE::PNS_DEBUG_SHAPE( PNS_DEBUG_SHAPE* aParent )
|
||||
{
|
||||
m_iter = 0;
|
||||
|
@ -106,7 +111,8 @@ PNS_DEBUG_STAGE::~PNS_DEBUG_STAGE()
|
|||
}
|
||||
|
||||
|
||||
PNS_TEST_DEBUG_DECORATOR::PNS_TEST_DEBUG_DECORATOR()
|
||||
PNS_TEST_DEBUG_DECORATOR::PNS_TEST_DEBUG_DECORATOR( REPORTER* aReporter ) :
|
||||
m_reporter( aReporter )
|
||||
{
|
||||
m_iter = 0;
|
||||
m_grouping = false;
|
||||
|
@ -235,6 +241,16 @@ void PNS_TEST_DEBUG_DECORATOR::Message( const wxString& msg, const SRC_LOCATION_
|
|||
ent->m_msg = msg.c_str();
|
||||
ent->m_srcLoc = aSrcLoc;
|
||||
addEntry( ent );
|
||||
|
||||
#ifdef VERBOSE
|
||||
static wxString lastMsg;
|
||||
|
||||
if( msg != lastMsg )
|
||||
{
|
||||
m_reporter->Report( msg );
|
||||
lastMsg = msg;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
#include <router/pns_debug_decorator.h>
|
||||
|
||||
class REPORTER;
|
||||
|
||||
class PNS_DEBUG_SHAPE
|
||||
{
|
||||
public:
|
||||
|
@ -70,7 +72,7 @@ struct PNS_DEBUG_STAGE
|
|||
class PNS_TEST_DEBUG_DECORATOR : public PNS::DEBUG_DECORATOR
|
||||
{
|
||||
public:
|
||||
PNS_TEST_DEBUG_DECORATOR();
|
||||
PNS_TEST_DEBUG_DECORATOR( REPORTER* aReporter );
|
||||
virtual ~PNS_TEST_DEBUG_DECORATOR();
|
||||
|
||||
virtual void SetIteration( int iter ) override { m_iter = iter; }
|
||||
|
@ -113,6 +115,8 @@ private:
|
|||
PNS_DEBUG_SHAPE* m_activeEntry;
|
||||
int m_iter;
|
||||
std::vector<PNS_DEBUG_STAGE*> m_stages;
|
||||
|
||||
REPORTER* m_reporter;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue