Tune connectivity progress reporter

We don't need quite as many updates, this helps speed a little

See https://gitlab.com/kicad/code/kicad/-/issues/10154

(cherry picked from commit 0ec440805d)
This commit is contained in:
Jon Evans 2021-12-30 09:16:19 -05:00
parent a54ec923cd
commit 992952e3d5
2 changed files with 15 additions and 2 deletions

View File

@ -431,7 +431,7 @@ void reportProgress( PROGRESS_REPORTER* aReporter, int aCount, int aSize, int aD
void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter ) void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
{ {
int delta = 100; // Number of additions between 2 calls to the progress bar int delta = 200; // Number of additions between 2 calls to the progress bar
int ii = 0; int ii = 0;
int size = 0; int size = 0;
@ -443,7 +443,7 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
size *= 2; // Our caller us gets the other half of the progress bar size *= 2; // Our caller us gets the other half of the progress bar
delta = std::max( delta, size / 50 ); delta = std::max( delta, size / 10 );
for( ZONE* zone : aBoard->Zones() ) for( ZONE* zone : aBoard->Zones() )
{ {

View File

@ -36,6 +36,7 @@
#include <connectivity/from_to_cache.h> #include <connectivity/from_to_cache.h>
#include <ratsnest/ratsnest_data.h> #include <ratsnest/ratsnest_data.h>
#include <progress_reporter.h>
#include <trigo.h> #include <trigo.h>
CONNECTIVITY_DATA::CONNECTIVITY_DATA() CONNECTIVITY_DATA::CONNECTIVITY_DATA()
@ -99,7 +100,19 @@ void CONNECTIVITY_DATA::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
if( net->GetNetClass()->GetName() != NETCLASS::Default ) if( net->GetNetClass()->GetName() != NETCLASS::Default )
m_netclassMap[ net->GetNetCode() ] = net->GetNetClass()->GetName(); m_netclassMap[ net->GetNetCode() ] = net->GetNetClass()->GetName();
if( aReporter )
{
aReporter->SetCurrentProgress( 0.75 );
aReporter->KeepRefreshing( false );
}
RecalculateRatsnest(); RecalculateRatsnest();
if( aReporter )
{
aReporter->SetCurrentProgress( 1.0 );
aReporter->KeepRefreshing( false );
}
} }