Merge pull request #2520 from OPM/2018.01.01-patch

2018.01.01 patch
This commit is contained in:
Magne Sjaastad 2018-02-22 08:11:07 +01:00 committed by GitHub
commit 36581daa9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
162 changed files with 4412 additions and 603 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -24,6 +24,7 @@ ${CEE_CURRENT_LIST_DIR}RiaStdStringTools.h
${CEE_CURRENT_LIST_DIR}RiaSummaryCurveAnalyzer.h
${CEE_CURRENT_LIST_DIR}RiaSimWellBranchTools.h
${CEE_CURRENT_LIST_DIR}RiaProjectFileVersionTools.h
${CEE_CURRENT_LIST_DIR}RiaStringEncodingTools.h
)
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}RiaSimWellBranchTools.cpp
${CEE_CURRENT_LIST_DIR}RiaProjectFileVersionTools.cpp
${CEE_CURRENT_LIST_DIR}RiaStringEncodingTools.cpp
)
list(APPEND CODE_HEADER_FILES

View 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
}

View 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);
};

View File

@ -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)
{
for (const auto& regionNumber : m_regionNumbers)
{
stringSet.insert(QString::number(regionNumber));
stringSet.push_back(QString::number(regionNumber));
}
}
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL)
{
for (const auto& wellName : m_wellNames)
{
stringSet.insert(QString::fromStdString(wellName));
stringSet.push_back(QString::fromStdString(wellName));
}
}
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
{
for (const auto& wellGroupName : m_wellGroupNames)
{
stringSet.insert(QString::fromStdString(wellGroupName));
stringSet.push_back(QString::fromStdString(wellGroupName));
}
}

View File

@ -48,7 +48,7 @@ public:
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,
RifEclipseSummaryAddress::SummaryVarCategory category);

View File

@ -18,11 +18,14 @@
#include "RicfCommandFileExecutor.h"
#include "RifcCommandFileReader.h"
#include "RicfCommandObject.h"
#include "RiaLogging.h"
#include "RicfCloseProject.h"
#include "RicfCommandObject.h"
#include "RicfOpenProject.h"
#include "RicfReplaceCase.h"
#include "RifcCommandFileReader.h"
namespace caf {
template<>
void RicfCommandFileExecutor::ExportTypeEnum::setUp()
@ -54,22 +57,44 @@ RicfCommandFileExecutor::~RicfCommandFileExecutor()
//--------------------------------------------------------------------------------------------------
void RicfCommandFileExecutor::executeCommands(QTextStream& stream)
{
std::vector<RicfCommandObject*> commands = RicfCommandFileReader::readCommands(stream, caf::PdmDefaultObjectFactory::instance(), &m_messages);
for (auto message : m_messages.m_messages)
std::vector<RicfCommandObject*> executableCommands;
{
if (message.first == RicfMessages::MESSAGE_WARNING)
std::vector<RicfCommandObject*> fileCommands = RicfCommandFileReader::readCommands(stream, caf::PdmDefaultObjectFactory::instance(), &m_messages);
for (auto message : m_messages.m_messages)
{
RiaLogging::warning(QString("Command file parsing warning: %1").arg(message.second));
}
else
{
RiaLogging::error(QString("Command file parsing error: %1").arg(message.second));
return;
if (message.first == RicfMessages::MESSAGE_WARNING)
{
RiaLogging::warning(QString("Command file parsing warning: %1").arg(message.second));
}
else
{
RiaLogging::error(QString("Command file parsing error: %1").arg(message.second));
for (auto& command : fileCommands)
{
delete command;
command = nullptr;
}
return;
}
}
executableCommands = RicfCommandFileExecutor::prepareFileCommandsForExecution(fileCommands);
}
for (RicfCommandObject* command : commands)
for (auto& command : executableCommands)
{
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();
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;
}

View File

@ -23,6 +23,9 @@
#include "cafAppEnum.h"
#include <map>
#include <vector>
class RicfCommandObject;
//==================================================================================================
//
@ -53,6 +56,8 @@ public:
static RicfCommandFileExecutor* instance();
static std::vector<RicfCommandObject*> prepareFileCommandsForExecution(const std::vector<RicfCommandObject*>& commandsReadFromFile);
private:
RicfMessages m_messages;

View File

@ -18,18 +18,20 @@
#include "RicfReplaceCase.h"
#include "RicfCommandFileExecutor.h"
#include "RiaApplication.h"
#include "RiaLogging.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_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
{
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("replaceCase: Required parameter newGridFile.");
RiaLogging::error("replaceCaseImpl: No replacements available.");
return;
}
@ -53,15 +100,19 @@ void RicfReplaceCase::execute()
return;
}
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
if (m_caseId() == -1)
for (const auto& a : m_caseIdToGridFileNameMap)
{
projectModifier->setReplaceCaseFirstOccurrence(m_newGridFile());
}
else
{
projectModifier->setReplaceCase(m_caseId(), m_newGridFile());
const auto caseId = a.first;
const auto filePath = a.second;
if (caseId < 0)
{
projectModifier->setReplaceCaseFirstOccurrence(filePath);
}
else
{
projectModifier->setReplaceCase(caseId, filePath);
}
}
RiaApplication::instance()->loadProject(lastProjectPath, RiaApplication::PLA_NONE, projectModifier.p());

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@ -23,16 +23,22 @@
#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;
public:
RicfReplaceCase();
RicfSingleCaseReplace();
int caseId() const;
QString filePath() const;
virtual void execute() override;
@ -40,3 +46,25 @@ private:
caf::PdmField<QString> m_newGridFile;
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;
};

View File

@ -32,7 +32,6 @@
#include <QAction>
#include <QFileDialog>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicExportFishbonesLateralsFeature, "RicExportFishbonesLateralsFeature");

View File

@ -43,7 +43,6 @@
#include "cvfMath.h"
#include <QAction>
#include <QMessageBox>
#include <QDir>

View File

@ -80,7 +80,7 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
std::map<size_t, std::vector<WellBorePartForTransCalc> > wellBorePartsInCells; //wellBore = main bore or fishbone lateral
findFishboneLateralsWellBoreParts(wellBorePartsInCells, wellPath, settings);
findFishboneImportedLateralsWellBoreParts(wellBorePartsInCells, wellPath, settings);
if (!wellBorePartsInCells.empty())
if (!wellBorePartsInCells.empty() && !settings.excludeMainBoreForFishbones)
{
findMainWellBoreParts(wellBorePartsInCells, wellPath, settings);
}

View File

@ -537,11 +537,6 @@ RigCompletionData RicWellPathExportCompletionDataFeature::combineEclipseCellComp
return resultCompletion; //Returning empty completion, should not be exported
}
if (settings.excludeMainBoreForFishbones && completionType == RigCompletionData::FISHBONES && completion.isMainBore())
{
continue;
}
totalTrans = totalTrans + completion.transmissibility();
}

View File

