mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
commit
36581daa9b
1678
ApplicationCode/Adm/projectfilekeywords/2018.01/ri-fieldKeywords.txt
Normal file
1678
ApplicationCode/Adm/projectfilekeywords/2018.01/ri-fieldKeywords.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,188 @@
|
|||||||
|
// ResInsight version string : 2018.01.00-dev.01
|
||||||
|
// Report generated : Fri 5. Jan 15:39:23 2018
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
AsciiDataCurve
|
||||||
|
CalcScript
|
||||||
|
CalculatedSummaryCase
|
||||||
|
CellEdgeResultSlot
|
||||||
|
CellFilter
|
||||||
|
CellPropertyFilter
|
||||||
|
CellPropertyFilters
|
||||||
|
CellRangeFilter
|
||||||
|
CellRangeFilterCollection
|
||||||
|
ChangeDataSourceFeatureUi
|
||||||
|
CmdAddItemExecData
|
||||||
|
CmdDeleteItemExecData
|
||||||
|
CmdFieldChangeExecData
|
||||||
|
CrossSection
|
||||||
|
CrossSectionCollection
|
||||||
|
EclipseCase
|
||||||
|
EclipseGeometrySelectionItem
|
||||||
|
Fault
|
||||||
|
Faults
|
||||||
|
FileSummaryCase
|
||||||
|
FishbonesCollection
|
||||||
|
FishbonesMultipleSubs
|
||||||
|
FishbonesPipeProperties
|
||||||
|
FlowCharacteristicsPlot
|
||||||
|
FlowDiagSolution
|
||||||
|
FlowPlotCollection
|
||||||
|
FormationNames
|
||||||
|
FormationNamesCollectionObject
|
||||||
|
FractureContainment
|
||||||
|
FractureDefinitionCollection
|
||||||
|
GeoMechGeometrySelectionItem
|
||||||
|
GeoMechPropertyFilter
|
||||||
|
GeoMechPropertyFilters
|
||||||
|
GeoMechResultDefinition
|
||||||
|
GeoMechResultSlot
|
||||||
|
GeoMechView
|
||||||
|
GridCollection
|
||||||
|
GridSummaryCase
|
||||||
|
GridTimeHistoryCurve
|
||||||
|
IntersectionBox
|
||||||
|
Legend
|
||||||
|
MainPlotCollection
|
||||||
|
MdiWindowController
|
||||||
|
MockModelSettings
|
||||||
|
MultiSnapshotDefinition
|
||||||
|
NoCommonAreaNNC
|
||||||
|
ObservedDataCollection
|
||||||
|
PdmDocument
|
||||||
|
PdmObjectCollection
|
||||||
|
PdmObjectGroup
|
||||||
|
Perforation
|
||||||
|
PerforationCollection
|
||||||
|
PropertyFilter
|
||||||
|
ResInsightAnalysisModels
|
||||||
|
ResInsightGeoMechCase
|
||||||
|
ResInsightGeoMechModels
|
||||||
|
ResInsightOilField
|
||||||
|
ResInsightProject
|
||||||
|
ReservoirCellResultStorage
|
||||||
|
ReservoirView
|
||||||
|
ResultDefinition
|
||||||
|
ResultSlot
|
||||||
|
ResultStorageEntryInfo
|
||||||
|
RftAddress
|
||||||
|
RiaPreferences
|
||||||
|
RiaRegressionTest
|
||||||
|
RicCaseAndFileExportSettingsUi
|
||||||
|
RicCellRangeUi
|
||||||
|
RicDeleteItemExecData
|
||||||
|
RicExportCarfinUi
|
||||||
|
RicExportCompletionDataSettingsUi
|
||||||
|
RicExportToLasFileObj
|
||||||
|
RicExportToLasFileResampleUi
|
||||||
|
RicLinkVisibleViewsFeatureUi
|
||||||
|
RicPasteAsciiDataToSummaryPlotFeatureUi
|
||||||
|
RicSaveEclipseInputVisibleCellsUi
|
||||||
|
RicSelectSummaryPlotUI
|
||||||
|
RicSelectViewUI
|
||||||
|
RicSummaryAddressSelection
|
||||||
|
RicSummaryCurveCalculator
|
||||||
|
RicSummaryCurveCreator
|
||||||
|
RicWellPathsUnitSystemSettingsUi
|
||||||
|
RifReaderSettings
|
||||||
|
RimBinaryExportSettings
|
||||||
|
RimCaseCollection
|
||||||
|
RimCommandExecuteScript
|
||||||
|
RimCommandIssueFieldChanged
|
||||||
|
RimCommandObject
|
||||||
|
RimCsvUserData
|
||||||
|
RimDialogData
|
||||||
|
RimEllipseFractureTemplate
|
||||||
|
RimExportInputSettings
|
||||||
|
RimFaultResultSlot
|
||||||
|
RimFractureExportSettings
|
||||||
|
RimIdenticalGridCaseGroup
|
||||||
|
RimInputProperty
|
||||||
|
RimInputPropertyCollection
|
||||||
|
RimInputReservoir
|
||||||
|
RimNoCommonAreaNncCollection
|
||||||
|
RimObservedEclipseUserData
|
||||||
|
RimOilFieldEntry
|
||||||
|
RimOilRegionEntry
|
||||||
|
RimStatisticalCalculation
|
||||||
|
RimStatisticalCollection
|
||||||
|
RimStimPlanColors
|
||||||
|
RimStimPlanFractureTemplate
|
||||||
|
RimStimPlanLegendConfig
|
||||||
|
RimSummaryCalculation
|
||||||
|
RimSummaryCalculationCollection
|
||||||
|
RimSummaryCalculationVariable
|
||||||
|
RimSummaryCurveCollection
|
||||||
|
RimSummaryCurveCollectionModifier
|
||||||
|
RimTernaryLegendConfig
|
||||||
|
RimTimeStepFilter
|
||||||
|
RimViewLinkerCollection
|
||||||
|
RimWellLogExtractionCurve
|
||||||
|
RimWellPathEntry
|
||||||
|
RimWellPathImport
|
||||||
|
ScriptLocation
|
||||||
|
SimWellFracture
|
||||||
|
SimWellFractureCollection
|
||||||
|
SummaryAddress
|
||||||
|
SummaryCaseCollection
|
||||||
|
SummaryCaseSubCollection
|
||||||
|
SummaryCrossPlot
|
||||||
|
SummaryCrossPlotCollection
|
||||||
|
SummaryCurve
|
||||||
|
SummaryCurveAutoName
|
||||||
|
SummaryCurveFilter
|
||||||
|
SummaryFilterSettings
|
||||||
|
SummaryObservedDataFile
|
||||||
|
SummaryPageDownloadEntity
|
||||||
|
SummaryPlot
|
||||||
|
SummaryPlotCollection
|
||||||
|
SummaryTimeAxisProperties
|
||||||
|
SummaryYAxisProperties
|
||||||
|
TC2
|
||||||
|
TestCommand1
|
||||||
|
TofAccumulatedPhaseFractionsPlot
|
||||||
|
TotalWellAllocationPlot
|
||||||
|
View3dOverlayInfoConfig
|
||||||
|
ViewController
|
||||||
|
ViewLinker
|
||||||
|
Well
|
||||||
|
WellAllocationPlot
|
||||||
|
WellAllocationPlotLegend
|
||||||
|
WellFlowRateCurve
|
||||||
|
WellLogFile
|
||||||
|
WellLogFileChannel
|
||||||
|
WellLogFileCurve
|
||||||
|
WellLogPlot
|
||||||
|
WellLogPlotCollection
|
||||||
|
WellLogPlotTrack
|
||||||
|
WellLogRftCurve
|
||||||
|
WellPath
|
||||||
|
WellPathCompletion
|
||||||
|
WellPathCompletionCollection
|
||||||
|
WellPathCompletions
|
||||||
|
WellPathFracture
|
||||||
|
WellPathFractureCollection
|
||||||
|
WellPaths
|
||||||
|
WellPltPlot
|
||||||
|
WellPltPlotCollection
|
||||||
|
WellRftPlot
|
||||||
|
WellRftPlotCollection
|
||||||
|
Wells
|
||||||
|
closeProject
|
||||||
|
computeCaseGroupStatistics
|
||||||
|
exportMsw
|
||||||
|
exportMultiCaseSnapshots
|
||||||
|
exportProperty
|
||||||
|
exportSimWellCompletions
|
||||||
|
exportSnapshots
|
||||||
|
exportWellPathCompletions
|
||||||
|
loadCase
|
||||||
|
openProject
|
||||||
|
replaceCase
|
||||||
|
replaceSourceCases
|
||||||
|
runOctaveScript
|
||||||
|
setExportFolder
|
||||||
|
setMainWindowSize
|
||||||
|
setStartDir
|
||||||
|
setTimeStep
|
@ -24,6 +24,7 @@ ${CEE_CURRENT_LIST_DIR}RiaStdStringTools.h
|
|||||||
${CEE_CURRENT_LIST_DIR}RiaSummaryCurveAnalyzer.h
|
${CEE_CURRENT_LIST_DIR}RiaSummaryCurveAnalyzer.h
|
||||||
${CEE_CURRENT_LIST_DIR}RiaSimWellBranchTools.h
|
${CEE_CURRENT_LIST_DIR}RiaSimWellBranchTools.h
|
||||||
${CEE_CURRENT_LIST_DIR}RiaProjectFileVersionTools.h
|
${CEE_CURRENT_LIST_DIR}RiaProjectFileVersionTools.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RiaStringEncodingTools.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
@ -45,6 +46,7 @@ ${CEE_CURRENT_LIST_DIR}RiaStdStringTools.cpp
|
|||||||
${CEE_CURRENT_LIST_DIR}RiaSummaryCurveAnalyzer.cpp
|
${CEE_CURRENT_LIST_DIR}RiaSummaryCurveAnalyzer.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RiaSimWellBranchTools.cpp
|
${CEE_CURRENT_LIST_DIR}RiaSimWellBranchTools.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RiaProjectFileVersionTools.cpp
|
${CEE_CURRENT_LIST_DIR}RiaProjectFileVersionTools.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RiaStringEncodingTools.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
43
ApplicationCode/Application/Tools/RiaStringEncodingTools.cpp
Normal file
43
ApplicationCode/Application/Tools/RiaStringEncodingTools.cpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2011- Statoil ASA
|
||||||
|
// Copyright (C) 2013- Ceetron Solutions AS
|
||||||
|
// Copyright (C) 2011-2012 Ceetron AS
|
||||||
|
//
|
||||||
|
// 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 "RiaStringEncodingTools.h"
|
||||||
|
|
||||||
|
|
||||||
|
const std::string RiaStringEncodingTools::toNativeEncoded(const QString& qstring)
|
||||||
|
{
|
||||||
|
#ifdef WIN32
|
||||||
|
return std::string(qstring.toLatin1().data());
|
||||||
|
#else
|
||||||
|
return std::string(qstring.toUtf8().data());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
const QString RiaStringEncodingTools::fromNativeEncoded(const char* native)
|
||||||
|
{
|
||||||
|
#ifdef WIN32
|
||||||
|
return QString::fromLatin1(native);
|
||||||
|
#else
|
||||||
|
return QString::fromUtf8(native);
|
||||||
|
#endif
|
||||||
|
}
|
38
ApplicationCode/Application/Tools/RiaStringEncodingTools.h
Normal file
38
ApplicationCode/Application/Tools/RiaStringEncodingTools.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2011- Statoil ASA
|
||||||
|
// Copyright (C) 2013- Ceetron Solutions AS
|
||||||
|
// Copyright (C) 2011-2012 Ceetron AS
|
||||||
|
//
|
||||||
|
// 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 <QString>
|
||||||
|
#include <QByteArray>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==================================================================================================
|
||||||
|
class RiaStringEncodingTools
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const std::string toNativeEncoded(const QString& qstring);
|
||||||
|
|
||||||
|
static const QString fromNativeEncoded(const char* native);
|
||||||
|
};
|
@ -97,29 +97,29 @@ std::set<RifEclipseSummaryAddress::SummaryVarCategory> RiaSummaryCurveAnalyzer::
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::set<QString> RiaSummaryCurveAnalyzer::identifierTexts(RifEclipseSummaryAddress::SummaryVarCategory category) const
|
std::vector<QString> RiaSummaryCurveAnalyzer::identifierTexts(RifEclipseSummaryAddress::SummaryVarCategory category) const
|
||||||
{
|
{
|
||||||
std::set<QString> stringSet;
|
std::vector<QString> stringSet;
|
||||||
|
|
||||||
if (category == RifEclipseSummaryAddress::SUMMARY_REGION)
|
if (category == RifEclipseSummaryAddress::SUMMARY_REGION)
|
||||||
{
|
{
|
||||||
for (const auto& regionNumber : m_regionNumbers)
|
for (const auto& regionNumber : m_regionNumbers)
|
||||||
{
|
{
|
||||||
stringSet.insert(QString::number(regionNumber));
|
stringSet.push_back(QString::number(regionNumber));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL)
|
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL)
|
||||||
{
|
{
|
||||||
for (const auto& wellName : m_wellNames)
|
for (const auto& wellName : m_wellNames)
|
||||||
{
|
{
|
||||||
stringSet.insert(QString::fromStdString(wellName));
|
stringSet.push_back(QString::fromStdString(wellName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
|
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
|
||||||
{
|
{
|
||||||
for (const auto& wellGroupName : m_wellGroupNames)
|
for (const auto& wellGroupName : m_wellGroupNames)
|
||||||
{
|
{
|
||||||
stringSet.insert(QString::fromStdString(wellGroupName));
|
stringSet.push_back(QString::fromStdString(wellGroupName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public:
|
|||||||
|
|
||||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> categories() const;
|
std::set<RifEclipseSummaryAddress::SummaryVarCategory> categories() const;
|
||||||
|
|
||||||
std::set<QString> identifierTexts(RifEclipseSummaryAddress::SummaryVarCategory category) const;
|
std::vector<QString> identifierTexts(RifEclipseSummaryAddress::SummaryVarCategory category) const;
|
||||||
|
|
||||||
static std::vector<RifEclipseSummaryAddress> addressesForCategory(const std::vector<RifEclipseSummaryAddress>& addresses,
|
static std::vector<RifEclipseSummaryAddress> addressesForCategory(const std::vector<RifEclipseSummaryAddress>& addresses,
|
||||||
RifEclipseSummaryAddress::SummaryVarCategory category);
|
RifEclipseSummaryAddress::SummaryVarCategory category);
|
||||||
|
@ -18,11 +18,14 @@
|
|||||||
|
|
||||||
#include "RicfCommandFileExecutor.h"
|
#include "RicfCommandFileExecutor.h"
|
||||||
|
|
||||||
#include "RifcCommandFileReader.h"
|
|
||||||
#include "RicfCommandObject.h"
|
|
||||||
|
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
|
#include "RicfCloseProject.h"
|
||||||
|
#include "RicfCommandObject.h"
|
||||||
|
#include "RicfOpenProject.h"
|
||||||
|
#include "RicfReplaceCase.h"
|
||||||
|
#include "RifcCommandFileReader.h"
|
||||||
|
|
||||||
namespace caf {
|
namespace caf {
|
||||||
template<>
|
template<>
|
||||||
void RicfCommandFileExecutor::ExportTypeEnum::setUp()
|
void RicfCommandFileExecutor::ExportTypeEnum::setUp()
|
||||||
@ -54,7 +57,9 @@ RicfCommandFileExecutor::~RicfCommandFileExecutor()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicfCommandFileExecutor::executeCommands(QTextStream& stream)
|
void RicfCommandFileExecutor::executeCommands(QTextStream& stream)
|
||||||
{
|
{
|
||||||
std::vector<RicfCommandObject*> commands = RicfCommandFileReader::readCommands(stream, caf::PdmDefaultObjectFactory::instance(), &m_messages);
|
std::vector<RicfCommandObject*> executableCommands;
|
||||||
|
{
|
||||||
|
std::vector<RicfCommandObject*> fileCommands = RicfCommandFileReader::readCommands(stream, caf::PdmDefaultObjectFactory::instance(), &m_messages);
|
||||||
for (auto message : m_messages.m_messages)
|
for (auto message : m_messages.m_messages)
|
||||||
{
|
{
|
||||||
if (message.first == RicfMessages::MESSAGE_WARNING)
|
if (message.first == RicfMessages::MESSAGE_WARNING)
|
||||||
@ -64,12 +69,32 @@ void RicfCommandFileExecutor::executeCommands(QTextStream& stream)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
RiaLogging::error(QString("Command file parsing error: %1").arg(message.second));
|
RiaLogging::error(QString("Command file parsing error: %1").arg(message.second));
|
||||||
|
|
||||||
|
for (auto& command : fileCommands)
|
||||||
|
{
|
||||||
|
delete command;
|
||||||
|
command = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (RicfCommandObject* command : commands)
|
|
||||||
|
executableCommands = RicfCommandFileExecutor::prepareFileCommandsForExecution(fileCommands);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto& command : executableCommands)
|
||||||
{
|
{
|
||||||
command->execute();
|
command->execute();
|
||||||
|
|
||||||
|
delete command;
|
||||||
|
command = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// All command objects should be deleted and grounded at this point
|
||||||
|
for (auto c : executableCommands)
|
||||||
|
{
|
||||||
|
CAF_ASSERT(c == nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,3 +144,66 @@ RicfCommandFileExecutor* RicfCommandFileExecutor::instance()
|
|||||||
static RicfCommandFileExecutor* commandFileExecutorInstance = new RicfCommandFileExecutor();
|
static RicfCommandFileExecutor* commandFileExecutorInstance = new RicfCommandFileExecutor();
|
||||||
return commandFileExecutorInstance;
|
return commandFileExecutorInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<RicfCommandObject*> RicfCommandFileExecutor::prepareFileCommandsForExecution(const std::vector<RicfCommandObject*>& commandsReadFromFile)
|
||||||
|
{
|
||||||
|
// This function will merge multiple RicfSingleCaseReplace object by a single RicfMultiCaseReplace object
|
||||||
|
// A command file version for multi case replace was rejected by @hhgs 2018-02-02
|
||||||
|
//
|
||||||
|
// The reason for this is based on two requirements
|
||||||
|
// 1. Ability to aggregate info from multiple replaceCase() statements in a command file
|
||||||
|
// 2. Improve performance, as a replace case is implemented by reading a project file from XML and replace file paths
|
||||||
|
// during project loading
|
||||||
|
|
||||||
|
std::vector<RicfCommandObject*> executableCommands;
|
||||||
|
{
|
||||||
|
std::vector<RicfSingleCaseReplace*> objectsToBeDeleted;
|
||||||
|
std::vector<RicfSingleCaseReplace*> batchOfReplaceCaseFileObjects;
|
||||||
|
|
||||||
|
std::map<int, QString> aggregatedCasePathPairs;
|
||||||
|
|
||||||
|
for (RicfCommandObject* command : commandsReadFromFile)
|
||||||
|
{
|
||||||
|
RicfSingleCaseReplace* fileReplaceCase = dynamic_cast<RicfSingleCaseReplace*>(command);
|
||||||
|
if (fileReplaceCase)
|
||||||
|
{
|
||||||
|
aggregatedCasePathPairs[fileReplaceCase->caseId()] = fileReplaceCase->filePath();
|
||||||
|
|
||||||
|
batchOfReplaceCaseFileObjects.push_back(fileReplaceCase);
|
||||||
|
objectsToBeDeleted.push_back(fileReplaceCase);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!batchOfReplaceCaseFileObjects.empty())
|
||||||
|
{
|
||||||
|
RicfMultiCaseReplace* multiCaseReplace = new RicfMultiCaseReplace;
|
||||||
|
multiCaseReplace->setCaseReplacePairs(aggregatedCasePathPairs);
|
||||||
|
|
||||||
|
executableCommands.push_back(multiCaseReplace);
|
||||||
|
|
||||||
|
batchOfReplaceCaseFileObjects.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dynamic_cast<RicfOpenProject*>(command) || dynamic_cast<RicfCloseProject*>(command))
|
||||||
|
{
|
||||||
|
// Reset aggregation when openProject or closeProject is issued
|
||||||
|
aggregatedCasePathPairs.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
executableCommands.push_back(command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete RicfSingleCaseReplace objects, as they are replaced by RicfMultiCaseReplace
|
||||||
|
for (auto objToDelete : objectsToBeDeleted)
|
||||||
|
{
|
||||||
|
delete objToDelete;
|
||||||
|
objToDelete = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return executableCommands;
|
||||||
|
}
|
||||||
|
@ -23,6 +23,9 @@
|
|||||||
#include "cafAppEnum.h"
|
#include "cafAppEnum.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class RicfCommandObject;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@ -53,6 +56,8 @@ public:
|
|||||||
|
|
||||||
static RicfCommandFileExecutor* instance();
|
static RicfCommandFileExecutor* instance();
|
||||||
|
|
||||||
|
static std::vector<RicfCommandObject*> prepareFileCommandsForExecution(const std::vector<RicfCommandObject*>& commandsReadFromFile);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RicfMessages m_messages;
|
RicfMessages m_messages;
|
||||||
|
|
||||||
|
@ -18,18 +18,20 @@
|
|||||||
|
|
||||||
#include "RicfReplaceCase.h"
|
#include "RicfReplaceCase.h"
|
||||||
|
|
||||||
#include "RicfCommandFileExecutor.h"
|
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
#include "RiaProjectModifier.h"
|
#include "RiaProjectModifier.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RicfReplaceCase, "replaceCase");
|
#include "RicfCommandFileExecutor.h"
|
||||||
|
|
||||||
|
#include "RimProject.h"
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT(RicfSingleCaseReplace, "replaceCase");
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfReplaceCase::RicfReplaceCase()
|
RicfSingleCaseReplace::RicfSingleCaseReplace()
|
||||||
{
|
{
|
||||||
RICF_InitField(&m_caseId, "caseId", -1, "Case ID", "", "", "");
|
RICF_InitField(&m_caseId, "caseId", -1, "Case ID", "", "", "");
|
||||||
RICF_InitField(&m_newGridFile, "newGridFile", QString(), "New Grid File", "", "", "");
|
RICF_InitField(&m_newGridFile, "newGridFile", QString(), "New Grid File", "", "", "");
|
||||||
@ -38,11 +40,56 @@ RicfReplaceCase::RicfReplaceCase()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicfReplaceCase::execute()
|
int RicfSingleCaseReplace::caseId() const
|
||||||
{
|
{
|
||||||
if (m_newGridFile().isNull())
|
return m_caseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RicfSingleCaseReplace::filePath() const
|
||||||
{
|
{
|
||||||
RiaLogging::error("replaceCase: Required parameter newGridFile.");
|
return m_newGridFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicfSingleCaseReplace::execute()
|
||||||
|
{
|
||||||
|
// Never call execute on this object, information is aggregated into RicfMultiCaseReplace
|
||||||
|
CAF_ASSERT(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT(RicfMultiCaseReplace, "replaceCaseImpl_no_support_for_command_file_text_parsing");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RicfMultiCaseReplace::RicfMultiCaseReplace()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicfMultiCaseReplace::setCaseReplacePairs(const std::map<int, QString>& caseIdToGridFileNameMap)
|
||||||
|
{
|
||||||
|
m_caseIdToGridFileNameMap = caseIdToGridFileNameMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicfMultiCaseReplace::execute()
|
||||||
|
{
|
||||||
|
if (m_caseIdToGridFileNameMap.empty())
|
||||||
|
{
|
||||||
|
RiaLogging::error("replaceCaseImpl: No replacements available.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,15 +100,19 @@ void RicfReplaceCase::execute()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
|
||||||
if (m_caseId() == -1)
|
for (const auto& a : m_caseIdToGridFileNameMap)
|
||||||
{
|
{
|
||||||
projectModifier->setReplaceCaseFirstOccurrence(m_newGridFile());
|
const auto caseId = a.first;
|
||||||
|
const auto filePath = a.second;
|
||||||
|
if (caseId < 0)
|
||||||
|
{
|
||||||
|
projectModifier->setReplaceCaseFirstOccurrence(filePath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
projectModifier->setReplaceCase(m_caseId(), m_newGridFile());
|
projectModifier->setReplaceCase(caseId, filePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RiaApplication::instance()->loadProject(lastProjectPath, RiaApplication::PLA_NONE, projectModifier.p());
|
RiaApplication::instance()->loadProject(lastProjectPath, RiaApplication::PLA_NONE, projectModifier.p());
|
||||||
|
@ -23,16 +23,22 @@
|
|||||||
#include "cafPdmField.h"
|
#include "cafPdmField.h"
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
// RicfSingleCaseReplace represents the parsed command from text file able to replace one case ID with
|
||||||
|
// a new file name
|
||||||
//
|
//
|
||||||
|
// This is the preferred interface on file, based on discussion with @hhgs 2018-02-02
|
||||||
//
|
//
|
||||||
//
|
// Multiple objects of this type can be aggregated into RicfMultipleReplaceCase
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicfReplaceCase : public RicfCommandObject
|
class RicfSingleCaseReplace : public RicfCommandObject
|
||||||
{
|
{
|
||||||
CAF_PDM_HEADER_INIT;
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RicfReplaceCase();
|
RicfSingleCaseReplace();
|
||||||
|
|
||||||
|
int caseId() const;
|
||||||
|
QString filePath() const;
|
||||||
|
|
||||||
virtual void execute() override;
|
virtual void execute() override;
|
||||||
|
|
||||||
@ -40,3 +46,25 @@ private:
|
|||||||
caf::PdmField<QString> m_newGridFile;
|
caf::PdmField<QString> m_newGridFile;
|
||||||
caf::PdmField<int> m_caseId;
|
caf::PdmField<int> m_caseId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
// RicfMultipleReplaceCase represents multiple caseId-gridFileName pairs
|
||||||
|
//
|
||||||
|
// NB! This object has no support for parsing a text command. This object is created by aggregating
|
||||||
|
// multiple RicfSingleCaseReplace objects
|
||||||
|
//
|
||||||
|
//==================================================================================================
|
||||||
|
class RicfMultiCaseReplace : public RicfCommandObject
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RicfMultiCaseReplace();
|
||||||
|
|
||||||
|
void setCaseReplacePairs(const std::map<int, QString>& caseIdToGridFileNameMap);
|
||||||
|
|
||||||
|
virtual void execute() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::map<int, QString> m_caseIdToGridFileNameMap;
|
||||||
|
};
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicExportFishbonesLateralsFeature, "RicExportFishbonesLateralsFeature");
|
CAF_CMD_SOURCE_INIT(RicExportFishbonesLateralsFeature, "RicExportFishbonesLateralsFeature");
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@
|
|||||||
#include "cvfMath.h"
|
#include "cvfMath.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
|
|||||||
std::map<size_t, std::vector<WellBorePartForTransCalc> > wellBorePartsInCells; //wellBore = main bore or fishbone lateral
|
std::map<size_t, std::vector<WellBorePartForTransCalc> > wellBorePartsInCells; //wellBore = main bore or fishbone lateral
|
||||||
findFishboneLateralsWellBoreParts(wellBorePartsInCells, wellPath, settings);
|
findFishboneLateralsWellBoreParts(wellBorePartsInCells, wellPath, settings);
|
||||||
findFishboneImportedLateralsWellBoreParts(wellBorePartsInCells, wellPath, settings);
|
findFishboneImportedLateralsWellBoreParts(wellBorePartsInCells, wellPath, settings);
|
||||||
if (!wellBorePartsInCells.empty())
|
if (!wellBorePartsInCells.empty() && !settings.excludeMainBoreForFishbones)
|
||||||
{
|
{
|
||||||
findMainWellBoreParts(wellBorePartsInCells, wellPath, settings);
|
findMainWellBoreParts(wellBorePartsInCells, wellPath, settings);
|
||||||
}
|
}
|
||||||
|
@ -537,11 +537,6 @@ RigCompletionData RicWellPathExportCompletionDataFeature::combineEclipseCellComp
|
|||||||
return resultCompletion; //Returning empty completion, should not be exported
|
return resultCompletion; //Returning empty completion, should not be exported
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.excludeMainBoreForFishbones && completionType == RigCompletionData::FISHBONES && completion.isMainBore())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
totalTrans = totalTrans + completion.transmissibility();
|
totalTrans = totalTrans + completion.transmissibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ void RicWellPathImportPerforationIntervalsFeature::onActionTriggered(bool isChec
|
|||||||
|
|
||||||
std::map<QString, std::vector<RifPerforationInterval> > perforationIntervals = RifPerforationIntervalReader::readPerforationIntervals(wellPathFilePaths);
|
std::map<QString, std::vector<RifPerforationInterval> > perforationIntervals = RifPerforationIntervalReader::readPerforationIntervals(wellPathFilePaths);
|
||||||
|
|
||||||
|
RimPerforationInterval* lastPerforationInterval = nullptr;
|
||||||
for (auto& entry : perforationIntervals)
|
for (auto& entry : perforationIntervals)
|
||||||
{
|
{
|
||||||
RimWellPath* wellPath = wellPathCollection->tryFindMatchingWellPath(entry.first);
|
RimWellPath* wellPath = wellPathCollection->tryFindMatchingWellPath(entry.first);
|
||||||
@ -95,14 +96,21 @@ void RicWellPathImportPerforationIntervalsFeature::onActionTriggered(bool isChec
|
|||||||
perforationInterval->setDate(interval.date);
|
perforationInterval->setDate(interval.date);
|
||||||
}
|
}
|
||||||
wellPath->perforationIntervalCollection()->appendPerforation(perforationInterval);
|
wellPath->perforationIntervalCollection()->appendPerforation(perforationInterval);
|
||||||
|
lastPerforationInterval = perforationInterval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
wellPathCollection->uiCapability()->updateConnectedEditors();
|
||||||
|
|
||||||
if (app->project())
|
if (app->project())
|
||||||
{
|
{
|
||||||
app->project()->createDisplayModelAndRedrawAllViews();
|
app->project()->createDisplayModelAndRedrawAllViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lastPerforationInterval)
|
||||||
|
{
|
||||||
|
RiuMainWindow::instance()->selectAsCurrentItem(lastPerforationInterval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -100,7 +100,7 @@ void RicAppendIntersectionFeatureCmd::redo()
|
|||||||
|
|
||||||
RimIntersection* intersection = new RimIntersection();
|
RimIntersection* intersection = new RimIntersection();
|
||||||
intersection->name = QString("Intersection");
|
intersection->name = QString("Intersection");
|
||||||
m_intersectionCollection->appendIntersection(intersection);
|
m_intersectionCollection->appendIntersectionAndUpdate(intersection);
|
||||||
|
|
||||||
RimView* view = nullptr;
|
RimView* view = nullptr;
|
||||||
m_intersectionCollection->firstAncestorOrThisOfTypeAsserted(view);
|
m_intersectionCollection->firstAncestorOrThisOfTypeAsserted(view);
|
||||||
|
@ -122,7 +122,7 @@ void RicNewAzimuthDipIntersectionFeatureCmd::redo()
|
|||||||
intersection->setLengthDown(cvf::Math::floor(bBox.extent()[2] / 2));
|
intersection->setLengthDown(cvf::Math::floor(bBox.extent()[2] / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_intersectionCollection->appendIntersection(intersection);
|
m_intersectionCollection->appendIntersectionAndUpdate(intersection);
|
||||||
|
|
||||||
RiuSelectionManager::instance()->deleteAllItems();
|
RiuSelectionManager::instance()->deleteAllItems();
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem(intersection);
|
RiuMainWindow::instance()->selectAsCurrentItem(intersection);
|
||||||
|
@ -112,7 +112,7 @@ void RicNewPolylineIntersectionFeatureCmd::redo()
|
|||||||
intersection->type = RimIntersection::CS_POLYLINE;
|
intersection->type = RimIntersection::CS_POLYLINE;
|
||||||
intersection->inputPolyLineFromViewerEnabled = true;
|
intersection->inputPolyLineFromViewerEnabled = true;
|
||||||
|
|
||||||
m_intersectionCollection->appendIntersection(intersection);
|
m_intersectionCollection->appendIntersectionAndUpdate(intersection);
|
||||||
|
|
||||||
RiuSelectionManager::instance()->deleteAllItems();
|
RiuSelectionManager::instance()->deleteAllItems();
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ void RicNewSimWellIntersectionCmd::redo()
|
|||||||
intersection->type = RimIntersection::CS_SIMULATION_WELL;
|
intersection->type = RimIntersection::CS_SIMULATION_WELL;
|
||||||
intersection->simulationWell = m_simWell;
|
intersection->simulationWell = m_simWell;
|
||||||
|
|
||||||
m_intersectionCollection->appendIntersection(intersection);
|
m_intersectionCollection->appendIntersectionAndUpdate(intersection);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -116,7 +116,7 @@ void RicNewWellPathIntersectionFeatureCmd::redo()
|
|||||||
intersection->type = RimIntersection::CS_WELL_PATH;
|
intersection->type = RimIntersection::CS_WELL_PATH;
|
||||||
intersection->wellPath = m_wellPath;
|
intersection->wellPath = m_wellPath;
|
||||||
|
|
||||||
m_intersectionCollection->appendIntersection(intersection);
|
m_intersectionCollection->appendIntersectionAndUpdate(intersection);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "RicExportFaultsFeature.h"
|
#include "RicExportFaultsFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
#include "RigEclipseCaseData.h"
|
#include "RigEclipseCaseData.h"
|
||||||
#include "RigFault.h"
|
#include "RigFault.h"
|
||||||
@ -33,7 +34,6 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicExportFaultsFeature, "RicExportFaultsFeature");
|
CAF_CMD_SOURCE_INIT(RicExportFaultsFeature, "RicExportFaultsFeature");
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ void RicExportFaultsFeature::saveFault(QString completeFilename, const RigMainGr
|
|||||||
|
|
||||||
if (!exportFile.open(QIODevice::WriteOnly) )
|
if (!exportFile.open(QIODevice::WriteOnly) )
|
||||||
{
|
{
|
||||||
QMessageBox::critical(NULL, "ResInsight - Export Faults", "Could not open the file :\n" + completeFilename);
|
RiaLogging::error("Could not open the file : " + completeFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextStream stream(&exportFile);
|
QTextStream stream(&exportFile);
|
||||||
|
@ -238,8 +238,9 @@ void RicExportMultipleSnapshotsFeature::exportViewVariationsToFolder(RimView* ri
|
|||||||
if (msd->sliceDirection == RimMultiSnapshotDefinition::NO_RANGEFILTER)
|
if (msd->sliceDirection == RimMultiSnapshotDefinition::NO_RANGEFILTER)
|
||||||
{
|
{
|
||||||
QString fileName = viewCaseResultString + "_" + timeStepString;
|
QString fileName = viewCaseResultString + "_" + timeStepString;
|
||||||
|
fileName.replace(" ", "_");
|
||||||
|
|
||||||
QString absoluteFileName = caf::Utils::constructFullFileName(folder, fileName, ".png");
|
QString absoluteFileName = caf::Utils::constructFullFileName(folder, fileName, ".png");
|
||||||
absoluteFileName.replace(" ", "_");
|
|
||||||
|
|
||||||
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, rimView);
|
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, rimView);
|
||||||
}
|
}
|
||||||
@ -274,9 +275,9 @@ void RicExportMultipleSnapshotsFeature::exportViewVariationsToFolder(RimView* ri
|
|||||||
}
|
}
|
||||||
|
|
||||||
rimView->rangeFilterCollection()->updateDisplayModeNotifyManagedViews(rangeFilter);
|
rimView->rangeFilterCollection()->updateDisplayModeNotifyManagedViews(rangeFilter);
|
||||||
|
fileName.replace(" ", "_");
|
||||||
|
|
||||||
QString absoluteFileName = caf::Utils::constructFullFileName(folder, fileName, ".png");
|
QString absoluteFileName = caf::Utils::constructFullFileName(folder, fileName, ".png");
|
||||||
absoluteFileName.replace(" ", "_");
|
|
||||||
|
|
||||||
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, rimView);
|
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, rimView);
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputVisibleCellsFeature, "RicSaveEclipseInputVisibleCellsFeature");
|
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputVisibleCellsFeature, "RicSaveEclipseInputVisibleCellsFeature");
|
||||||
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputActiveVisibleCellsFeature, "RicSaveEclipseInputActiveVisibleCellsFeature");
|
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputActiveVisibleCellsFeature, "RicSaveEclipseInputActiveVisibleCellsFeature");
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "RicSaveEclipseResultAsInputPropertyExec.h"
|
#include "RicSaveEclipseResultAsInputPropertyExec.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
#include "RicExportFeatureImpl.h"
|
#include "RicExportFeatureImpl.h"
|
||||||
|
|
||||||
@ -38,7 +39,7 @@
|
|||||||
#include "cafPdmUiPropertyViewDialog.h"
|
#include "cafPdmUiPropertyViewDialog.h"
|
||||||
#include "cafUtils.h"
|
#include "cafUtils.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -101,7 +102,7 @@ void RicSaveEclipseResultAsInputPropertyExec::redo()
|
|||||||
bool isOk = RifEclipseInputFileTools::writeBinaryResultToTextFile(exportSettings.fileName, m_cellColors->reservoirView()->eclipseCase()->eclipseCaseData(), timeStep, m_cellColors, exportSettings.eclipseKeyword, exportSettings.undefinedValue);
|
bool isOk = RifEclipseInputFileTools::writeBinaryResultToTextFile(exportSettings.fileName, m_cellColors->reservoirView()->eclipseCase()->eclipseCaseData(), timeStep, m_cellColors, exportSettings.eclipseKeyword, exportSettings.undefinedValue);
|
||||||
if (!isOk)
|
if (!isOk)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(NULL, "File export", "Failed to exported current result to " + exportSettings.fileName);
|
RiaLogging::error("Failed to exported current result to " + exportSettings.fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMdiSubWindow>
|
#include <QMdiSubWindow>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicSnapshotAllPlotsToFileFeature, "RicSnapshotAllPlotsToFileFeature");
|
CAF_CMD_SOURCE_INIT(RicSnapshotAllPlotsToFileFeature, "RicSnapshotAllPlotsToFileFeature");
|
||||||
@ -63,7 +62,7 @@ void RicSnapshotAllPlotsToFileFeature::saveAllPlots()
|
|||||||
exportSnapshotOfAllPlotsIntoFolder(snapshotFolderName);
|
exportSnapshotOfAllPlotsIntoFolder(snapshotFolderName);
|
||||||
|
|
||||||
QString text = QString("Exported snapshots to folder : \n%1").arg(snapshotFolderName);
|
QString text = QString("Exported snapshots to folder : \n%1").arg(snapshotFolderName);
|
||||||
QMessageBox::information(nullptr, "Export Snapshots To Folder", text);
|
RiaLogging::info(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -92,9 +91,9 @@ void RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(QStrin
|
|||||||
if (viewWindow->isMdiWindow() && viewWindow->viewWidget())
|
if (viewWindow->isMdiWindow() && viewWindow->viewWidget())
|
||||||
{
|
{
|
||||||
QString fileName = RicSnapshotFilenameGenerator::generateSnapshotFileName(viewWindow);
|
QString fileName = RicSnapshotFilenameGenerator::generateSnapshotFileName(viewWindow);
|
||||||
|
fileName.replace(" ", "_");
|
||||||
|
|
||||||
QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png");
|
QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png");
|
||||||
absoluteFileName.replace(" ", "_");
|
|
||||||
|
|
||||||
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, viewWindow);
|
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, viewWindow);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMdiSubWindow>
|
#include <QMdiSubWindow>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicSnapshotAllViewsToFileFeature, "RicSnapshotAllViewsToFileFeature");
|
CAF_CMD_SOURCE_INIT(RicSnapshotAllViewsToFileFeature, "RicSnapshotAllViewsToFileFeature");
|
||||||
@ -64,7 +63,7 @@ void RicSnapshotAllViewsToFileFeature::saveAllViews()
|
|||||||
exportSnapshotOfAllViewsIntoFolder(snapshotFolderName);
|
exportSnapshotOfAllViewsIntoFolder(snapshotFolderName);
|
||||||
|
|
||||||
QString text = QString("Exported snapshots to folder : \n%1").arg(snapshotFolderName);
|
QString text = QString("Exported snapshots to folder : \n%1").arg(snapshotFolderName);
|
||||||
QMessageBox::information(nullptr, "Export Snapshots To Folder", text);
|
RiaLogging::info(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -51,7 +51,7 @@ QString RicSnapshotFilenameGenerator::generateSnapshotFileName(RimViewWindow* vi
|
|||||||
fileName = viewWindow->uiCapability()->uiName();
|
fileName = viewWindow->uiCapability()->uiName();
|
||||||
}
|
}
|
||||||
|
|
||||||
fileName = caf::Utils::makeValidFileBasename(fileName);
|
fileName = makeValidFileName(fileName);
|
||||||
|
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
@ -68,10 +68,10 @@ QString RicSnapshotFilenameGenerator::generateSnapshotFilenameForRimView(RimView
|
|||||||
.arg(rimView->name())
|
.arg(rimView->name())
|
||||||
.arg(resultName(rimView));
|
.arg(resultName(rimView));
|
||||||
|
|
||||||
if ( timeSteps.size() ) fileName += QString("_%1_%2").arg(timeStep, 2, 10, QChar('0'))
|
if ( !timeSteps.empty() ) fileName += QString("_%1_%2").arg(timeStep, 2, 10, QChar('0'))
|
||||||
.arg(timeSteps[timeStep].replace(".", "-"));
|
.arg(timeSteps[timeStep]);
|
||||||
|
|
||||||
fileName = caf::Utils::makeValidFileBasename(fileName);
|
fileName = makeValidFileName(fileName);
|
||||||
|
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
@ -109,3 +109,18 @@ QString RicSnapshotFilenameGenerator::resultName(RimView * rimView)
|
|||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RicSnapshotFilenameGenerator::makeValidFileName(const QString& filename)
|
||||||
|
{
|
||||||
|
QString trimmedString = filename;
|
||||||
|
|
||||||
|
// Use lowercase instead of dash before calling caf::Utils::makeValidFileBasename
|
||||||
|
trimmedString.replace("-", "_");
|
||||||
|
|
||||||
|
trimmedString = caf::Utils::makeValidFileBasename(trimmedString);
|
||||||
|
|
||||||
|
return trimmedString;
|
||||||
|
}
|
||||||
|
@ -34,4 +34,5 @@ public:
|
|||||||
private:
|
private:
|
||||||
static QString generateSnapshotFilenameForRimView(RimView* rimView);
|
static QString generateSnapshotFilenameForRimView(RimView* rimView);
|
||||||
static QString resultName(RimView* rimView);
|
static QString resultName(RimView* rimView);
|
||||||
|
static QString makeValidFileName(const QString& filename);
|
||||||
};
|
};
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMdiSubWindow>
|
#include <QMdiSubWindow>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicSnapshotViewToClipboardFeature, "RicSnapshotViewToClipboardFeature");
|
CAF_CMD_SOURCE_INIT(RicSnapshotViewToClipboardFeature, "RicSnapshotViewToClipboardFeature");
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMdiSubWindow>
|
#include <QMdiSubWindow>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicSnapshotViewToFileFeature, "RicSnapshotViewToFileFeature");
|
CAF_CMD_SOURCE_INIT(RicSnapshotViewToFileFeature, "RicSnapshotViewToFileFeature");
|
||||||
|
@ -295,6 +295,7 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot*
|
|||||||
newCurve->setSummaryAddressY(addr);
|
newCurve->setSummaryAddressY(addr);
|
||||||
newCurve->setColor(color);
|
newCurve->setColor(color);
|
||||||
newCurve->setLeftOrRightAxisY(plotAxis);
|
newCurve->setLeftOrRightAxisY(plotAxis);
|
||||||
|
newCurve->loadDataAndUpdate(true);
|
||||||
|
|
||||||
return newCurve;
|
return newCurve;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ void RicAppendIntersectionBoxFeature::onActionTriggered(bool isChecked)
|
|||||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||||
intersectionBox->name = QString("Intersection Box");
|
intersectionBox->name = QString("Intersection Box");
|
||||||
|
|
||||||
coll->appendIntersectionBox(intersectionBox);
|
coll->appendIntersectionBoxAndUpdate(intersectionBox);
|
||||||
|
|
||||||
intersectionBox->setToDefaultSizeBox();
|
intersectionBox->setToDefaultSizeBox();
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ void RicIntersectionBoxAtPosFeature::onActionTriggered(bool isChecked)
|
|||||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||||
intersectionBox->name = QString("Intersection box");
|
intersectionBox->name = QString("Intersection box");
|
||||||
|
|
||||||
coll->appendIntersectionBox(intersectionBox);
|
coll->appendIntersectionBoxAndUpdate(intersectionBox);
|
||||||
|
|
||||||
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
||||||
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_NONE, domainCoord);
|
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_NONE, domainCoord);
|
||||||
|
@ -59,7 +59,7 @@ void RicIntersectionBoxXSliceFeature::onActionTriggered(bool isChecked)
|
|||||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||||
intersectionBox->name = QString("X-slice (Intersection box)");
|
intersectionBox->name = QString("X-slice (Intersection box)");
|
||||||
|
|
||||||
coll->appendIntersectionBox(intersectionBox);
|
coll->appendIntersectionBoxAndUpdate(intersectionBox);
|
||||||
|
|
||||||
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
||||||
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_X, domainCoord);
|
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_X, domainCoord);
|
||||||
|
@ -59,7 +59,7 @@ void RicIntersectionBoxYSliceFeature::onActionTriggered(bool isChecked)
|
|||||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||||
intersectionBox->name = QString("Y-slice (Intersection box)");
|
intersectionBox->name = QString("Y-slice (Intersection box)");
|
||||||
|
|
||||||
coll->appendIntersectionBox(intersectionBox);
|
coll->appendIntersectionBoxAndUpdate(intersectionBox);
|
||||||
|
|
||||||
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
||||||
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Y, domainCoord);
|
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Y, domainCoord);
|
||||||
|
@ -59,7 +59,7 @@ void RicIntersectionBoxZSliceFeature::onActionTriggered(bool isChecked)
|
|||||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||||
intersectionBox->name = QString("Z-slice (Intersection box)");
|
intersectionBox->name = QString("Z-slice (Intersection box)");
|
||||||
|
|
||||||
coll->appendIntersectionBox(intersectionBox);
|
coll->appendIntersectionBoxAndUpdate(intersectionBox);
|
||||||
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
||||||
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Z, domainCoord);
|
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Z, domainCoord);
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicDeleteScriptPathFeature, "RicDeleteScriptPathFeature");
|
CAF_CMD_SOURCE_INIT(RicDeleteScriptPathFeature, "RicDeleteScriptPathFeature");
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicConvertAllFractureTemplatesToMetricFeature, "RicConvertAllFractureTemplatesToMetricFeature");
|
CAF_CMD_SOURCE_INIT(RicConvertAllFractureTemplatesToMetricFeature, "RicConvertAllFractureTemplatesToMetricFeature");
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "RimCase.h"
|
#include "RimCase.h"
|
||||||
#include "RimCellRangeFilterCollection.h"
|
#include "RimCellRangeFilterCollection.h"
|
||||||
#include "RimEclipsePropertyFilterCollection.h"
|
#include "RimEclipsePropertyFilterCollection.h"
|
||||||
|
#include "RimEclipseView.h"
|
||||||
#include "RimFormationNamesCollection.h"
|
#include "RimFormationNamesCollection.h"
|
||||||
#include "RimGeoMechPropertyFilterCollection.h"
|
#include "RimGeoMechPropertyFilterCollection.h"
|
||||||
#include "RimIntersectionCollection.h"
|
#include "RimIntersectionCollection.h"
|
||||||
@ -150,6 +151,16 @@ void RicDeleteItemExec::redo()
|
|||||||
{
|
{
|
||||||
proj->createDisplayModelAndRedrawAllViews();
|
proj->createDisplayModelAndRedrawAllViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<RimView*> views;
|
||||||
|
proj->allVisibleViews(views);
|
||||||
|
for (RimView* view : views)
|
||||||
|
{
|
||||||
|
if (dynamic_cast<RimEclipseView*>(view))
|
||||||
|
{
|
||||||
|
view->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ void RicGridStatisticsDialog::setInfoText(RimView* view)
|
|||||||
QString text;
|
QString text;
|
||||||
text = overlayInfo->timeStepText();
|
text = overlayInfo->timeStepText();
|
||||||
text += overlayInfo->caseInfoText();
|
text += overlayInfo->caseInfoText();
|
||||||
text += overlayInfo->resultInfoText(overlayInfo->histogramData(), true);
|
text += overlayInfo->resultInfoText(overlayInfo->histogramData());
|
||||||
m_textEdit->setText(text);
|
m_textEdit->setText(text);
|
||||||
adjustTextEditHeightToContent();
|
adjustTextEditHeightToContent();
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
#include "RimOilField.h"
|
#include "RimOilField.h"
|
||||||
|
#include "RimEclipseView.h"
|
||||||
#include "RimEllipseFractureTemplate.h"
|
#include "RimEllipseFractureTemplate.h"
|
||||||
#include "RimFractureTemplateCollection.h"
|
#include "RimFractureTemplateCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
@ -58,6 +59,18 @@ void RicNewEllipseFractureTemplateFeature::onActionTriggered(bool isChecked)
|
|||||||
fractureDef->setDefaultWellDiameterFromUnit();
|
fractureDef->setDefaultWellDiameterFromUnit();
|
||||||
|
|
||||||
fracDefColl->updateConnectedEditors();
|
fracDefColl->updateConnectedEditors();
|
||||||
|
|
||||||
|
std::vector<RimView*> views;
|
||||||
|
project->allVisibleViews(views);
|
||||||
|
|
||||||
|
for (RimView* view : views)
|
||||||
|
{
|
||||||
|
if (dynamic_cast<RimEclipseView*>(view))
|
||||||
|
{
|
||||||
|
view->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem(fractureDef);
|
RiuMainWindow::instance()->selectAsCurrentItem(fractureDef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,9 @@ CAF_CMD_SOURCE_INIT(RicNewSimWellFractureAtPosFeature, "RicNewSimWellFractureAtP
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
|
void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allFractureTemplates().empty()) return;
|
||||||
|
|
||||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||||
if (!activeView) return;
|
if (!activeView) return;
|
||||||
|
|
||||||
@ -120,6 +123,9 @@ void RicNewSimWellFractureAtPosFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicNewSimWellFractureAtPosFeature::isCommandEnabled()
|
bool RicNewSimWellFractureAtPosFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allFractureTemplates().empty()) return false;
|
||||||
|
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||||
if (!pdmUiItem) return false;
|
if (!pdmUiItem) return false;
|
||||||
|
|
||||||
|
@ -50,6 +50,9 @@ CAF_CMD_SOURCE_INIT(RicNewSimWellFractureFeature, "RicNewSimWellFractureFeature"
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewSimWellFractureFeature::onActionTriggered(bool isChecked)
|
void RicNewSimWellFractureFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allFractureTemplates().empty()) return;
|
||||||
|
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||||
if (!pdmUiItem) return;
|
if (!pdmUiItem) return;
|
||||||
|
|
||||||
@ -109,6 +112,9 @@ void RicNewSimWellFractureFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicNewSimWellFractureFeature::isCommandEnabled()
|
bool RicNewSimWellFractureFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allFractureTemplates().empty()) return false;
|
||||||
|
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||||
if (!pdmUiItem) return false;
|
if (!pdmUiItem) return false;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
#include "RimOilField.h"
|
#include "RimOilField.h"
|
||||||
|
#include "RimEclipseView.h"
|
||||||
#include "RimFractureTemplateCollection.h"
|
#include "RimFractureTemplateCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimStimPlanFractureTemplate.h"
|
#include "RimStimPlanFractureTemplate.h"
|
||||||
@ -44,7 +45,7 @@ void RicNewStimPlanFractureTemplateFeature::onActionTriggered(bool isChecked)
|
|||||||
{
|
{
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
QString defaultDir = app->lastUsedDialogDirectory("BINARY_GRID");
|
QString defaultDir = app->lastUsedDialogDirectory("BINARY_GRID");
|
||||||
QString fileName = QFileDialog::getOpenFileName(NULL, "Open StimPlan XML File", defaultDir, "StimPlan XML File (*.xml);;All files(*.*)");
|
QString fileName = QFileDialog::getOpenFileName(nullptr, "Open StimPlan XML File", defaultDir, "StimPlan XML File (*.xml);;All files(*.*)");
|
||||||
|
|
||||||
if (fileName.isEmpty()) return;
|
if (fileName.isEmpty()) return;
|
||||||
|
|
||||||
@ -67,6 +68,18 @@ void RicNewStimPlanFractureTemplateFeature::onActionTriggered(bool isChecked)
|
|||||||
fractureDef->setDefaultWellDiameterFromUnit();
|
fractureDef->setDefaultWellDiameterFromUnit();
|
||||||
|
|
||||||
fracDefColl->updateConnectedEditors();
|
fracDefColl->updateConnectedEditors();
|
||||||
|
|
||||||
|
std::vector<RimView*> views;
|
||||||
|
project->allVisibleViews(views);
|
||||||
|
|
||||||
|
for (RimView* view : views)
|
||||||
|
{
|
||||||
|
if (dynamic_cast<RimEclipseView*>(view))
|
||||||
|
{
|
||||||
|
view->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem(fractureDef);
|
RiuMainWindow::instance()->selectAsCurrentItem(fractureDef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#include "RicNewWellPathFractureFeature.h"
|
#include "RicNewWellPathFractureFeature.h"
|
||||||
|
|
||||||
|
#include "RimProject.h"
|
||||||
|
|
||||||
#include "RiuSelectionManager.h"
|
#include "RiuSelectionManager.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@ -35,6 +37,9 @@ CAF_CMD_SOURCE_INIT(RicNewWellPathFractureAtPosFeature, "RicNewWellPathFractureA
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewWellPathFractureAtPosFeature::onActionTriggered(bool isChecked)
|
void RicNewWellPathFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allFractureTemplates().empty()) return;
|
||||||
|
|
||||||
RiuSelectionManager* riuSelManager = RiuSelectionManager::instance();
|
RiuSelectionManager* riuSelManager = RiuSelectionManager::instance();
|
||||||
RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY);
|
RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY);
|
||||||
|
|
||||||
@ -61,5 +66,8 @@ void RicNewWellPathFractureAtPosFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicNewWellPathFractureAtPosFeature::isCommandEnabled()
|
bool RicNewWellPathFractureAtPosFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allFractureTemplates().empty()) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -96,6 +96,9 @@ void RicNewWellPathFractureFeature::addFracture(RimWellPath* wellPath, double me
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewWellPathFractureFeature::onActionTriggered(bool isChecked)
|
void RicNewWellPathFractureFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allFractureTemplates().empty()) return;
|
||||||
|
|
||||||
RimWellPathFractureCollection* fractureColl = RicNewWellPathFractureFeature::selectedWellPathFractureCollection();
|
RimWellPathFractureCollection* fractureColl = RicNewWellPathFractureFeature::selectedWellPathFractureCollection();
|
||||||
if (!fractureColl) return;
|
if (!fractureColl) return;
|
||||||
|
|
||||||
@ -120,6 +123,9 @@ void RicNewWellPathFractureFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicNewWellPathFractureFeature::isCommandEnabled()
|
bool RicNewWellPathFractureFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if (proj->allFractureTemplates().empty()) return false;
|
||||||
|
|
||||||
if (selectedWellPathFractureCollection())
|
if (selectedWellPathFractureCollection())
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "cafPdmUiListEditor.h"
|
#include "cafPdmUiListEditor.h"
|
||||||
#include "cafPdmUiPushButtonEditor.h"
|
#include "cafPdmUiPushButtonEditor.h"
|
||||||
#include "cafPdmUiTreeSelectionEditor.h"
|
#include "cafPdmUiTreeSelectionEditor.h"
|
||||||
|
#include "cafPdmUiObjectEditorHandle.h"
|
||||||
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RicSummaryCurveCalculator, "RicSummaryCurveCalculator");
|
CAF_PDM_SOURCE_INIT(RicSummaryCurveCalculator, "RicSummaryCurveCalculator");
|
||||||
@ -134,6 +135,7 @@ void RicSummaryCurveCalculator::fieldChangedByUi(const caf::PdmFieldHandle* chan
|
|||||||
m_currentCalculation = nullptr;
|
m_currentCalculation = nullptr;
|
||||||
|
|
||||||
this->updateConnectedEditors();
|
this->updateConnectedEditors();
|
||||||
|
caf::PdmUiObjectEditorHandle::updateUiAllObjectEditors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -247,6 +249,7 @@ bool RicSummaryCurveCalculator::calculate() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_currentCalculation()->updateDependentCurvesAndPlots();
|
m_currentCalculation()->updateDependentCurvesAndPlots();
|
||||||
|
caf::PdmUiObjectEditorHandle::updateUiAllObjectEditors();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -268,7 +271,7 @@ void RicSummaryCurveCalculator::defineEditorAttribute(const caf::PdmFieldHandle*
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
/// f
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicSummaryCurveCalculator::onEditorWidgetsCreated()
|
void RicSummaryCurveCalculator::onEditorWidgetsCreated()
|
||||||
{
|
{
|
||||||
|
@ -510,8 +510,10 @@ void RicSummaryCurveCreator::populateCurveCreator(const RimSummaryPlot& sourceSu
|
|||||||
curve->setCurveVisiblity(false);
|
curve->setCurveVisiblity(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_previewPlot->copyAxisPropertiesFromOther(sourceSummaryPlot);
|
||||||
m_previewPlot->enableAutoPlotTitle(sourceSummaryPlot.autoPlotTitle());
|
m_previewPlot->enableAutoPlotTitle(sourceSummaryPlot.autoPlotTitle());
|
||||||
m_previewPlot->updatePlotTitle();
|
m_previewPlot->updatePlotTitle();
|
||||||
|
m_previewPlot->updateAxes();
|
||||||
|
|
||||||
m_summaryCurveSelectionEditor->summaryAddressSelection()->setSelectedCurveDefinitions(curveDefs);
|
m_summaryCurveSelectionEditor->summaryAddressSelection()->setSelectedCurveDefinitions(curveDefs);
|
||||||
|
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ void RicWellPathFormationsImportFileFeature::onActionTriggered(bool isChecked)
|
|||||||
|
|
||||||
if (oilField->wellPathCollection->wellPaths().size() > 0)
|
if (oilField->wellPathCollection->wellPaths().size() > 0)
|
||||||
{
|
{
|
||||||
RimWellPath* wellPath = oilField->wellPathCollection->newestAddedWellPath();
|
RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath();
|
||||||
if (wellPath)
|
if (wellPath)
|
||||||
{
|
{
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
|
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
|
||||||
|
@ -70,7 +70,7 @@ void RicWellPathsImportFileFeature::onActionTriggered(bool isChecked)
|
|||||||
|
|
||||||
if (oilField->wellPathCollection->wellPaths().size() > 0)
|
if (oilField->wellPathCollection->wellPaths().size() > 0)
|
||||||
{
|
{
|
||||||
RimWellPath* wellPath = oilField->wellPathCollection->newestAddedWellPath();
|
RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath();
|
||||||
if (wellPath)
|
if (wellPath)
|
||||||
{
|
{
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
|
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
|
||||||
|
@ -342,7 +342,17 @@ void RifEclipseInputFileTools::findKeywordsOnFile(const QString &fileName, std::
|
|||||||
|
|
||||||
filepos = data.pos() - lineLength;
|
filepos = data.pos() - lineLength;
|
||||||
keyPos.filePos = filepos;
|
keyPos.filePos = filepos;
|
||||||
keyPos.keyword = line.trimmed();
|
|
||||||
|
QString keywordCandidate = line;
|
||||||
|
int commentStart = keywordCandidate.indexOf("--");
|
||||||
|
if (commentStart > 0)
|
||||||
|
{
|
||||||
|
keywordCandidate = keywordCandidate.left(commentStart);
|
||||||
|
}
|
||||||
|
|
||||||
|
keywordCandidate = keywordCandidate.trimmed();
|
||||||
|
|
||||||
|
keyPos.keyword = keywordCandidate;
|
||||||
keywords->push_back(keyPos);
|
keywords->push_back(keyPos);
|
||||||
//qDebug() << keyPos.keyword << " - " << keyPos.filePos;
|
//qDebug() << keyPos.keyword << " - " << keyPos.filePos;
|
||||||
}
|
}
|
||||||
@ -430,6 +440,7 @@ const std::vector<QString>& RifEclipseInputFileTools::invalidPropertyDataKeyword
|
|||||||
keywords.push_back("ZCORN");
|
keywords.push_back("ZCORN");
|
||||||
keywords.push_back("SPECGRID");
|
keywords.push_back("SPECGRID");
|
||||||
keywords.push_back("MAPAXES");
|
keywords.push_back("MAPAXES");
|
||||||
|
keywords.push_back("NOECHO");
|
||||||
|
|
||||||
keywords.push_back(faultsKeyword);
|
keywords.push_back(faultsKeyword);
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "RifEclipseRestartFilesetAccess.h"
|
#include "RifEclipseRestartFilesetAccess.h"
|
||||||
#include "RifEclipseUnifiedRestartFileAccess.h"
|
#include "RifEclipseUnifiedRestartFileAccess.h"
|
||||||
|
#include "RiaStringEncodingTools.h"
|
||||||
#include "RiaQDateTimeTools.h"
|
#include "RiaQDateTimeTools.h"
|
||||||
|
|
||||||
#include "ert/ecl/ecl_file.h"
|
#include "ert/ecl/ecl_file.h"
|
||||||
@ -183,7 +184,7 @@ void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vector<Q
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifEclipseOutputFileTools::keywordData(ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<double>* values)
|
bool RifEclipseOutputFileTools::keywordData(ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<double>* values)
|
||||||
{
|
{
|
||||||
ecl_kw_type* kwData = ecl_file_iget_named_kw(ecl_file, keyword.toAscii().data(), static_cast<int>(fileKeywordOccurrence));
|
ecl_kw_type* kwData = ecl_file_iget_named_kw(ecl_file, RiaStringEncodingTools::toNativeEncoded(keyword).data(), static_cast<int>(fileKeywordOccurrence));
|
||||||
if (kwData)
|
if (kwData)
|
||||||
{
|
{
|
||||||
size_t numValues = ecl_kw_get_size(kwData);
|
size_t numValues = ecl_kw_get_size(kwData);
|
||||||
@ -205,7 +206,7 @@ bool RifEclipseOutputFileTools::keywordData(ecl_file_type* ecl_file, const QStri
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifEclipseOutputFileTools::keywordData(ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<int>* values)
|
bool RifEclipseOutputFileTools::keywordData(ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<int>* values)
|
||||||
{
|
{
|
||||||
ecl_kw_type* kwData = ecl_file_iget_named_kw(ecl_file, keyword.toAscii().data(), static_cast<int>(fileKeywordOccurrence));
|
ecl_kw_type* kwData = ecl_file_iget_named_kw(ecl_file, RiaStringEncodingTools::toNativeEncoded(keyword).data(), static_cast<int>(fileKeywordOccurrence));
|
||||||
if (kwData)
|
if (kwData)
|
||||||
{
|
{
|
||||||
size_t numValues = ecl_kw_get_size(kwData);
|
size_t numValues = ecl_kw_get_size(kwData);
|
||||||
@ -232,7 +233,7 @@ QString RifEclipseOutputFileTools::firstFileNameOfType(const QStringList& fileSe
|
|||||||
{
|
{
|
||||||
bool formatted = false;
|
bool formatted = false;
|
||||||
int reportNumber = -1;
|
int reportNumber = -1;
|
||||||
if (ecl_util_get_file_type(fileSet.at(i).toAscii().data(), &formatted, &reportNumber) == fileType)
|
if (ecl_util_get_file_type(RiaStringEncodingTools::toNativeEncoded(fileSet.at(i)).data(), &formatted, &reportNumber) == fileType)
|
||||||
{
|
{
|
||||||
return fileSet.at(i);
|
return fileSet.at(i);
|
||||||
}
|
}
|
||||||
@ -253,7 +254,7 @@ QStringList RifEclipseOutputFileTools::filterFileNamesOfType(const QStringList&
|
|||||||
{
|
{
|
||||||
bool formatted = false;
|
bool formatted = false;
|
||||||
int reportNumber = -1;
|
int reportNumber = -1;
|
||||||
if (ecl_util_get_file_type(fileSet.at(i).toAscii().data(), &formatted, &reportNumber) == fileType)
|
if (ecl_util_get_file_type(RiaStringEncodingTools::toNativeEncoded(fileSet.at(i)).data(), &formatted, &reportNumber) == fileType)
|
||||||
{
|
{
|
||||||
fileNames.append(fileSet.at(i));
|
fileNames.append(fileSet.at(i));
|
||||||
}
|
}
|
||||||
@ -276,12 +277,12 @@ bool RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(const QString&
|
|||||||
QString fileNameBase = QFileInfo(fullPathFileName).baseName();
|
QString fileNameBase = QFileInfo(fullPathFileName).baseName();
|
||||||
|
|
||||||
stringlist_type* eclipseFiles = stringlist_alloc_new();
|
stringlist_type* eclipseFiles = stringlist_alloc_new();
|
||||||
ecl_util_select_filelist(filePath.toAscii().data(), fileNameBase.toAscii().data(), ECL_OTHER_FILE, false, eclipseFiles);
|
ecl_util_select_filelist(RiaStringEncodingTools::toNativeEncoded(filePath).data(), RiaStringEncodingTools::toNativeEncoded(fileNameBase).data(), ECL_OTHER_FILE, false, eclipseFiles);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < stringlist_get_size(eclipseFiles); i++)
|
for (i = 0; i < stringlist_get_size(eclipseFiles); i++)
|
||||||
{
|
{
|
||||||
baseNameFiles->append(stringlist_safe_iget(eclipseFiles, i));
|
baseNameFiles->append(RiaStringEncodingTools::fromNativeEncoded(stringlist_safe_iget(eclipseFiles, i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
stringlist_free(eclipseFiles);
|
stringlist_free(eclipseFiles);
|
||||||
@ -294,7 +295,7 @@ bool RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(const QString&
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifEclipseOutputFileTools::readGridDimensions(const QString& gridFileName, std::vector< std::vector<int> >& gridDimensions)
|
void RifEclipseOutputFileTools::readGridDimensions(const QString& gridFileName, std::vector< std::vector<int> >& gridDimensions)
|
||||||
{
|
{
|
||||||
ecl_grid_type * grid = ecl_grid_alloc(gridFileName.toAscii().data()); // bootstrap ecl_grid instance
|
ecl_grid_type * grid = ecl_grid_alloc(RiaStringEncodingTools::toNativeEncoded(gridFileName).data()); // bootstrap ecl_grid instance
|
||||||
stringlist_type * lgr_names = ecl_grid_alloc_lgr_name_list( grid ); // get a list of all the lgr names.
|
stringlist_type * lgr_names = ecl_grid_alloc_lgr_name_list( grid ); // get a list of all the lgr names.
|
||||||
|
|
||||||
//printf("grid:%s has %d a total of %d lgr's \n", grid_filename , stringlist_get_size( lgr_names ));
|
//printf("grid:%s has %d a total of %d lgr's \n", grid_filename , stringlist_get_size( lgr_names ));
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "RifEclipseRestartFilesetAccess.h"
|
#include "RifEclipseRestartFilesetAccess.h"
|
||||||
#include "RifEclipseOutputFileTools.h"
|
#include "RifEclipseOutputFileTools.h"
|
||||||
|
#include "RiaStringEncodingTools.h"
|
||||||
|
|
||||||
#include "cafProgressInfo.h"
|
#include "cafProgressInfo.h"
|
||||||
|
|
||||||
#include "ert/ecl/ecl_file.h"
|
#include "ert/ecl/ecl_file.h"
|
||||||
@ -251,8 +253,7 @@ void RifEclipseRestartFilesetAccess::readWellData(well_info_type* well_info, boo
|
|||||||
|
|
||||||
if (m_ecl_files[i])
|
if (m_ecl_files[i])
|
||||||
{
|
{
|
||||||
const char* fileName = ecl_file_get_src_file(m_ecl_files[i]);
|
int reportNumber = RifEclipseRestartFilesetAccess::reportNumber(m_ecl_files[i]);
|
||||||
int reportNumber = ecl_util_filename_report_nr(fileName);
|
|
||||||
if(reportNumber != -1)
|
if(reportNumber != -1)
|
||||||
{
|
{
|
||||||
well_info_add_wells(well_info, m_ecl_files[i], reportNumber, importCompleteMswData);
|
well_info_add_wells(well_info, m_ecl_files[i], reportNumber, importCompleteMswData);
|
||||||
@ -271,7 +272,7 @@ void RifEclipseRestartFilesetAccess::openTimeStep(size_t timeStep)
|
|||||||
if (m_ecl_files[timeStep] == NULL)
|
if (m_ecl_files[timeStep] == NULL)
|
||||||
{
|
{
|
||||||
int index = static_cast<int>(timeStep);
|
int index = static_cast<int>(timeStep);
|
||||||
ecl_file_type* ecl_file = ecl_file_open(m_fileNames[index].toAscii().data(), ECL_FILE_CLOSE_STREAM);
|
ecl_file_type* ecl_file = ecl_file_open(RiaStringEncodingTools::toNativeEncoded(m_fileNames[index]).data(), ECL_FILE_CLOSE_STREAM);
|
||||||
|
|
||||||
m_ecl_files[timeStep] = ecl_file;
|
m_ecl_files[timeStep] = ecl_file;
|
||||||
|
|
||||||
@ -284,6 +285,23 @@ void RifEclipseRestartFilesetAccess::openTimeStep(size_t timeStep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
int RifEclipseRestartFilesetAccess::reportNumber(const ecl_file_type* ecl_file)
|
||||||
|
{
|
||||||
|
if (!ecl_file) return -1;
|
||||||
|
|
||||||
|
const char* eclFileName = ecl_file_get_src_file(ecl_file);
|
||||||
|
QString fileNameUpper(eclFileName);
|
||||||
|
fileNameUpper = fileNameUpper.toUpper();
|
||||||
|
|
||||||
|
// Convert to upper case, as ecl_util_filename_report_nr does not handle lower case file extensions
|
||||||
|
int reportNumber = ecl_util_filename_report_nr(RiaStringEncodingTools::toNativeEncoded(fileNameUpper).data());
|
||||||
|
|
||||||
|
return reportNumber;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -315,12 +333,11 @@ std::vector<int> RifEclipseRestartFilesetAccess::reportNumbers()
|
|||||||
{
|
{
|
||||||
std::vector<int> reportNr;
|
std::vector<int> reportNr;
|
||||||
|
|
||||||
for (size_t i = 0; i < m_ecl_files.size(); i++)
|
for (const auto* ecl_file : m_ecl_files)
|
||||||
{
|
{
|
||||||
if (m_ecl_files[i])
|
if (ecl_file)
|
||||||
{
|
{
|
||||||
const char* fileName = ecl_file_get_src_file(m_ecl_files[i]);
|
int reportNumber = RifEclipseRestartFilesetAccess::reportNumber(ecl_file);
|
||||||
int reportNumber = ecl_util_filename_report_nr(fileName);
|
|
||||||
if (reportNumber != -1)
|
if (reportNumber != -1)
|
||||||
{
|
{
|
||||||
reportNr.push_back(reportNumber);
|
reportNr.push_back(reportNumber);
|
||||||
|
@ -58,6 +58,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void openTimeStep(size_t timeStep);
|
void openTimeStep(size_t timeStep);
|
||||||
|
static int reportNumber(const ecl_file_type* ecl_file);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStringList m_fileNames;
|
QStringList m_fileNames;
|
||||||
|
@ -20,17 +20,21 @@
|
|||||||
|
|
||||||
#include "RiaSummaryCurveAnalyzer.h"
|
#include "RiaSummaryCurveAnalyzer.h"
|
||||||
#include "RifReaderEclipseSummary.h"
|
#include "RifReaderEclipseSummary.h"
|
||||||
|
#include "RiaStringEncodingTools.h"
|
||||||
|
|
||||||
#include "cafAppEnum.h"
|
#include "cafAppEnum.h"
|
||||||
|
|
||||||
#include "ert/ecl/ecl_util.h"
|
#include "ert/ecl/ecl_util.h"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifEclipseSummaryTools::findSummaryHeaderFile(const std::string& inputFile, std::string* headerFile, bool* isFormatted)
|
void RifEclipseSummaryTools::findSummaryHeaderFile(const QString& inputFile, QString* headerFile, bool* isFormatted)
|
||||||
{
|
{
|
||||||
findSummaryHeaderFileInfo(inputFile, headerFile, NULL, NULL, isFormatted);
|
findSummaryHeaderFileInfo(inputFile, headerFile, NULL, NULL, isFormatted);
|
||||||
}
|
}
|
||||||
@ -38,9 +42,9 @@ void RifEclipseSummaryTools::findSummaryHeaderFile(const std::string& inputFile,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifEclipseSummaryTools::findSummaryFiles(const std::string& inputFile,
|
void RifEclipseSummaryTools::findSummaryFiles(const QString& inputFile,
|
||||||
std::string* headerFile,
|
QString* headerFile,
|
||||||
std::vector<std::string>* dataFiles)
|
QStringList* dataFiles)
|
||||||
{
|
{
|
||||||
dataFiles->clear();
|
dataFiles->clear();
|
||||||
headerFile->clear();
|
headerFile->clear();
|
||||||
@ -49,21 +53,21 @@ void RifEclipseSummaryTools::findSummaryFiles(const std::string& inputFile,
|
|||||||
char* myBase = NULL;
|
char* myBase = NULL;
|
||||||
char* myExtention = NULL;
|
char* myExtention = NULL;
|
||||||
|
|
||||||
util_alloc_file_components(inputFile.data(), &myPath, &myBase, &myExtention);
|
util_alloc_file_components(RiaStringEncodingTools::toNativeEncoded(inputFile).data(), &myPath, &myBase, &myExtention);
|
||||||
|
|
||||||
std::string path; if(myPath) path = myPath;
|
QString path; if(myPath) path = RiaStringEncodingTools::fromNativeEncoded(myPath);
|
||||||
std::string base; if(myBase) base = myBase;
|
QString base; if(myBase) base = RiaStringEncodingTools::fromNativeEncoded(myBase);
|
||||||
std::string extention; if(myExtention) extention = myExtention;
|
std::string extention; if(myExtention) extention = myExtention;
|
||||||
|
|
||||||
if(path.empty() || base.empty()) return ;
|
if(path.isEmpty() || base.isEmpty()) return ;
|
||||||
|
|
||||||
char* myHeaderFile = NULL;
|
char* myHeaderFile = NULL;
|
||||||
stringlist_type* summary_file_list = stringlist_alloc_new();
|
stringlist_type* summary_file_list = stringlist_alloc_new();
|
||||||
|
|
||||||
ecl_util_alloc_summary_files(path.data(), base.data(), extention.data(), &myHeaderFile, summary_file_list);
|
ecl_util_alloc_summary_files(RiaStringEncodingTools::toNativeEncoded(path).data(), RiaStringEncodingTools::toNativeEncoded(base).data(), extention.data(), &myHeaderFile, summary_file_list);
|
||||||
if(myHeaderFile)
|
if(myHeaderFile)
|
||||||
{
|
{
|
||||||
(*headerFile) = myHeaderFile;
|
(*headerFile) = RiaStringEncodingTools::fromNativeEncoded(myHeaderFile);
|
||||||
util_safe_free(myHeaderFile);
|
util_safe_free(myHeaderFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +75,7 @@ void RifEclipseSummaryTools::findSummaryFiles(const std::string& inputFile,
|
|||||||
{
|
{
|
||||||
for(int i = 0; i < stringlist_get_size(summary_file_list); i++)
|
for(int i = 0; i < stringlist_get_size(summary_file_list); i++)
|
||||||
{
|
{
|
||||||
dataFiles->push_back(stringlist_iget(summary_file_list,i));
|
dataFiles->push_back(RiaStringEncodingTools::fromNativeEncoded(stringlist_iget(summary_file_list,i)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stringlist_free(summary_file_list);
|
stringlist_free(summary_file_list);
|
||||||
@ -83,12 +87,12 @@ void RifEclipseSummaryTools::findSummaryFiles(const std::string& inputFile,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifEclipseSummaryTools::hasSummaryFiles(const std::string& gridFileName)
|
bool RifEclipseSummaryTools::hasSummaryFiles(const QString& gridFileName)
|
||||||
{
|
{
|
||||||
std::string headerFileName;
|
QString headerFileName;
|
||||||
std::vector<std::string> dataFileNames;
|
QStringList dataFileNames;
|
||||||
RifEclipseSummaryTools::findSummaryFiles(gridFileName, &headerFileName, &dataFileNames);
|
RifEclipseSummaryTools::findSummaryFiles(gridFileName, &headerFileName, &dataFileNames);
|
||||||
if (!headerFileName.empty() && dataFileNames.size()) return true;
|
if (!headerFileName.isEmpty() && dataFileNames.size()) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -96,25 +100,25 @@ bool RifEclipseSummaryTools::hasSummaryFiles(const std::string& gridFileName)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<std::string> RifEclipseSummaryTools::findSummaryDataFiles(const std::string& caseFile)
|
QStringList RifEclipseSummaryTools::findSummaryDataFiles(const QString& caseFile)
|
||||||
{
|
{
|
||||||
std::vector<std::string> fileNames;
|
QStringList fileNames;
|
||||||
|
|
||||||
std::string path;
|
QString path;
|
||||||
std::string base;
|
QString base;
|
||||||
|
|
||||||
findSummaryHeaderFileInfo(caseFile, NULL, &path, &base, NULL);
|
findSummaryHeaderFileInfo(caseFile, NULL, &path, &base, NULL);
|
||||||
if (path.empty() || base.empty()) return fileNames;
|
if (path.isEmpty() || base.isEmpty()) return fileNames;
|
||||||
|
|
||||||
char* header_file = NULL;
|
char* header_file = NULL;
|
||||||
stringlist_type* summary_file_list = stringlist_alloc_new();
|
stringlist_type* summary_file_list = stringlist_alloc_new();
|
||||||
|
|
||||||
ecl_util_alloc_summary_files(path.data(), base.data(), NULL, &header_file, summary_file_list);
|
ecl_util_alloc_summary_files(RiaStringEncodingTools::toNativeEncoded(path).data(), RiaStringEncodingTools::toNativeEncoded(base).data(), NULL, &header_file, summary_file_list);
|
||||||
if (stringlist_get_size( summary_file_list ) > 0)
|
if (stringlist_get_size( summary_file_list ) > 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < stringlist_get_size(summary_file_list); i++)
|
for (int i = 0; i < stringlist_get_size(summary_file_list); i++)
|
||||||
{
|
{
|
||||||
fileNames.push_back(stringlist_iget(summary_file_list, i));
|
fileNames.push_back(RiaStringEncodingTools::fromNativeEncoded(stringlist_iget(summary_file_list, i)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,13 +167,13 @@ void RifEclipseSummaryTools::dumpMetaData(RifSummaryReaderInterface* readerEclip
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifEclipseSummaryTools::findSummaryHeaderFileInfo(const std::string& inputFile, std::string* headerFile, std::string* path, std::string* base, bool* isFormatted)
|
void RifEclipseSummaryTools::findSummaryHeaderFileInfo(const QString& inputFile, QString* headerFile, QString* path, QString* base, bool* isFormatted)
|
||||||
{
|
{
|
||||||
char* myPath = NULL;
|
char* myPath = NULL;
|
||||||
char* myBase = NULL;
|
char* myBase = NULL;
|
||||||
bool formattedFile = true;
|
bool formattedFile = true;
|
||||||
|
|
||||||
util_alloc_file_components(inputFile.data(), &myPath, &myBase, NULL);
|
util_alloc_file_components(RiaStringEncodingTools::toNativeEncoded(inputFile).data(), &myPath, &myBase, NULL);
|
||||||
|
|
||||||
char* myHeaderFile = ecl_util_alloc_exfilename(myPath, myBase, ECL_SUMMARY_HEADER_FILE, true, -1);
|
char* myHeaderFile = ecl_util_alloc_exfilename(myPath, myBase, ECL_SUMMARY_HEADER_FILE, true, -1);
|
||||||
if (!myHeaderFile)
|
if (!myHeaderFile)
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class RifSummaryReaderInterface;
|
class RifSummaryReaderInterface;
|
||||||
|
class QStringList;
|
||||||
|
class QString;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@ -33,13 +35,13 @@ class RifSummaryReaderInterface;
|
|||||||
class RifEclipseSummaryTools
|
class RifEclipseSummaryTools
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void findSummaryHeaderFile(const std::string& inputFile, std::string* headerFile, bool* isFormatted);
|
static void findSummaryHeaderFile(const QString& inputFile, QString* headerFile, bool* isFormatted);
|
||||||
static std::vector<std::string> findSummaryDataFiles(const std::string& caseFile);
|
static QStringList findSummaryDataFiles(const QString& caseFile);
|
||||||
|
|
||||||
static void findSummaryFiles(const std::string& inputFile, std::string* headerFile, std::vector<std::string>* dataFiles);
|
static void findSummaryFiles(const QString& inputFile, QString* headerFile, QStringList* dataFiles);
|
||||||
static bool hasSummaryFiles(const std::string& gridFileName);
|
static bool hasSummaryFiles(const QString& gridFileName);
|
||||||
static void dumpMetaData(RifSummaryReaderInterface* readerEclipseSummary);
|
static void dumpMetaData(RifSummaryReaderInterface* readerEclipseSummary);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void findSummaryHeaderFileInfo(const std::string& inputFile, std::string* headerFile, std::string* path, std::string* base, bool* isFormatted);
|
static void findSummaryHeaderFileInfo(const QString& inputFile, QString* headerFile, QString* path, QString* base, bool* isFormatted);
|
||||||
};
|
};
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "RifEclipseOutputFileTools.h"
|
#include "RifEclipseOutputFileTools.h"
|
||||||
#include "RifReaderSettings.h"
|
#include "RifReaderSettings.h"
|
||||||
|
#include "RiaStringEncodingTools.h"
|
||||||
|
|
||||||
#include "ert/ecl/ecl_file.h"
|
#include "ert/ecl/ecl_file.h"
|
||||||
#include "ert/ecl/ecl_kw_magic.h"
|
#include "ert/ecl/ecl_kw_magic.h"
|
||||||
@ -83,7 +84,7 @@ bool RifEclipseUnifiedRestartFileAccess::openFile()
|
|||||||
|
|
||||||
if (resultFileInfo.lastModified() < indexFileInfo.lastModified())
|
if (resultFileInfo.lastModified() < indexFileInfo.lastModified())
|
||||||
{
|
{
|
||||||
m_ecl_file = ecl_file_fast_open(m_filename.toAscii().data(), indexFileName.toAscii().data(), ECL_FILE_CLOSE_STREAM);
|
m_ecl_file = ecl_file_fast_open(RiaStringEncodingTools::toNativeEncoded(m_filename).data(), RiaStringEncodingTools::toNativeEncoded(indexFileName).data(), ECL_FILE_CLOSE_STREAM);
|
||||||
if (!m_ecl_file)
|
if (!m_ecl_file)
|
||||||
{
|
{
|
||||||
RiaLogging::error(QString("Failed to open file %1 using index file.").arg(m_filename));
|
RiaLogging::error(QString("Failed to open file %1 using index file.").arg(m_filename));
|
||||||
@ -99,7 +100,7 @@ bool RifEclipseUnifiedRestartFileAccess::openFile()
|
|||||||
|
|
||||||
if (!m_ecl_file)
|
if (!m_ecl_file)
|
||||||
{
|
{
|
||||||
m_ecl_file = ecl_file_open(m_filename.toAscii().data(), ECL_FILE_CLOSE_STREAM);
|
m_ecl_file = ecl_file_open(RiaStringEncodingTools::toNativeEncoded(m_filename).data(), ECL_FILE_CLOSE_STREAM);
|
||||||
if (!m_ecl_file)
|
if (!m_ecl_file)
|
||||||
{
|
{
|
||||||
RiaLogging::error(QString("Failed to open file %1").arg(m_filename));
|
RiaLogging::error(QString("Failed to open file %1").arg(m_filename));
|
||||||
@ -112,7 +113,7 @@ bool RifEclipseUnifiedRestartFileAccess::openFile()
|
|||||||
QString resultPath = fi.absolutePath();
|
QString resultPath = fi.absolutePath();
|
||||||
if (caf::Utils::isFolderWritable(resultPath))
|
if (caf::Utils::isFolderWritable(resultPath))
|
||||||
{
|
{
|
||||||
bool success = ecl_file_write_index(m_ecl_file, indexFileName.toAscii().data());
|
bool success = ecl_file_write_index(m_ecl_file, RiaStringEncodingTools::toNativeEncoded(indexFileName).data());
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "RifEclipseOutputFileTools.h"
|
#include "RifEclipseOutputFileTools.h"
|
||||||
#include "RifHdf5ReaderInterface.h"
|
#include "RifHdf5ReaderInterface.h"
|
||||||
#include "RifReaderSettings.h"
|
#include "RifReaderSettings.h"
|
||||||
|
#include "RiaStringEncodingTools.h"
|
||||||
|
|
||||||
#ifdef USE_HDF5
|
#ifdef USE_HDF5
|
||||||
#include "RifHdf5Reader.h"
|
#include "RifHdf5Reader.h"
|
||||||
@ -374,7 +375,7 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigEclipseCaseData* e
|
|||||||
|
|
||||||
// Read geometry
|
// Read geometry
|
||||||
// Todo: Needs to check existence of file before calling ert, else it will abort
|
// Todo: Needs to check existence of file before calling ert, else it will abort
|
||||||
ecl_grid_type * mainEclGrid = ecl_grid_alloc( fileName.toAscii().data() );
|
ecl_grid_type * mainEclGrid = ecl_grid_alloc( RiaStringEncodingTools::toNativeEncoded(fileName).data() );
|
||||||
|
|
||||||
progInfo.incrementProgress();
|
progInfo.incrementProgress();
|
||||||
|
|
||||||
@ -693,7 +694,7 @@ bool RifReaderEclipseOutput::openAndReadActiveCellData(const QString& fileName,
|
|||||||
// Keep the set of files of interest
|
// Keep the set of files of interest
|
||||||
m_filesWithSameBaseName = fileSet;
|
m_filesWithSameBaseName = fileSet;
|
||||||
m_eclipseCase = eclipseCase;
|
m_eclipseCase = eclipseCase;
|
||||||
|
m_fileName = fileName;
|
||||||
|
|
||||||
if (!readActiveCellInfo())
|
if (!readActiveCellInfo())
|
||||||
{
|
{
|
||||||
@ -722,7 +723,7 @@ bool RifReaderEclipseOutput::readActiveCellInfo()
|
|||||||
QString egridFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_EGRID_FILE);
|
QString egridFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_EGRID_FILE);
|
||||||
if (egridFileName.size() > 0)
|
if (egridFileName.size() > 0)
|
||||||
{
|
{
|
||||||
ecl_file_type* ecl_file = ecl_file_open(egridFileName.toAscii().data(), ECL_FILE_CLOSE_STREAM);
|
ecl_file_type* ecl_file = ecl_file_open(RiaStringEncodingTools::toNativeEncoded(egridFileName).data(), ECL_FILE_CLOSE_STREAM);
|
||||||
if (!ecl_file) return false;
|
if (!ecl_file) return false;
|
||||||
|
|
||||||
int actnumKeywordCount = ecl_file_get_num_named_kw(ecl_file, ACTNUM_KW);
|
int actnumKeywordCount = ecl_file_get_num_named_kw(ecl_file, ACTNUM_KW);
|
||||||
@ -2108,6 +2109,9 @@ std::vector<RigEclipseTimeStepInfo> RifReaderEclipseOutput::createFilteredTimeSt
|
|||||||
m_dynamicResultsAccess->timeSteps(&timeStepsOnFile, &daysSinceSimulationStartOnFile);
|
m_dynamicResultsAccess->timeSteps(&timeStepsOnFile, &daysSinceSimulationStartOnFile);
|
||||||
reportNumbersOnFile = m_dynamicResultsAccess->reportNumbers();
|
reportNumbersOnFile = m_dynamicResultsAccess->reportNumbers();
|
||||||
|
|
||||||
|
if (timeStepsOnFile.size() != daysSinceSimulationStartOnFile.size()) return timeStepInfos;
|
||||||
|
if (timeStepsOnFile.size() != reportNumbersOnFile.size()) return timeStepInfos;
|
||||||
|
|
||||||
for (size_t i = 0; i < timeStepsOnFile.size(); i++)
|
for (size_t i = 0; i < timeStepsOnFile.size(); i++)
|
||||||
{
|
{
|
||||||
if (this->isTimeStepIncludedByFilter(i))
|
if (this->isTimeStepIncludedByFilter(i))
|
||||||
@ -2210,7 +2214,7 @@ void RifReaderEclipseOutput::openInitFile()
|
|||||||
QString initFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_INIT_FILE);
|
QString initFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_INIT_FILE);
|
||||||
if (initFileName.size() > 0)
|
if (initFileName.size() > 0)
|
||||||
{
|
{
|
||||||
m_ecl_init_file = ecl_file_open(initFileName.toAscii().data(), ECL_FILE_CLOSE_STREAM);
|
m_ecl_init_file = ecl_file_open(RiaStringEncodingTools::toNativeEncoded(initFileName).data(), ECL_FILE_CLOSE_STREAM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
#include "RiaQDateTimeTools.h"
|
#include "RiaQDateTimeTools.h"
|
||||||
|
|
||||||
|
#include "RiaStringEncodingTools.h"
|
||||||
|
|
||||||
#include "cafVecIjk.h"
|
#include "cafVecIjk.h"
|
||||||
|
|
||||||
#include "ert/ecl/ecl_rft_file.h"
|
#include "ert/ecl/ecl_rft_file.h"
|
||||||
@ -28,7 +30,7 @@
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RifReaderEclipseRft::RifReaderEclipseRft(const std::string& fileName):
|
RifReaderEclipseRft::RifReaderEclipseRft(const QString& fileName):
|
||||||
m_fileName(fileName), m_ecl_rft_file(nullptr)
|
m_fileName(fileName), m_ecl_rft_file(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -45,15 +47,15 @@ RifReaderEclipseRft::~RifReaderEclipseRft()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifReaderEclipseRft::open()
|
void RifReaderEclipseRft::open()
|
||||||
{
|
{
|
||||||
if (m_fileName.empty()) return;
|
if (m_fileName.isEmpty()) return;
|
||||||
|
|
||||||
RiaLogging::info(QString("Opening file '%1'").arg(m_fileName.c_str()));
|
RiaLogging::info(QString("Opening file '%1'").arg( m_fileName));
|
||||||
|
|
||||||
m_ecl_rft_file = ecl_rft_file_alloc_case(m_fileName.data());
|
m_ecl_rft_file = ecl_rft_file_alloc_case(RiaStringEncodingTools::toNativeEncoded(m_fileName).data());
|
||||||
|
|
||||||
if (m_ecl_rft_file == NULL)
|
if (m_ecl_rft_file == NULL)
|
||||||
{
|
{
|
||||||
RiaLogging::warning(QString("Libecl could not find/open file '%'").arg(m_fileName.c_str()));
|
RiaLogging::warning(QString("Libecl could not find/open file '%'").arg( m_fileName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace caf
|
|||||||
class RifReaderEclipseRft : public cvf::Object
|
class RifReaderEclipseRft : public cvf::Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RifReaderEclipseRft(const std::string& fileName);
|
RifReaderEclipseRft(const QString& fileName);
|
||||||
~RifReaderEclipseRft();
|
~RifReaderEclipseRft();
|
||||||
|
|
||||||
const std::vector<RifEclipseRftAddress>& eclipseRftAddresses();
|
const std::vector<RifEclipseRftAddress>& eclipseRftAddresses();
|
||||||
@ -63,7 +63,7 @@ private:
|
|||||||
// Taken from ecl_rft_file.h and ecl_rft_node.h
|
// Taken from ecl_rft_file.h and ecl_rft_node.h
|
||||||
typedef struct ecl_rft_file_struct ecl_rft_file_type;
|
typedef struct ecl_rft_file_struct ecl_rft_file_type;
|
||||||
|
|
||||||
std::string m_fileName;
|
QString m_fileName;
|
||||||
ecl_rft_file_type* m_ecl_rft_file;
|
ecl_rft_file_type* m_ecl_rft_file;
|
||||||
std::vector<RifEclipseRftAddress> m_eclipseRftAddresses;
|
std::vector<RifEclipseRftAddress> m_eclipseRftAddresses;
|
||||||
std::set<QString> m_wellNames;
|
std::set<QString> m_wellNames;
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RifReaderEclipseSummary.h"
|
#include "RifReaderEclipseSummary.h"
|
||||||
|
#include "RiaStringEncodingTools.h"
|
||||||
|
|
||||||
#include "ert/ecl/ecl_sum.h"
|
#include "ert/ecl/ecl_sum.h"
|
||||||
|
|
||||||
@ -24,6 +25,8 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
#include "ert/ecl/smspec_node.h"
|
#include "ert/ecl/smspec_node.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -51,23 +54,23 @@ RifReaderEclipseSummary::~RifReaderEclipseSummary()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifReaderEclipseSummary::open(const std::string& headerFileName, const std::vector<std::string>& dataFileNames)
|
bool RifReaderEclipseSummary::open(const QString& headerFileName, const QStringList& dataFileNames)
|
||||||
{
|
{
|
||||||
assert(m_ecl_sum == NULL);
|
assert(m_ecl_sum == NULL);
|
||||||
|
|
||||||
if (headerFileName.empty() || dataFileNames.size() == 0) return false;
|
if (headerFileName.isEmpty() || dataFileNames.size() == 0) return false;
|
||||||
|
|
||||||
assert(!headerFileName.empty());
|
assert(!headerFileName.isEmpty());
|
||||||
assert(dataFileNames.size() > 0);
|
assert(dataFileNames.size() > 0);
|
||||||
|
|
||||||
stringlist_type* dataFiles = stringlist_alloc_new();
|
stringlist_type* dataFiles = stringlist_alloc_new();
|
||||||
for (size_t i = 0; i < dataFileNames.size(); i++)
|
for (int i = 0; i < dataFileNames.size(); i++)
|
||||||
{
|
{
|
||||||
stringlist_append_copy(dataFiles, dataFileNames[i].data());
|
stringlist_append_copy(dataFiles, RiaStringEncodingTools::toNativeEncoded(dataFileNames[i]).data());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string itemSeparatorInVariableNames = ":";
|
std::string itemSeparatorInVariableNames = ":";
|
||||||
m_ecl_sum = ecl_sum_fread_alloc(headerFileName.data(), dataFiles, itemSeparatorInVariableNames.data(), false);
|
m_ecl_sum = ecl_sum_fread_alloc(RiaStringEncodingTools::toNativeEncoded(headerFileName).data(), dataFiles, itemSeparatorInVariableNames.data(), false);
|
||||||
|
|
||||||
stringlist_free(dataFiles);
|
stringlist_free(dataFiles);
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
class QString;
|
||||||
|
class QStringList;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@ -36,7 +38,7 @@ public:
|
|||||||
RifReaderEclipseSummary();
|
RifReaderEclipseSummary();
|
||||||
~RifReaderEclipseSummary();
|
~RifReaderEclipseSummary();
|
||||||
|
|
||||||
bool open(const std::string& headerFileName, const std::vector<std::string>& dataFileNames);
|
bool open(const QString& headerFileName, const QStringList& dataFileNames);
|
||||||
|
|
||||||
virtual const std::vector<time_t>& timeSteps(const RifEclipseSummaryAddress& resultAddress) const override;
|
virtual const std::vector<time_t>& timeSteps(const RifEclipseSummaryAddress& resultAddress) const override;
|
||||||
|
|
||||||
|
@ -224,12 +224,13 @@ std::vector<std::vector<double>> RifStimPlanXmlReader::getAllDepthDataAtTimeSte
|
|||||||
if (xmlStream.isCDATA())
|
if (xmlStream.isCDATA())
|
||||||
{
|
{
|
||||||
QString depthDataStr = xmlStream.text().toString();
|
QString depthDataStr = xmlStream.text().toString();
|
||||||
for (int i = 0; i < depthDataStr.split(' ').size(); i++)
|
QStringList splitted = depthDataStr.split(' ');
|
||||||
|
for (int i = 0; i < splitted.size(); i++)
|
||||||
{
|
{
|
||||||
if (i < static_cast<int>(startingNegValuesXs)) continue;
|
if (i < static_cast<int>(startingNegValuesXs)) continue;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString value = depthDataStr.split(' ')[i];
|
QString value = splitted[i];
|
||||||
if ( value != "")
|
if ( value != "")
|
||||||
{
|
{
|
||||||
propertyValuesAtDepth.push_back(value.toDouble());
|
propertyValuesAtDepth.push_back(value.toDouble());
|
||||||
|
@ -39,11 +39,29 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
|
|||||||
|
|
||||||
std::vector<QString> wellNames;
|
std::vector<QString> wellNames;
|
||||||
std::vector<QString> formationNames;
|
std::vector<QString> formationNames;
|
||||||
|
|
||||||
std::vector<double> mdTop;
|
std::vector<double> mdTop;
|
||||||
std::vector<double> mdBase;
|
std::vector<double> mdBase;
|
||||||
|
|
||||||
readFile(filePath, &wellNames, &formationNames, &mdTop, &mdBase);
|
std::vector<double> tvdTop;
|
||||||
if (wellNames.empty() || formationNames.empty() || mdTop.empty() || mdBase.empty())
|
std::vector<double> tvdBase;
|
||||||
|
|
||||||
|
readFile(filePath, &wellNames, &formationNames, &mdTop, &mdBase, &tvdTop, &tvdBase);
|
||||||
|
|
||||||
|
bool mdIsPresent = true;
|
||||||
|
bool tvdIsPresent = true;
|
||||||
|
|
||||||
|
if (mdTop.empty() || mdBase.empty())
|
||||||
|
{
|
||||||
|
mdIsPresent = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tvdTop.empty() || tvdBase.empty())
|
||||||
|
{
|
||||||
|
tvdIsPresent = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wellNames.empty() || formationNames.empty())
|
||||||
{
|
{
|
||||||
QMessageBox::warning(RiuMainWindow::instance(), "Import failure",
|
QMessageBox::warning(RiuMainWindow::instance(), "Import failure",
|
||||||
QString("Failed to parse %1 as a well pick file").arg(filePath));
|
QString("Failed to parse %1 as a well pick file").arg(filePath));
|
||||||
@ -51,10 +69,16 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
else if (!(mdIsPresent || tvdIsPresent))
|
||||||
|
{
|
||||||
|
QMessageBox::warning(RiuMainWindow::instance(), "Import failure",
|
||||||
|
QString("Failed to parse %1 as a well pick file. Neither MD or TVD is present.").arg(filePath));
|
||||||
|
RiaLogging::error(QString("Failed to parse %1 as a well pick file. Neither MD or TVD is present.").arg(filePath));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
CVF_ASSERT(wellNames.size() == formationNames.size());
|
CVF_ASSERT(wellNames.size() == formationNames.size());
|
||||||
CVF_ASSERT(mdTop.size() == formationNames.size());
|
|
||||||
CVF_ASSERT(mdBase.size() == formationNames.size());
|
|
||||||
|
|
||||||
std::map<QString, std::vector<RigWellPathFormation>> formations;
|
std::map<QString, std::vector<RigWellPathFormation>> formations;
|
||||||
|
|
||||||
@ -62,8 +86,18 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
|
|||||||
{
|
{
|
||||||
RigWellPathFormation formation;
|
RigWellPathFormation formation;
|
||||||
formation.formationName = formationNames[i];
|
formation.formationName = formationNames[i];
|
||||||
|
|
||||||
|
if (mdIsPresent)
|
||||||
|
{
|
||||||
formation.mdTop = mdTop[i];
|
formation.mdTop = mdTop[i];
|
||||||
formation.mdBase = mdBase[i];
|
formation.mdBase = mdBase[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tvdIsPresent)
|
||||||
|
{
|
||||||
|
formation.tvdTop = tvdTop[i];
|
||||||
|
formation.tvdBase = tvdBase[i];
|
||||||
|
}
|
||||||
|
|
||||||
if (!formations.count(wellNames[i]))
|
if (!formations.count(wellNames[i]))
|
||||||
{
|
{
|
||||||
@ -73,10 +107,10 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
|
|||||||
formations[wellNames[i]].push_back(formation);
|
formations[wellNames[i]].push_back(formation);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto it = formations.begin(); it != formations.end(); it++)
|
for (const std::pair<QString, std::vector<RigWellPathFormation>>& formation : formations)
|
||||||
{
|
{
|
||||||
cvf::ref<RigWellPathFormations> wellPathFormations = new RigWellPathFormations(it->second, filePath, it->first);
|
cvf::ref<RigWellPathFormations> wellPathFormations = new RigWellPathFormations(formation.second, filePath, formation.first);
|
||||||
result[it->first] = wellPathFormations;
|
result[formation.first] = wellPathFormations;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -95,7 +129,8 @@ void removeWhiteSpaces(QString* word)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifWellPathFormationReader::readFile(const QString& filePath, std::vector<QString>* wellNames,
|
void RifWellPathFormationReader::readFile(const QString& filePath, std::vector<QString>* wellNames,
|
||||||
std::vector<QString>* formationNames, std::vector<double>* mdTop,
|
std::vector<QString>* formationNames, std::vector<double>* mdTop,
|
||||||
std::vector<double>* mdBase)
|
std::vector<double>* mdBase, std::vector<double>* tvdTop,
|
||||||
|
std::vector<double>* tvdBase)
|
||||||
{
|
{
|
||||||
QFile data(filePath);
|
QFile data(filePath);
|
||||||
|
|
||||||
@ -151,12 +186,31 @@ void RifWellPathFormationReader::readFile(const QString& filePath, std::vector<Q
|
|||||||
static const QString unitNameText = "unitname";
|
static const QString unitNameText = "unitname";
|
||||||
static const QString measuredDepthToptext = "topmd";
|
static const QString measuredDepthToptext = "topmd";
|
||||||
static const QString measuredDepthBasetext = "basemd";
|
static const QString measuredDepthBasetext = "basemd";
|
||||||
|
static const QString trueVerticalDepthToptext = "toptvdss";
|
||||||
|
static const QString trueVerticalDepthBasetext = "basetvdss";
|
||||||
|
|
||||||
int unitNameIndex = header.indexOf(unitNameText);
|
int unitNameIndex = header.indexOf(unitNameText);
|
||||||
|
|
||||||
int measuredDepthTopIndex = header.indexOf(measuredDepthToptext);
|
int measuredDepthTopIndex = header.indexOf(measuredDepthToptext);
|
||||||
int measuredDepthBaseIndex = header.indexOf(measuredDepthBasetext);
|
int measuredDepthBaseIndex = header.indexOf(measuredDepthBasetext);
|
||||||
|
|
||||||
if (unitNameIndex != -1 && measuredDepthTopIndex != -1 && measuredDepthBaseIndex != -1)
|
int trueVerticalDepthTopIndex = header.indexOf(trueVerticalDepthToptext);
|
||||||
|
int trueVerticalDepthBaseIndex = header.indexOf(trueVerticalDepthBasetext);
|
||||||
|
|
||||||
|
bool mdIsPresent = true;
|
||||||
|
bool tvdIsPresent = true;
|
||||||
|
|
||||||
|
if (measuredDepthTopIndex == -1 || measuredDepthBaseIndex == -1)
|
||||||
|
{
|
||||||
|
mdIsPresent = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trueVerticalDepthTopIndex == -1 || trueVerticalDepthBaseIndex == -1)
|
||||||
|
{
|
||||||
|
tvdIsPresent = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unitNameIndex != -1 && (mdIsPresent || tvdIsPresent))
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -168,13 +222,27 @@ void RifWellPathFormationReader::readFile(const QString& filePath, std::vector<Q
|
|||||||
QString wellName = dataLine[wellNameIndex];
|
QString wellName = dataLine[wellNameIndex];
|
||||||
QString unitName = dataLine[unitNameIndex];
|
QString unitName = dataLine[unitNameIndex];
|
||||||
unitName = unitName.trimmed();
|
unitName = unitName.trimmed();
|
||||||
double measuredDepthTop = dataLine[measuredDepthTopIndex].toDouble();
|
|
||||||
double measuredDepthBase = dataLine[measuredDepthBaseIndex].toDouble();
|
if (mdIsPresent)
|
||||||
|
{
|
||||||
|
double mdTopValue = dataLine[measuredDepthTopIndex].toDouble();
|
||||||
|
double mdBaseValue = dataLine[measuredDepthBaseIndex].toDouble();
|
||||||
|
|
||||||
|
mdTop->push_back(mdTopValue);
|
||||||
|
mdBase->push_back(mdBaseValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tvdIsPresent)
|
||||||
|
{
|
||||||
|
double tvdTopValue = dataLine[trueVerticalDepthTopIndex].toDouble();
|
||||||
|
double tvdBaseValue = dataLine[trueVerticalDepthBaseIndex].toDouble();
|
||||||
|
|
||||||
|
tvdTop->push_back(-tvdTopValue);
|
||||||
|
tvdBase->push_back(-tvdBaseValue);
|
||||||
|
}
|
||||||
|
|
||||||
wellNames->push_back(wellName);
|
wellNames->push_back(wellName);
|
||||||
formationNames->push_back(unitName);
|
formationNames->push_back(unitName);
|
||||||
mdTop->push_back(measuredDepthTop);
|
|
||||||
mdBase->push_back(measuredDepthBase);
|
|
||||||
|
|
||||||
} while (!data.atEnd());
|
} while (!data.atEnd());
|
||||||
}
|
}
|
||||||
|
@ -39,5 +39,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static void readFile(const QString& filePath, std::vector<QString>* wellNames, std::vector<QString>* formationNames,
|
static void readFile(const QString& filePath, std::vector<QString>* wellNames, std::vector<QString>* formationNames,
|
||||||
std::vector<double>* mdTop, std::vector<double>* mdBase);
|
std::vector<double>* mdTop, std::vector<double>* mdBase, std::vector<double>* tvdTop,
|
||||||
|
std::vector<double>* tvdBase);
|
||||||
};
|
};
|
||||||
|
@ -1370,10 +1370,18 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
|
|||||||
if(resVarAddr.resultPosType == RIG_ELEMENT_NODAL_FACE )
|
if(resVarAddr.resultPosType == RIG_ELEMENT_NODAL_FACE )
|
||||||
{
|
{
|
||||||
if (resVarAddr.componentName == "Pazi" || resVarAddr.componentName == "Pinc")
|
if (resVarAddr.componentName == "Pazi" || resVarAddr.componentName == "Pinc")
|
||||||
|
{
|
||||||
return calculateSurfaceAngles(partIndex, resVarAddr);
|
return calculateSurfaceAngles(partIndex, resVarAddr);
|
||||||
|
}
|
||||||
|
else if (resVarAddr.componentName.empty())
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return calculateSurfaceAlignedStress(partIndex, resVarAddr);
|
return calculateSurfaceAlignedStress(partIndex, resVarAddr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (resVarAddr.fieldName == "SE" && resVarAddr.componentName == "SFI")
|
if (resVarAddr.fieldName == "SE" && resVarAddr.componentName == "SFI")
|
||||||
{
|
{
|
||||||
|
@ -92,8 +92,12 @@ void RimCompletionCellIntersectionCalc::calculateWellPathIntersections(const Rim
|
|||||||
std::vector<double>& values,
|
std::vector<double>& values,
|
||||||
const QDateTime& fromDate)
|
const QDateTime& fromDate)
|
||||||
{
|
{
|
||||||
std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::findRawHexCellIntersections(grid,
|
std::vector<HexIntersectionInfo> intersections;
|
||||||
|
if (wellPath->wellPathGeometry())
|
||||||
|
{
|
||||||
|
intersections = RigWellPathIntersectionTools::findRawHexCellIntersections(grid,
|
||||||
wellPath->wellPathGeometry()->m_wellPathPoints);
|
wellPath->wellPathGeometry()->m_wellPathPoints);
|
||||||
|
}
|
||||||
|
|
||||||
for (auto& intersection : intersections)
|
for (auto& intersection : intersections)
|
||||||
{
|
{
|
||||||
|
@ -44,13 +44,12 @@
|
|||||||
#include "cvfVector3.h"
|
#include "cvfVector3.h"
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
static std::vector<double> EMPTY_DOUBLE_VECTOR;
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimStimPlanFractureTemplate, "RimStimPlanFractureTemplate");
|
CAF_PDM_SOURCE_INIT(RimStimPlanFractureTemplate, "RimStimPlanFractureTemplate");
|
||||||
|
|
||||||
@ -75,6 +74,7 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate(void)
|
|||||||
CAF_PDM_InitField(&m_conductivityScalingFactor, "ConductivityFactor", 1.0, "Conductivity Scaling Factor", "", "The conductivity values read from file will be scaled with this parameters", "");
|
CAF_PDM_InitField(&m_conductivityScalingFactor, "ConductivityFactor", 1.0, "Conductivity Scaling Factor", "", "The conductivity values read from file will be scaled with this parameters", "");
|
||||||
|
|
||||||
m_fractureGrid = new RigFractureGrid();
|
m_fractureGrid = new RigFractureGrid();
|
||||||
|
m_readError = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -93,6 +93,7 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
|||||||
|
|
||||||
if (&m_stimPlanFileName == changedField)
|
if (&m_stimPlanFileName == changedField)
|
||||||
{
|
{
|
||||||
|
m_readError = false;
|
||||||
updateUiTreeName();
|
updateUiTreeName();
|
||||||
loadDataAndUpdate();
|
loadDataAndUpdate();
|
||||||
setDefaultsBasedOnXMLfile();
|
setDefaultsBasedOnXMLfile();
|
||||||
@ -237,16 +238,21 @@ bool RimStimPlanFractureTemplate::setBorderPolygonResultNameToDefault()
|
|||||||
void RimStimPlanFractureTemplate::loadDataAndUpdate()
|
void RimStimPlanFractureTemplate::loadDataAndUpdate()
|
||||||
{
|
{
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
|
|
||||||
|
if (m_readError) return;
|
||||||
|
|
||||||
m_stimPlanFractureDefinitionData = RifStimPlanXmlReader::readStimPlanXMLFile( m_stimPlanFileName(), m_conductivityScalingFactor(), &errorMessage);
|
m_stimPlanFractureDefinitionData = RifStimPlanXmlReader::readStimPlanXMLFile( m_stimPlanFileName(), m_conductivityScalingFactor(), &errorMessage);
|
||||||
if (errorMessage.size() > 0) RiaLogging::error(errorMessage);
|
if (errorMessage.size() > 0) RiaLogging::error(errorMessage);
|
||||||
|
|
||||||
if (m_stimPlanFractureDefinitionData.notNull())
|
if (m_stimPlanFractureDefinitionData.notNull())
|
||||||
{
|
{
|
||||||
fractureTemplateUnit = m_stimPlanFractureDefinitionData->unitSet();
|
fractureTemplateUnit = m_stimPlanFractureDefinitionData->unitSet();
|
||||||
|
m_readError = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fractureTemplateUnit = RiaEclipseUnitTools::UNITS_UNKNOWN;
|
fractureTemplateUnit = RiaEclipseUnitTools::UNITS_UNKNOWN;
|
||||||
|
m_readError = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateFractureGrid();
|
updateFractureGrid();
|
||||||
@ -335,7 +341,7 @@ QString RimStimPlanFractureTemplate::getUnitForStimPlanParameter(QString paramet
|
|||||||
const std::vector<double>& RimStimPlanFractureTemplate::timeSteps()
|
const std::vector<double>& RimStimPlanFractureTemplate::timeSteps()
|
||||||
{
|
{
|
||||||
if (m_stimPlanFractureDefinitionData.isNull()) loadDataAndUpdate();
|
if (m_stimPlanFractureDefinitionData.isNull()) loadDataAndUpdate();
|
||||||
return m_stimPlanFractureDefinitionData->timeSteps();
|
return m_stimPlanFractureDefinitionData.notNull() ? m_stimPlanFractureDefinitionData->timeSteps() : EMPTY_DOUBLE_VECTOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -367,6 +373,7 @@ void RimStimPlanFractureTemplate::computeMinMax(const QString& resultName, const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<std::vector<double>> RimStimPlanFractureTemplate::resultValues(const QString& resultName, const QString& unitName, size_t timeStepIndex) const
|
std::vector<std::vector<double>> RimStimPlanFractureTemplate::resultValues(const QString& resultName, const QString& unitName, size_t timeStepIndex) const
|
||||||
{
|
{
|
||||||
|
if (m_stimPlanFractureDefinitionData.isNull()) return std::vector<std::vector<double>>();
|
||||||
return m_stimPlanFractureDefinitionData->getDataAtTimeIndex(resultName, unitName, timeStepIndex);
|
return m_stimPlanFractureDefinitionData->getDataAtTimeIndex(resultName, unitName, timeStepIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,6 +382,7 @@ std::vector<std::vector<double>> RimStimPlanFractureTemplate::resultValues(const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<double> RimStimPlanFractureTemplate::fractureGridResults(const QString& resultName, const QString& unitName, size_t timeStepIndex) const
|
std::vector<double> RimStimPlanFractureTemplate::fractureGridResults(const QString& resultName, const QString& unitName, size_t timeStepIndex) const
|
||||||
{
|
{
|
||||||
|
if (m_stimPlanFractureDefinitionData.isNull()) return EMPTY_DOUBLE_VECTOR;
|
||||||
return m_stimPlanFractureDefinitionData->fractureGridResults(resultName, unitName, timeStepIndex);
|
return m_stimPlanFractureDefinitionData->fractureGridResults(resultName, unitName, timeStepIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,11 +412,14 @@ const RigFractureGrid* RimStimPlanFractureTemplate::fractureGrid() const
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimStimPlanFractureTemplate::updateFractureGrid()
|
void RimStimPlanFractureTemplate::updateFractureGrid()
|
||||||
|
{
|
||||||
|
if (m_stimPlanFractureDefinitionData.notNull())
|
||||||
{
|
{
|
||||||
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid(m_activeTimeStepIndex,
|
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid(m_activeTimeStepIndex,
|
||||||
fractureTemplateUnit,
|
fractureTemplateUnit,
|
||||||
m_wellPathDepthAtFracture);
|
m_wellPathDepthAtFracture);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -424,12 +435,14 @@ void RimStimPlanFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3
|
|||||||
{
|
{
|
||||||
loadDataAndUpdate();
|
loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry(m_wellPathDepthAtFracture,
|
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry(m_wellPathDepthAtFracture,
|
||||||
neededUnit,
|
neededUnit,
|
||||||
name,
|
name,
|
||||||
nodeCoords,
|
nodeCoords,
|
||||||
triangleIndices);
|
triangleIndices);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,6 +451,7 @@ void RimStimPlanFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fractureBorderPolygon(RiaEclipseUnitTools::UnitSystem neededUnit)
|
std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fractureBorderPolygon(RiaEclipseUnitTools::UnitSystem neededUnit)
|
||||||
{
|
{
|
||||||
|
if (m_stimPlanFractureDefinitionData.isNull()) return std::vector<cvf::Vec3f>();
|
||||||
|
|
||||||
QString parameterName = m_borderPolygonResultName;
|
QString parameterName = m_borderPolygonResultName;
|
||||||
QString parameterUnit = getUnitForStimPlanParameter(parameterName);
|
QString parameterUnit = getUnitForStimPlanParameter(parameterName);
|
||||||
|
@ -107,4 +107,5 @@ private:
|
|||||||
caf::PdmField<double> m_conductivityScalingFactor;
|
caf::PdmField<double> m_conductivityScalingFactor;
|
||||||
cvf::ref<RigFractureGrid> m_fractureGrid;
|
cvf::ref<RigFractureGrid> m_fractureGrid;
|
||||||
|
|
||||||
|
bool m_readError;
|
||||||
};
|
};
|
||||||
|
@ -253,6 +253,7 @@ void RimWellAllocationPlot::updateFromWell()
|
|||||||
RimWellLogTrack* plotTrack = new RimWellLogTrack();
|
RimWellLogTrack* plotTrack = new RimWellLogTrack();
|
||||||
|
|
||||||
plotTrack->setDescription(QString("Branch %1").arg(brIdx + 1));
|
plotTrack->setDescription(QString("Branch %1").arg(brIdx + 1));
|
||||||
|
plotTrack->setFormationsForCaseWithSimWellOnly(true);
|
||||||
plotTrack->setFormationBranchIndex((int)brIdx);
|
plotTrack->setFormationBranchIndex((int)brIdx);
|
||||||
|
|
||||||
accumulatedWellFlowPlot()->addTrack(plotTrack);
|
accumulatedWellFlowPlot()->addTrack(plotTrack);
|
||||||
|
@ -204,12 +204,12 @@ QString Rim3dOverlayInfoConfig::caseInfoText()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString Rim3dOverlayInfoConfig::resultInfoText(const HistogramData& histData, bool showVolumeWeightedMean)
|
QString Rim3dOverlayInfoConfig::resultInfoText(const HistogramData& histData)
|
||||||
{
|
{
|
||||||
auto eclipseView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
auto eclipseView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
||||||
auto geoMechView = dynamic_cast<RimGeoMechView*>(m_viewDef.p());
|
auto geoMechView = dynamic_cast<RimGeoMechView*>(m_viewDef.p());
|
||||||
|
|
||||||
if (eclipseView) return resultInfoText(histData, eclipseView, showVolumeWeightedMean);
|
if (eclipseView) return resultInfoText(histData, eclipseView, showVolumeWeightedMean());
|
||||||
if (geoMechView) return resultInfoText(histData, geoMechView);
|
if (geoMechView) return resultInfoText(histData, geoMechView);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@ -755,7 +755,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
|||||||
|
|
||||||
if (showResultInfo())
|
if (showResultInfo())
|
||||||
{
|
{
|
||||||
infoText += resultInfoText(histData, showVolumeWeightedMean());
|
infoText += resultInfoText(histData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!infoText.isEmpty())
|
if (!infoText.isEmpty())
|
||||||
|
@ -74,7 +74,7 @@ public:
|
|||||||
HistogramData histogramData();
|
HistogramData histogramData();
|
||||||
QString timeStepText();
|
QString timeStepText();
|
||||||
QString caseInfoText();
|
QString caseInfoText();
|
||||||
QString resultInfoText(const HistogramData& histData, bool showVolumeWeightedMean);
|
QString resultInfoText(const HistogramData& histData);
|
||||||
|
|
||||||
void showStatisticsInfoDialog(bool raise = true);
|
void showStatisticsInfoDialog(bool raise = true);
|
||||||
QImage statisticsDialogScreenShotImage();
|
QImage statisticsDialogScreenShotImage();
|
||||||
|
@ -91,9 +91,9 @@ RimEclipseCase::RimEclipseCase()
|
|||||||
m_filesContainingFaults_OBSOLETE.xmlCapability()->setIOWritable(false);
|
m_filesContainingFaults_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||||
m_filesContainingFaults_OBSOLETE.uiCapability()->setUiHidden(true);
|
m_filesContainingFaults_OBSOLETE.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
CAF_PDM_InitField(&caseName, "CaseName", QString(), "Obsolete", "", "" ,"");
|
CAF_PDM_InitField(&m_caseName_OBSOLETE, "CaseName", QString(), "Obsolete", "", "" ,"");
|
||||||
caseName.xmlCapability()->setIOWritable(false);
|
m_caseName_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||||
caseName.uiCapability()->setUiHidden(true);
|
m_caseName_OBSOLETE.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
// Init
|
// Init
|
||||||
|
|
||||||
@ -210,9 +210,9 @@ void RimEclipseCase::initAfterRead()
|
|||||||
riv->setEclipseCase(this);
|
riv->setEclipseCase(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caseUserDescription().isEmpty() && !caseName().isEmpty())
|
if (caseUserDescription().isEmpty() && !m_caseName_OBSOLETE().isEmpty())
|
||||||
{
|
{
|
||||||
caseUserDescription = caseName;
|
caseUserDescription = m_caseName_OBSOLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ private:
|
|||||||
|
|
||||||
// Obsolete fields
|
// Obsolete fields
|
||||||
protected:
|
protected:
|
||||||
caf::PdmField<QString> caseName;
|
caf::PdmField<QString> m_caseName_OBSOLETE;
|
||||||
private:
|
private:
|
||||||
caf::PdmField<std::vector<QString> > m_filesContainingFaults_OBSOLETE;
|
caf::PdmField<std::vector<QString> > m_filesContainingFaults_OBSOLETE;
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@
|
|||||||
|
|
||||||
#include "cafPdmUiTreeOrdering.h"
|
#include "cafPdmUiTreeOrdering.h"
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimEclipseCellColors, "ResultSlot");
|
CAF_PDM_SOURCE_INIT(RimEclipseCellColors, "ResultSlot");
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -249,9 +249,9 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
|
|||||||
// Then read the properties from all the files referenced by the InputReservoir
|
// Then read the properties from all the files referenced by the InputReservoir
|
||||||
|
|
||||||
std::vector<QString> filenames;
|
std::vector<QString> filenames;
|
||||||
for (const RimEclipseInputProperty* inputProperty : m_inputPropertyCollection()->inputProperties())
|
for (const QString& fileName : additionalFiles())
|
||||||
{
|
{
|
||||||
filenames.push_back(inputProperty->fileName);
|
filenames.push_back(fileName);
|
||||||
}
|
}
|
||||||
filenames.push_back(m_gridFileName);
|
filenames.push_back(m_gridFileName);
|
||||||
|
|
||||||
|
@ -92,8 +92,6 @@ RimEclipseResultCase::RimEclipseResultCase()
|
|||||||
|
|
||||||
m_activeCellInfoIsReadFromFile = false;
|
m_activeCellInfoIsReadFromFile = false;
|
||||||
m_gridAndWellDataIsReadFromFile = false;
|
m_gridAndWellDataIsReadFromFile = false;
|
||||||
|
|
||||||
m_caseName = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -210,7 +208,7 @@ bool RimEclipseResultCase::importGridAndResultMetaData(bool showTimeStepFilter)
|
|||||||
if (rftFileInfo.exists())
|
if (rftFileInfo.exists())
|
||||||
{
|
{
|
||||||
RiaLogging::info(QString("RFT file found"));
|
RiaLogging::info(QString("RFT file found"));
|
||||||
m_readerEclipseRft = new RifReaderEclipseRft(rftFileInfo.filePath().toStdString());
|
m_readerEclipseRft = new RifReaderEclipseRft(rftFileInfo.filePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -574,9 +572,9 @@ void RimEclipseResultCase::initAfterRead()
|
|||||||
// Convert from old (9.0.2) way of storing the case file
|
// Convert from old (9.0.2) way of storing the case file
|
||||||
if (caseFileName().isEmpty())
|
if (caseFileName().isEmpty())
|
||||||
{
|
{
|
||||||
if (!this->caseName().isEmpty() && !caseDirectory().isEmpty())
|
if (!this->m_caseName_OBSOLETE().isEmpty() && !caseDirectory().isEmpty())
|
||||||
{
|
{
|
||||||
caseFileName = QDir::fromNativeSeparators(caseDirectory()) + "/" + caseName() + ".EGRID";
|
caseFileName = QDir::fromNativeSeparators(caseDirectory()) + "/" + m_caseName_OBSOLETE() + ".EGRID";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,8 +65,6 @@ public:
|
|||||||
|
|
||||||
RifReaderEclipseRft* rftReader();
|
RifReaderEclipseRft* rftReader();
|
||||||
|
|
||||||
QString caseName() const { return m_caseName; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||||
@ -90,12 +88,9 @@ private:
|
|||||||
caf::PdmChildArrayField<RimFlowDiagSolution*> m_flowDiagSolutions;
|
caf::PdmChildArrayField<RimFlowDiagSolution*> m_flowDiagSolutions;
|
||||||
caf::PdmField<QString> m_sourSimFileName;
|
caf::PdmField<QString> m_sourSimFileName;
|
||||||
|
|
||||||
QString m_caseName;
|
|
||||||
|
|
||||||
// Obsolete field
|
// Obsolete field
|
||||||
caf::PdmField<QString> caseDirectory;
|
caf::PdmField<QString> caseDirectory;
|
||||||
|
|
||||||
bool m_gridAndWellDataIsReadFromFile;
|
bool m_gridAndWellDataIsReadFromFile;
|
||||||
bool m_activeCellInfoIsReadFromFile;
|
bool m_activeCellInfoIsReadFromFile;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -458,7 +458,15 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
|
|||||||
bool enableSouring = false;
|
bool enableSouring = false;
|
||||||
|
|
||||||
#ifdef ENABLE_SOURING
|
#ifdef ENABLE_SOURING
|
||||||
|
if (m_eclipseCase.notNull())
|
||||||
|
{
|
||||||
|
RigCaseCellResultsData* cellResultsData = m_eclipseCase->results(this->porosityModel());
|
||||||
|
|
||||||
|
if (cellResultsData->hasFlowDiagUsableFluxes())
|
||||||
|
{
|
||||||
enableSouring = true;
|
enableSouring = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif /* ENABLE_SOURING */
|
#endif /* ENABLE_SOURING */
|
||||||
|
|
||||||
|
|
||||||
@ -1108,11 +1116,9 @@ bool RimEclipseResultDefinition::isFlowDiagOrInjectionFlooding() const
|
|||||||
bool RimEclipseResultDefinition::hasDualPorFractureResult()
|
bool RimEclipseResultDefinition::hasDualPorFractureResult()
|
||||||
{
|
{
|
||||||
if (m_eclipseCase
|
if (m_eclipseCase
|
||||||
&& m_eclipseCase->eclipseCaseData()
|
&& m_eclipseCase->eclipseCaseData())
|
||||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)
|
|
||||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount() > 0 )
|
|
||||||
{
|
{
|
||||||
return true;
|
return m_eclipseCase->eclipseCaseData()->hasFractureResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -71,6 +71,7 @@
|
|||||||
|
|
||||||
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
||||||
#include "RimFracture.h"
|
#include "RimFracture.h"
|
||||||
|
#include "RimFractureTemplateCollection.h"
|
||||||
#include "RimSimWellFracture.h"
|
#include "RimSimWellFracture.h"
|
||||||
#include "RivWellFracturePartMgr.h"
|
#include "RivWellFracturePartMgr.h"
|
||||||
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
||||||
@ -1469,7 +1470,18 @@ void RimEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
|||||||
uiTreeOrdering.add(cellEdgeResult());
|
uiTreeOrdering.add(cellEdgeResult());
|
||||||
uiTreeOrdering.add(faultResultSettings());
|
uiTreeOrdering.add(faultResultSettings());
|
||||||
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
||||||
|
|
||||||
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
|
CVF_ASSERT(project);
|
||||||
|
RimOilField* oilfield = project->activeOilField();
|
||||||
|
|
||||||
|
if (oilfield && oilfield->fractureDefinitionCollection().notNull())
|
||||||
|
{
|
||||||
|
if (!oilfield->fractureDefinitionCollection()->fractureDefinitions.empty())
|
||||||
|
{
|
||||||
uiTreeOrdering.add(stimPlanColors());
|
uiTreeOrdering.add(stimPlanColors());
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
||||||
|
|
||||||
uiTreeOrdering.add(wellCollection());
|
uiTreeOrdering.add(wellCollection());
|
||||||
@ -1547,6 +1559,8 @@ bool RimEclipseView::isTimeStepDependentDataVisible() const
|
|||||||
if (this->faultResultSettings->customFaultResult()->isTernarySaturationSelected()) return true;
|
if (this->faultResultSettings->customFaultResult()->isTernarySaturationSelected()) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->wellPathCollection()->anyWellsContainingPerforationIntervals()) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +76,7 @@ void RimGeoMechCellColors::updateIconState()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGeoMechCellColors::initAfterRead()
|
void RimGeoMechCellColors::initAfterRead()
|
||||||
{
|
{
|
||||||
|
RimGeoMechResultDefinition::initAfterRead();
|
||||||
updateIconState();
|
updateIconState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
caf::PdmChildField<RimLegendConfig*> legendConfig;
|
caf::PdmChildField<RimLegendConfig*> legendConfig;
|
||||||
|
|
||||||
void updateIconState();
|
void updateIconState();
|
||||||
virtual void initAfterRead();
|
virtual void initAfterRead() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void updateLegendCategorySettings() override;
|
void updateLegendCategorySettings() override;
|
||||||
|
@ -94,8 +94,7 @@ RimGeoMechResultDefinition::RimGeoMechResultDefinition(void)
|
|||||||
m_resultVariableUiField.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
|
m_resultVariableUiField.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
|
||||||
m_resultVariableUiField.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
m_resultVariableUiField.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||||
|
|
||||||
|
m_isChangedByField = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -122,6 +121,14 @@ void RimGeoMechResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
|
|||||||
timeLapseGr->add(&m_timeLapseBaseTimestepUiField);
|
timeLapseGr->add(&m_timeLapseBaseTimestepUiField);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_isChangedByField)
|
||||||
|
{
|
||||||
|
m_resultPositionTypeUiField = m_resultPositionType;
|
||||||
|
m_resultVariableUiField = composeFieldCompString(m_resultFieldName(), m_resultComponentName());
|
||||||
|
}
|
||||||
|
|
||||||
|
m_isChangedByField = false;
|
||||||
|
|
||||||
uiOrdering.skipRemainingFields(true);
|
uiOrdering.skipRemainingFields(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,6 +194,8 @@ void RimGeoMechResultDefinition::setGeoMechCase(RimGeoMechCase* geomCase)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
{
|
{
|
||||||
|
m_isChangedByField = true;
|
||||||
|
|
||||||
if( &m_resultPositionTypeUiField == changedField
|
if( &m_resultPositionTypeUiField == changedField
|
||||||
|| &m_isTimeLapseResultUiField == changedField
|
|| &m_isTimeLapseResultUiField == changedField
|
||||||
|| &m_timeLapseBaseTimestepUiField == changedField)
|
|| &m_timeLapseBaseTimestepUiField == changedField)
|
||||||
|
@ -113,6 +113,7 @@ private:
|
|||||||
caf::PdmField<bool> m_isTimeLapseResultUiField;
|
caf::PdmField<bool> m_isTimeLapseResultUiField;
|
||||||
caf::PdmField<int> m_timeLapseBaseTimestepUiField;
|
caf::PdmField<int> m_timeLapseBaseTimestepUiField;
|
||||||
|
|
||||||
|
|
||||||
caf::PdmPointer<RimGeoMechCase> m_geomCase;
|
caf::PdmPointer<RimGeoMechCase> m_geomCase;
|
||||||
|
|
||||||
|
bool m_isChangedByField;
|
||||||
};
|
};
|
||||||
|
@ -149,7 +149,7 @@ void RimIntersectionCollection::appendPartsToModel(cvf::ModelBasicList* model, c
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimIntersectionCollection::appendIntersection(RimIntersection* intersection)
|
void RimIntersectionCollection::appendIntersectionAndUpdate(RimIntersection* intersection)
|
||||||
{
|
{
|
||||||
m_intersections.push_back(intersection);
|
m_intersections.push_back(intersection);
|
||||||
|
|
||||||
@ -167,9 +167,19 @@ void RimIntersectionCollection::appendIntersection(RimIntersection* intersection
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimIntersectionCollection::appendIntersectionBox(RimIntersectionBox* intersectionBox)
|
void RimIntersectionCollection::appendIntersectionBoxAndUpdate(RimIntersectionBox* intersectionBox)
|
||||||
{
|
{
|
||||||
m_intersectionBoxes.push_back(intersectionBox);
|
m_intersectionBoxes.push_back(intersectionBox);
|
||||||
|
|
||||||
|
updateConnectedEditors();
|
||||||
|
RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox);
|
||||||
|
|
||||||
|
RimView* rimView = NULL;
|
||||||
|
firstAncestorOrThisOfType(rimView);
|
||||||
|
if (rimView)
|
||||||
|
{
|
||||||
|
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -48,8 +48,9 @@ public:
|
|||||||
|
|
||||||
caf::PdmField<bool> isActive;
|
caf::PdmField<bool> isActive;
|
||||||
|
|
||||||
void appendIntersection(RimIntersection* intersection);
|
void appendIntersectionAndUpdate(RimIntersection* intersection);
|
||||||
void appendIntersectionBox(RimIntersectionBox* intersectionBox);
|
|
||||||
|
void appendIntersectionBoxAndUpdate(RimIntersectionBox* intersectionBox);
|
||||||
|
|
||||||
bool hasActiveIntersectionForSimulationWell(const RimSimWellInView* simWell) const;
|
bool hasActiveIntersectionForSimulationWell(const RimSimWellInView* simWell) const;
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ void RimPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, con
|
|||||||
{
|
{
|
||||||
if (changedField == &m_showCurve)
|
if (changedField == &m_showCurve)
|
||||||
{
|
{
|
||||||
this->updateCurveVisibility();
|
this->updateCurveVisibility(true);
|
||||||
if (m_showCurve()) loadDataAndUpdate(true);
|
if (m_showCurve()) loadDataAndUpdate(true);
|
||||||
}
|
}
|
||||||
else if (changedField == &m_curveName)
|
else if (changedField == &m_curveName)
|
||||||
@ -180,7 +180,7 @@ caf::PdmFieldHandle* RimPlotCurve::objectToggleField()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimPlotCurve::updateCurveVisibility()
|
void RimPlotCurve::updateCurveVisibility(bool updateParentPlot)
|
||||||
{
|
{
|
||||||
bool isVisibleInPossibleParent = true;
|
bool isVisibleInPossibleParent = true;
|
||||||
|
|
||||||
@ -199,15 +199,18 @@ void RimPlotCurve::updateCurveVisibility()
|
|||||||
m_qwtPlotCurve->detach();
|
m_qwtPlotCurve->detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (updateParentPlot)
|
||||||
|
{
|
||||||
updateZoomInParentPlot();
|
updateZoomInParentPlot();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimPlotCurve::updateCurvePresentation(bool updatePlotLegend)
|
void RimPlotCurve::updateCurvePresentation(bool updatePlotLegend)
|
||||||
{
|
{
|
||||||
this->updateCurveVisibility();
|
this->updateCurveVisibility(updatePlotLegend);
|
||||||
|
|
||||||
if (updatePlotLegend)
|
if (updatePlotLegend)
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,7 @@ public:
|
|||||||
|
|
||||||
QString curveName() const { return m_curveName; }
|
QString curveName() const { return m_curveName; }
|
||||||
|
|
||||||
void updateCurveVisibility();
|
void updateCurveVisibility(bool updateParentPlot);
|
||||||
void updateLegendEntryVisibilityAndPlotLegend();
|
void updateLegendEntryVisibilityAndPlotLegend();
|
||||||
void updateLegendEntryVisibilityNoPlotUpdate();
|
void updateLegendEntryVisibilityNoPlotUpdate();
|
||||||
|
|
||||||
|
@ -52,6 +52,8 @@
|
|||||||
#include "RimMultiSnapshotDefinition.h"
|
#include "RimMultiSnapshotDefinition.h"
|
||||||
#include "RimObservedDataCollection.h"
|
#include "RimObservedDataCollection.h"
|
||||||
#include "RimOilField.h"
|
#include "RimOilField.h"
|
||||||
|
#include "RimPltPlotCollection.h"
|
||||||
|
#include "RimRftPlotCollection.h"
|
||||||
#include "RimScriptCollection.h"
|
#include "RimScriptCollection.h"
|
||||||
#include "RimSummaryCaseMainCollection.h"
|
#include "RimSummaryCaseMainCollection.h"
|
||||||
#include "RimSummaryCrossPlotCollection.h"
|
#include "RimSummaryCrossPlotCollection.h"
|
||||||
@ -59,12 +61,11 @@
|
|||||||
#include "RimView.h"
|
#include "RimView.h"
|
||||||
#include "RimViewLinker.h"
|
#include "RimViewLinker.h"
|
||||||
#include "RimViewLinkerCollection.h"
|
#include "RimViewLinkerCollection.h"
|
||||||
|
#include "RimWellLogFile.h"
|
||||||
#include "RimWellLogPlotCollection.h"
|
#include "RimWellLogPlotCollection.h"
|
||||||
#include "RimRftPlotCollection.h"
|
#include "RimWellPath.h"
|
||||||
#include "RimPltPlotCollection.h"
|
|
||||||
#include "RimWellPathCollection.h"
|
#include "RimWellPathCollection.h"
|
||||||
#include "RimWellPathImport.h"
|
#include "RimWellPathImport.h"
|
||||||
#include "RimWellPath.h"
|
|
||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
#include "RiuMainPlotWindow.h"
|
#include "RiuMainPlotWindow.h"
|
||||||
@ -448,6 +449,11 @@ void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName
|
|||||||
cases[i]->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
cases[i]->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (RimSummaryCase* summaryCase : allSummaryCases())
|
||||||
|
{
|
||||||
|
summaryCase->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
||||||
|
}
|
||||||
|
|
||||||
// Update path to well path file cache
|
// Update path to well path file cache
|
||||||
for(RimOilField* oilField: oilFields)
|
for(RimOilField* oilField: oilFields)
|
||||||
{
|
{
|
||||||
@ -470,6 +476,15 @@ void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName
|
|||||||
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
std::vector<RimWellLogFile*> rimWellLogFiles;
|
||||||
|
this->descendantsIncludingThisOfType(rimWellLogFiles);
|
||||||
|
|
||||||
|
for (auto rimWellLogFile : rimWellLogFiles)
|
||||||
|
{
|
||||||
|
rimWellLogFile->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wellPathImport->updateFilePaths();
|
wellPathImport->updateFilePaths();
|
||||||
}
|
}
|
||||||
|
@ -320,6 +320,13 @@ void RimSimWellInViewCollection::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
|||||||
if (&isActive == changedField)
|
if (&isActive == changedField)
|
||||||
{
|
{
|
||||||
this->updateUiIconFromToggleField();
|
this->updateUiIconFromToggleField();
|
||||||
|
|
||||||
|
RimView* view;
|
||||||
|
firstAncestorOrThisOfType(view);
|
||||||
|
if (view)
|
||||||
|
{
|
||||||
|
view->hasUserRequestedAnimation = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (&m_showWellLabel == changedField)
|
if (&m_showWellLabel == changedField)
|
||||||
|
@ -436,7 +436,7 @@ void RimView::endAnimation()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimWellPathCollection* RimView::wellPathCollection()
|
RimWellPathCollection* RimView::wellPathCollection() const
|
||||||
{
|
{
|
||||||
RimProject* proj = nullptr;
|
RimProject* proj = nullptr;
|
||||||
this->firstAncestorOrThisOfTypeAsserted(proj);
|
this->firstAncestorOrThisOfTypeAsserted(proj);
|
||||||
|
@ -210,7 +210,7 @@ protected:
|
|||||||
|
|
||||||
virtual void onLoadDataAndUpdate() = 0;
|
virtual void onLoadDataAndUpdate() = 0;
|
||||||
|
|
||||||
RimWellPathCollection* wellPathCollection();
|
RimWellPathCollection* wellPathCollection() const;
|
||||||
|
|
||||||
QPointer<RiuViewer> m_viewer;
|
QPointer<RiuViewer> m_viewer;
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ void RimWellLogExtractionCurve::setPropertiesFromView(RimView* view)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellLogExtractionCurve::clampTimestep()
|
void RimWellLogExtractionCurve::clampTimestep()
|
||||||
{
|
{
|
||||||
if (m_case)
|
if (m_timeStep > 0 && m_case)
|
||||||
{
|
{
|
||||||
if (m_timeStep > m_case->timeStepStrings().size() - 1)
|
if (m_timeStep > m_case->timeStepStrings().size() - 1)
|
||||||
{
|
{
|
||||||
@ -814,7 +814,7 @@ QString RimWellLogExtractionCurve::wellDate() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (m_timeStep < timeStepNames.size()) ? timeStepNames[m_timeStep] : "";
|
return (m_timeStep >= 0 && m_timeStep < timeStepNames.size()) ? timeStepNames[m_timeStep] : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -243,6 +243,21 @@ bool RimWellLogFile::hasFlowData() const
|
|||||||
return RimWellPlotTools::hasFlowData(this);
|
return RimWellPlotTools::hasFlowData(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogFile::updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath)
|
||||||
|
{
|
||||||
|
bool foundFile = false;
|
||||||
|
std::vector<QString> searchedPaths;
|
||||||
|
|
||||||
|
QString fileNameCandidate = RimTools::relocateFile(m_fileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths);
|
||||||
|
if (foundFile)
|
||||||
|
{
|
||||||
|
m_fileName = fileNameCandidate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -72,6 +72,8 @@ public:
|
|||||||
|
|
||||||
RimWellLogFile::WellFlowCondition wellFlowRateCondition() const { return m_wellFlowCondition(); }
|
RimWellLogFile::WellFlowCondition wellFlowRateCondition() const { return m_wellFlowCondition(); }
|
||||||
|
|
||||||
|
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void setupBeforeSave() override;
|
virtual void setupBeforeSave() override;
|
||||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user