mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #5021 from OPM/improve-default-flow-diag-plots
#5020 Flow Diag : Improve default initialization of plots
This commit is contained in:
@@ -144,14 +144,6 @@ void RimFlowPlotCollection::addFlowCharacteristicsPlotToStoredPlots( RimFlowChar
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimWellAllocationPlot* RimFlowPlotCollection::defaultWellAllocPlot()
|
RimWellAllocationPlot* RimFlowPlotCollection::defaultWellAllocPlot()
|
||||||
{
|
{
|
||||||
if ( !m_defaultWellAllocPlot() )
|
|
||||||
{
|
|
||||||
m_defaultWellAllocPlot = new RimWellAllocationPlot;
|
|
||||||
m_defaultWellAllocPlot->setDescription( "Default Flow Diagnostics Plot" );
|
|
||||||
}
|
|
||||||
|
|
||||||
this->updateConnectedEditors();
|
|
||||||
|
|
||||||
return m_defaultWellAllocPlot();
|
return m_defaultWellAllocPlot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,12 +152,32 @@ RimWellAllocationPlot* RimFlowPlotCollection::defaultWellAllocPlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimFlowCharacteristicsPlot* RimFlowPlotCollection::defaultFlowCharacteristicsPlot()
|
RimFlowCharacteristicsPlot* RimFlowPlotCollection::defaultFlowCharacteristicsPlot()
|
||||||
{
|
{
|
||||||
|
return m_flowCharacteristicsPlot();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimFlowPlotCollection::ensureDefaultPlotsAreCreated()
|
||||||
|
{
|
||||||
|
bool isUpdateRequired = false;
|
||||||
|
|
||||||
if ( !m_flowCharacteristicsPlot() )
|
if ( !m_flowCharacteristicsPlot() )
|
||||||
{
|
{
|
||||||
m_flowCharacteristicsPlot = new RimFlowCharacteristicsPlot;
|
m_flowCharacteristicsPlot = new RimFlowCharacteristicsPlot;
|
||||||
|
isUpdateRequired = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !m_defaultWellAllocPlot() )
|
||||||
|
{
|
||||||
|
m_defaultWellAllocPlot = new RimWellAllocationPlot;
|
||||||
|
m_defaultWellAllocPlot->setDescription( "Default Flow Diagnostics Plot" );
|
||||||
|
|
||||||
|
isUpdateRequired = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isUpdateRequired )
|
||||||
|
{
|
||||||
this->updateConnectedEditors();
|
this->updateConnectedEditors();
|
||||||
|
}
|
||||||
return m_flowCharacteristicsPlot();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ public:
|
|||||||
RimWellAllocationPlot* defaultWellAllocPlot();
|
RimWellAllocationPlot* defaultWellAllocPlot();
|
||||||
RimFlowCharacteristicsPlot* defaultFlowCharacteristicsPlot();
|
RimFlowCharacteristicsPlot* defaultFlowCharacteristicsPlot();
|
||||||
|
|
||||||
|
void ensureDefaultPlotsAreCreated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmChildField<RimFlowCharacteristicsPlot*> m_flowCharacteristicsPlot;
|
caf::PdmChildField<RimFlowCharacteristicsPlot*> m_flowCharacteristicsPlot;
|
||||||
caf::PdmChildField<RimWellAllocationPlot*> m_defaultWellAllocPlot;
|
caf::PdmChildField<RimWellAllocationPlot*> m_defaultWellAllocPlot;
|
||||||
|
|||||||
@@ -127,6 +127,8 @@ RimWellAllocationPlot::RimWellAllocationPlot()
|
|||||||
{RimWellLogPlot::CONNECTION_NUMBER, RimWellLogPlot::TRUE_VERTICAL_DEPTH, RimWellLogPlot::PSEUDO_LENGTH} );
|
{RimWellLogPlot::CONNECTION_NUMBER, RimWellLogPlot::TRUE_VERTICAL_DEPTH, RimWellLogPlot::PSEUDO_LENGTH} );
|
||||||
|
|
||||||
m_accumulatedWellFlowPlot->setCommonDataSourceEnabled( false );
|
m_accumulatedWellFlowPlot->setCommonDataSourceEnabled( false );
|
||||||
|
|
||||||
|
m_showWindow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -168,6 +170,8 @@ void RimWellAllocationPlot::setFromSimulationWell( RimSimWellInView* simWell )
|
|||||||
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
|
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_showWindow = true;
|
||||||
|
|
||||||
onLoadDataAndUpdate();
|
onLoadDataAndUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -647,6 +651,11 @@ QList<caf::PdmOptionItemInfo>
|
|||||||
{
|
{
|
||||||
options.push_back( caf::PdmOptionItemInfo( timeStepNames[i], i ) );
|
options.push_back( caf::PdmOptionItemInfo( timeStepNames[i], i ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( options.size() == 0 )
|
||||||
|
{
|
||||||
|
options.push_front( caf::PdmOptionItemInfo( "None", -1 ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( fieldNeedingOptions == &m_case )
|
else if ( fieldNeedingOptions == &m_case )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -299,3 +299,11 @@ void RimMainPlotCollection::deleteAllCachedData()
|
|||||||
m_rftPlotCollection()->deleteAllExtractors();
|
m_rftPlotCollection()->deleteAllExtractors();
|
||||||
m_pltPlotCollection()->deleteAllExtractors();
|
m_pltPlotCollection()->deleteAllExtractors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimMainPlotCollection::ensureDefaultFlowPlotsAreCreated()
|
||||||
|
{
|
||||||
|
m_flowPlotCollection()->ensureDefaultPlotsAreCreated();
|
||||||
|
}
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ public:
|
|||||||
void updatePlotsWithCompletions();
|
void updatePlotsWithCompletions();
|
||||||
void deleteAllCachedData();
|
void deleteAllCachedData();
|
||||||
|
|
||||||
|
void ensureDefaultFlowPlotsAreCreated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Overridden PDM methods
|
// Overridden PDM methods
|
||||||
caf::PdmFieldHandle* objectToggleField() override;
|
caf::PdmFieldHandle* objectToggleField() override;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include "RiaSummaryTools.h"
|
#include "RiaSummaryTools.h"
|
||||||
|
|
||||||
#include "RimEnsembleCurveSetCollection.h"
|
#include "RimEnsembleCurveSetCollection.h"
|
||||||
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSummaryCaseMainCollection.h"
|
#include "RimSummaryCaseMainCollection.h"
|
||||||
#include "RimSummaryCurveCollection.h"
|
#include "RimSummaryCurveCollection.h"
|
||||||
@@ -98,7 +99,8 @@ QString RiuPlotMainWindow::mainWindowName()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
|
void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
|
||||||
{
|
{
|
||||||
setPdmRoot( RiaApplication::instance()->project() );
|
auto project = RiaApplication::instance()->project();
|
||||||
|
setPdmRoot( project );
|
||||||
restoreTreeViewState();
|
restoreTreeViewState();
|
||||||
|
|
||||||
if ( m_pdmUiPropertyView && m_pdmUiPropertyView->currentObject() )
|
if ( m_pdmUiPropertyView && m_pdmUiPropertyView->currentObject() )
|
||||||
@@ -140,6 +142,11 @@ void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
|
|||||||
}
|
}
|
||||||
|
|
||||||
refreshToolbars();
|
refreshToolbars();
|
||||||
|
|
||||||
|
if ( project && project->mainPlotCollection() )
|
||||||
|
{
|
||||||
|
project->mainPlotCollection()->ensureDefaultFlowPlotsAreCreated();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user