@ -71,6 +71,7 @@ void RicWellPathImportPerforationIntervalsFeature::onActionTriggered(bool isChec
std::map<QString, std::vector<RifPerforationInterval> > perforationIntervals = RifPerforationIntervalReader::readPerforationIntervals(wellPathFilePaths);
RimPerforationInterval* lastPerforationInterval = nullptr;
for (auto& entry : perforationIntervals)
{
RimWellPath* wellPath = wellPathCollection->tryFindMatchingWellPath(entry.first);
@ -95,14 +96,21 @@ void RicWellPathImportPerforationIntervalsFeature::onActionTriggered(bool isChec
perforationInterval->setDate(interval.date);
}
wellPath->perforationIntervalCollection()->appendPerforation(perforationInterval);
lastPerforationInterval = perforationInterval;
}
}
}
wellPathCollection->uiCapability()->updateConnectedEditors();
if (app->project())
{
app->project()->createDisplayModelAndRedrawAllViews();
}
if (lastPerforationInterval)
{
RiuMainWindow::instance()->selectAsCurrentItem(lastPerforationInterval);
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -100,7 +100,7 @@ void RicAppendIntersectionFeatureCmd::redo()
RimIntersection* intersection = new RimIntersection();
intersection->name = QString("Intersection");
m_intersectionCollection->appendIntersection(intersection);
m_intersectionCollection->appendIntersectionAndUpdate(intersection);
RimView* view = nullptr;
m_intersectionCollection->firstAncestorOrThisOfTypeAsserted(view);

View File

@ -122,7 +122,7 @@ void RicNewAzimuthDipIntersectionFeatureCmd::redo()
intersection->setLengthDown(cvf::Math::floor(bBox.extent()[2] / 2));
}
m_intersectionCollection->appendIntersection(intersection);
m_intersectionCollection->appendIntersectionAndUpdate(intersection);
RiuSelectionManager::instance()->deleteAllItems();
RiuMainWindow::instance()->selectAsCurrentItem(intersection);

View File

@ -112,7 +112,7 @@ void RicNewPolylineIntersectionFeatureCmd::redo()
intersection->type = RimIntersection::CS_POLYLINE;
intersection->inputPolyLineFromViewerEnabled = true;
m_intersectionCollection->appendIntersection(intersection);
m_intersectionCollection->appendIntersectionAndUpdate(intersection);
RiuSelectionManager::instance()->deleteAllItems();

View File

@ -107,7 +107,7 @@ void RicNewSimWellIntersectionCmd::redo()
intersection->type = RimIntersection::CS_SIMULATION_WELL;
intersection->simulationWell = m_simWell;
m_intersectionCollection->appendIntersection(intersection);
m_intersectionCollection->appendIntersectionAndUpdate(intersection);
}
//--------------------------------------------------------------------------------------------------

View File

@ -116,7 +116,7 @@ void RicNewWellPathIntersectionFeatureCmd::redo()
intersection->type = RimIntersection::CS_WELL_PATH;
intersection->wellPath = m_wellPath;
m_intersectionCollection->appendIntersection(intersection);
m_intersectionCollection->appendIntersectionAndUpdate(intersection);
}
//--------------------------------------------------------------------------------------------------

View File

@ -20,6 +20,7 @@
#include "RicExportFaultsFeature.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RigEclipseCaseData.h"
#include "RigFault.h"
@ -33,7 +34,6 @@
#include <QAction>
#include <QFileDialog>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicExportFaultsFeature, "RicExportFaultsFeature");
@ -191,7 +191,7 @@ void RicExportFaultsFeature::saveFault(QString completeFilename, const RigMainGr
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);

View File

@ -238,8 +238,9 @@ void RicExportMultipleSnapshotsFeature::exportViewVariationsToFolder(RimView* ri
if (msd->sliceDirection == RimMultiSnapshotDefinition::NO_RANGEFILTER)
{
QString fileName = viewCaseResultString + "_" + timeStepString;
fileName.replace(" ", "_");
QString absoluteFileName = caf::Utils::constructFullFileName(folder, fileName, ".png");
absoluteFileName.replace(" ", "_");
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, rimView);
}
@ -274,9 +275,9 @@ void RicExportMultipleSnapshotsFeature::exportViewVariationsToFolder(RimView* ri
}
rimView->rangeFilterCollection()->updateDisplayModeNotifyManagedViews(rangeFilter);
fileName.replace(" ", "_");
QString absoluteFileName = caf::Utils::constructFullFileName(folder, fileName, ".png");
absoluteFileName.replace(" ", "_");
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, rimView);
}

View File

@ -42,7 +42,6 @@
#include <QAction>
#include <QFileInfo>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputVisibleCellsFeature, "RicSaveEclipseInputVisibleCellsFeature");
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputActiveVisibleCellsFeature, "RicSaveEclipseInputActiveVisibleCellsFeature");

View File

@ -20,6 +20,7 @@
#include "RicSaveEclipseResultAsInputPropertyExec.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RicExportFeatureImpl.h"
@ -38,7 +39,7 @@
#include "cafPdmUiPropertyViewDialog.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);
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);
}
}
}

View File

@ -38,7 +38,6 @@
#include <QFileDialog>
#include <QFileInfo>
#include <QMdiSubWindow>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicSnapshotAllPlotsToFileFeature, "RicSnapshotAllPlotsToFileFeature");
@ -63,7 +62,7 @@ void RicSnapshotAllPlotsToFileFeature::saveAllPlots()
exportSnapshotOfAllPlotsIntoFolder(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())
{
QString fileName = RicSnapshotFilenameGenerator::generateSnapshotFileName(viewWindow);
fileName.replace(" ", "_");
QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png");
absoluteFileName.replace(" ", "_");
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, viewWindow);
}

View File

@ -44,7 +44,6 @@
#include <QFileDialog>
#include <QFileInfo>
#include <QMdiSubWindow>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicSnapshotAllViewsToFileFeature, "RicSnapshotAllViewsToFileFeature");
@ -64,7 +63,7 @@ void RicSnapshotAllViewsToFileFeature::saveAllViews()
exportSnapshotOfAllViewsIntoFolder(snapshotFolderName);
QString text = QString("Exported snapshots to folder : \n%1").arg(snapshotFolderName);
QMessageBox::information(nullptr, "Export Snapshots To Folder", text);
RiaLogging::info(text);
}
//--------------------------------------------------------------------------------------------------

View File

