2017-01-12 06:16:46 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-01-12 06:16:46 -06:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-01-12 06:16:46 -06:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-01-12 06:16:46 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimFlowPlotCollection.h"
|
|
|
|
|
2017-03-24 09:10:39 -05:00
|
|
|
#include "RimFlowCharacteristicsPlot.h"
|
2019-10-09 02:21:28 -05:00
|
|
|
#include "RimProject.h"
|
2023-01-18 02:18:00 -06:00
|
|
|
#include "RimWellAllocationOverTimePlot.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimWellAllocationPlot.h"
|
2019-12-17 02:20:40 -06:00
|
|
|
#include "RimWellDistributionPlotCollection.h"
|
2017-01-12 06:16:46 -06:00
|
|
|
|
2017-02-13 07:49:52 -06:00
|
|
|
#include "cafProgressInfo.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "cvfAssert.h"
|
2017-01-12 06:16:46 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimFlowPlotCollection, "FlowPlotCollection" );
|
2017-01-12 06:16:46 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-12 06:16:46 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimFlowPlotCollection::RimFlowPlotCollection()
|
|
|
|
{
|
2022-01-07 01:31:52 -06:00
|
|
|
CAF_PDM_InitObject( "Flow Diagnostics Plots", ":/WellAllocPlots16x16.png" );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_flowCharacteristicsPlot, "FlowCharacteristicsPlot", "" );
|
2021-10-13 06:39:46 -05:00
|
|
|
m_flowCharacteristicsPlot.uiCapability()->setUiTreeHidden( true );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2023-01-18 02:18:00 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_defaultWellAllocOverTimePlot, "DefaultWellAllocationOverTimePlot", "" );
|
|
|
|
m_defaultWellAllocOverTimePlot.uiCapability()->setUiTreeHidden( true );
|
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_defaultWellAllocPlot, "DefaultWellAllocationPlot", "" );
|
2021-10-13 06:39:46 -05:00
|
|
|
m_defaultWellAllocPlot.uiCapability()->setUiTreeHidden( true );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_wellDistributionPlotCollection, "WellDistributionPlotCollection", "" );
|
2021-10-13 06:39:46 -05:00
|
|
|
m_wellDistributionPlotCollection.uiCapability()->setUiTreeHidden( true );
|
2019-12-11 02:38:25 -06:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_storedWellAllocPlots, "StoredWellAllocationPlots", "Stored Well Allocation Plots" );
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_storedFlowCharacteristicsPlots,
|
|
|
|
"StoredFlowCharacteristicsPlots",
|
2021-11-14 07:15:12 -06:00
|
|
|
"Stored Flow Characteristics Plots" );
|
2017-01-12 06:16:46 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-12 06:16:46 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimFlowPlotCollection::~RimFlowPlotCollection()
|
|
|
|
{
|
2017-03-28 16:35:53 -05:00
|
|
|
delete m_defaultWellAllocPlot();
|
2017-01-23 01:51:50 -06:00
|
|
|
|
2022-05-31 06:08:07 -05:00
|
|
|
m_storedWellAllocPlots.deleteChildren();
|
2017-01-12 06:16:46 -06:00
|
|
|
}
|
2017-01-24 07:25:31 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-24 07:25:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-05-05 02:43:49 -05:00
|
|
|
void RimFlowPlotCollection::deleteAllPlots()
|
2017-01-24 07:25:31 -06:00
|
|
|
{
|
2017-03-28 16:35:53 -05:00
|
|
|
if ( m_defaultWellAllocPlot )
|
2017-02-13 07:49:52 -06:00
|
|
|
{
|
2017-03-28 16:35:53 -05:00
|
|
|
m_defaultWellAllocPlot->removeFromMdiAreaAndDeleteViewWidget();
|
|
|
|
delete m_defaultWellAllocPlot();
|
2017-02-13 07:49:52 -06:00
|
|
|
}
|
2023-01-18 02:18:00 -06:00
|
|
|
delete m_defaultWellAllocOverTimePlot;
|
2017-03-30 03:07:51 -05:00
|
|
|
delete m_flowCharacteristicsPlot;
|
2019-12-17 02:20:40 -06:00
|
|
|
delete m_wellDistributionPlotCollection;
|
2017-03-30 03:07:51 -05:00
|
|
|
|
2022-05-31 06:08:07 -05:00
|
|
|
m_storedWellAllocPlots.deleteChildren();
|
|
|
|
m_storedFlowCharacteristicsPlots.deleteChildren();
|
2017-02-13 07:49:52 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 07:49:52 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-05-05 02:43:49 -05:00
|
|
|
void RimFlowPlotCollection::loadDataAndUpdateAllPlots()
|
2017-02-13 07:49:52 -06:00
|
|
|
{
|
2023-01-18 02:18:00 -06:00
|
|
|
caf::ProgressInfo plotProgress( m_storedWellAllocPlots.size() + m_storedFlowCharacteristicsPlots.size() + 4, "" );
|
2017-02-13 07:49:52 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_defaultWellAllocPlot ) m_defaultWellAllocPlot->loadDataAndUpdate();
|
2017-02-13 07:49:52 -06:00
|
|
|
plotProgress.incrementProgress();
|
|
|
|
|
2023-01-18 02:18:00 -06:00
|
|
|
if ( m_defaultWellAllocOverTimePlot ) m_defaultWellAllocOverTimePlot->loadDataAndUpdate();
|
|
|
|
plotProgress.incrementProgress();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimWellAllocationPlot* p : m_storedWellAllocPlots )
|
2017-02-13 07:49:52 -06:00
|
|
|
{
|
|
|
|
p->loadDataAndUpdate();
|
|
|
|
plotProgress.incrementProgress();
|
|
|
|
}
|
2017-08-17 05:52:18 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimFlowCharacteristicsPlot* p : m_storedFlowCharacteristicsPlots )
|
2017-08-17 05:52:18 -05:00
|
|
|
{
|
|
|
|
p->loadDataAndUpdate();
|
|
|
|
plotProgress.incrementProgress();
|
|
|
|
}
|
2019-06-23 12:00:14 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_flowCharacteristicsPlot )
|
2019-06-23 12:00:14 -05:00
|
|
|
{
|
|
|
|
m_flowCharacteristicsPlot->loadDataAndUpdate();
|
|
|
|
}
|
2019-12-11 02:38:25 -06:00
|
|
|
|
2019-12-17 02:20:40 -06:00
|
|
|
if ( m_wellDistributionPlotCollection )
|
2019-12-11 02:38:25 -06:00
|
|
|
{
|
2019-12-17 02:20:40 -06:00
|
|
|
m_wellDistributionPlotCollection->loadDataAndUpdate();
|
2019-12-11 02:38:25 -06:00
|
|
|
}
|
2017-02-13 07:49:52 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 07:49:52 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
size_t RimFlowPlotCollection::plotCount() const
|
|
|
|
{
|
2017-03-07 05:19:19 -06:00
|
|
|
size_t plotCount = 0;
|
2023-01-18 02:18:00 -06:00
|
|
|
plotCount += m_defaultWellAllocPlot ? 1 : 0;
|
|
|
|
plotCount += m_defaultWellAllocOverTimePlot ? 1 : 0;
|
2017-03-28 16:35:53 -05:00
|
|
|
plotCount += m_storedWellAllocPlots.size();
|
2017-08-17 05:52:18 -05:00
|
|
|
plotCount += m_storedFlowCharacteristicsPlots.size();
|
2017-03-07 05:19:19 -06:00
|
|
|
return plotCount;
|
2017-02-13 07:49:52 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 07:49:52 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimFlowPlotCollection::addWellAllocPlotToStoredPlots( RimWellAllocationPlot* plot )
|
2017-02-13 07:49:52 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_storedWellAllocPlots.push_back( plot );
|
2017-02-13 07:49:52 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-08-17 05:52:18 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimFlowPlotCollection::addFlowCharacteristicsPlotToStoredPlots( RimFlowCharacteristicsPlot* plot )
|
2017-08-17 05:52:18 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_storedFlowCharacteristicsPlots.push_back( plot );
|
2017-08-17 05:52:18 -05:00
|
|
|
}
|
|
|
|
|
2023-01-18 02:18:00 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellAllocationOverTimePlot* RimFlowPlotCollection::defaultWellAllocOverTimePlot()
|
|
|
|
{
|
|
|
|
if ( !m_defaultWellAllocOverTimePlot() )
|
|
|
|
{
|
|
|
|
m_defaultWellAllocOverTimePlot = new RimWellAllocationOverTimePlot;
|
|
|
|
m_defaultWellAllocOverTimePlot->setDescription( "Default Well Allocation Over Time Plot" );
|
|
|
|
}
|
|
|
|
|
|
|
|
this->updateConnectedEditors();
|
|
|
|
|
|
|
|
return m_defaultWellAllocOverTimePlot();
|
|
|
|
}
|
|
|
|
|
2017-08-17 05:52:18 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-13 07:49:52 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-03-28 16:35:53 -05:00
|
|
|
RimWellAllocationPlot* RimFlowPlotCollection::defaultWellAllocPlot()
|
2017-02-13 07:49:52 -06:00
|
|
|
{
|
2019-11-11 01:34:30 -06:00
|
|
|
if ( !m_defaultWellAllocPlot() )
|
|
|
|
{
|
|
|
|
m_defaultWellAllocPlot = new RimWellAllocationPlot;
|
|
|
|
m_defaultWellAllocPlot->setDescription( "Default Flow Diagnostics Plot" );
|
|
|
|
}
|
|
|
|
|
|
|
|
this->updateConnectedEditors();
|
|
|
|
|
2017-03-28 16:35:53 -05:00
|
|
|
return m_defaultWellAllocPlot();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-28 16:35:53 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimFlowCharacteristicsPlot* RimFlowPlotCollection::defaultFlowCharacteristicsPlot()
|
|
|
|
{
|
2019-11-11 01:34:30 -06:00
|
|
|
if ( !m_flowCharacteristicsPlot() )
|
|
|
|
{
|
|
|
|
m_flowCharacteristicsPlot = new RimFlowCharacteristicsPlot;
|
|
|
|
}
|
|
|
|
|
|
|
|
this->updateConnectedEditors();
|
|
|
|
|
2019-11-08 07:10:32 -06:00
|
|
|
return m_flowCharacteristicsPlot();
|
|
|
|
}
|
|
|
|
|
2020-01-12 09:51:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellDistributionPlotCollection* RimFlowPlotCollection::wellDistributionPlotCollection() const
|
|
|
|
{
|
|
|
|
return m_wellDistributionPlotCollection();
|
|
|
|
}
|
|
|
|
|
2019-11-08 07:10:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-11 01:34:30 -06:00
|
|
|
void RimFlowPlotCollection::ensureDefaultFlowPlotsAreCreated()
|
2019-11-08 07:10:32 -06:00
|
|
|
{
|
|
|
|
if ( !m_defaultWellAllocPlot() )
|
|
|
|
{
|
|
|
|
m_defaultWellAllocPlot = new RimWellAllocationPlot;
|
|
|
|
m_defaultWellAllocPlot->setDescription( "Default Flow Diagnostics Plot" );
|
|
|
|
}
|
2017-03-28 16:35:53 -05:00
|
|
|
|
2023-01-18 02:18:00 -06:00
|
|
|
if ( !m_defaultWellAllocOverTimePlot() )
|
|
|
|
{
|
|
|
|
m_defaultWellAllocOverTimePlot = new RimWellAllocationOverTimePlot;
|
|
|
|
m_defaultWellAllocOverTimePlot->setDescription( "Default Well Allocation Over Time Plot" );
|
|
|
|
}
|
|
|
|
|
2019-11-11 01:34:30 -06:00
|
|
|
if ( !m_flowCharacteristicsPlot() )
|
2019-11-08 07:10:32 -06:00
|
|
|
{
|
2019-11-11 01:34:30 -06:00
|
|
|
m_flowCharacteristicsPlot = new RimFlowCharacteristicsPlot;
|
2019-11-08 07:10:32 -06:00
|
|
|
}
|
2019-12-11 02:38:25 -06:00
|
|
|
|
2019-12-17 02:20:40 -06:00
|
|
|
if ( !m_wellDistributionPlotCollection() )
|
2019-12-11 02:38:25 -06:00
|
|
|
{
|
2019-12-17 02:20:40 -06:00
|
|
|
m_wellDistributionPlotCollection = new RimWellDistributionPlotCollection;
|
2019-12-11 02:38:25 -06:00
|
|
|
}
|
2017-01-24 07:25:31 -06:00
|
|
|
}
|