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
This commit is contained in:
Jon Evans 2021-12-30 09:16:19 -05:00
parent 67fe8904c0
commit 0ec440805d
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 )
{
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 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
delta = std::max( delta, size / 50 );
delta = std::max( delta, size / 10 );
for( ZONE* zone : aBoard->Zones() )
{

View File

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