@ -51,7 +51,7 @@ QString RicSnapshotFilenameGenerator::generateSnapshotFileName(RimViewWindow* vi
fileName = viewWindow->uiCapability()->uiName();
}
fileName = caf::Utils::makeValidFileBasename(fileName);
fileName = makeValidFileName(fileName);
return fileName;
}
@ -68,10 +68,10 @@ QString RicSnapshotFilenameGenerator::generateSnapshotFilenameForRimView(RimView
.arg(rimView->name())
.arg(resultName(rimView));
if ( timeSteps.size() ) fileName += QString("_%1_%2").arg(timeStep, 2, 10, QChar('0'))
.arg(timeSteps[timeStep].replace(".", "-"));
if ( !timeSteps.empty() ) fileName += QString("_%1_%2").arg(timeStep, 2, 10, QChar('0'))
.arg(timeSteps[timeStep]);
fileName = caf::Utils::makeValidFileBasename(fileName);
fileName = makeValidFileName(fileName);
return fileName;
}
@ -109,3 +109,18 @@ QString RicSnapshotFilenameGenerator::resultName(RimView * rimView)
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;
}

View File

@ -34,4 +34,5 @@ public:
private:
static QString generateSnapshotFilenameForRimView(RimView* rimView);
static QString resultName(RimView* rimView);
static QString makeValidFileName(const QString& filename);
};

View File

@ -35,7 +35,6 @@
#include <QFileDialog>
#include <QFileInfo>
#include <QMdiSubWindow>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicSnapshotViewToClipboardFeature, "RicSnapshotViewToClipboardFeature");

View File

@ -36,7 +36,6 @@
#include <QFileDialog>
#include <QFileInfo>
#include <QMdiSubWindow>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicSnapshotViewToFileFeature, "RicSnapshotViewToFileFeature");

View File

@ -295,6 +295,7 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot*
newCurve->setSummaryAddressY(addr);
newCurve->setColor(color);
newCurve->setLeftOrRightAxisY(plotAxis);
newCurve->loadDataAndUpdate(true);
return newCurve;
}

View File

@ -56,7 +56,7 @@ void RicAppendIntersectionBoxFeature::onActionTriggered(bool isChecked)
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString("Intersection Box");
coll->appendIntersectionBox(intersectionBox);
coll->appendIntersectionBoxAndUpdate(intersectionBox);
intersectionBox->setToDefaultSizeBox();

View File

@ -59,7 +59,7 @@ void RicIntersectionBoxAtPosFeature::onActionTriggered(bool isChecked)
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString("Intersection box");
coll->appendIntersectionBox(intersectionBox);
coll->appendIntersectionBoxAndUpdate(intersectionBox);
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_NONE, domainCoord);

View File

@ -59,7 +59,7 @@ void RicIntersectionBoxXSliceFeature::onActionTriggered(bool isChecked)
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString("X-slice (Intersection box)");
coll->appendIntersectionBox(intersectionBox);
coll->appendIntersectionBoxAndUpdate(intersectionBox);
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_X, domainCoord);

View File

@ -59,7 +59,7 @@ void RicIntersectionBoxYSliceFeature::onActionTriggered(bool isChecked)
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString("Y-slice (Intersection box)");
coll->appendIntersectionBox(intersectionBox);
coll->appendIntersectionBoxAndUpdate(intersectionBox);
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Y, domainCoord);

View File

@ -59,7 +59,7 @@ void RicIntersectionBoxZSliceFeature::onActionTriggered(bool isChecked)
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString("Z-slice (Intersection box)");
coll->appendIntersectionBox(intersectionBox);
coll->appendIntersectionBoxAndUpdate(intersectionBox);
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Z, domainCoord);

View File

@ -31,7 +31,6 @@
#include "cvfAssert.h"
#include <QAction>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicDeleteScriptPathFeature, "RicDeleteScriptPathFeature");

View File

@ -39,7 +39,6 @@
#include "cvfAssert.h"
#include <QAction>
#include <QMessageBox>
#include <QString>
#include <QFileInfo>

View File

@ -40,7 +40,6 @@
#include <QAction>
#include <QFileInfo>
#include <QMessageBox>
#include <QString>
CAF_CMD_SOURCE_INIT(RicConvertAllFractureTemplatesToMetricFeature, "RicConvertAllFractureTemplatesToMetricFeature");

View File

@ -39,7 +39,6 @@
#include "cvfAssert.h"
#include <QAction>
#include <QMessageBox>
#include <QString>
#include <QFileInfo>

View File

@ -26,6 +26,7 @@
#include "RimCase.h"
#include "RimCellRangeFilterCollection.h"
#include "RimEclipsePropertyFilterCollection.h"
#include "RimEclipseView.h"
#include "RimFormationNamesCollection.h"
#include "RimGeoMechPropertyFilterCollection.h"
#include "RimIntersectionCollection.h"
@ -150,6 +151,16 @@ void RicDeleteItemExec::redo()
{
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

View File

@ -142,7 +142,7 @@ void RicGridStatisticsDialog::setInfoText(RimView* view)
QString text;
text = overlayInfo->timeStepText();
text += overlayInfo->caseInfoText();
text += overlayInfo->resultInfoText(overlayInfo->histogramData(), true);
text += overlayInfo->resultInfoText(overlayInfo->histogramData());
m_textEdit->setText(text);
adjustTextEditHeightToContent();
}

View File

@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "RimOilField.h"
#include "RimEclipseView.h"
#include "RimEllipseFractureTemplate.h"
#include "RimFractureTemplateCollection.h"
#include "RimProject.h"
@ -58,6 +59,18 @@ void RicNewEllipseFractureTemplateFeature::onActionTriggered(bool isChecked)
fractureDef->setDefaultWellDiameterFromUnit();
fracDefColl->updateConnectedEditors();
std::vector<RimView*> views;
project->allVisibleViews(views);
for (RimView* view : views)
{
if (dynamic_cast<RimEclipseView*>(view))
{
view->updateConnectedEditors();
}
}
RiuMainWindow::instance()->selectAsCurrentItem(fractureDef);
}
}

View File

