mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#2051 Curve calc. Edit calculation command
This commit is contained in:
parent
ea87c84d8c
commit
bfa1a1cb67
@ -28,6 +28,7 @@ ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreator.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorSplitterUi.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorDialog.h
|
||||
${CEE_CURRENT_LIST_DIR}RicShowSummaryCurveCalculatorFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicEditSummaryCurveCalculationFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorDialog.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorEditor.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculator.h
|
||||
@ -56,6 +57,7 @@ ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreator.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorSplitterUi.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorDialog.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicShowSummaryCurveCalculatorFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicEditSummaryCurveCalculationFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorDialog.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorEditor.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculator.cpp
|
||||
|
@ -0,0 +1,85 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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 "RicEditSummaryCurveCalculationFeature.h"
|
||||
|
||||
#include "RicSummaryCurveCalculatorDialog.h"
|
||||
#include "RicSummaryCurveCalculator.h"
|
||||
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimCalculatedSummaryCurveReader.h"
|
||||
|
||||
#include "../../FileInterface/RifEclipseSummaryAddress.h"
|
||||
#include "../../ProjectDataModel/RimProject.h"
|
||||
#include "../../Application/RiaApplication.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafSelectionManagerTools.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicEditSummaryCurveCalculationFeature, "RicEditSummaryCurveCalculationFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicEditSummaryCurveCalculationFeature::isCommandEnabled()
|
||||
{
|
||||
std::vector<RimSummaryCurve*> selectedCurves = caf::selectedObjectsByType<RimSummaryCurve*>();
|
||||
return selectedCurves.size() == 1 && selectedCurves.front()->summaryAddress().category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicEditSummaryCurveCalculationFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimSummaryCurve*> selectedCurves = caf::selectedObjectsByType<RimSummaryCurve*>();
|
||||
RimSummaryCalculation* calculation = nullptr;
|
||||
|
||||
if (selectedCurves.size() > 0)
|
||||
{
|
||||
RifEclipseSummaryAddress selectedAddress = selectedCurves.front()->summaryAddress();
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RifCalculatedSummaryCurveReader* reader = dynamic_cast<RifCalculatedSummaryCurveReader*>(proj->calculationCollection->calculationSummaryCase()->summaryReader());
|
||||
calculation = reader != nullptr ? reader->findCalculationByName(selectedAddress) : nullptr;
|
||||
}
|
||||
|
||||
RicSummaryCurveCalculatorDialog dlg(nullptr);
|
||||
|
||||
RicSummaryCurveCalculator* calculator = dlg.calculator();
|
||||
calculator->setCurrentCalculation(calculation);
|
||||
calculator->updateConnectedEditors();
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicEditSummaryCurveCalculationFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Edit Curve Calculation");
|
||||
actionToSetup->setIcon(QIcon(":/calculator.png"));
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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 RimSummaryPlotCollection;
|
||||
class RimSummaryCase;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicEditSummaryCurveCalculationFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
};
|
@ -77,6 +77,14 @@ RimSummaryCalculation* RicSummaryCurveCalculator::currentCalculation() const
|
||||
return m_currentCalculation();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryCurveCalculator::setCurrentCalculation(RimSummaryCalculation* calculation)
|
||||
{
|
||||
m_currentCalculation = calculation;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -1,4 +1,4 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////// /////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
@ -40,7 +40,8 @@ public:
|
||||
static QString calculatedSummariesGroupName();
|
||||
static QString calulationGroupName();
|
||||
|
||||
RimSummaryCalculation* currentCalculation() const;
|
||||
RimSummaryCalculation* currentCalculation() const;
|
||||
void setCurrentCalculation(RimSummaryCalculation* calculation);
|
||||
|
||||
bool parseExpression() const;
|
||||
bool calculate() const;
|
||||
|
@ -17,7 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicSummaryCurveCalculatorDialog.h"
|
||||
|
||||
#include "RicSummaryCurveCalculator.h"
|
||||
#include "RicSummaryCurveCalculatorEditor.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
@ -42,6 +42,14 @@ RicSummaryCurveCalculatorDialog::~RicSummaryCurveCalculatorDialog()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCalculator* RicSummaryCurveCalculatorDialog::calculator() const
|
||||
{
|
||||
return m_summaryCalcEditor->calculator();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <memory>
|
||||
|
||||
class RicSummaryCurveCalculatorEditor;
|
||||
class RicSummaryCurveCalculator;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -33,6 +34,8 @@ public:
|
||||
RicSummaryCurveCalculatorDialog(QWidget* parent);
|
||||
~RicSummaryCurveCalculatorDialog();
|
||||
|
||||
RicSummaryCurveCalculator* calculator() const;
|
||||
|
||||
private:
|
||||
void setUp();
|
||||
|
||||
|
@ -180,6 +180,14 @@ QMinimizePanel* RicSummaryCurveCalculatorEditor::updateGroupBoxWithContent(caf::
|
||||
return groupBox;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCalculator* RicSummaryCurveCalculatorEditor::calculator() const
|
||||
{
|
||||
return m_calculator.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -49,6 +49,8 @@ public:
|
||||
RicSummaryCurveCalculatorEditor();
|
||||
~RicSummaryCurveCalculatorEditor();
|
||||
|
||||
RicSummaryCurveCalculator* calculator() const;
|
||||
|
||||
private:
|
||||
virtual void recursivelyConfigureAndUpdateTopLevelUiItems(const std::vector<caf::PdmUiItem *>& topLevelUiItems,
|
||||
const QString& uiConfigName) override;
|
||||
|
@ -354,6 +354,8 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "RicNewSummaryCurveFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicCopyReferencesToClipboardFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicEditSummaryCurveCalculationFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimSummaryCurveCollection*>(uiItem))
|
||||
{
|
||||
|
@ -28,6 +28,7 @@ ${CEE_CURRENT_LIST_DIR}RimObservedDataCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryObservedDataFile.h
|
||||
${CEE_CURRENT_LIST_DIR}RimObservedEclipseUserData.h
|
||||
${CEE_CURRENT_LIST_DIR}RimCalculatedSummaryCase.h
|
||||
${CEE_CURRENT_LIST_DIR}RimCalculatedSummaryCurveReader.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -54,6 +55,7 @@ ${CEE_CURRENT_LIST_DIR}RimObservedDataCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryObservedDataFile.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimObservedEclipseUserData.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimCalculatedSummaryCase.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimCalculatedSummaryCurveReader.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -24,31 +24,6 @@
|
||||
CAF_PDM_SOURCE_INIT(RimCalculatedSummaryCase,"CalculatedSummaryCase");
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RifCalculatedSummaryCurveReader : public RifSummaryReaderInterface
|
||||
{
|
||||
public:
|
||||
explicit RifCalculatedSummaryCurveReader(RimSummaryCalculationCollection* calculationCollection);
|
||||
|
||||
virtual const std::vector<time_t>& timeSteps(const RifEclipseSummaryAddress& resultAddress) const override;
|
||||
virtual bool values(const RifEclipseSummaryAddress& resultAddress, std::vector<double>* values) const override;
|
||||
virtual std::string unitName(const RifEclipseSummaryAddress& resultAddress) const override;
|
||||
|
||||
void buildMetaData();
|
||||
|
||||
private:
|
||||
RimSummaryCalculation* findCalculationByName(const RifEclipseSummaryAddress& resultAddress) const;
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimSummaryCalculationCollection> m_calculationCollection;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -122,91 +97,3 @@ void RimCalculatedSummaryCase::buildMetaData()
|
||||
|
||||
m_calculatedCurveReader->buildMetaData();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifCalculatedSummaryCurveReader::RifCalculatedSummaryCurveReader(RimSummaryCalculationCollection* calculationCollection)
|
||||
: m_calculationCollection(calculationCollection)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<time_t>& RifCalculatedSummaryCurveReader::timeSteps(const RifEclipseSummaryAddress& resultAddress) const
|
||||
{
|
||||
RimSummaryCalculation* calc = findCalculationByName(resultAddress);
|
||||
if (calc)
|
||||
{
|
||||
return calc->timeSteps();
|
||||
}
|
||||
|
||||
static std::vector<time_t> dummy;
|
||||
|
||||
return dummy;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifCalculatedSummaryCurveReader::values(const RifEclipseSummaryAddress& resultAddress, std::vector<double>* values) const
|
||||
{
|
||||
RimSummaryCalculation* calc = findCalculationByName(resultAddress);
|
||||
if (calc)
|
||||
{
|
||||
*values = calc->values();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RifCalculatedSummaryCurveReader::unitName(const RifEclipseSummaryAddress& resultAddress) const
|
||||
{
|
||||
RimSummaryCalculation* calculation = findCalculationByName(resultAddress);
|
||||
if (calculation != nullptr && !calculation->unitName().isEmpty())
|
||||
{
|
||||
return calculation->unitName().toStdString();
|
||||
}
|
||||
return "Calculated Curve Unit";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifCalculatedSummaryCurveReader::buildMetaData()
|
||||
{
|
||||
m_allResultAddresses.clear();
|
||||
|
||||
for (RimSummaryCalculation* calc : m_calculationCollection->calculations())
|
||||
{
|
||||
m_allResultAddresses.push_back(RifEclipseSummaryAddress::calculatedCurveAddress(calc->description().toStdString()));
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCalculation* RifCalculatedSummaryCurveReader::findCalculationByName(const RifEclipseSummaryAddress& resultAddress) const
|
||||
{
|
||||
if (m_calculationCollection && resultAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED)
|
||||
{
|
||||
QString calculatedName = QString::fromStdString(resultAddress.quantityName());
|
||||
|
||||
for (RimSummaryCalculation* calc : m_calculationCollection->calculations())
|
||||
{
|
||||
if (calc->description() == calculatedName)
|
||||
{
|
||||
return calc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
#include "RimCalculatedSummaryCurveReader.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
@ -0,0 +1,111 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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 "RimCalculatedSummaryCurveReader.h"
|
||||
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifCalculatedSummaryCurveReader::RifCalculatedSummaryCurveReader(RimSummaryCalculationCollection* calculationCollection)
|
||||
: m_calculationCollection(calculationCollection)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<time_t>& RifCalculatedSummaryCurveReader::timeSteps(const RifEclipseSummaryAddress& resultAddress) const
|
||||
{
|
||||
RimSummaryCalculation* calc = findCalculationByName(resultAddress);
|
||||
if (calc)
|
||||
{
|
||||
return calc->timeSteps();
|
||||
}
|
||||
|
||||
static std::vector<time_t> dummy;
|
||||
|
||||
return dummy;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifCalculatedSummaryCurveReader::values(const RifEclipseSummaryAddress& resultAddress, std::vector<double>* values) const
|
||||
{
|
||||
RimSummaryCalculation* calc = findCalculationByName(resultAddress);
|
||||
if (calc)
|
||||
{
|
||||
*values = calc->values();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RifCalculatedSummaryCurveReader::unitName(const RifEclipseSummaryAddress& resultAddress) const
|
||||
{
|
||||
RimSummaryCalculation* calculation = findCalculationByName(resultAddress);
|
||||
if (calculation != nullptr && !calculation->unitName().isEmpty())
|
||||
{
|
||||
return calculation->unitName().toStdString();
|
||||
}
|
||||
return "Calculated Curve Unit";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifCalculatedSummaryCurveReader::buildMetaData()
|
||||
{
|
||||
m_allResultAddresses.clear();
|
||||
|
||||
for (RimSummaryCalculation* calc : m_calculationCollection->calculations())
|
||||
{
|
||||
m_allResultAddresses.push_back(RifEclipseSummaryAddress::calculatedCurveAddress(calc->description().toStdString()));
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCalculation* RifCalculatedSummaryCurveReader::findCalculationByName(const RifEclipseSummaryAddress& resultAddress) const
|
||||
{
|
||||
if (m_calculationCollection && resultAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED)
|
||||
{
|
||||
QString calculatedName = QString::fromStdString(resultAddress.quantityName());
|
||||
|
||||
for (RimSummaryCalculation* calc : m_calculationCollection->calculations())
|
||||
{
|
||||
if (calc->description() == calculatedName)
|
||||
{
|
||||
return calc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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 "RimSummaryCase.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class RifCalculatedSummaryCurveReader;
|
||||
class RimSummaryCalculation;
|
||||
class RimSummaryCalculationCollection;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RifCalculatedSummaryCurveReader : public RifSummaryReaderInterface
|
||||
{
|
||||
public:
|
||||
explicit RifCalculatedSummaryCurveReader(RimSummaryCalculationCollection* calculationCollection);
|
||||
|
||||
virtual const std::vector<time_t>& timeSteps(const RifEclipseSummaryAddress& resultAddress) const override;
|
||||
virtual bool values(const RifEclipseSummaryAddress& resultAddress, std::vector<double>* values) const override;
|
||||
virtual std::string unitName(const RifEclipseSummaryAddress& resultAddress) const override;
|
||||
|
||||
void buildMetaData();
|
||||
|
||||
RimSummaryCalculation* findCalculationByName(const RifEclipseSummaryAddress& resultAddress) const;
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimSummaryCalculationCollection> m_calculationCollection;
|
||||
};
|
@ -68,7 +68,8 @@ void RiuCalculationsContextMenuManager::slotCreateCalculationCopy()
|
||||
if (m_widget != nullptr && currCalculation != nullptr)
|
||||
{
|
||||
RimSummaryCalculationCollection* coll = RicSummaryCurveCalculator::calculationCollection();
|
||||
coll->addCalculationCopy(currCalculation);
|
||||
RimSummaryCalculation* calcCopy = coll->addCalculationCopy(currCalculation);
|
||||
m_curveCalc->setCurrentCalculation(calcCopy);
|
||||
m_curveCalc->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user