mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2089 Cross Plot : Add New and Edit cross plot features
This commit is contained in:
parent
7104064937
commit
baa9a47b92
@ -7,6 +7,7 @@ endif()
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSummaryPlotFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSummaryCrossPlotFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSummaryCurveFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSummaryCurveFilterFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicPasteAsciiDataToSummaryPlotFeature.h
|
||||
@ -22,6 +23,7 @@ ${CEE_CURRENT_LIST_DIR}RicSelectSummaryPlotUI.h
|
||||
${CEE_CURRENT_LIST_DIR}RicPasteTimeHistoryCurveFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicPasteAsciiDataCurveFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicEditSummaryPlotFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicEditSummaryCrossPlotFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreator.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorSplitterUi.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorDialog.h
|
||||
@ -33,6 +35,7 @@ ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculator.h
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSummaryPlotFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSummaryCrossPlotFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSummaryCurveFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSummaryCurveFilterFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicPasteAsciiDataToSummaryPlotFeature.cpp
|
||||
@ -48,6 +51,7 @@ ${CEE_CURRENT_LIST_DIR}RicSelectSummaryPlotUI.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicPasteTimeHistoryCurveFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicPasteAsciiDataCurveFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicEditSummaryPlotFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicEditSummaryCrossPlotFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreator.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorSplitterUi.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorDialog.cpp
|
||||
|
@ -0,0 +1,128 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicEditSummaryCrossPlotFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RicSummaryCurveCreator.h"
|
||||
#include "RicSummaryCurveCreatorDialog.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicEditSummaryCrossPlotFeature, "RicEditSummaryCrossPlotFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicEditSummaryCrossPlotFeature::RicEditSummaryCrossPlotFeature()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicEditSummaryCrossPlotFeature::closeDialogAndResetTargetPlot()
|
||||
{
|
||||
auto dialog = RicEditSummaryCrossPlotFeature::curveCreatorDialog();
|
||||
|
||||
if (dialog && dialog->isVisible())
|
||||
{
|
||||
dialog->hide();
|
||||
}
|
||||
|
||||
dialog->updateFromSummaryPlot(nullptr);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreatorDialog* RicEditSummaryCrossPlotFeature::curveCreatorDialog()
|
||||
{
|
||||
static RicSummaryCurveCreatorDialog* singletonDialog = new RicSummaryCurveCreatorDialog(nullptr);
|
||||
|
||||
return singletonDialog;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicEditSummaryCrossPlotFeature::isCommandEnabled()
|
||||
{
|
||||
if (selectedSummaryPlot()) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicEditSummaryCrossPlotFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
CVF_ASSERT(project);
|
||||
|
||||
auto dialog = RicEditSummaryCrossPlotFeature::curveCreatorDialog();
|
||||
|
||||
if (!dialog->isVisible())
|
||||
{
|
||||
dialog->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog->raise();
|
||||
}
|
||||
|
||||
// Set target plot
|
||||
if (selectedSummaryPlot())
|
||||
{
|
||||
//dialog->updateFromSummaryPlot(selectedSummaryPlot());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicEditSummaryCrossPlotFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Edit Summary Plot");
|
||||
actionToSetup->setIcon(QIcon(":/SummaryPlot16x16.png"));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RicEditSummaryCrossPlotFeature::selectedSummaryPlot() const
|
||||
{
|
||||
RimSummaryPlot* sumPlot = nullptr;
|
||||
|
||||
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>(caf::SelectionManager::instance()->selectedItem());
|
||||
if (selObj)
|
||||
{
|
||||
selObj->firstAncestorOrThisOfType(sumPlot);
|
||||
}
|
||||
|
||||
return sumPlot;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryPlot;
|
||||
class RicSummaryCurveCreatorDialog;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicEditSummaryCrossPlotFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
RicEditSummaryCrossPlotFeature();
|
||||
|
||||
public:
|
||||
void closeDialogAndResetTargetPlot();
|
||||
|
||||
static RicSummaryCurveCreatorDialog* curveCreatorDialog();
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled();
|
||||
virtual void onActionTriggered( bool isChecked );
|
||||
virtual void setupActionLook(QAction* actionToSetup);
|
||||
|
||||
|
||||
private:
|
||||
RimSummaryPlot* selectedSummaryPlot() const;
|
||||
};
|
@ -0,0 +1,84 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicNewSummaryCrossPlotFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RicEditSummaryPlotFeature.h"
|
||||
#include "RicSummaryCurveCreator.h"
|
||||
#include "RicSummaryCurveCreatorDialog.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryCurveFilter.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuMainPlotWindow.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewSummaryCrossPlotFeature, "RicNewSummaryCrossPlotFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewSummaryCrossPlotFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSummaryCrossPlotFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
CVF_ASSERT(project);
|
||||
|
||||
RimSummaryCrossPlotCollection* summaryCrossPlotColl = project->mainPlotCollection()->summaryCrossPlotCollection();
|
||||
RimSummaryPlot* summaryPlot = summaryCrossPlotColl->addSummaryPlot();
|
||||
|
||||
if (summaryPlot)
|
||||
{
|
||||
summaryCrossPlotColl->updateConnectedEditors();
|
||||
summaryPlot->loadDataAndUpdate();
|
||||
|
||||
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
||||
if (mainPlotWindow)
|
||||
{
|
||||
mainPlotWindow->selectAsCurrentItem(summaryPlot);
|
||||
mainPlotWindow->setExpanded(summaryPlot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSummaryCrossPlotFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("New Summary Cross Plot");
|
||||
actionToSetup->setIcon(QIcon(":/SummaryPlot16x16.png"));
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryCrossPlotCollection;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryPlot;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewSummaryCrossPlotFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
private:
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
};
|
@ -51,6 +51,7 @@
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryCurveFilter.h"
|
||||
@ -299,6 +300,10 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicShowSummaryCurveCalculatorFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimSummaryCrossPlotCollection*>(uiItem))
|
||||
{
|
||||
commandIds << "RicNewSummaryCrossPlotFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimWellLogPlot*>(uiItem))
|
||||
{
|
||||
commandIds << "RicPasteWellLogPlotFeature";
|
||||
|
@ -30,8 +30,8 @@ RimSummaryCrossPlotCollection::RimSummaryCrossPlotCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("Summary Cross Plots", ":/SummaryPlots16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&summaryCrossPlots, "SummaryCrossPlots", "Summary Cross Plots", "", "", "");
|
||||
summaryCrossPlots.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_summaryCrossPlots, "SummaryCrossPlots", "Summary Cross Plots", "", "", "");
|
||||
m_summaryCrossPlots.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -46,7 +46,7 @@ RimSummaryCrossPlotCollection::~RimSummaryCrossPlotCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCrossPlotCollection::deleteAllChildObjects()
|
||||
{
|
||||
summaryCrossPlots.deleteAllChildObjects();
|
||||
m_summaryCrossPlots.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -54,7 +54,7 @@ void RimSummaryCrossPlotCollection::deleteAllChildObjects()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryPlot*> RimSummaryCrossPlotCollection::summaryPlots() const
|
||||
{
|
||||
return summaryCrossPlots.childObjects();
|
||||
return m_summaryCrossPlots.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -62,7 +62,7 @@ std::vector<RimSummaryPlot*> RimSummaryCrossPlotCollection::summaryPlots() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCrossPlotCollection::updateSummaryNameHasChanged()
|
||||
{
|
||||
for (RimSummaryPlot* plot : summaryCrossPlots)
|
||||
for (RimSummaryPlot* plot : m_summaryCrossPlots)
|
||||
{
|
||||
plot->updateCaseNameHasChanged();
|
||||
}
|
||||
@ -73,7 +73,7 @@ void RimSummaryCrossPlotCollection::updateSummaryNameHasChanged()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCrossPlotCollection::summaryPlotItemInfos(QList<caf::PdmOptionItemInfo>* optionInfos) const
|
||||
{
|
||||
for (RimSummaryPlot* plot : summaryCrossPlots())
|
||||
for (RimSummaryPlot* plot : m_summaryCrossPlots())
|
||||
{
|
||||
QIcon icon = plot->uiCapability()->uiIcon();
|
||||
QString displayName = plot->description();
|
||||
@ -82,3 +82,16 @@ void RimSummaryCrossPlotCollection::summaryPlotItemInfos(QList<caf::PdmOptionIte
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RimSummaryCrossPlotCollection::addSummaryPlot()
|
||||
{
|
||||
RimSummaryPlot* plot = new RimSummaryPlot();
|
||||
m_summaryCrossPlots().push_back(plot);
|
||||
|
||||
plot->setDescription(QString("Summary Cross Plot %1").arg(m_summaryCrossPlots.size()));
|
||||
|
||||
return plot;
|
||||
}
|
||||
|
||||
|
@ -37,10 +37,12 @@ public:
|
||||
void deleteAllChildObjects();
|
||||
|
||||
std::vector<RimSummaryPlot*> summaryPlots() const;
|
||||
RimSummaryPlot* addSummaryPlot();
|
||||
|
||||
void updateSummaryNameHasChanged();
|
||||
void summaryPlotItemInfos(QList<caf::PdmOptionItemInfo>* optionInfos) const;
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimSummaryPlot*> summaryCrossPlots;
|
||||
caf::PdmChildArrayField<RimSummaryPlot*> m_summaryCrossPlots;
|
||||
public:
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user