@ -49,6 +49,9 @@ CAF_CMD_SOURCE_INIT(RicNewSimWellFractureAtPosFeature, "RicNewSimWellFractureAtP
//--------------------------------------------------------------------------------------------------
void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
{
RimProject* proj = RiaApplication::instance()->project();
if (proj->allFractureTemplates().empty()) return;
RimView* activeView = RiaApplication::instance()->activeReservoirView();
if (!activeView) return;
@ -120,6 +123,9 @@ void RicNewSimWellFractureAtPosFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
bool RicNewSimWellFractureAtPosFeature::isCommandEnabled()
{
RimProject* proj = RiaApplication::instance()->project();
if (proj->allFractureTemplates().empty()) return false;
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if (!pdmUiItem) return false;

View File

@ -50,6 +50,9 @@ CAF_CMD_SOURCE_INIT(RicNewSimWellFractureFeature, "RicNewSimWellFractureFeature"
//--------------------------------------------------------------------------------------------------
void RicNewSimWellFractureFeature::onActionTriggered(bool isChecked)
{
RimProject* proj = RiaApplication::instance()->project();
if (proj->allFractureTemplates().empty()) return;
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if (!pdmUiItem) return;
@ -109,6 +112,9 @@ void RicNewSimWellFractureFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
bool RicNewSimWellFractureFeature::isCommandEnabled()
{
RimProject* proj = RiaApplication::instance()->project();
if (proj->allFractureTemplates().empty()) return false;
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if (!pdmUiItem) return false;

View File

@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "RimOilField.h"
#include "RimEclipseView.h"
#include "RimFractureTemplateCollection.h"
#include "RimProject.h"
#include "RimStimPlanFractureTemplate.h"
@ -44,7 +45,7 @@ void RicNewStimPlanFractureTemplateFeature::onActionTriggered(bool isChecked)
{
RiaApplication* app = RiaApplication::instance();
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;
@ -67,6 +68,18 @@ void RicNewStimPlanFractureTemplateFeature::onActionTriggered(bool isChecked)
fractureDef->setDefaultWellDiameterFromUnit();
fracDefColl->updateConnectedEditors();
std::vector<RimView*> views;
project->allVisibleViews(views);
for (RimView* view : views)
{
if (dynamic_cast<RimEclipseView*>(view))
{
view->updateConnectedEditors();
}
}
RiuMainWindow::instance()->selectAsCurrentItem(fractureDef);
}
}

View File

@ -22,6 +22,8 @@
#include "RicNewWellPathFractureFeature.h"
#include "RimProject.h"
#include "RiuSelectionManager.h"
#include <QAction>
@ -35,6 +37,9 @@ CAF_CMD_SOURCE_INIT(RicNewWellPathFractureAtPosFeature, "RicNewWellPathFractureA
//--------------------------------------------------------------------------------------------------
void RicNewWellPathFractureAtPosFeature::onActionTriggered(bool isChecked)
{
RimProject* proj = RiaApplication::instance()->project();
if (proj->allFractureTemplates().empty()) return;
RiuSelectionManager* riuSelManager = RiuSelectionManager::instance();
RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY);
@ -61,5 +66,8 @@ void RicNewWellPathFractureAtPosFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
bool RicNewWellPathFractureAtPosFeature::isCommandEnabled()
{
RimProject* proj = RiaApplication::instance()->project();
if (proj->allFractureTemplates().empty()) return false;
return true;
}

View File

@ -96,6 +96,9 @@ void RicNewWellPathFractureFeature::addFracture(RimWellPath* wellPath, double me
//--------------------------------------------------------------------------------------------------
void RicNewWellPathFractureFeature::onActionTriggered(bool isChecked)
{
RimProject* proj = RiaApplication::instance()->project();
if (proj->allFractureTemplates().empty()) return;
RimWellPathFractureCollection* fractureColl = RicNewWellPathFractureFeature::selectedWellPathFractureCollection();
if (!fractureColl) return;
@ -120,6 +123,9 @@ void RicNewWellPathFractureFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
bool RicNewWellPathFractureFeature::isCommandEnabled()
{
RimProject* proj = RiaApplication::instance()->project();
if (proj->allFractureTemplates().empty()) return false;
if (selectedWellPathFractureCollection())
{
return true;

View File

@ -36,7 +36,6 @@
#include <QDebug>
#include <QFileDialog>
#include <QFileInfo>
#include <QMessageBox>

View File

@ -28,6 +28,7 @@
#include "cafPdmUiListEditor.h"
#include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiTreeSelectionEditor.h"
#include "cafPdmUiObjectEditorHandle.h"
CAF_PDM_SOURCE_INIT(RicSummaryCurveCalculator, "RicSummaryCurveCalculator");
@ -134,6 +135,7 @@ void RicSummaryCurveCalculator::fieldChangedByUi(const caf::PdmFieldHandle* chan
m_currentCalculation = nullptr;
this->updateConnectedEditors();
caf::PdmUiObjectEditorHandle::updateUiAllObjectEditors();
}
}
}
@ -247,6 +249,7 @@ bool RicSummaryCurveCalculator::calculate() const
}
m_currentCalculation()->updateDependentCurvesAndPlots();
caf::PdmUiObjectEditorHandle::updateUiAllObjectEditors();
}
return true;
@ -268,7 +271,7 @@ void RicSummaryCurveCalculator::defineEditorAttribute(const caf::PdmFieldHandle*
}
//--------------------------------------------------------------------------------------------------
///
/// f
//--------------------------------------------------------------------------------------------------
void RicSummaryCurveCalculator::onEditorWidgetsCreated()
{

View File

@ -510,8 +510,10 @@ void RicSummaryCurveCreator::populateCurveCreator(const RimSummaryPlot& sourceSu
curve->setCurveVisiblity(false);
}
m_previewPlot->copyAxisPropertiesFromOther(sourceSummaryPlot);
m_previewPlot->enableAutoPlotTitle(sourceSummaryPlot.autoPlotTitle());
m_previewPlot->updatePlotTitle();
m_previewPlot->updateAxes();
m_summaryCurveSelectionEditor->summaryAddressSelection()->setSelectedCurveDefinitions(curveDefs);

View File

@ -35,7 +35,6 @@
#include <QDebug>
#include <QFileDialog>
#include <QFileInfo>
#include <QMessageBox>

View File

@ -77,7 +77,7 @@ void RicWellPathFormationsImportFileFeature::onActionTriggered(bool isChecked)
if (oilField->wellPathCollection->wellPaths().size() > 0)
{
RimWellPath* wellPath = oilField->wellPathCollection->newestAddedWellPath();
RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath();
if (wellPath)
{
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);

View File

@ -70,7 +70,7 @@ void RicWellPathsImportFileFeature::onActionTriggered(bool isChecked)
if (oilField->wellPathCollection->wellPaths().size() > 0)
{
RimWellPath* wellPath = oilField->wellPathCollection->newestAddedWellPath();
RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath();
if (wellPath)
{
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);

View File

@ -342,7 +342,17 @@ void RifEclipseInputFileTools::findKeywordsOnFile(const QString &fileName, std::
filepos = data.pos() - lineLength;
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);
//qDebug() << keyPos.keyword << " - " << keyPos.filePos;
}
@ -430,6 +440,7 @@ const std::vector<QString>& RifEclipseInputFileTools::invalidPropertyDataKeyword
keywords.push_back("ZCORN");
keywords.push_back("SPECGRID");
keywords.push_back("MAPAXES");
keywords.push_back("NOECHO");
keywords.push_back(faultsKeyword);

View File

@ -22,6 +22,7 @@
#include "RifEclipseRestartFilesetAccess.h"
#include "RifEclipseUnifiedRestartFileAccess.h"
#include "RiaStringEncodingTools.h"
#include "RiaQDateTimeTools.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)
{
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)
{
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)
{
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)
{
size_t numValues = ecl_kw_get_size(kwData);
@ -232,7 +233,7 @@ QString RifEclipseOutputFileTools::firstFileNameOfType(const QStringList& fileSe
{
bool formatted = false;
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);
}
@ -253,7 +254,7 @@ QStringList RifEclipseOutputFileTools::filterFileNamesOfType(const QStringList&
{
bool formatted = false;
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));
}
@ -276,12 +277,12 @@ bool RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(const QString&
QString fileNameBase = QFileInfo(fullPathFileName).baseName();
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;
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);
@ -294,7 +295,7 @@ bool RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(const QString&
//--------------------------------------------------------------------------------------------------
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.
//printf("grid:%s has %d a total of %d lgr's \n", grid_filename , stringlist_get_size( lgr_names ));

View File

@ -20,6 +20,8 @@
#include "RifEclipseRestartFilesetAccess.h"
#include "RifEclipseOutputFileTools.h"
#include "RiaStringEncodingTools.h"
#include "cafProgressInfo.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])
{
const char* fileName = ecl_file_get_src_file(m_ecl_files[i]);
int reportNumber = ecl_util_filename_report_nr(fileName);
int reportNumber = RifEclipseRestartFilesetAccess::reportNumber(m_ecl_files[i]);
if(reportNumber != -1)
{
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)
{
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;
@ -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;
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 = ecl_util_filename_report_nr(fileName);
int reportNumber = RifEclipseRestartFilesetAccess::reportNumber(ecl_file);
if (reportNumber != -1)
{
reportNr.push_back(reportNumber);

View File

@ -58,6 +58,7 @@ public:
private:
void openTimeStep(size_t timeStep);
static int reportNumber(const ecl_file_type* ecl_file);
private:
QStringList m_fileNames;

View File

@ -20,17 +20,21 @@
#include "RiaSummaryCurveAnalyzer.h"
#include "RifReaderEclipseSummary.h"
#include "RiaStringEncodingTools.h"
#include "cafAppEnum.h"
#include "ert/ecl/ecl_util.h"
#include <QString>
#include <QStringList>
#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);
}
@ -38,9 +42,9 @@ void RifEclipseSummaryTools::findSummaryHeaderFile(const std::string& inputFile,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseSummaryTools::findSummaryFiles(const std::string& inputFile,
std::string* headerFile,
std::vector<std::string>* dataFiles)
void RifEclipseSummaryTools::findSummaryFiles(const QString& inputFile,
QString* headerFile,
QStringList* dataFiles)
{
dataFiles->clear();
headerFile->clear();
@ -49,21 +53,21 @@ void RifEclipseSummaryTools::findSummaryFiles(const std::string& inputFile,
char* myBase = 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;
std::string base; if(myBase) base = myBase;
QString path; if(myPath) path = RiaStringEncodingTools::fromNativeEncoded(myPath);
QString base; if(myBase) base = RiaStringEncodingTools::fromNativeEncoded(myBase);
std::string extention; if(myExtention) extention = myExtention;
if(path.empty() || base.empty()) return ;
if(path.isEmpty() || base.isEmpty()) return ;
char* myHeaderFile = NULL;
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)
{
(*headerFile) = myHeaderFile;
(*headerFile) = RiaStringEncodingTools::fromNativeEncoded(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++)
{
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);
@ -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;
std::vector<std::string> dataFileNames;
QString headerFileName;
QStringList dataFileNames;
RifEclipseSummaryTools::findSummaryFiles(gridFileName, &headerFileName, &dataFileNames);
if (!headerFileName.empty() && dataFileNames.size()) return true;
if (!headerFileName.isEmpty() && dataFileNames.size()) return true;
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;
std::string base;
QString path;
QString base;
findSummaryHeaderFileInfo(caseFile, NULL, &path, &base, NULL);
if (path.empty() || base.empty()) return fileNames;
if (path.isEmpty() || base.isEmpty()) return fileNames;
char* header_file = NULL;
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)
{
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* myBase = NULL;
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);
if (!myHeaderFile)

View File

@ -24,6 +24,8 @@
#include <vector>
class RifSummaryReaderInterface;
class QStringList;
class QString;
//==================================================================================================
//
@ -33,13 +35,13 @@ class RifSummaryReaderInterface;
class RifEclipseSummaryTools
{
public:
static void findSummaryHeaderFile(const std::string& inputFile, std::string* headerFile, bool* isFormatted);
static std::vector<std::string> findSummaryDataFiles(const std::string& caseFile);
static void findSummaryHeaderFile(const QString& inputFile, QString* headerFile, bool* isFormatted);
static QStringList findSummaryDataFiles(const QString& caseFile);
static void findSummaryFiles(const std::string& inputFile, std::string* headerFile, std::vector<std::string>* dataFiles);
static bool hasSummaryFiles(const std::string& gridFileName);
static void findSummaryFiles(const QString& inputFile, QString* headerFile, QStringList* dataFiles);
static bool hasSummaryFiles(const QString& gridFileName);
static void dumpMetaData(RifSummaryReaderInterface* readerEclipseSummary);
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);
};

View File

@ -26,6 +26,7 @@
#include "RifEclipseOutputFileTools.h"
#include "RifReaderSettings.h"
#include "RiaStringEncodingTools.h"
#include "ert/ecl/ecl_file.h"
#include "ert/ecl/ecl_kw_magic.h"
@ -83,7 +84,7 @@ bool RifEclipseUnifiedRestartFileAccess::openFile()
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)
{
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)
{
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)
{
RiaLogging::error(QString("Failed to open file %1").arg(m_filename));
@ -112,7 +113,7 @@ bool RifEclipseUnifiedRestartFileAccess::openFile()
QString resultPath = fi.absolutePath();
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)
{

View File

@ -28,6 +28,7 @@
#include "RifEclipseOutputFileTools.h"
#include "RifHdf5ReaderInterface.h"
#include "RifReaderSettings.h"
#include "RiaStringEncodingTools.h"
#ifdef USE_HDF5
#include "RifHdf5Reader.h"
@ -374,7 +375,7 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigEclipseCaseData* e
// Read geometry
// 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();
@ -693,7 +694,7 @@ bool RifReaderEclipseOutput::openAndReadActiveCellData(const QString& fileName,
// Keep the set of files of interest
m_filesWithSameBaseName = fileSet;
m_eclipseCase = eclipseCase;
m_fileName = fileName;
if (!readActiveCellInfo())
{
@ -722,7 +723,7 @@ bool RifReaderEclipseOutput::readActiveCellInfo()
QString egridFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_EGRID_FILE);
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;
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);
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++)
{
if (this->isTimeStepIncludedByFilter(i))
@ -2210,7 +2214,7 @@ void RifReaderEclipseOutput::openInitFile()
QString initFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_INIT_FILE);
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);
}
}

View File

@ -21,6 +21,8 @@
#include "RiaLogging.h"
#include "RiaQDateTimeTools.h"
#include "RiaStringEncodingTools.h"
#include "cafVecIjk.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)
{
}
@ -45,15 +47,15 @@ RifReaderEclipseRft::~RifReaderEclipseRft()
//--------------------------------------------------------------------------------------------------
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)
{
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;
}

View File

@ -41,7 +41,7 @@ namespace caf
class RifReaderEclipseRft : public cvf::Object
{
public:
RifReaderEclipseRft(const std::string& fileName);
RifReaderEclipseRft(const QString& fileName);
~RifReaderEclipseRft();
const std::vector<RifEclipseRftAddress>& eclipseRftAddresses();
@ -63,7 +63,7 @@ private:
// Taken from ecl_rft_file.h and ecl_rft_node.h
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;
std::vector<RifEclipseRftAddress> m_eclipseRftAddresses;
std::set<QString> m_wellNames;

View File

@ -17,6 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RifReaderEclipseSummary.h"
#include "RiaStringEncodingTools.h"
#include "ert/ecl/ecl_sum.h"
@ -24,6 +25,8 @@
#include <assert.h>
#include <QDateTime>
#include <QString>
#include <QStringList>
#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);
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);
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 = ":";
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);

View File

@ -25,6 +25,8 @@
#include <vector>
#include <map>
class QString;
class QStringList;
//==================================================================================================
//
@ -36,7 +38,7 @@ public:
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;

View File

@ -224,12 +224,13 @@ std::vector<std::vector<double>> RifStimPlanXmlReader::getAllDepthDataAtTimeSte
if (xmlStream.isCDATA())
{
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;
else
{
QString value = depthDataStr.split(' ')[i];
QString value = splitted[i];
if ( value != "")
{
propertyValuesAtDepth.push_back(value.toDouble());

View File

@ -39,11 +39,29 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
std::vector<QString> wellNames;
std::vector<QString> formationNames;
std::vector<double> mdTop;
std::vector<double> mdBase;
readFile(filePath, &wellNames, &formationNames, &mdTop, &mdBase);
if (wellNames.empty() || formationNames.empty() || mdTop.empty() || mdBase.empty())
std::vector<double> tvdTop;
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",
QString("Failed to parse %1 as a well pick file").arg(filePath));
@ -51,10 +69,16 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
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(mdTop.size() == formationNames.size());
CVF_ASSERT(mdBase.size() == formationNames.size());
std::map<QString, std::vector<RigWellPathFormation>> formations;
@ -62,8 +86,18 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
{
RigWellPathFormation formation;
formation.formationName = formationNames[i];
formation.mdTop = mdTop[i];
formation.mdBase = mdBase[i];
if (mdIsPresent)
{
formation.mdTop = mdTop[i];
formation.mdBase = mdBase[i];
}
if (tvdIsPresent)
{
formation.tvdTop = tvdTop[i];
formation.tvdBase = tvdBase[i];
}
if (!formations.count(wellNames[i]))
{
@ -73,10 +107,10 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
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);
result[it->first] = wellPathFormations;
cvf::ref<RigWellPathFormations> wellPathFormations = new RigWellPathFormations(formation.second, filePath, formation.first);
result[formation.first] = wellPathFormations;
}
return result;
@ -95,7 +129,8 @@ void removeWhiteSpaces(QString* word)
//--------------------------------------------------------------------------------------------------
void RifWellPathFormationReader::readFile(const QString& filePath, std::vector<QString>* wellNames,
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);
@ -151,12 +186,31 @@ void RifWellPathFormationReader::readFile(const QString& filePath, std::vector<Q
static const QString unitNameText = "unitname";
static const QString measuredDepthToptext = "topmd";
static const QString measuredDepthBasetext = "basemd";
static const QString trueVerticalDepthToptext = "toptvdss";
static const QString trueVerticalDepthBasetext = "basetvdss";
int unitNameIndex = header.indexOf(unitNameText);
int measuredDepthTopIndex = header.indexOf(measuredDepthToptext);
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
{
@ -168,13 +222,27 @@ void RifWellPathFormationReader::readFile(const QString& filePath, std::vector<Q
QString wellName = dataLine[wellNameIndex];
QString unitName = dataLine[unitNameIndex];
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);
formationNames->push_back(unitName);
mdTop->push_back(measuredDepthTop);
mdBase->push_back(measuredDepthBase);
} while (!data.atEnd());
}

View File

@ -39,5 +39,6 @@ public:
private:
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);
};

View File

@ -1369,10 +1369,18 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
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);
else
}
else if (resVarAddr.componentName.empty())
{
return nullptr;
}
else
{
return calculateSurfaceAlignedStress(partIndex, resVarAddr);
}
}
if (resVarAddr.fieldName == "SE" && resVarAddr.componentName == "SFI")

View File

@ -92,9 +92,13 @@ void RimCompletionCellIntersectionCalc::calculateWellPathIntersections(const Rim
std::vector<double>& values,
const QDateTime& fromDate)
{
std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::findRawHexCellIntersections(grid,
wellPath->wellPathGeometry()->m_wellPathPoints);
std::vector<HexIntersectionInfo> intersections;
if (wellPath->wellPathGeometry())
{
intersections = RigWellPathIntersectionTools::findRawHexCellIntersections(grid,
wellPath->wellPathGeometry()->m_wellPathPoints);
}
for (auto& intersection : intersections)
{
values[intersection.m_hexIndex] = RiaDefines::WELL_PATH;

View File

@ -44,13 +44,12 @@
#include "cvfVector3.h"
#include <QFileInfo>
#include <QMessageBox>
#include <algorithm>
#include <vector>
#include <cmath>
static std::vector<double> EMPTY_DOUBLE_VECTOR;
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", "");
m_fractureGrid = new RigFractureGrid();
m_readError = false;
}
//--------------------------------------------------------------------------------------------------
@ -93,6 +93,7 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
if (&m_stimPlanFileName == changedField)
{
m_readError = false;
updateUiTreeName();
loadDataAndUpdate();
setDefaultsBasedOnXMLfile();
@ -237,16 +238,21 @@ bool RimStimPlanFractureTemplate::setBorderPolygonResultNameToDefault()
void RimStimPlanFractureTemplate::loadDataAndUpdate()
{
QString errorMessage;
if (m_readError) return;
m_stimPlanFractureDefinitionData = RifStimPlanXmlReader::readStimPlanXMLFile( m_stimPlanFileName(), m_conductivityScalingFactor(), &errorMessage);
if (errorMessage.size() > 0) RiaLogging::error(errorMessage);
if (m_stimPlanFractureDefinitionData.notNull())
{
fractureTemplateUnit = m_stimPlanFractureDefinitionData->unitSet();
m_readError = false;
}
else
{
fractureTemplateUnit = RiaEclipseUnitTools::UNITS_UNKNOWN;
m_readError = true;
}
updateFractureGrid();
@ -335,7 +341,7 @@ QString RimStimPlanFractureTemplate::getUnitForStimPlanParameter(QString paramet
const std::vector<double>& RimStimPlanFractureTemplate::timeSteps()
{
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
{
if (m_stimPlanFractureDefinitionData.isNull()) return std::vector<std::vector<double>>();
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
{
if (m_stimPlanFractureDefinitionData.isNull()) return EMPTY_DOUBLE_VECTOR;
return m_stimPlanFractureDefinitionData->fractureGridResults(resultName, unitName, timeStepIndex);
}
@ -405,9 +413,12 @@ const RigFractureGrid* RimStimPlanFractureTemplate::fractureGrid() const
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate::updateFractureGrid()
{
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid(m_activeTimeStepIndex,
fractureTemplateUnit,
m_wellPathDepthAtFracture);
if (m_stimPlanFractureDefinitionData.notNull())
{
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid(m_activeTimeStepIndex,
fractureTemplateUnit,
m_wellPathDepthAtFracture);
}
}
@ -424,12 +435,14 @@ void RimStimPlanFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3
{
loadDataAndUpdate();
}
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry(m_wellPathDepthAtFracture,
neededUnit,
name,
nodeCoords,
triangleIndices);
else
{
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry(m_wellPathDepthAtFracture,
neededUnit,
name,
nodeCoords,
triangleIndices);
}
return;
}
@ -438,6 +451,7 @@ void RimStimPlanFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3
//--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fractureBorderPolygon(RiaEclipseUnitTools::UnitSystem neededUnit)
{
if (m_stimPlanFractureDefinitionData.isNull()) return std::vector<cvf::Vec3f>();
QString parameterName = m_borderPolygonResultName;
QString parameterUnit = getUnitForStimPlanParameter(parameterName);

View File

@ -107,4 +107,5 @@ private:
caf::PdmField<double> m_conductivityScalingFactor;
cvf::ref<RigFractureGrid> m_fractureGrid;
bool m_readError;
};

View File

@ -253,6 +253,7 @@ void RimWellAllocationPlot::updateFromWell()
RimWellLogTrack* plotTrack = new RimWellLogTrack();
plotTrack->setDescription(QString("Branch %1").arg(brIdx + 1));
plotTrack->setFormationsForCaseWithSimWellOnly(true);
plotTrack->setFormationBranchIndex((int)brIdx);
accumulatedWellFlowPlot()->addTrack(plotTrack);

View File

@ -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 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);
return "";
}
@ -755,7 +755,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
if (showResultInfo())
{
infoText += resultInfoText(histData, showVolumeWeightedMean());
infoText += resultInfoText(histData);
}
if (!infoText.isEmpty())

View File

@ -74,7 +74,7 @@ public:
HistogramData histogramData();
QString timeStepText();
QString caseInfoText();
QString resultInfoText(const HistogramData& histData, bool showVolumeWeightedMean);
QString resultInfoText(const HistogramData& histData);
void showStatisticsInfoDialog(bool raise = true);
QImage statisticsDialogScreenShotImage();

View File

@ -91,9 +91,9 @@ RimEclipseCase::RimEclipseCase()
m_filesContainingFaults_OBSOLETE.xmlCapability()->setIOWritable(false);
m_filesContainingFaults_OBSOLETE.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&caseName, "CaseName", QString(), "Obsolete", "", "" ,"");
caseName.xmlCapability()->setIOWritable(false);
caseName.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_caseName_OBSOLETE, "CaseName", QString(), "Obsolete", "", "" ,"");
m_caseName_OBSOLETE.xmlCapability()->setIOWritable(false);
m_caseName_OBSOLETE.uiCapability()->setUiHidden(true);
// Init
@ -210,9 +210,9 @@ void RimEclipseCase::initAfterRead()
riv->setEclipseCase(this);
}
if (caseUserDescription().isEmpty() && !caseName().isEmpty())
if (caseUserDescription().isEmpty() && !m_caseName_OBSOLETE().isEmpty())
{
caseUserDescription = caseName;
caseUserDescription = m_caseName_OBSOLETE;
}
}

View File

@ -135,7 +135,7 @@ private:
// Obsolete fields
protected:
caf::PdmField<QString> caseName;
caf::PdmField<QString> m_caseName_OBSOLETE;
private:
caf::PdmField<std::vector<QString> > m_filesContainingFaults_OBSOLETE;

View File

@ -40,6 +40,8 @@
#include "cafPdmUiTreeOrdering.h"
#include <QMessageBox>
CAF_PDM_SOURCE_INIT(RimEclipseCellColors, "ResultSlot");
//--------------------------------------------------------------------------------------------------

View File

@ -249,9 +249,9 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
// Then read the properties from all the files referenced by the InputReservoir
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);

View File

@ -92,8 +92,6 @@ RimEclipseResultCase::RimEclipseResultCase()
m_activeCellInfoIsReadFromFile = false;
m_gridAndWellDataIsReadFromFile = false;
m_caseName = "";
}
//--------------------------------------------------------------------------------------------------
@ -210,7 +208,7 @@ bool RimEclipseResultCase::importGridAndResultMetaData(bool showTimeStepFilter)
if (rftFileInfo.exists())
{
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
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";
}
}
}

