#1787 Making test feature to be able to run the calculator

This commit is contained in:
astridkbjorke 2017-08-30 08:54:59 +02:00
parent 55ca85625f
commit 3112c10ec1
4 changed files with 117 additions and 0 deletions

View File

@ -15,6 +15,7 @@ ${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeatureImpl.h
${CEE_CURRENT_LIST_DIR}RicPlotProductionRateFeature.h
${CEE_CURRENT_LIST_DIR}RicSelectViewUI.h
${CEE_CURRENT_LIST_DIR}RicShowTotalAllocationDataFeature.h
${CEE_CURRENT_LIST_DIR}RicCalculateNumberOfFloodedPoreVolumes.h
)
set (SOURCE_GROUP_SOURCE_FILES
@ -28,6 +29,7 @@ ${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeatureImpl.cpp
${CEE_CURRENT_LIST_DIR}RicPlotProductionRateFeature.cpp
${CEE_CURRENT_LIST_DIR}RicSelectViewUI.cpp
${CEE_CURRENT_LIST_DIR}RicShowTotalAllocationDataFeature.cpp
${CEE_CURRENT_LIST_DIR}RicCalculateNumberOfFloodedPoreVolumes.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -0,0 +1,76 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RicCalculateNumberOfFloodedPoreVolumes.h"
#include "RiaApplication.h"
#include "RimEclipseCase.h"
#include "RimEclipseResultCase.h"
#include "RimEclipseWell.h"
#include "RimFlowPlotCollection.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
#include "RimView.h"
#include "RimWellAllocationPlot.h"
#include "RiuMainPlotWindow.h"
#include "cafSelectionManager.h"
#include <QAction>
#include "RigMainGrid.h"
#include "RigEclipseCaseData.h"
#include "RigNumberOfFloodedPoreVolumesCalculator.h"
CAF_CMD_SOURCE_INIT(RicCalculateNumberOfFloodedPoreVolumes, "RicCalculateNumberOfFloodedPoreVolumes");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCalculateNumberOfFloodedPoreVolumes::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCalculateNumberOfFloodedPoreVolumes::onActionTriggered(bool isChecked)
{
RimView* view = RiaApplication::instance()->activeReservoirView();
RimEclipseCase* caseToApply;
view->firstAncestorOrThisOfType(caseToApply);
RigMainGrid* mainGrid = caseToApply->eclipseCaseData()->mainGrid();
std::vector<std::string> tracerNames;
tracerNames.push_back("SOIL");
RigNumberOfFloodedPoreVolumesCalculator calc(mainGrid, caseToApply, tracerNames);
std::vector<std::vector<double>> numberOfFloodedPorevolumes = calc.numberOfFloodedPorevolumes();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCalculateNumberOfFloodedPoreVolumes::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("TEST Calculate Number of Flooded Pore Volumes");
}

View File

@ -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 RicCalculateNumberOfFloodedPoreVolumes : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled() override;
virtual void onActionTriggered( bool isChecked ) override;
virtual void setupActionLook( QAction* actionToSetup ) override;
};

View File

@ -108,6 +108,7 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
commandIds << "RicImportInputEclipseCaseFeature";
commandIds << "RicCreateGridCaseGroupFeature";
commandIds << "RicEclipseCaseNewGroupFeature";
commandIds << "RicCalculateNumberOfFloodedPoreVolumes";
}
else if (dynamic_cast<RimGeoMechView*>(uiItem))
{