drc_proto: report rule hit statistics

This commit is contained in:
Tomasz Wlostowski 2020-07-27 15:32:37 +02:00
parent 7fc532df2e
commit ff1872379d
2 changed files with 20 additions and 0 deletions

View File

@ -26,6 +26,13 @@ void test::DRC_TEST_PROVIDER::Report( DRC_ITEM* item )
m_drcEngine->Report( item, nullptr );
}
void test::DRC_TEST_PROVIDER::ReportWithMarker( DRC_ITEM* item, VECTOR2I aMarkerPos )
{
item->SetViolatingTest( this );
m_drcEngine->Report( item, nullptr ); // fixme: create marker
}
void test::DRC_TEST_PROVIDER::ReportWithMarker( DRC_ITEM* item, wxPoint aMarkerPos )
{
item->SetViolatingTest( this );
@ -55,6 +62,7 @@ void test::DRC_TEST_PROVIDER::ReportAux( const wxString fmt, ... )
bool test::DRC_TEST_PROVIDER::isErrorLimitExceeded( int error_code )
{
// fixme: implement error limit (or timeout)
return false;
}
@ -71,3 +79,12 @@ void test::DRC_TEST_PROVIDER::accountCheck( test::DRC_RULE* ruleToTest )
else
it->second++;
}
void test::DRC_TEST_PROVIDER::reportRuleStatistics()
{
m_drcEngine->ReportAux("Rule hit statistics: ");
for( auto stat : m_stats )
{
m_drcEngine->ReportAux( wxString::Format( " - rule '%s': %d hits ", stat.first->GetName().c_str(), stat.second ) );
}
}

View File

@ -99,6 +99,8 @@ public:
virtual void ReportAux( const wxString fmt, ... );
virtual void Report( DRC_ITEM* item );
virtual void ReportWithMarker( DRC_ITEM* item, wxPoint aMarkerPos );
virtual void ReportWithMarker( DRC_ITEM* item, VECTOR2I aMarkerPos );
virtual void ReportProgress( double aProgress );
virtual void ReportStage ( const wxString& aStageName, int index, int total );
@ -106,6 +108,7 @@ public:
protected:
virtual void reportRuleStatistics();
virtual void accountCheck( test::DRC_RULE* ruleToTest );
virtual bool isErrorLimitExceeded( int error_code );