View File

@ -65,8 +65,6 @@ public:
RifReaderEclipseRft* rftReader();
QString caseName() const { return m_caseName; }
protected:
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);
@ -90,12 +88,9 @@ private:
caf::PdmChildArrayField<RimFlowDiagSolution*> m_flowDiagSolutions;
caf::PdmField<QString> m_sourSimFileName;
QString m_caseName;
// Obsolete field
caf::PdmField<QString> caseDirectory;
bool m_gridAndWellDataIsReadFromFile;
bool m_activeCellInfoIsReadFromFile;
};

View File

@ -458,7 +458,15 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
bool enableSouring = false;
#ifdef ENABLE_SOURING
enableSouring = true;
if (m_eclipseCase.notNull())
{
RigCaseCellResultsData* cellResultsData = m_eclipseCase->results(this->porosityModel());
if (cellResultsData->hasFlowDiagUsableFluxes())
{
enableSouring = true;
}
}
#endif /* ENABLE_SOURING */
@ -1107,13 +1115,11 @@ bool RimEclipseResultDefinition::isFlowDiagOrInjectionFlooding() const
//--------------------------------------------------------------------------------------------------
bool RimEclipseResultDefinition::hasDualPorFractureResult()
{
if ( m_eclipseCase
&& m_eclipseCase->eclipseCaseData()
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount() > 0 )
{
return true;
}
if (m_eclipseCase
&& m_eclipseCase->eclipseCaseData())
{
return m_eclipseCase->eclipseCaseData()->hasFractureResults();
}
return false;
}

