mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-23 23:13:39 -06:00
#2187 Summary Plot : Add summary plot tool bar for stepping
This commit is contained in:
parent
3f55d4f1f0
commit
f2bd87762c
@ -242,6 +242,14 @@ void RimSummaryCurveCollection::applyPreviousIdentifier()
|
||||
m_sourceStepping->applyPreviousIdentifier();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<caf::PdmFieldHandle*> RimSummaryCurveCollection::fieldsToShowInToolbar()
|
||||
{
|
||||
return m_sourceStepping()->fieldsToShowInToolbar();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
|
||||
void applyNextIdentifier();
|
||||
void applyPreviousIdentifier();
|
||||
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||
|
||||
QString compileAutoPlotTitle() const;
|
||||
|
||||
|
@ -159,6 +159,47 @@ void RimSummaryPlotSourceStepping::applyPreviousIdentifier()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::fieldsToShowInToolbar()
|
||||
{
|
||||
std::vector<caf::PdmFieldHandle*> fields;
|
||||
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
||||
|
||||
RiaSummaryCurveAnalyzer analyzer;
|
||||
analyzer.analyzeCurves(curveCollection);
|
||||
|
||||
if (analyzer.summaryCases().size() == 1)
|
||||
{
|
||||
fields.push_back(&m_summaryCase);
|
||||
}
|
||||
|
||||
if (analyzer.wellNames().size() == 1)
|
||||
{
|
||||
fields.push_back(&m_wellName);
|
||||
}
|
||||
|
||||
if (analyzer.wellGroupNames().size() == 1)
|
||||
{
|
||||
fields.push_back(&m_wellGroupName);
|
||||
}
|
||||
|
||||
if (analyzer.regionNumbers().size() == 1)
|
||||
{
|
||||
fields.push_back(&m_region);
|
||||
}
|
||||
|
||||
if (analyzer.quantities().size() == 1)
|
||||
{
|
||||
fields.push_back(&m_quantity);
|
||||
}
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -41,6 +41,8 @@ public:
|
||||
void applyNextIdentifier();
|
||||
void applyPreviousIdentifier();
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||
|
||||
private:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimViewWindow.h"
|
||||
#include "RimWellAllocationPlot.h"
|
||||
@ -38,6 +39,7 @@
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmUiPropertyView.h"
|
||||
#include "cafPdmUiToolBarEditor.h"
|
||||
#include "cafPdmUiTreeView.h"
|
||||
#include "cafQTreeViewStateSerializer.h"
|
||||
|
||||
@ -308,6 +310,8 @@ void RiuMainPlotWindow::createToolBars()
|
||||
toolbar->addAction(cmdFeatureMgr->action(s));
|
||||
}
|
||||
}
|
||||
|
||||
m_summaryPlotToolBar = new caf::PdmUiToolBarEditor("Summary Plot", this);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -587,6 +591,20 @@ void RiuMainPlotWindow::selectedObjectsChanged()
|
||||
}
|
||||
m_pdmUiPropertyView->showProperties(firstSelectedObject);
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> toolBarFields;
|
||||
if (firstSelectedObject)
|
||||
{
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
firstSelectedObject->firstAncestorOrThisOfType(summaryPlot);
|
||||
if (summaryPlot)
|
||||
{
|
||||
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
||||
}
|
||||
|
||||
}
|
||||
m_summaryPlotToolBar->setFields(toolBarFields);
|
||||
m_summaryPlotToolBar->updateUi();
|
||||
|
||||
if (uiItems.size() == 1)
|
||||
{
|
||||
// Find the reservoir view or the Plot that the selected item is within
|
||||
@ -671,6 +689,20 @@ void RiuMainPlotWindow::restoreTreeViewState()
|
||||
void RiuMainPlotWindow::selectAsCurrentItem(caf::PdmObject* object)
|
||||
{
|
||||
m_projectTreeView->selectAsCurrentItem(object);
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> toolBarFields;
|
||||
|
||||
/*
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
object->firstAncestorOrThisOfType(summaryPlot);
|
||||
if (summaryPlot)
|
||||
{
|
||||
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
||||
}
|
||||
|
||||
m_summaryPlotToolBar->setFields(toolBarFields);
|
||||
m_summaryPlotToolBar->updateUi();
|
||||
*/
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -39,6 +39,7 @@ namespace caf
|
||||
class PdmObject;
|
||||
class PdmUiPropertyView;
|
||||
class PdmUiItem;
|
||||
class PdmUiToolBarEditor;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
@ -121,7 +122,7 @@ private:
|
||||
QMenu* m_windowMenu;
|
||||
|
||||
caf::PdmUiTreeView* m_projectTreeView;
|
||||
|
||||
caf::PdmUiToolBarEditor* m_summaryPlotToolBar;
|
||||
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
||||
|
||||
caf::PdmObject* m_pdmRoot;
|
||||
|
Loading…
Reference in New Issue
Block a user