mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Show progress bar when appending plots to multiplot (#8976)
* Show progress bar when appending plots to multiplot * Stop plot manager from going crazy creating plots when filter text is blank * Speed up plot manager create plot
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "cafAssert.h"
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@@ -63,6 +64,8 @@ void RicAppendSummaryPlotsForObjectsFeature::appendPlots( RimSummaryMultiPlot* s
|
||||
auto sourcePlots = summaryMultiPlot->summaryPlots();
|
||||
auto plotsForOneInstance = plotsForOneInstanceOfObjectType( sourcePlots, selectionType );
|
||||
|
||||
caf::ProgressInfo info( sumAddressCollections.size(), "Appending plots..." );
|
||||
|
||||
for ( auto summaryAdrCollection : sumAddressCollections )
|
||||
{
|
||||
auto duplicatedPlots = RicSummaryPlotBuilder::duplicateSummaryPlots( plotsForOneInstance );
|
||||
@@ -94,6 +97,7 @@ void RicAppendSummaryPlotsForObjectsFeature::appendPlots( RimSummaryMultiPlot* s
|
||||
duplicatedPlot->resolveReferencesRecursively();
|
||||
}
|
||||
}
|
||||
info.incrementProgress();
|
||||
}
|
||||
|
||||
summaryMultiPlot->loadDataAndUpdate();
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@@ -43,6 +44,8 @@ void RicAppendSummaryPlotsForSummaryAddressesFeature::appendPlotsForAddresses( R
|
||||
if ( !summaryMultiPlot ) return;
|
||||
if ( addresses.empty() ) return;
|
||||
|
||||
caf::ProgressInfo info( addresses.size(), "Appending plots..." );
|
||||
|
||||
for ( auto adr : addresses )
|
||||
{
|
||||
auto* plot = new RimSummaryPlot();
|
||||
@@ -50,6 +53,8 @@ void RicAppendSummaryPlotsForSummaryAddressesFeature::appendPlotsForAddresses( R
|
||||
plot->handleDroppedObjects( { adr } );
|
||||
|
||||
summaryMultiPlot->addPlot( plot );
|
||||
|
||||
info.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -478,11 +478,11 @@ RimSummaryMultiPlot* RicSummaryPlotBuilder::createAndAppendSummaryMultiPlot( con
|
||||
appendPlotsToSummaryMultiPlot( summaryMultiPlot, plots );
|
||||
|
||||
summaryMultiPlot->setDefaultRangeAggregationSteppingDimension();
|
||||
summaryMultiPlot->zoomAll();
|
||||
|
||||
plotCollection->updateAllRequiredEditors();
|
||||
summaryMultiPlot->loadDataAndUpdate();
|
||||
summaryMultiPlot->updateAllRequiredEditors();
|
||||
summaryMultiPlot->zoomAll();
|
||||
|
||||
if ( !plots.empty() )
|
||||
{
|
||||
@@ -527,6 +527,7 @@ RimSummaryMultiPlot* RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlo
|
||||
void RicSummaryPlotBuilder::appendPlotsToSummaryMultiPlot( RimSummaryMultiPlot* multiPlot,
|
||||
const std::vector<RimSummaryPlot*>& plots )
|
||||
{
|
||||
multiPlot->startBatchAddOperation();
|
||||
for ( auto plot : plots )
|
||||
{
|
||||
plot->revokeMdiWindowStatus();
|
||||
@@ -535,9 +536,8 @@ void RicSummaryPlotBuilder::appendPlotsToSummaryMultiPlot( RimSummaryMultiPlot*
|
||||
|
||||
plot->resolveReferencesRecursively();
|
||||
plot->setShowWindow( true );
|
||||
|
||||
plot->loadDataAndUpdate();
|
||||
}
|
||||
multiPlot->endBatchAddOperation();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user