View File

@ -71,6 +71,7 @@
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
#include "RimFracture.h"
#include "RimFractureTemplateCollection.h"
#include "RimSimWellFracture.h"
#include "RivWellFracturePartMgr.h"
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
@ -1469,7 +1470,18 @@ void RimEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
uiTreeOrdering.add(cellEdgeResult());
uiTreeOrdering.add(faultResultSettings());
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
uiTreeOrdering.add(stimPlanColors());
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());
}
}
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
uiTreeOrdering.add(wellCollection());
@ -1547,6 +1559,8 @@ bool RimEclipseView::isTimeStepDependentDataVisible() const
if (this->faultResultSettings->customFaultResult()->isTernarySaturationSelected()) return true;
}
if (this->wellPathCollection()->anyWellsContainingPerforationIntervals()) return true;
return false;
}

View File

@ -76,6 +76,7 @@ void RimGeoMechCellColors::updateIconState()
//--------------------------------------------------------------------------------------------------
void RimGeoMechCellColors::initAfterRead()
{
RimGeoMechResultDefinition::initAfterRead();
updateIconState();
}

View File

@ -42,7 +42,7 @@ public:
caf::PdmChildField<RimLegendConfig*> legendConfig;
void updateIconState();
virtual void initAfterRead();
virtual void initAfterRead() override;
protected:
void updateLegendCategorySettings() override;

