#1772 Add command to store flow characteristics plots

This commit is contained in:
Bjørnar Grip Fjær
2017-08-17 12:52:18 +02:00
parent 65ce0d3788
commit 189378a1b0
8 changed files with 169 additions and 3 deletions

View File

@@ -64,16 +64,17 @@ public:
virtual void zoomAll() override;
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
virtual void deleteViewWidget() override;
virtual void loadDataAndUpdate() override;
enum TimeSelectionType
{
ALL_AVAILABLE,
SELECT_AVAILABLE
};
protected:
// RimViewWindow overrides
virtual void loadDataAndUpdate() override;
virtual QImage snapshotWindowContent() override;
// Overridden PDM methods

View File

@@ -40,7 +40,8 @@ RimFlowPlotCollection::RimFlowPlotCollection()
CAF_PDM_InitFieldNoDefault(&m_defaultWellAllocPlot, "DefaultWellAllocationPlot", "", "", "", "");
m_defaultWellAllocPlot.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_storedWellAllocPlots, "StoredWellAllocationPlots", "Stored Plots", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_storedWellAllocPlots, "StoredWellAllocationPlots", "Stored Well Allocation Plots", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_storedFlowCharacteristicsPlots, "StoredFlowCharacteristicsPlots", "Stored Flow Characteristics Plots", "", "", "");
}
//--------------------------------------------------------------------------------------------------
@@ -67,6 +68,7 @@ void RimFlowPlotCollection::closeDefaultPlotWindowAndDeletePlots()
delete m_flowCharacteristicsPlot;
m_storedWellAllocPlots.deleteAllChildObjects();
m_storedFlowCharacteristicsPlots.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
@@ -74,7 +76,7 @@ void RimFlowPlotCollection::closeDefaultPlotWindowAndDeletePlots()
//--------------------------------------------------------------------------------------------------
void RimFlowPlotCollection::loadDataAndUpdate()
{
caf::ProgressInfo plotProgress(m_storedWellAllocPlots.size() + 1, "");
caf::ProgressInfo plotProgress(m_storedWellAllocPlots.size() + m_storedFlowCharacteristicsPlots.size() + 1, "");
if (m_defaultWellAllocPlot) m_defaultWellAllocPlot->loadDataAndUpdate();
plotProgress.incrementProgress();
@@ -84,6 +86,12 @@ void RimFlowPlotCollection::loadDataAndUpdate()
p->loadDataAndUpdate();
plotProgress.incrementProgress();
}
for (RimFlowCharacteristicsPlot* p : m_storedFlowCharacteristicsPlots)
{
p->loadDataAndUpdate();
plotProgress.incrementProgress();
}
}
//--------------------------------------------------------------------------------------------------
@@ -94,6 +102,7 @@ size_t RimFlowPlotCollection::plotCount() const
size_t plotCount = 0;
if (m_defaultWellAllocPlot) plotCount = 1;
plotCount += m_storedWellAllocPlots.size();
plotCount += m_storedFlowCharacteristicsPlots.size();
return plotCount;
}
@@ -105,6 +114,14 @@ void RimFlowPlotCollection::addWellAllocPlotToStoredPlots(RimWellAllocationPlot*
m_storedWellAllocPlots.push_back(plot);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFlowPlotCollection::addFlowCharacteristicsPlotToStoredPlots(RimFlowCharacteristicsPlot* plot)
{
m_storedFlowCharacteristicsPlots.push_back(plot);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -41,6 +41,7 @@ public:
size_t plotCount() const;
void addWellAllocPlotToStoredPlots(RimWellAllocationPlot* plot);
void addFlowCharacteristicsPlotToStoredPlots(RimFlowCharacteristicsPlot* plot);
RimWellAllocationPlot* defaultWellAllocPlot();
RimFlowCharacteristicsPlot* defaultFlowCharacteristicsPlot();
@@ -48,4 +49,5 @@ private:
caf::PdmChildField<RimFlowCharacteristicsPlot*> m_flowCharacteristicsPlot;
caf::PdmChildField<RimWellAllocationPlot*> m_defaultWellAllocPlot;
caf::PdmChildArrayField<RimWellAllocationPlot*> m_storedWellAllocPlots;
caf::PdmChildArrayField<RimFlowCharacteristicsPlot*> m_storedFlowCharacteristicsPlots;
};