mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 07:26:03 -06:00
Merged in changes from maintenance branch
This commit is contained in:
commit
4bfef4ead0
@ -1178,6 +1178,9 @@ bool RiaApplication::parseArguments()
|
||||
QString gridListFile = cvfqt::Utils::toQString(o.safeValue(0));
|
||||
std::vector<QString> gridFiles = readFileListFromTextFile(gridListFile);
|
||||
runMultiCaseSnapshots(projectFileName, gridFiles, "multiCaseSnapshots");
|
||||
|
||||
closeProject(false);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1262,6 +1265,8 @@ bool RiaApplication::parseArguments()
|
||||
saveSnapshotForAllViews("snapshots");
|
||||
|
||||
mainWnd->loadWinGeoAndDockToolBarLayout();
|
||||
|
||||
closeProject(false);
|
||||
}
|
||||
|
||||
// Returning false will exit the application
|
||||
|
@ -12,6 +12,7 @@ ${CEE_CURRENT_LIST_DIR}RicExecuteScriptFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExecuteScriptForCasesFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewScriptFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicScriptFeatureImpl.h
|
||||
${CEE_CURRENT_LIST_DIR}RicRefreshScriptsFeature.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -22,6 +23,7 @@ ${CEE_CURRENT_LIST_DIR}RicExecuteScriptFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExecuteScriptForCasesFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewScriptFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicScriptFeatureImpl.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicRefreshScriptsFeature.cpp
|
||||
)
|
||||
|
||||
set (QT_MOC_HEADERS
|
||||
|
@ -19,11 +19,13 @@
|
||||
|
||||
#include "RicAddScriptPathFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RicRefreshScriptsFeature.h"
|
||||
#include "RicScriptFeatureImpl.h"
|
||||
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
@ -62,6 +64,8 @@ void RicAddScriptPathFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
RiaApplication::instance()->preferences()->scriptDirectories = filePathString;
|
||||
RiaApplication::instance()->applyPreferences();
|
||||
|
||||
RicRefreshScriptsFeature::refreshScriptFolders();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,13 @@
|
||||
|
||||
#include "RicDeleteScriptPathFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RicRefreshScriptsFeature.h"
|
||||
#include "RicScriptFeatureImpl.h"
|
||||
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
@ -69,6 +71,8 @@ void RicDeleteScriptPathFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
RiaApplication::instance()->preferences()->scriptDirectories = filePathString;
|
||||
RiaApplication::instance()->applyPreferences();
|
||||
|
||||
RicRefreshScriptsFeature::refreshScriptFolders();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,16 +19,20 @@
|
||||
|
||||
#include "RicNewScriptFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RicRefreshScriptsFeature.h"
|
||||
#include "RicScriptFeatureImpl.h"
|
||||
|
||||
#include "RimCalcScript.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QFileInfo>
|
||||
#include <QInputDialog>
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewScriptFeature, "RicNewScriptFeature");
|
||||
@ -38,8 +42,7 @@ CAF_CMD_SOURCE_INIT(RicNewScriptFeature, "RicNewScriptFeature");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewScriptFeature::isCommandEnabled()
|
||||
{
|
||||
std::vector<RimCalcScript*> selection = RicScriptFeatureImpl::selectedScripts();
|
||||
return selection.size() > 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -55,7 +58,7 @@ void RicNewScriptFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
QString fullPathNewScript;
|
||||
|
||||
if (calcScript )
|
||||
if (calcScript)
|
||||
{
|
||||
QFileInfo existingScriptFileInfo(calcScript->absolutePath());
|
||||
fullPathNewScript = existingScriptFileInfo.absolutePath();
|
||||
@ -79,6 +82,26 @@ void RicNewScriptFeature::onActionTriggered(bool isChecked)
|
||||
num++;
|
||||
}
|
||||
|
||||
bool ok;
|
||||
fullPathFilenameNewScript = QInputDialog::getText(NULL, "Specify new script file", "File name", QLineEdit::Normal, fullPathFilenameNewScript, &ok);
|
||||
|
||||
if (ok && !fullPathFilenameNewScript.isEmpty())
|
||||
{
|
||||
QFile file(fullPathFilenameNewScript);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
{
|
||||
QMessageBox::warning(RiuMainWindow::instance(), "Script editor", "Failed to create file\n" + fullPathFilenameNewScript);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
RicRefreshScriptsFeature::refreshScriptFolders();
|
||||
|
||||
if (calcScript)
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(calcScript);
|
||||
}
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QString scriptEditor = app->scriptEditorPath();
|
||||
if (!scriptEditor.isEmpty())
|
||||
@ -94,6 +117,7 @@ void RicNewScriptFeature::onActionTriggered(bool isChecked)
|
||||
QMessageBox::warning(RiuMainWindow::instance(), "Script editor", "Failed to start script editor executable\n" + scriptEditor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RicRefreshScriptsFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicRefreshScriptsFeature, "RicRefreshScriptsFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicRefreshScriptsFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRefreshScriptsFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
refreshScriptFolders();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRefreshScriptsFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Refresh");
|
||||
actionToSetup->setIcon(QIcon(":/Refresh-32.png"));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRefreshScriptsFeature::refreshScriptFolders()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
|
||||
proj->setScriptDirectories(prefs->scriptDirectories());
|
||||
proj->updateConnectedEditors();
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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"
|
||||
|
||||
#include <vector>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicRefreshScriptsFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
static void refreshScriptFolders();
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled();
|
||||
virtual void onActionTriggered( bool isChecked );
|
||||
virtual void setupActionLook( QAction* actionToSetup );
|
||||
};
|
||||
|
||||
|
@ -67,11 +67,15 @@ void RicCloseCaseFeature::onActionTriggered(bool isChecked)
|
||||
if (userConfirmedGridCaseGroupChange(casesToBeDeleted))
|
||||
{
|
||||
deleteEclipseCase(eclipseCase);
|
||||
|
||||
RiuMainWindow::instance()->cleanupGuiCaseClose();
|
||||
}
|
||||
}
|
||||
else if (geoMechCase)
|
||||
{
|
||||
deleteGeoMechCase(geoMechCase);
|
||||
|
||||
RiuMainWindow::instance()->cleanupGuiCaseClose();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,59 @@ RifEclipseOutputFileTools::~RifEclipseOutputFileTools()
|
||||
{
|
||||
}
|
||||
|
||||
struct KeywordItemCounter
|
||||
{
|
||||
KeywordItemCounter(std::string keyword, size_t aggregatedItemCount)
|
||||
: m_keyword(keyword),
|
||||
m_aggregatedItemCount(aggregatedItemCount),
|
||||
m_reportStepCount(1)
|
||||
{}
|
||||
|
||||
bool operator==(const std::string& rhs) const
|
||||
{
|
||||
return this->m_keyword == rhs;
|
||||
}
|
||||
|
||||
|
||||
std::string m_keyword;
|
||||
size_t m_aggregatedItemCount;
|
||||
size_t m_reportStepCount;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseOutputFileTools::findKeywordsAndItemCount(std::vector<ecl_file_type*> ecl_files, QStringList* resultNames, std::vector<size_t>* resultDataItemCounts)
|
||||
{
|
||||
std::vector<RifRestartReportStep> reportSteps;
|
||||
RifEclipseOutputFileTools::createReportStepsMetaData(ecl_files, &reportSteps);
|
||||
|
||||
std::vector<KeywordItemCounter> foundKeywords;
|
||||
|
||||
for (auto reportStep : reportSteps)
|
||||
{
|
||||
for (auto keywordItemCount : reportStep.m_keywords.keywordsWithAggregatedItemCount())
|
||||
{
|
||||
auto it = std::find(foundKeywords.begin(), foundKeywords.end(), keywordItemCount.first);
|
||||
if (it == foundKeywords.end())
|
||||
{
|
||||
foundKeywords.push_back(KeywordItemCounter(keywordItemCount.first, keywordItemCount.second));
|
||||
}
|
||||
else
|
||||
{
|
||||
it->m_aggregatedItemCount += keywordItemCount.second;
|
||||
it->m_reportStepCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (auto stdKeyword : foundKeywords)
|
||||
{
|
||||
resultNames->push_back(QString::fromStdString(stdKeyword.m_keyword));
|
||||
resultDataItemCounts->push_back(stdKeyword.m_aggregatedItemCount);
|
||||
}
|
||||
}
|
||||
|
||||
void getDayMonthYear(const ecl_kw_type* intehead_kw, int* day, int* month, int* year)
|
||||
{
|
||||
assert(day && month && year);
|
||||
@ -230,45 +283,6 @@ bool RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(const QString&
|
||||
return baseNameFiles->count() > 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseOutputFileTools::findKeywordsAndDataItemCounts(ecl_file_type* ecl_file, QStringList* keywords, std::vector<size_t>* keywordDataItemCounts)
|
||||
{
|
||||
if (!ecl_file || !keywords || !keywordDataItemCounts) return;
|
||||
|
||||
int numKeywords = ecl_file_get_num_distinct_kw(ecl_file);
|
||||
|
||||
caf::ProgressInfo info(numKeywords, "Reading Keywords on file");
|
||||
|
||||
for (int i = 0; i < numKeywords; i++)
|
||||
{
|
||||
const char* kw = ecl_file_iget_distinct_kw(ecl_file , i);
|
||||
int numKeywordOccurrences = ecl_file_get_num_named_kw(ecl_file, kw);
|
||||
bool validData = true;
|
||||
size_t fileResultValueCount = 0;
|
||||
for (int j = 0; j < numKeywordOccurrences; j++)
|
||||
{
|
||||
fileResultValueCount += ecl_file_iget_named_size(ecl_file, kw, j);
|
||||
|
||||
ecl_type_enum dataType = ecl_file_iget_named_type(ecl_file, kw, j);
|
||||
if (dataType != ECL_DOUBLE_TYPE && dataType != ECL_FLOAT_TYPE && dataType != ECL_INT_TYPE )
|
||||
{
|
||||
validData = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (validData)
|
||||
{
|
||||
keywords->append(QString(kw));
|
||||
keywordDataItemCounts->push_back(fileResultValueCount);
|
||||
}
|
||||
|
||||
info.setProgress(i);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -321,3 +335,66 @@ int RifEclipseOutputFileTools::readUnitsType(ecl_file_type* ecl_file)
|
||||
|
||||
return unitsType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseOutputFileTools::createReportStepsMetaData(std::vector<ecl_file_type*> ecl_files, std::vector<RifRestartReportStep>* reportSteps)
|
||||
{
|
||||
if (!reportSteps) return;
|
||||
|
||||
for (auto ecl_file : ecl_files)
|
||||
{
|
||||
if (!ecl_file) continue;
|
||||
|
||||
int reportStepCount = ecl_file_get_num_named_kw(ecl_file, INTEHEAD_KW);
|
||||
for (int reportStepIndex = 0; reportStepIndex < reportStepCount; reportStepIndex++)
|
||||
{
|
||||
ecl_rsthead_type* restart_header = ecl_rsthead_ialloc(ecl_file, reportStepIndex);
|
||||
if (restart_header)
|
||||
{
|
||||
ecl_file_push_block(ecl_file);
|
||||
|
||||
{
|
||||
ecl_file_select_block(ecl_file, INTEHEAD_KW, reportStepIndex);
|
||||
|
||||
RifRestartReportStep reportStep;
|
||||
|
||||
// Set Date
|
||||
{
|
||||
QDateTime reportDateTime(QDate(restart_header->year, restart_header->month, restart_header->day));
|
||||
CVF_ASSERT(reportDateTime.isValid());
|
||||
|
||||
reportStep.dateTime = reportDateTime;
|
||||
}
|
||||
|
||||
// Find number of keywords withing this report step
|
||||
int numKeywords = ecl_file_get_num_distinct_kw(ecl_file);
|
||||
for (int iKey = 0; iKey < numKeywords; iKey++)
|
||||
{
|
||||
const char* kw = ecl_file_iget_distinct_kw(ecl_file, iKey);
|
||||
|
||||
int namedKeywordCount = ecl_file_get_num_named_kw(ecl_file, kw);
|
||||
for (int iOcc = 0; iOcc < namedKeywordCount; iOcc++)
|
||||
{
|
||||
ecl_type_enum dataType = ecl_file_iget_named_type(ecl_file, kw, iOcc);
|
||||
if (dataType != ECL_DOUBLE_TYPE && dataType != ECL_FLOAT_TYPE && dataType != ECL_INT_TYPE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int itemCount = ecl_file_iget_named_size(ecl_file, kw, iOcc);
|
||||
reportStep.m_keywords.appendKeyword(kw, itemCount, iOcc);
|
||||
}
|
||||
}
|
||||
|
||||
reportSteps->push_back(reportStep);
|
||||
}
|
||||
|
||||
ecl_file_pop_block(ecl_file);
|
||||
|
||||
ecl_rsthead_free(restart_header);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,10 +24,12 @@
|
||||
#include "cvfObject.h"
|
||||
#include "cvfLibCore.h"
|
||||
|
||||
#include "RifReaderInterface.h"
|
||||
#include "RifEclipseRestartDataAccess.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QDateTime>
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
#include "ert/ecl/ecl_util.h"
|
||||
|
||||
@ -45,7 +47,8 @@ public:
|
||||
RifEclipseOutputFileTools();
|
||||
virtual ~RifEclipseOutputFileTools();
|
||||
|
||||
static void findKeywordsAndDataItemCounts(ecl_file_type* ecl_file, QStringList* keywords, std::vector<size_t>* keywordDataItemCounts);
|
||||
static void findKeywordsAndItemCount(std::vector<ecl_file_type*> ecl_files, QStringList* resultNames, std::vector<size_t>* resultDataItemCounts);
|
||||
|
||||
static bool keywordData(ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<double>* values);
|
||||
static bool keywordData(ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<int>* values);
|
||||
|
||||
@ -59,4 +62,7 @@ public:
|
||||
static void readGridDimensions(const QString& gridFileName, std::vector< std::vector<int> >& gridDimensions);
|
||||
|
||||
static int readUnitsType(ecl_file_type* ecl_file);
|
||||
|
||||
private:
|
||||
static void createReportStepsMetaData(std::vector<ecl_file_type*> ecl_files, std::vector<RifRestartReportStep>* reportSteps);
|
||||
};
|
||||
|
@ -33,3 +33,106 @@ RifEclipseRestartDataAccess::RifEclipseRestartDataAccess()
|
||||
RifEclipseRestartDataAccess::~RifEclipseRestartDataAccess()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifRestartReportKeywords::RifRestartReportKeywords()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifRestartReportKeywords::appendKeyword(const std::string& keyword, size_t itemCount, int globalIndex)
|
||||
{
|
||||
m_keywordNameAndItemCount.push_back(RifKeywordLocation(keyword, itemCount, globalIndex));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::string> RifRestartReportKeywords::keywordsWithItemCountFactorOf(const std::vector<size_t>& factorCandidates)
|
||||
{
|
||||
std::vector<std::string> tmp;
|
||||
|
||||
for (auto uni : uniqueKeywords())
|
||||
{
|
||||
size_t sum = 0;
|
||||
for (auto loc : objectsForKeyword(uni))
|
||||
{
|
||||
sum += loc.itemCount();
|
||||
}
|
||||
|
||||
bool foundMatch = false;
|
||||
size_t i = 0;
|
||||
|
||||
while (i < factorCandidates.size() && !foundMatch)
|
||||
{
|
||||
if (sum > 0 && (sum % factorCandidates[i]) == 0)
|
||||
{
|
||||
foundMatch = true;
|
||||
tmp.push_back(uni);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::pair<std::string, size_t> > RifRestartReportKeywords::keywordsWithAggregatedItemCount()
|
||||
{
|
||||
std::vector<std::pair<std::string, size_t> > tmp;
|
||||
|
||||
for (auto uni : uniqueKeywords())
|
||||
{
|
||||
size_t sum = 0;
|
||||
for (auto loc : objectsForKeyword(uni))
|
||||
{
|
||||
sum += loc.itemCount();
|
||||
}
|
||||
|
||||
tmp.push_back(std::make_pair(uni, sum));
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RifKeywordLocation> RifRestartReportKeywords::objectsForKeyword(const std::string& keyword)
|
||||
{
|
||||
std::vector<RifKeywordLocation> tmp;
|
||||
|
||||
for (auto a : m_keywordNameAndItemCount)
|
||||
{
|
||||
if (a.keyword() == keyword)
|
||||
{
|
||||
tmp.push_back(a);
|
||||
}
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RifRestartReportKeywords::uniqueKeywords()
|
||||
{
|
||||
std::set<std::string> unique;
|
||||
|
||||
for (auto a : m_keywordNameAndItemCount)
|
||||
{
|
||||
unique.insert(a.keyword());
|
||||
}
|
||||
|
||||
return unique;
|
||||
}
|
||||
|
@ -33,6 +33,55 @@
|
||||
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
|
||||
class RifKeywordLocation
|
||||
{
|
||||
public:
|
||||
RifKeywordLocation(std::string keyword, size_t itemCount, int indexWithinReportStep)
|
||||
: m_keyword(keyword),
|
||||
m_itemCount(itemCount),
|
||||
m_indexWithinReportStep(indexWithinReportStep)
|
||||
{
|
||||
}
|
||||
|
||||
std::string keyword() const { return m_keyword; }
|
||||
size_t itemCount() const { return m_itemCount; }
|
||||
int indexWithinReportStep() const { return m_indexWithinReportStep; }
|
||||
|
||||
private:
|
||||
std::string m_keyword;
|
||||
size_t m_itemCount;
|
||||
int m_indexWithinReportStep;
|
||||
};
|
||||
|
||||
class RifRestartReportKeywords
|
||||
{
|
||||
public:
|
||||
RifRestartReportKeywords();
|
||||
|
||||
void appendKeyword(const std::string& keyword, size_t itemCount, int globalIndex);
|
||||
|
||||
std::vector<std::string> keywordsWithItemCountFactorOf(const std::vector<size_t>& factorCandidates);
|
||||
std::vector<std::pair<std::string, size_t> > keywordsWithAggregatedItemCount();
|
||||
|
||||
private:
|
||||
std::vector<RifKeywordLocation> objectsForKeyword(const std::string& keyword);
|
||||
std::set<std::string> uniqueKeywords();
|
||||
|
||||
private:
|
||||
std::vector<RifKeywordLocation> m_keywordNameAndItemCount;
|
||||
};
|
||||
|
||||
|
||||
class RifRestartReportStep
|
||||
{
|
||||
public:
|
||||
//int globalIndex;
|
||||
QDateTime dateTime;
|
||||
|
||||
RifRestartReportKeywords m_keywords;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
// Abstract class for results access
|
||||
|
@ -155,15 +155,12 @@ void RifEclipseRestartFilesetAccess::resultNames(QStringList* resultNames, std::
|
||||
{
|
||||
CVF_ASSERT(timeStepCount() > 0);
|
||||
|
||||
openTimeStep(0);
|
||||
|
||||
std::vector<size_t> valueCountForOneFile;
|
||||
RifEclipseOutputFileTools::findKeywordsAndDataItemCounts(m_ecl_files[0], resultNames, &valueCountForOneFile);
|
||||
|
||||
for (size_t i = 0; i < valueCountForOneFile.size(); i++)
|
||||
for (int i = 0; i < m_fileNames.size(); i++)
|
||||
{
|
||||
resultDataItemCounts->push_back(valueCountForOneFile[i] * timeStepCount());
|
||||
openTimeStep(i);
|
||||
}
|
||||
|
||||
RifEclipseOutputFileTools::findKeywordsAndItemCount(m_ecl_files, resultNames, resultDataItemCounts);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -205,7 +202,6 @@ bool RifEclipseRestartFilesetAccess::results(const QString& resultName, size_t t
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -55,7 +55,6 @@ public:
|
||||
private:
|
||||
void openTimeStep(size_t timeStep);
|
||||
|
||||
|
||||
private:
|
||||
QStringList m_fileNames;
|
||||
std::vector<QDateTime> m_timeSteps;
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "ert/ecl/ecl_file.h"
|
||||
#include "ert/ecl/ecl_kw_magic.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Constructor
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -102,6 +104,7 @@ std::vector<QDateTime> RifEclipseUnifiedRestartFileAccess::timeSteps()
|
||||
return timeSteps;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Get list of result names
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -109,7 +112,10 @@ void RifEclipseUnifiedRestartFileAccess::resultNames(QStringList* resultNames, s
|
||||
{
|
||||
if (openFile())
|
||||
{
|
||||
RifEclipseOutputFileTools::findKeywordsAndDataItemCounts(m_ecl_file, resultNames, resultDataItemCounts);
|
||||
std::vector< ecl_file_type* > filesUsedToFindAvailableKeywords;
|
||||
filesUsedToFindAvailableKeywords.push_back(m_ecl_file);
|
||||
|
||||
RifEclipseOutputFileTools::findKeywordsAndItemCount(filesUsedToFindAvailableKeywords, resultNames, resultDataItemCounts);
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,24 +129,27 @@ bool RifEclipseUnifiedRestartFileAccess::results(const QString& resultName, size
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t numOccurrences = ecl_file_get_num_named_kw(m_ecl_file, resultName.toAscii().data());
|
||||
ecl_file_push_block(m_ecl_file);
|
||||
|
||||
size_t startIndex = timeStep * gridCount;
|
||||
CVF_ASSERT(startIndex + gridCount <= numOccurrences);
|
||||
for (size_t i = 0; i < gridCount; i++)
|
||||
{
|
||||
ecl_file_select_block(m_ecl_file, INTEHEAD_KW, static_cast<int>(timeStep * gridCount + i));
|
||||
|
||||
size_t occurrenceIdx;
|
||||
for (occurrenceIdx = startIndex; occurrenceIdx < startIndex + gridCount; occurrenceIdx++)
|
||||
int namedKeywordCount = ecl_file_get_num_named_kw(m_ecl_file, resultName.toAscii().data());
|
||||
for (int iOcc = 0; iOcc < namedKeywordCount; iOcc++)
|
||||
{
|
||||
std::vector<double> partValues;
|
||||
RifEclipseOutputFileTools::keywordData(m_ecl_file, resultName, occurrenceIdx, &partValues);
|
||||
RifEclipseOutputFileTools::keywordData(m_ecl_file, resultName, iOcc, &partValues);
|
||||
|
||||
values->insert(values->end(), partValues.begin(), partValues.end());
|
||||
}
|
||||
}
|
||||
|
||||
ecl_file_pop_block(m_ecl_file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -28,6 +28,8 @@ class RifEclipseOutputFileTools;
|
||||
|
||||
#include "ert/ecl_well/well_info.h"
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
// Class for access to results from a unified restart file
|
||||
@ -56,7 +58,6 @@ public:
|
||||
private:
|
||||
bool openFile();
|
||||
|
||||
|
||||
private:
|
||||
QString m_filename;
|
||||
ecl_file_type* m_ecl_file;
|
||||
|
@ -683,7 +683,10 @@ void RifReaderEclipseOutput::buildMetaData()
|
||||
{
|
||||
QStringList resultNames;
|
||||
std::vector<size_t> resultNamesDataItemCounts;
|
||||
RifEclipseOutputFileTools::findKeywordsAndDataItemCounts(m_ecl_init_file, &resultNames, &resultNamesDataItemCounts);
|
||||
std::vector< ecl_file_type* > filesUsedToFindAvailableKeywords;
|
||||
filesUsedToFindAvailableKeywords.push_back(m_ecl_init_file);
|
||||
|
||||
RifEclipseOutputFileTools::findKeywordsAndItemCount(filesUsedToFindAvailableKeywords, &resultNames, &resultNamesDataItemCounts);
|
||||
|
||||
{
|
||||
QStringList matrixResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts,
|
||||
@ -1565,7 +1568,7 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid, boo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringList& keywords, const std::vector<size_t>& keywordDataItemCounts,
|
||||
const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo,
|
||||
PorosityModelResultType matrixOrFracture, size_t timeStepCount) const
|
||||
PorosityModelResultType porosityModel, size_t timeStepCount) const
|
||||
{
|
||||
CVF_ASSERT(activeCellInfo);
|
||||
|
||||
@ -1574,7 +1577,7 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
if (matrixOrFracture == RifReaderInterface::FRACTURE_RESULTS)
|
||||
if (porosityModel == RifReaderInterface::FRACTURE_RESULTS)
|
||||
{
|
||||
if (fractureActiveCellInfo->reservoirActiveCellCount() == 0)
|
||||
{
|
||||
@ -1590,43 +1593,47 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
|
||||
|
||||
if (activeCellInfo->reservoirActiveCellCount() > 0)
|
||||
{
|
||||
if (keywordDataItemCounts[i] < activeCellInfo->reservoirActiveCellCount()) continue;
|
||||
|
||||
size_t timeStepsAllCellsRest = keywordDataItemCounts[i] % activeCellInfo->reservoirCellCount();
|
||||
|
||||
size_t timeStepsMatrix = keywordDataItemCounts[i] / activeCellInfo->reservoirActiveCellCount();
|
||||
size_t timeStepsMatrixRest = keywordDataItemCounts[i] % activeCellInfo->reservoirActiveCellCount();
|
||||
|
||||
size_t timeStepsMatrixAndFracture = keywordDataItemCounts[i] / (activeCellInfo->reservoirActiveCellCount() + fractureActiveCellInfo->reservoirActiveCellCount());
|
||||
size_t timeStepsMatrixAndFractureRest = keywordDataItemCounts[i] % (activeCellInfo->reservoirActiveCellCount() + fractureActiveCellInfo->reservoirActiveCellCount());
|
||||
|
||||
if (matrixOrFracture == RifReaderInterface::MATRIX_RESULTS)
|
||||
if (timeStepsAllCellsRest == 0)
|
||||
{
|
||||
if (timeStepsMatrixRest == 0 || timeStepsMatrixAndFractureRest == 0)
|
||||
if (keywordDataItemCounts[i] > timeStepCount * activeCellInfo->reservoirCellCount())
|
||||
{
|
||||
if (timeStepCount == timeStepsMatrix || timeStepCount == timeStepsMatrixAndFracture)
|
||||
{
|
||||
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
|
||||
}
|
||||
}
|
||||
else if (timeStepsAllCellsRest == 0)
|
||||
{
|
||||
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (timeStepsMatrixAndFractureRest == 0 && timeStepCount == timeStepsMatrixAndFracture)
|
||||
{
|
||||
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
|
||||
}
|
||||
else if (timeStepsAllCellsRest == 0)
|
||||
else if (porosityModel == RifReaderInterface::MATRIX_RESULTS && timeStepsMatrixRest == 0)
|
||||
{
|
||||
if (keywordDataItemCounts[i] > timeStepCount * activeCellInfo->reservoirActiveCellCount())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
|
||||
}
|
||||
else if (porosityModel == RifReaderInterface::FRACTURE_RESULTS && timeStepsMatrixAndFractureRest == 0)
|
||||
{
|
||||
if (keywordDataItemCounts[i] > timeStepCount * (activeCellInfo->reservoirActiveCellCount() + fractureActiveCellInfo->reservoirActiveCellCount()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (keywordDataItemCounts[i] > activeCellInfo->reservoirCellCount())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
|
||||
}
|
||||
}
|
||||
|
@ -19,23 +19,26 @@
|
||||
|
||||
#include "RivGeoMechVizLogic.h"
|
||||
|
||||
#include "RimGeoMechView.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "RimGeoMechCellColors.h"
|
||||
#include "RivGeoMechPartMgrCache.h"
|
||||
#include "RivGeoMechPartMgr.h"
|
||||
#include "RivReservoirViewPartMgr.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RigFemPartCollection.h"
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
#include "RigGeoMechCaseData.h"
|
||||
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimGeoMechCellColors.h"
|
||||
#include "RimGeoMechPropertyFilterCollection.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimView.h"
|
||||
#include "RimViewController.h"
|
||||
|
||||
#include "RivCellSetEnum.h"
|
||||
#include "RivFemElmVisibilityCalculator.h"
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
#include "RimGeoMechPropertyFilterCollection.h"
|
||||
#include "RimView.h"
|
||||
#include "RimViewController.h"
|
||||
#include "RivGeoMechPartMgr.h"
|
||||
#include "RivGeoMechPartMgrCache.h"
|
||||
#include "RivReservoirViewPartMgr.h"
|
||||
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfStructGridGeometryGenerator.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -26,15 +26,18 @@
|
||||
#include "RigGridBase.h"
|
||||
#include "RigResultAccessor.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RimEclipseCase.h"
|
||||
|
||||
#include "RimCellEdgeColors.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
|
||||
#include "RivTernaryTextureCoordsCreator.h"
|
||||
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfScalarMapper.h"
|
||||
#include "cvfVertexAttribute.h"
|
||||
|
||||
|
||||
@ -48,6 +51,7 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
|
||||
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||
cvf::DrawableGeo* geo,
|
||||
size_t gridIndex,
|
||||
bool useDefaultValueForHugeVals,
|
||||
float opacityLevel)
|
||||
{
|
||||
RigCaseData* eclipseCase = cellResultColors->reservoirView()->eclipseCase()->reservoirData();
|
||||
@ -114,9 +118,13 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
|
||||
|
||||
{
|
||||
float cellColorTextureCoord = 0.5f; // If no results exists, the texture will have a special color
|
||||
if (useDefaultValueForHugeVals || scalarValue != HUGE_VAL)
|
||||
{
|
||||
if (scalarValue != HUGE_VAL)
|
||||
{
|
||||
cellColorTextureCoord = cellResultScalarMapper->mapToTextureCoord(scalarValue)[0];
|
||||
}
|
||||
|
||||
// If we are dealing with wellcells, the default is transparent.
|
||||
// we need to make cells opaque if there are no wellpipe through them.
|
||||
if (opacityLevel < 1.0f)
|
||||
|
@ -44,6 +44,7 @@ public:
|
||||
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||
cvf::DrawableGeo* geo,
|
||||
size_t gridIndex,
|
||||
bool useDefaultValueForHugeVals,
|
||||
float opacityLevel);
|
||||
|
||||
static void addTernaryCellEdgeResultsToDrawableGeo(size_t timeStepIndex,
|
||||
|
@ -19,20 +19,24 @@
|
||||
|
||||
#include "RivReservoirFaultsPartMgr.h"
|
||||
|
||||
#include "cvfPart.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseFaultColors.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFaultCollection.h"
|
||||
|
||||
#include "RivFaultPartMgr.h"
|
||||
|
||||
#include "cvfColor3.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfTransform.h"
|
||||
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
#include "RimFaultCollection.h"
|
||||
#include "RimEclipseFaultColors.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RigCaseData.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -20,19 +20,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfArray.h"
|
||||
#include "cvfCollection.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
#include "RigGridBase.h"
|
||||
#include "RivFaultPartMgr.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class Transform;
|
||||
class ModelBasicList;
|
||||
}
|
||||
|
||||
class RimEclipseCellColors;
|
||||
class RimCellEdgeColors;
|
||||
class RimEclipseView;
|
||||
class RivFaultPartMgr;
|
||||
class RigMainGrid;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
|
@ -20,12 +20,13 @@
|
||||
|
||||
#include "RivReservoirPartMgr.h"
|
||||
|
||||
#include "RigCaseData.h"
|
||||
|
||||
#include "RivGridPartMgr.h"
|
||||
#include "RivReservoirFaultsPartMgr.h"
|
||||
|
||||
#include "cvfStructGrid.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
|
||||
#include "RigCaseData.h"
|
||||
#include "RivGridPartMgr.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -24,9 +24,6 @@
|
||||
#include "cvfArray.h"
|
||||
#include "cvfCollection.h"
|
||||
|
||||
#include "RivGridPartMgr.h"
|
||||
#include "RivReservoirFaultsPartMgr.h"
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class ModelBasicList;
|
||||
@ -37,6 +34,8 @@ class RimEclipseCellColors;
|
||||
class RimCellEdgeColors;
|
||||
class RigCaseData;
|
||||
class RimEclipseView;
|
||||
class RivReservoirFaultsPartMgr;
|
||||
class RivGridPartMgr;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
|
@ -22,25 +22,26 @@
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "RigCaseToCaseCellMapper.h"
|
||||
#include "RigGridBase.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimCellEdgeColors.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
#include "RimFaultCollection.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
|
||||
#include "RivGridPartMgr.h"
|
||||
#include "RimViewController.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RigCaseToCaseCellMapper.h"
|
||||
|
||||
#include "RivGridPartMgr.h"
|
||||
#include "RivReservoirFaultsPartMgr.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -952,10 +953,12 @@ void RivReservoirViewPartMgr::appendFaultsDynamicGeometryPartsToModel(cvf::Model
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivCellSetEnum RivReservoirViewPartMgr::geometryTypeForFaultLabels(const std::vector<RivCellSetEnum>& geometryTypes) const
|
||||
RivCellSetEnum RivReservoirViewPartMgr::geometryTypeForFaultLabels(const std::vector<RivCellSetEnum>& geometryTypes, bool showFaultsOutsideFilters) const
|
||||
{
|
||||
bool hasInactive = false;
|
||||
for (size_t i = 0; i < geometryTypes.size(); i++)
|
||||
{
|
||||
if (!showFaultsOutsideFilters)
|
||||
{
|
||||
if (geometryTypes[i] == PROPERTY_FILTERED)
|
||||
{
|
||||
@ -966,6 +969,7 @@ RivCellSetEnum RivReservoirViewPartMgr::geometryTypeForFaultLabels(const std::ve
|
||||
{
|
||||
return RANGE_FILTERED;
|
||||
}
|
||||
}
|
||||
|
||||
if (geometryTypes[i] == INACTIVE)
|
||||
{
|
||||
|
@ -19,18 +19,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
#include "RivReservoirPartMgr.h"
|
||||
#include "cvfTransform.h"
|
||||
|
||||
#include "RivCellSetEnum.h"
|
||||
#include "RivReservoirPartMgr.h" // Must include here because of caf::FixedArray<RivReservoirPartMgr, PROPERTY_FILTERED>
|
||||
|
||||
#include "cafFixedArray.h"
|
||||
#include "cvfArray.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cvfTransform.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "RivCellSetEnum.h"
|
||||
|
||||
class RimEclipseView;
|
||||
class RigGridBase;
|
||||
class RimCellRangeFilterCollection;
|
||||
class RimEclipsePropertyFilterCollection;
|
||||
class RigActiveCellInfo;
|
||||
class RimEclipseCellColors;
|
||||
class RimCellEdgeColors;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class ModelBasicList;
|
||||
}
|
||||
|
||||
class RivReservoirViewPartMgr: public cvf::Object
|
||||
{
|
||||
@ -64,7 +75,7 @@ public:
|
||||
RimCellEdgeColors* cellEdgeResultColors);
|
||||
|
||||
// Fault labels
|
||||
RivCellSetEnum geometryTypeForFaultLabels(const std::vector<RivCellSetEnum>& geometryTypes) const;
|
||||
RivCellSetEnum geometryTypeForFaultLabels(const std::vector<RivCellSetEnum>& geometryTypes, bool showFaultsOutsideFilters) const;
|
||||
void appendFaultLabelsStaticGeometryPartsToModel(cvf::ModelBasicList* model, RivCellSetEnum geometryType);
|
||||
void appendFaultLabelsDynamicGeometryPartsToModel(cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex);
|
||||
|
||||
|
@ -90,12 +90,23 @@ cvf::ref<cvf::Effect> RivScalarMapperUtils::createCellEdgeEffect(cvf::DrawableGe
|
||||
}
|
||||
else
|
||||
{
|
||||
RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultColors, cellEdgeResultColors,
|
||||
quadToCellFaceMapper, dg, gridIndex, opacityLevel);
|
||||
bool useDefaultValueForHugeVals = false;
|
||||
if (!cellResultColors->hasResult())
|
||||
{
|
||||
useDefaultValueForHugeVals = true;
|
||||
}
|
||||
|
||||
RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultColors, cellEdgeResultColors,
|
||||
quadToCellFaceMapper, dg, gridIndex, useDefaultValueForHugeVals, opacityLevel);
|
||||
|
||||
if (cellResultColors->hasResult())
|
||||
{
|
||||
// If no scalar mapper is set for the effect, a default color is used to fill the texture
|
||||
// This is what we want when the fault colors should be visible in combination with cell edge
|
||||
cvf::ScalarMapper* cellScalarMapper = cellResultColors->legendConfig()->scalarMapper();
|
||||
cellFaceEffectGen.setScalarMapper(cellScalarMapper);
|
||||
}
|
||||
}
|
||||
|
||||
cellFaceEffectGen.setOpacityLevel(opacityLevel);
|
||||
cellFaceEffectGen.setDefaultCellColor(defaultColor);
|
||||
|
@ -84,14 +84,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "RicNewWellLogPlotFeature";
|
||||
commandIds << "RicNewSummaryPlotFeature";
|
||||
}
|
||||
else if (uiItems.size() > 1)
|
||||
{
|
||||
caf::PdmUiItem* uiItem = uiItems[0];
|
||||
if (dynamic_cast<RimWellLogFileChannel*>(uiItem))
|
||||
{
|
||||
commandIds << "RicAddWellLogToPlotFeature";
|
||||
}
|
||||
}
|
||||
else if (uiItems.size() == 1)
|
||||
{
|
||||
caf::PdmUiItem* uiItem = uiItems[0];
|
||||
@ -130,7 +122,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "RicNewViewFeature";
|
||||
commandIds << "RicComputeStatisticsFeature";
|
||||
commandIds << "RicCloseCaseFeature";
|
||||
commandIds << "RicExecuteScriptForCasesFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimEclipseCase*>(uiItem))
|
||||
{
|
||||
@ -142,7 +133,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "RicCloseCaseFeature";
|
||||
commandIds << "RicNewViewFeature";
|
||||
commandIds << "RicEclipseCaseNewGroupFeature";
|
||||
commandIds << "RicExecuteScriptForCasesFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimGeoMechCase*>(uiItem))
|
||||
{
|
||||
@ -233,6 +223,9 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
{
|
||||
commandIds << "RicAddScriptPathFeature";
|
||||
commandIds << "RicDeleteScriptPathFeature";
|
||||
commandIds << "RicNewScriptFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicRefreshScriptsFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimViewController*>(uiItem))
|
||||
{
|
||||
@ -328,6 +321,24 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
}
|
||||
}
|
||||
|
||||
// Command supporting multiple selected objects
|
||||
if (uiItems.size() > 0)
|
||||
{
|
||||
caf::PdmUiItem* uiItem = uiItems[0];
|
||||
if (dynamic_cast<RimWellLogFileChannel*>(uiItem))
|
||||
{
|
||||
commandIds << "RicAddWellLogToPlotFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimEclipseStatisticsCase*>(uiItem))
|
||||
{
|
||||
commandIds << "RicExecuteScriptForCasesFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimEclipseCase*>(uiItem))
|
||||
{
|
||||
commandIds << "RicExecuteScriptForCasesFeature";
|
||||
}
|
||||
}
|
||||
|
||||
if (RicToggleItemsFeatureImpl::isToggleCommandsAvailable())
|
||||
{
|
||||
commandIds << "Separator";
|
||||
|
@ -20,10 +20,13 @@
|
||||
#include "RimCrossSectionCollection.h"
|
||||
|
||||
#include "RimCrossSection.h"
|
||||
#include "RivCrossSectionPartMgr.h"
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "RivCrossSectionPartMgr.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimCrossSectionCollection, "CrossSectionCollection");
|
||||
|
||||
@ -143,3 +146,25 @@ void RimCrossSectionCollection::fieldChangedByUi(const caf::PdmFieldHandle* chan
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimCrossSectionCollection::hasActiveCrossSectionForSimulationWell(RimEclipseWell* eclipseWell) const
|
||||
{
|
||||
if (!isActive) return false;
|
||||
|
||||
for (size_t csIdx = 0; csIdx < m_crossSections.size(); ++csIdx)
|
||||
{
|
||||
RimCrossSection* cs = m_crossSections[csIdx];
|
||||
|
||||
if (cs->isActive &&
|
||||
cs->type() == RimCrossSection::CS_SIMULATION_WELL &&
|
||||
cs->simulationWell() == eclipseWell)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
class RimCrossSection;
|
||||
class RimEclipseCellColors;
|
||||
class RimEclipseWell;
|
||||
|
||||
namespace cvf {
|
||||
class ModelBasicList;
|
||||
@ -48,6 +49,7 @@ public:
|
||||
|
||||
void appendCrossSection(RimCrossSection* crossSection);
|
||||
|
||||
bool hasActiveCrossSectionForSimulationWell(RimEclipseWell* eclipseWell) const;
|
||||
|
||||
// Visualization interface
|
||||
|
||||
|
@ -407,7 +407,7 @@ void RimEclipseView::createDisplayModel()
|
||||
|
||||
std::vector<RivCellSetEnum> faultGeometryTypesToAppend = visibleFaultGeometryTypes();
|
||||
|
||||
RivCellSetEnum faultLabelType = m_reservoirGridPartManager->geometryTypeForFaultLabels(faultGeometryTypesToAppend);
|
||||
RivCellSetEnum faultLabelType = m_reservoirGridPartManager->geometryTypeForFaultLabels(faultGeometryTypesToAppend, faultCollection()->showFaultsOutsideFilters());
|
||||
|
||||
for (size_t frameIdx = 0; frameIdx < frameModels.size(); ++frameIdx)
|
||||
{
|
||||
@ -535,7 +535,7 @@ void RimEclipseView::updateCurrentTimeStep()
|
||||
m_reservoirGridPartManager->appendFaultsStaticGeometryPartsToModel(frameParts.p(), faultGeometryTypesToAppend[i]);
|
||||
}
|
||||
|
||||
RivCellSetEnum faultLabelType = m_reservoirGridPartManager->geometryTypeForFaultLabels(faultGeometryTypesToAppend);
|
||||
RivCellSetEnum faultLabelType = m_reservoirGridPartManager->geometryTypeForFaultLabels(faultGeometryTypesToAppend, faultCollection()->showFaultsOutsideFilters());
|
||||
m_reservoirGridPartManager->appendFaultLabelsStaticGeometryPartsToModel(frameParts.p(), faultLabelType);
|
||||
}
|
||||
else
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "RimEclipseWell.h"
|
||||
|
||||
#include "RimCrossSectionCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
|
||||
@ -179,6 +180,9 @@ bool RimEclipseWell::calculateWellPipeVisibility(size_t frameIndex)
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_INDIVIDUALLY)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->crossSectionCollection()->hasActiveCrossSectionForSimulationWell(this))
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_OPEN_IN_VISIBLE_CELLS)
|
||||
{
|
||||
const std::vector<RivCellSetEnum>& visGridParts = m_reservoirView->visibleGridParts();
|
||||
|
@ -21,12 +21,17 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RigCaseData.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFault.h"
|
||||
#include "RimNoCommonAreaNNC.h"
|
||||
#include "RimNoCommonAreaNncCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "RivColorTableArray.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
@ -180,6 +180,10 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
|
||||
RigCaseData* rigCaseData = mainCase->reservoirData();
|
||||
CVF_ASSERT(rigCaseData);
|
||||
|
||||
RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS;
|
||||
mainCase->results(poroModel)->cellResults()->createPlaceholderResultEntries();
|
||||
|
||||
|
||||
// Action A : Read active cell info
|
||||
// Read active cell info from all source cases. The file access is optimized for this purpose, and result meta data
|
||||
// is copied from main case to all other cases (see "Action B")
|
||||
@ -245,11 +249,15 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
|
||||
RimDefines::ResultCatType resultType = resultInfos[resIdx].m_resultType;
|
||||
QString resultName = resultInfos[resIdx].m_resultName;
|
||||
bool needsToBeStored = resultInfos[resIdx].m_needsToBeStored;
|
||||
bool mustBeCalculated = resultInfos[resIdx].m_mustBeCalculated;
|
||||
|
||||
size_t scalarResultIndex = cellResultsStorage->cellResults()->findScalarResultIndex(resultType, resultName);
|
||||
if (scalarResultIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
size_t scalarResultIndex = cellResultsStorage->cellResults()->addEmptyScalarResult(resultType, resultName, needsToBeStored);
|
||||
|
||||
if (mustBeCalculated) cellResultsStorage->cellResults()->setMustBeCalculated(scalarResultIndex);
|
||||
|
||||
cellResultsStorage->cellResults()->setTimeStepDates(scalarResultIndex, timeStepDates);
|
||||
|
||||
std::vector< std::vector<double> >& dataValues = cellResultsStorage->cellResults()->cellScalarResults(scalarResultIndex);
|
||||
|
@ -484,6 +484,15 @@ bool RigGridCellFaceVisibilityFilter::isFaceVisible(size_t i, size_t j, size_t k
|
||||
return true;
|
||||
}
|
||||
|
||||
// Do not show cell geometry if a fault is present to avoid z fighting between surfaces
|
||||
// It will always be a better solution to avoid geometry creation instead of part priority and polygon offset
|
||||
size_t nativeResvCellIndex = m_grid->reservoirCellIndex(cellIndex);
|
||||
const RigFault* fault = m_grid->mainGrid()->findFaultFromCellIndexAndCellFace(nativeResvCellIndex, face);
|
||||
if (fault)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the neighbour cell is invisible, we need to draw the face
|
||||
if ((cellVisibility != NULL) && !(*cellVisibility)[neighborCellIndex])
|
||||
{
|
||||
|
@ -57,6 +57,8 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
||||
|
||||
if (uiResultName == RimDefines::combinedTransmissibilityResultName())
|
||||
{
|
||||
CVF_ASSERT(timeStepIndex == 0); // Static result, only data for first time step
|
||||
|
||||
cvf::ref<RigCombTransResultAccessor> cellFaceAccessObject = new RigCombTransResultAccessor(grid);
|
||||
|
||||
cvf::ref<RigResultAccessor> xTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "TRANX");
|
||||
@ -69,6 +71,8 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
||||
}
|
||||
else if (uiResultName == RimDefines::combinedMultResultName())
|
||||
{
|
||||
CVF_ASSERT(timeStepIndex == 0); // Static result, only data for first time step
|
||||
|
||||
cvf::ref<RigCombMultResultAccessor> cellFaceAccessObject = new RigCombMultResultAccessor(grid);
|
||||
|
||||
cvf::ref<RigResultAccessor> multXPos = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "MULTX");
|
||||
@ -84,6 +88,8 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
||||
}
|
||||
else if (uiResultName == RimDefines::combinedRiTranResultName())
|
||||
{
|
||||
CVF_ASSERT(timeStepIndex == 0); // Static result, only data for first time step
|
||||
|
||||
cvf::ref<RigCombTransResultAccessor> cellFaceAccessObject = new RigCombTransResultAccessor(grid);
|
||||
|
||||
cvf::ref<RigResultAccessor> xTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, RimDefines::riTranXResultName());
|
||||
@ -96,6 +102,8 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
||||
}
|
||||
else if (uiResultName == RimDefines::combinedRiMultResultName())
|
||||
{
|
||||
CVF_ASSERT(timeStepIndex == 0); // Static result, only data for first time step
|
||||
|
||||
cvf::ref<RigCombTransResultAccessor> cellFaceAccessObject = new RigCombTransResultAccessor(grid);
|
||||
|
||||
cvf::ref<RigResultAccessor> xRiMultAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, RimDefines::riMultXResultName());
|
||||
@ -108,6 +116,8 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
||||
}
|
||||
else if (uiResultName == RimDefines::combinedRiAreaNormTranResultName())
|
||||
{
|
||||
CVF_ASSERT(timeStepIndex == 0); // Static result, only data for first time step
|
||||
|
||||
cvf::ref<RigCombTransResultAccessor> cellFaceAccessObject = new RigCombTransResultAccessor(grid);
|
||||
|
||||
cvf::ref<RigResultAccessor> xRiAreaNormTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, RimDefines::riAreaNormTranXResultName());
|
||||
@ -118,6 +128,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
||||
|
||||
return cellFaceAccessObject;
|
||||
}
|
||||
|
||||
return RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, uiResultName);
|
||||
}
|
||||
|
||||
|
BIN
ApplicationCode/Resources/Refresh-32.png
Normal file
BIN
ApplicationCode/Resources/Refresh-32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 466 B |
@ -56,6 +56,7 @@
|
||||
<file>WellLogCurve16x16.png</file>
|
||||
<file>CrossSection16x16.png</file>
|
||||
<file>CrossSections16x16.png</file>
|
||||
<file>Refresh-32.png</file>
|
||||
<file>SummaryPlot16x16.png</file>
|
||||
<file>SummaryPlots16x16.png</file>
|
||||
<file>SummaryCurve16x16.png</file>
|
||||
|
@ -30,6 +30,90 @@
|
||||
#include "RifEclipseUnifiedRestartFileAccess.h"
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST(RigReservoirTest, BasicTest)
|
||||
{
|
||||
RifEclipseUnifiedRestartFileAccess unrstAccess;
|
||||
|
||||
QStringList filenames;
|
||||
//filenames << "d:/Models/Statoil/testcase_juli_2011/data/TEST10K_FLT_LGR_NNC.UNRST";
|
||||
filenames << "d:/Models/MRST/simple/SIMPLE.UNRST";
|
||||
|
||||
unrstAccess.setRestartFiles(filenames);
|
||||
|
||||
|
||||
QStringList resultNames;
|
||||
std::vector<size_t> dataItemCount;
|
||||
|
||||
unrstAccess.resultNames(&resultNames, &dataItemCount);
|
||||
|
||||
for (size_t i = 0; i < resultNames.size(); i++)
|
||||
{
|
||||
qDebug() << resultNames[i] << "\t" << dataItemCount[i];
|
||||
}
|
||||
|
||||
auto reportNums = unrstAccess.reportNumbers();
|
||||
for (auto reportNum : reportNums)
|
||||
{
|
||||
qDebug() << reportNum;
|
||||
}
|
||||
|
||||
/*
|
||||
cvf::ref<RifReaderEclipseOutput> readerInterfaceEcl = new RifReaderEclipseOutput;
|
||||
cvf::ref<RigCaseData> reservoir = new RigCaseData;
|
||||
|
||||
// Location of test dataset received from Håkon Høgstøl in July 2011 with 10k active cells
|
||||
#ifdef WIN32
|
||||
QString filename("TEST10K_FLT_LGR_NNC.EGRID");
|
||||
#else
|
||||
QString filename("/mnt/hgfs/Statoil/testcase_juli_2011/data/TEST10K_FLT_LGR_NNC.EGRID");
|
||||
#endif
|
||||
|
||||
bool result = readerInterfaceEcl->open(filename, reservoir.p());
|
||||
EXPECT_TRUE(result);
|
||||
|
||||
{
|
||||
QStringList staticResults = readerInterfaceEcl->staticResults();
|
||||
EXPECT_EQ(42, staticResults.size());
|
||||
qDebug() << "Static results\n" << staticResults;
|
||||
|
||||
QStringList dynamicResults = readerInterfaceEcl->dynamicResults();
|
||||
EXPECT_EQ(23, dynamicResults.size());
|
||||
qDebug() << "Dynamic results\n" << dynamicResults;
|
||||
|
||||
int numTimeSteps = static_cast<int>(readerInterfaceEcl->numTimeSteps());
|
||||
EXPECT_EQ(9, numTimeSteps);
|
||||
|
||||
QStringList timeStepText = readerInterfaceEcl->timeStepText();
|
||||
EXPECT_EQ(numTimeSteps, timeStepText.size());
|
||||
qDebug() << "Time step texts\n" << timeStepText;
|
||||
}
|
||||
|
||||
|
||||
readerInterfaceEcl->close();
|
||||
|
||||
{
|
||||
QStringList staticResults = readerInterfaceEcl->staticResults();
|
||||
EXPECT_EQ(0, staticResults.size());
|
||||
|
||||
QStringList dynamicResults = readerInterfaceEcl->dynamicResults();
|
||||
EXPECT_EQ(0, dynamicResults.size());
|
||||
|
||||
int numTimeSteps = static_cast<int>(readerInterfaceEcl->numTimeSteps());
|
||||
EXPECT_EQ(0, numTimeSteps);
|
||||
|
||||
QStringList timeStepText = readerInterfaceEcl->timeStepText();
|
||||
EXPECT_EQ(numTimeSteps, timeStepText.size());
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
|
@ -175,11 +175,10 @@ void RiuMainWindow::initializeGuiNewProjectLoaded()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::cleanupGuiBeforeProjectClose()
|
||||
void RiuMainWindow::cleanupGuiCaseClose()
|
||||
{
|
||||
caf::CmdExecCommandManager::instance()->undoStack()->clear();
|
||||
|
||||
setPdmRoot(NULL);
|
||||
setResultInfo("");
|
||||
|
||||
m_resultQwtPlot->deleteAllCurves();
|
||||
@ -200,6 +199,16 @@ void RiuMainWindow::cleanupGuiBeforeProjectClose()
|
||||
m_processMonitor->startMonitorWorkProcess(NULL);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::cleanupGuiBeforeProjectClose()
|
||||
{
|
||||
setPdmRoot(NULL);
|
||||
|
||||
cleanupGuiCaseClose();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -79,6 +79,7 @@ public:
|
||||
virtual QString mainWindowName() { return "RiuMainWindow"; }
|
||||
|
||||
void initializeGuiNewProjectLoaded();
|
||||
void cleanupGuiCaseClose();
|
||||
void cleanupGuiBeforeProjectClose();
|
||||
|
||||
void removeViewer( QWidget* viewer );
|
||||
|
@ -113,6 +113,12 @@ void RiuMultiCaseImportDialog::on_m_addSearchFolderButton_clicked()
|
||||
}
|
||||
|
||||
RiaApplication::instance()->setDefaultFileDialogDirectory("MULTICASEIMPORT", selectedFolder);
|
||||
|
||||
QPushButton* okButton = ui->m_dialogButtons->button(QDialogButtonBox::Ok);
|
||||
if (okButton)
|
||||
{
|
||||
okButton->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -623,7 +623,13 @@ QString RiuResultTextBuilder::cellResultText(RimEclipseCellColors* resultColors)
|
||||
}
|
||||
else
|
||||
{
|
||||
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createResultAccessor(eclipseCaseData, m_gridIndex, porosityModel, m_timeStepIndex, resultVar);
|
||||
size_t adjustedTimeStep = m_timeStepIndex;
|
||||
if (resultColors->hasStaticResult())
|
||||
{
|
||||
adjustedTimeStep = 0;
|
||||
}
|
||||
|
||||
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createResultAccessor(eclipseCaseData, m_gridIndex, porosityModel, adjustedTimeStep, resultVar);
|
||||
if (resultAccessor.notNull())
|
||||
{
|
||||
double scalarValue = resultAccessor->cellFaceScalar(m_cellIndex, m_face);
|
||||
|
@ -101,6 +101,8 @@ bool RiuTreeViewEventFilter::eventFilter(QObject *obj, QEvent *event)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!RiuMainWindow::instance()->projectTreeView()->isTreeItemEditWidgetActive())
|
||||
{
|
||||
switch (keyEvent->key())
|
||||
{
|
||||
case Qt::Key_Space:
|
||||
@ -115,6 +117,7 @@ bool RiuTreeViewEventFilter::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// standard event processing
|
||||
return QObject::eventFilter(obj, event);
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "RimEclipseFaultColors.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimFault.h"
|
||||
#include "RimFaultCollection.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimGeoMechCellColors.h"
|
||||
|
@ -107,6 +107,14 @@ QTreeView* PdmUiTreeView::treeView()
|
||||
return m_treeViewEditor->treeView();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool PdmUiTreeView::isTreeItemEditWidgetActive() const
|
||||
{
|
||||
return m_treeViewEditor->isTreeItemEditWidgetActive();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -72,6 +72,7 @@ public:
|
||||
void setPdmItem(caf::PdmUiItem* object);
|
||||
|
||||
QTreeView* treeView();
|
||||
bool isTreeItemEditWidgetActive() const;
|
||||
|
||||
void selectedUiItems(std::vector<PdmUiItem*>& objects); // TODO: rename
|
||||
void selectAsCurrentItem(PdmUiItem* uiItem);
|
||||
|
@ -67,6 +67,11 @@ public:
|
||||
PdmUiTreeViewWidget(QWidget* parent = 0) : QTreeView(parent) {};
|
||||
virtual ~PdmUiTreeViewWidget() {};
|
||||
|
||||
bool isTreeItemEditWidgetActive() const
|
||||
{
|
||||
return state() == QAbstractItemView::EditingState;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void dragMoveEvent(QDragMoveEvent* event)
|
||||
{
|
||||
@ -162,6 +167,14 @@ QTreeView* PdmUiTreeViewEditor::treeView()
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool PdmUiTreeViewEditor::isTreeItemEditWidgetActive() const
|
||||
{
|
||||
return m_treeView->isTreeItemEditWidgetActive();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -58,10 +58,11 @@ class QVBoxLayout;
|
||||
namespace caf
|
||||
{
|
||||
|
||||
class PdmUiItem;
|
||||
class PdmUiTreeViewModel;
|
||||
class PdmChildArrayFieldHandle;
|
||||
class PdmUiDragDropInterface;
|
||||
class PdmUiItem;
|
||||
class PdmUiTreeViewModel;
|
||||
class PdmUiTreeViewWidget;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -94,6 +95,7 @@ public:
|
||||
bool isAppendOfClassNameToUiItemTextEnabled();
|
||||
|
||||
QTreeView* treeView();
|
||||
bool isTreeItemEditWidgetActive() const;
|
||||
|
||||
void selectAsCurrentItem(PdmUiItem* uiItem);
|
||||
void selectedUiItems(std::vector<PdmUiItem*>& objects);
|
||||
@ -133,7 +135,7 @@ private:
|
||||
QPointer<QWidget> m_mainWidget;
|
||||
QVBoxLayout* m_layout;
|
||||
|
||||
QTreeView* m_treeView;
|
||||
PdmUiTreeViewWidget* m_treeView;
|
||||
PdmUiTreeViewModel* m_treeViewModel;
|
||||
|
||||
PdmUiTreeViewEditorAttribute m_editorAttributes;
|
||||
|
Loading…
Reference in New Issue
Block a user