View File

@ -94,8 +94,7 @@ RimGeoMechResultDefinition::RimGeoMechResultDefinition(void)
m_resultVariableUiField.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
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);
}
if (!m_isChangedByField)
{
m_resultPositionTypeUiField = m_resultPositionType;
m_resultVariableUiField = composeFieldCompString(m_resultFieldName(), m_resultComponentName());
}
m_isChangedByField = false;
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)
{
m_isChangedByField = true;
if( &m_resultPositionTypeUiField == changedField
|| &m_isTimeLapseResultUiField == changedField
|| &m_timeLapseBaseTimestepUiField == changedField)

View File

@ -113,6 +113,7 @@ private:
caf::PdmField<bool> m_isTimeLapseResultUiField;
caf::PdmField<int> m_timeLapseBaseTimestepUiField;
caf::PdmPointer<RimGeoMechCase> m_geomCase;
bool m_isChangedByField;
};

View File

@ -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);
@ -167,9 +167,19 @@ void RimIntersectionCollection::appendIntersection(RimIntersection* intersection
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::appendIntersectionBox(RimIntersectionBox* intersectionBox)
void RimIntersectionCollection::appendIntersectionBoxAndUpdate(RimIntersectionBox* intersectionBox)
{
m_intersectionBoxes.push_back(intersectionBox);
updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox);
RimView* rimView = NULL;
firstAncestorOrThisOfType(rimView);
if (rimView)
{
rimView->scheduleCreateDisplayModelAndRedraw();
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -48,8 +48,9 @@ public:
caf::PdmField<bool> isActive;
void appendIntersection(RimIntersection* intersection);
void appendIntersectionBox(RimIntersectionBox* intersectionBox);
void appendIntersectionAndUpdate(RimIntersection* intersection);
void appendIntersectionBoxAndUpdate(RimIntersectionBox* intersectionBox);
bool hasActiveIntersectionForSimulationWell(const RimSimWellInView* simWell) const;

View File

@ -135,7 +135,7 @@ void RimPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, con
{
if (changedField == &m_showCurve)
{
this->updateCurveVisibility();
this->updateCurveVisibility(true);
if (m_showCurve()) loadDataAndUpdate(true);
}
else if (changedField == &m_curveName)
@ -180,7 +180,7 @@ caf::PdmFieldHandle* RimPlotCurve::objectToggleField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateCurveVisibility()
void RimPlotCurve::updateCurveVisibility(bool updateParentPlot)
{
bool isVisibleInPossibleParent = true;
@ -199,7 +199,10 @@ void RimPlotCurve::updateCurveVisibility()
m_qwtPlotCurve->detach();
}
updateZoomInParentPlot();
if (updateParentPlot)
{
updateZoomInParentPlot();
}
}
//--------------------------------------------------------------------------------------------------
@ -207,7 +210,7 @@ void RimPlotCurve::updateCurveVisibility()
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateCurvePresentation(bool updatePlotLegend)
{
this->updateCurveVisibility();
this->updateCurveVisibility(updatePlotLegend);
if (updatePlotLegend)
{

View File

@ -92,7 +92,7 @@ public:
QString curveName() const { return m_curveName; }
void updateCurveVisibility();
void updateCurveVisibility(bool updateParentPlot);
void updateLegendEntryVisibilityAndPlotLegend();
void updateLegendEntryVisibilityNoPlotUpdate();

View File

@ -52,6 +52,8 @@
#include "RimMultiSnapshotDefinition.h"
#include "RimObservedDataCollection.h"
#include "RimOilField.h"
#include "RimPltPlotCollection.h"
#include "RimRftPlotCollection.h"
#include "RimScriptCollection.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSummaryCrossPlotCollection.h"
@ -59,12 +61,11 @@
#include "RimView.h"
#include "RimViewLinker.h"
#include "RimViewLinkerCollection.h"
#include "RimWellLogFile.h"
#include "RimWellLogPlotCollection.h"
#include "RimRftPlotCollection.h"
#include "RimPltPlotCollection.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPathImport.h"
#include "RimWellPath.h"
#include "RiuMainWindow.h"
#include "RiuMainPlotWindow.h"
@ -448,6 +449,11 @@ void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName
cases[i]->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
}
for (RimSummaryCase* summaryCase : allSummaryCases())
{
summaryCase->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
}
// Update path to well path file cache
for(RimOilField* oilField: oilFields)
{
@ -470,6 +476,15 @@ void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
}
{
std::vector<RimWellLogFile*> rimWellLogFiles;
this->descendantsIncludingThisOfType(rimWellLogFiles);
for (auto rimWellLogFile : rimWellLogFiles)
{
rimWellLogFile->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
}
}
wellPathImport->updateFilePaths();
}

View File

@ -320,6 +320,13 @@ void RimSimWellInViewCollection::fieldChangedByUi(const caf::PdmFieldHandle* cha
if (&isActive == changedField)
{
this->updateUiIconFromToggleField();
RimView* view;
firstAncestorOrThisOfType(view);
if (view)
{
view->hasUserRequestedAnimation = true;
}
}
if (&m_showWellLabel == changedField)

View File

@ -436,7 +436,7 @@ void RimView::endAnimation()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathCollection* RimView::wellPathCollection()
RimWellPathCollection* RimView::wellPathCollection() const
{
RimProject* proj = nullptr;
this->firstAncestorOrThisOfTypeAsserted(proj);

View File

@ -210,7 +210,7 @@ protected:
virtual void onLoadDataAndUpdate() = 0;
RimWellPathCollection* wellPathCollection();
RimWellPathCollection* wellPathCollection() const;
QPointer<RiuViewer> m_viewer;

View File

@ -215,7 +215,7 @@ void RimWellLogExtractionCurve::setPropertiesFromView(RimView* view)
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::clampTimestep()
{
if (m_case)
if (m_timeStep > 0 && m_case)
{
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] : "";
}
//--------------------------------------------------------------------------------------------------

View File

@ -243,6 +243,21 @@ bool RimWellLogFile::hasFlowData() const
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;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -72,6 +72,8 @@ public:
RimWellLogFile::WellFlowCondition wellFlowRateCondition() const { return m_wellFlowCondition(); }
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
private:
virtual void setupBeforeSave() 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