drc_proto: working on progress reporting

This commit is contained in:
Tomasz Wlostowski 2020-08-27 00:06:23 +02:00
parent 91ce549e63
commit b107c4a025
2 changed files with 6 additions and 8 deletions

View File

@ -296,14 +296,12 @@ void test::DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances()
for( auto seg_it = m_board->Tracks().begin(); seg_it != m_board->Tracks().end(); seg_it++ ) for( auto seg_it = m_board->Tracks().begin(); seg_it != m_board->Tracks().end(); seg_it++ )
{ {
if( ii++ > delta ) if( (ii % delta) == 0)
{ {
ii = 0; ReportProgress( (double) ii / (double) m_board->Tracks().size() );
count++;
ReportProgress( (double) ii / (double ) count );
} }
ii++;
// Test new segment against tracks and pads, optionally against copper zones // Test new segment against tracks and pads, optionally against copper zones
doTrackDrc( *seg_it, seg_it + 1, m_board->Tracks().end(), false /*fixme: control for copper zones*/ ); doTrackDrc( *seg_it, seg_it + 1, m_board->Tracks().end(), false /*fixme: control for copper zones*/ );
} }
@ -611,8 +609,8 @@ bool test::DRC_TEST_PROVIDER_COPPER_CLEARANCE::doPadToPadsDrc( D_PAD* aRefPad, D
{ {
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_SHORTING_ITEMS ); std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_SHORTING_ITEMS );
wxString msg; wxString msg;
msg.Printf( drcItem->GetErrorText() + _( " (nets %s and %s)" ), msg.Printf( drcItem->GetErrorText() + _( " (nets %d and %d)" ),
pad->GetNetCode(), aRefPad->GetNetCode() ); (int) pad->GetNetCode(), (int) aRefPad->GetNetCode() );
drcItem->SetErrorMessage( msg ); drcItem->SetErrorMessage( msg );
drcItem->SetItems( pad, aRefPad ); drcItem->SetItems( pad, aRefPad );

View File

@ -310,7 +310,7 @@ bool test::DRC_TEST_PROVIDER_HOLE_CLEARANCE::doPadToPadHoleDrc( D_PAD* aRefPad,
accountCheck( constraint.GetParentRule() ); accountCheck( constraint.GetParentRule() );
drc_dbg(1,"check pad %p rule '%s' cl %d\n", constraint.GetParentRule()->GetName(), minClearance ); drc_dbg(1,"check pad %p rule '%s' cl %d\n", aRefPad, constraint.GetParentRule()->GetName(), minClearance );
auto padShape = pad->GetEffectiveShape(); auto padShape = pad->GetEffectiveShape();
if( padShape->Collide( aRefPad->GetEffectiveHoleShape(), minClearance, &actual ) ) if( padShape->Collide( aRefPad->GetEffectiveHoleShape(), minClearance, &actual ) )