Fix problem with assignment of view id for plots on console runs

This commit is contained in:
Gaute Lindkvist
2020-01-27 13:12:28 +01:00
parent 98dfa8a72b
commit 54f1ed32de
6 changed files with 164 additions and 154 deletions

View File

@@ -301,156 +301,6 @@ bool RiaGuiApplication::saveProjectAs( const QString& fileName )
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaGuiApplication::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();
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------