mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix problem with assignment of view id for plots on console runs
This commit is contained in:
@@ -55,10 +55,13 @@
|
||||
#include "RimGridCrossPlotCollection.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimMultiPlotCollection.h"
|
||||
#include "RimObservedDataCollection.h"
|
||||
#include "RimObservedFmuRftData.h"
|
||||
#include "RimObservedSummaryData.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimPlotWindow.h"
|
||||
#include "RimPltPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRftPlotCollection.h"
|
||||
@@ -71,6 +74,7 @@
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimSurfaceCollection.h"
|
||||
#include "RimTextAnnotation.h"
|
||||
#include "RimTextAnnotationInView.h"
|
||||
@@ -1505,3 +1509,153 @@ int RiaApplication::launchUnitTestsWithConsole()
|
||||
{
|
||||
return launchUnitTests();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::loadAndUpdatePlotData()
|
||||
{
|
||||
RimWellLogPlotCollection* wlpColl = nullptr;
|
||||
RimSummaryPlotCollection* spColl = nullptr;
|
||||
RimSummaryCrossPlotCollection* scpColl = nullptr;
|
||||
RimFlowPlotCollection* flowColl = nullptr;
|
||||
RimRftPlotCollection* rftColl = nullptr;
|
||||
RimPltPlotCollection* pltColl = nullptr;
|
||||
RimGridCrossPlotCollection* gcpColl = nullptr;
|
||||
RimSaturationPressurePlotCollection* sppColl = nullptr;
|
||||
RimMultiPlotCollection* gpwColl = nullptr;
|
||||
|
||||
if ( m_project->mainPlotCollection() )
|
||||
{
|
||||
if ( m_project->mainPlotCollection()->wellLogPlotCollection() )
|
||||
{
|
||||
wlpColl = m_project->mainPlotCollection()->wellLogPlotCollection();
|
||||
}
|
||||
if ( m_project->mainPlotCollection()->summaryPlotCollection() )
|
||||
{
|
||||
spColl = m_project->mainPlotCollection()->summaryPlotCollection();
|
||||
}
|
||||
if ( m_project->mainPlotCollection()->summaryCrossPlotCollection() )
|
||||
{
|
||||
scpColl = m_project->mainPlotCollection()->summaryCrossPlotCollection();
|
||||
}
|
||||
if ( m_project->mainPlotCollection()->flowPlotCollection() )
|
||||
{
|
||||
flowColl = m_project->mainPlotCollection()->flowPlotCollection();
|
||||
}
|
||||
if ( m_project->mainPlotCollection()->rftPlotCollection() )
|
||||
{
|
||||
rftColl = m_project->mainPlotCollection()->rftPlotCollection();
|
||||
}
|
||||
if ( m_project->mainPlotCollection()->pltPlotCollection() )
|
||||
{
|
||||
pltColl = m_project->mainPlotCollection()->pltPlotCollection();
|
||||
}
|
||||
if ( m_project->mainPlotCollection()->gridCrossPlotCollection() )
|
||||
{
|
||||
gcpColl = m_project->mainPlotCollection()->gridCrossPlotCollection();
|
||||
}
|
||||
if ( m_project->mainPlotCollection()->saturationPressurePlotCollection() )
|
||||
{
|
||||
sppColl = m_project->mainPlotCollection()->saturationPressurePlotCollection();
|
||||
}
|
||||
if ( m_project->mainPlotCollection()->multiPlotCollection() )
|
||||
{
|
||||
gpwColl = m_project->mainPlotCollection()->multiPlotCollection();
|
||||
}
|
||||
}
|
||||
|
||||
size_t plotCount = 0;
|
||||
plotCount += wlpColl ? wlpColl->wellLogPlots().size() : 0;
|
||||
plotCount += spColl ? spColl->summaryPlots().size() : 0;
|
||||
plotCount += scpColl ? scpColl->summaryPlots().size() : 0;
|
||||
plotCount += flowColl ? flowColl->plotCount() : 0;
|
||||
plotCount += rftColl ? rftColl->rftPlots().size() : 0;
|
||||
plotCount += pltColl ? pltColl->pltPlots().size() : 0;
|
||||
plotCount += gcpColl ? gcpColl->gridCrossPlots().size() : 0;
|
||||
plotCount += sppColl ? sppColl->plots().size() : 0;
|
||||
plotCount += gpwColl ? gpwColl->multiPlots().size() : 0;
|
||||
|
||||
if ( plotCount > 0 )
|
||||
{
|
||||
caf::ProgressInfo plotProgress( plotCount, "Loading Plot Data" );
|
||||
if ( wlpColl )
|
||||
{
|
||||
for ( size_t wlpIdx = 0; wlpIdx < wlpColl->wellLogPlots().size(); ++wlpIdx )
|
||||
{
|
||||
wlpColl->wellLogPlots[wlpIdx]->loadDataAndUpdate();
|
||||
plotProgress.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
||||
if ( spColl )
|
||||
{
|
||||
for ( size_t wlpIdx = 0; wlpIdx < spColl->summaryPlots().size(); ++wlpIdx )
|
||||
{
|
||||
spColl->summaryPlots[wlpIdx]->loadDataAndUpdate();
|
||||
plotProgress.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
||||
if ( scpColl )
|
||||
{
|
||||
for ( auto plot : scpColl->summaryPlots() )
|
||||
{
|
||||
plot->loadDataAndUpdate();
|
||||
plotProgress.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
||||
if ( flowColl )
|
||||
{
|
||||
plotProgress.setNextProgressIncrement( flowColl->plotCount() );
|
||||
flowColl->loadDataAndUpdate();
|
||||
plotProgress.incrementProgress();
|
||||
}
|
||||
|
||||
if ( rftColl )
|
||||
{
|
||||
for ( const auto& rftPlot : rftColl->rftPlots() )
|
||||
{
|
||||
rftPlot->loadDataAndUpdate();
|
||||
plotProgress.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
||||
if ( pltColl )
|
||||
{
|
||||
for ( const auto& pltPlot : pltColl->pltPlots() )
|
||||
{
|
||||
pltPlot->loadDataAndUpdate();
|
||||
plotProgress.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
||||
if ( gcpColl )
|
||||
{
|
||||
for ( const auto& gcpPlot : gcpColl->gridCrossPlots() )
|
||||
{
|
||||
gcpPlot->loadDataAndUpdate();
|
||||
plotProgress.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
||||
if ( sppColl )
|
||||
{
|
||||
for ( const auto& sppPlot : sppColl->plots() )
|
||||
{
|
||||
sppPlot->loadDataAndUpdate();
|
||||
plotProgress.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
||||
if ( gpwColl )
|
||||
{
|
||||
for ( const auto& multiPlot : gpwColl->multiPlots() )
|
||||
{
|
||||
multiPlot->loadDataAndUpdate();
|
||||
plotProgress.incrementProgress();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user