mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge branch 'dev' into dev-deeper
This commit is contained in:
@@ -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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -31,27 +31,29 @@
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicfExportSnapshots, "exportSnapshots");
|
||||
|
||||
namespace caf {
|
||||
template<>
|
||||
void RicfExportSnapshots::SnapshotsTypeEnum::setUp()
|
||||
{
|
||||
addItem(RicfExportSnapshots::ALL, "ALL", "All");
|
||||
addItem(RicfExportSnapshots::VIEWS, "VIEWS", "Views");
|
||||
addItem(RicfExportSnapshots::PLOTS, "PLOTS", "Plots");
|
||||
setDefault(RicfExportSnapshots::ALL);
|
||||
}
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void RicfExportSnapshots::SnapshotsTypeEnum::setUp()
|
||||
{
|
||||
addItem(RicfExportSnapshots::ALL, "ALL", "All");
|
||||
addItem(RicfExportSnapshots::VIEWS, "VIEWS", "Views");
|
||||
addItem(RicfExportSnapshots::PLOTS, "PLOTS", "Plots");
|
||||
setDefault(RicfExportSnapshots::ALL);
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfExportSnapshots::RicfExportSnapshots()
|
||||
{
|
||||
RICF_InitField(&m_type, "type", RicfExportSnapshots::SnapshotsTypeEnum(), "Type", "", "", "");
|
||||
RICF_InitField(&m_type, "type", RicfExportSnapshots::SnapshotsTypeEnum(), "Type", "", "", "");
|
||||
RICF_InitField(&m_prefix, "prefix", QString(), "Prefix", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicfExportSnapshots::execute()
|
||||
{
|
||||
@@ -67,11 +69,11 @@ void RicfExportSnapshots::execute()
|
||||
}
|
||||
if (m_type == RicfExportSnapshots::VIEWS || m_type == RicfExportSnapshots::ALL)
|
||||
{
|
||||
RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(absolutePathToSnapshotDir);
|
||||
RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(absolutePathToSnapshotDir, m_prefix);
|
||||
}
|
||||
if (m_type == RicfExportSnapshots::PLOTS || m_type == RicfExportSnapshots::ALL)
|
||||
{
|
||||
RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(absolutePathToSnapshotDir);
|
||||
RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(absolutePathToSnapshotDir, m_prefix);
|
||||
}
|
||||
|
||||
mainWnd->loadWinGeoAndDockToolBarLayout();
|
||||
|
||||
@@ -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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -48,4 +48,5 @@ public:
|
||||
|
||||
private:
|
||||
caf::PdmField<SnapshotsTypeEnum> m_type;
|
||||
};
|
||||
caf::PdmField<QString> m_prefix;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "RicNewValveFeature.h"
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimWellPathValve.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
@@ -17,7 +18,7 @@ CAF_CMD_SOURCE_INIT(RicNewValveFeature, "RicNewValveFeature");
|
||||
bool RicNewValveFeature::isCommandEnabled()
|
||||
{
|
||||
const RimPerforationInterval* perfInterval = caf::SelectionManager::instance()->selectedItemOfType<RimPerforationInterval>();
|
||||
return perfInterval != nullptr;
|
||||
return perfInterval != nullptr && RiaApplication::enableDevelopmentFeatures();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -359,9 +359,10 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
RicWellPathFractureReportItem reportItem(
|
||||
wellPathName, fracture->name(), fracTemplate->name(), fracture->fractureMD());
|
||||
reportItem.setUnitSystem(fracTemplate->fractureTemplateUnit());
|
||||
reportItem.setPressureDepletionParameters(performPressureDepletionScaling ? "True" : "False",
|
||||
reportItem.setPressureDepletionParameters(performPressureDepletionScaling,
|
||||
caseToApply->timeStepStrings()[pdParams.pressureScalingTimeStep],
|
||||
caf::AppEnum<PressureDepletionWBHPSource>::uiTextFromIndex(pdParams.wbhpSource),
|
||||
pdParams.userWBHP, minPressureDrop, maxPressureDrop);
|
||||
pdParams.userWBHP, currentWellPressure, minPressureDrop, maxPressureDrop);
|
||||
|
||||
RicExportFractureCompletionsImpl::calculateAndSetReportItemData(
|
||||
allCompletionsForOneFracture, eclToFractureCalc, reportItem);
|
||||
|
||||
@@ -32,7 +32,6 @@ RicWellPathFractureReportItem::RicWellPathFractureReportItem(const QString& well
|
||||
: m_wellPathNameForExport(wellPathName)
|
||||
, m_wellPathFracture(fractureName)
|
||||
, m_wellPathFractureTemplate(fractureTemplateName)
|
||||
, m_pressureDepletionScalingString()
|
||||
, m_mesuredDepth(measuredDepth)
|
||||
, m_transmissibility(0.0)
|
||||
, m_connectionCount(0)
|
||||
@@ -43,6 +42,9 @@ RicWellPathFractureReportItem::RicWellPathFractureReportItem(const QString& well
|
||||
, m_xf(0.0)
|
||||
, m_h(0.0)
|
||||
, m_km(0.0)
|
||||
, m_performPressureDepletionScaling(false)
|
||||
, m_pressureDepletionUserWBHP(0.0)
|
||||
, m_pressureDepletionActualWBHP(0.0)
|
||||
, m_pressureDepletionMinPressureDrop(-1.0)
|
||||
, m_pressureDepletionMaxPressureDrop(-1.0)
|
||||
{
|
||||
@@ -112,22 +114,6 @@ QString RicWellPathFractureReportItem::fractureTemplateName() const
|
||||
return m_wellPathFractureTemplate;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureReportItem::pressureDepletionScaling() const
|
||||
{
|
||||
return m_pressureDepletionScalingString;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureReportItem::pressureDepletionWBHPString() const
|
||||
{
|
||||
return m_pressureDepletionWBHPString;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -139,13 +125,15 @@ void RicWellPathFractureReportItem::setUnitSystem(RiaEclipseUnitTools::UnitSyste
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathFractureReportItem::setPressureDepletionParameters(QString scalingString, QString wbhpString, double userWBHP, double minPressureDrop, double maxPressureDrop)
|
||||
void RicWellPathFractureReportItem::setPressureDepletionParameters(bool performPDDScaling, QString timeStepString, QString wbhpString, double userWBHP, double actualWBHP, double minPressureDrop, double maxPressureDrop)
|
||||
{
|
||||
m_pressureDepletionScalingString = scalingString;
|
||||
m_pressureDepletionWBHPString = wbhpString;
|
||||
m_pressureDepletionUserWBHP = userWBHP;
|
||||
m_pressureDepletionMinPressureDrop = minPressureDrop;
|
||||
m_pressureDepletionMaxPressureDrop = maxPressureDrop;
|
||||
m_performPressureDepletionScaling = performPDDScaling;
|
||||
m_pressureDepletionTimeStepString = timeStepString;
|
||||
m_pressureDepletionWBHPString = wbhpString;
|
||||
m_pressureDepletionUserWBHP = userWBHP;
|
||||
m_pressureDepletionActualWBHP = actualWBHP;
|
||||
m_pressureDepletionMinPressureDrop = minPressureDrop;
|
||||
m_pressureDepletionMaxPressureDrop = maxPressureDrop;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -252,6 +240,30 @@ double RicWellPathFractureReportItem::kmxf() const
|
||||
return m_km * m_xf;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicWellPathFractureReportItem::performPressureDepletionScaling() const
|
||||
{
|
||||
return m_performPressureDepletionScaling;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureReportItem::pressureDepletionTimeStepString() const
|
||||
{
|
||||
return m_pressureDepletionTimeStepString;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureReportItem::pressureDepletionWBHPString() const
|
||||
{
|
||||
return m_pressureDepletionWBHPString;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -260,6 +272,14 @@ double RicWellPathFractureReportItem::pressureDepletionUserWBHP() const
|
||||
return m_pressureDepletionUserWBHP;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RicWellPathFractureReportItem::pressureDepletionActualWBHP() const
|
||||
{
|
||||
return m_pressureDepletionActualWBHP;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -35,13 +35,11 @@ public:
|
||||
void setHeightAndHalfLength(double height, double halfLength);
|
||||
void setAreaWeightedTransmissibility(double transmissibility);
|
||||
void setUnitSystem(RiaEclipseUnitTools::UnitSystem unitSystem);
|
||||
void setPressureDepletionParameters(QString scalingString, QString wbhpString, double userWBHP, double minPressureDrop, double maxPressureDrop);
|
||||
void setPressureDepletionParameters(bool performPressureDepletionScaling, QString timeStepString, QString wbhpString, double userWBHP, double actualWBHP, double minPressureDrop, double maxPressureDrop);
|
||||
|
||||
QString wellPathNameForExport() const;
|
||||
QString fractureName() const;
|
||||
QString fractureTemplateName() const;
|
||||
QString pressureDepletionScaling() const;
|
||||
QString pressureDepletionWBHPString() const;
|
||||
|
||||
RiaEclipseUnitTools::UnitSystem unitSystem() const;
|
||||
|
||||
@@ -59,9 +57,13 @@ public:
|
||||
double km() const;
|
||||
double kmxf() const;
|
||||
|
||||
double pressureDepletionUserWBHP() const;
|
||||
double pressureDepletionMinPressureDrop() const;
|
||||
double pressureDepletionMaxPressureDrop() const;
|
||||
bool performPressureDepletionScaling() const;
|
||||
QString pressureDepletionTimeStepString() const;
|
||||
QString pressureDepletionWBHPString() const;
|
||||
double pressureDepletionUserWBHP() const;
|
||||
double pressureDepletionActualWBHP() const;
|
||||
double pressureDepletionMinPressureDrop() const;
|
||||
double pressureDepletionMaxPressureDrop() const;
|
||||
|
||||
bool operator < (const RicWellPathFractureReportItem& other) const;
|
||||
|
||||
@@ -70,8 +72,6 @@ private:
|
||||
QString m_wellPathNameForExport;
|
||||
QString m_wellPathFracture;
|
||||
QString m_wellPathFractureTemplate;
|
||||
QString m_pressureDepletionScalingString;
|
||||
QString m_pressureDepletionWBHPString;
|
||||
double m_mesuredDepth;
|
||||
|
||||
double m_transmissibility;
|
||||
@@ -84,8 +84,12 @@ private:
|
||||
double m_xf;
|
||||
double m_h;
|
||||
double m_km;
|
||||
|
||||
double m_pressureDepletionUserWBHP;
|
||||
double m_pressureDepletionMinPressureDrop;
|
||||
double m_pressureDepletionMaxPressureDrop;
|
||||
|
||||
bool m_performPressureDepletionScaling;
|
||||
QString m_pressureDepletionTimeStepString;
|
||||
QString m_pressureDepletionWBHPString;
|
||||
double m_pressureDepletionUserWBHP;
|
||||
double m_pressureDepletionActualWBHP;
|
||||
double m_pressureDepletionMinPressureDrop;
|
||||
double m_pressureDepletionMaxPressureDrop;
|
||||
};
|
||||
|
||||
@@ -709,30 +709,40 @@ QString RicWellPathFractureTextReportFeatureImpl::createFracturePressureDepletio
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn("Well"),
|
||||
RifEclipseOutputTableColumn("Fracture"),
|
||||
RifEclipseOutputTableColumn("PDD Scaling"),
|
||||
RifEclipseOutputTableColumn("WBHP Source"),
|
||||
RifEclipseOutputTableColumn("User WBHP"),
|
||||
RifEclipseOutputTableColumn("Actual WBHP"),
|
||||
RifEclipseOutputTableColumn("Min Pressure Drop"),
|
||||
RifEclipseOutputTableColumn("Max Pressure Drop")
|
||||
};
|
||||
|
||||
formatter.header(header);
|
||||
formatter.addHorizontalLine('-');
|
||||
bool createdTable = false;
|
||||
|
||||
for (const auto& reportItem : wellPathFractureReportItems)
|
||||
{
|
||||
formatter.add(reportItem.wellPathNameForExport());
|
||||
formatter.add(reportItem.fractureName());
|
||||
formatter.add(reportItem.pressureDepletionScaling());
|
||||
formatter.add(reportItem.pressureDepletionWBHPString());
|
||||
formatter.add(reportItem.pressureDepletionUserWBHP());
|
||||
formatter.add(reportItem.pressureDepletionMinPressureDrop());
|
||||
formatter.add(reportItem.pressureDepletionMaxPressureDrop());
|
||||
if (reportItem.performPressureDepletionScaling())
|
||||
{
|
||||
if (!createdTable)
|
||||
{
|
||||
formatter.comment(QString("Pressure Depletion Time step: %1").arg(reportItem.pressureDepletionTimeStepString()));
|
||||
formatter.comment(QString("User Defined WBHP: %1").arg(reportItem.pressureDepletionUserWBHP()));
|
||||
|
||||
formatter.rowCompleted();
|
||||
formatter.header(header);
|
||||
formatter.addHorizontalLine('-');
|
||||
createdTable = true;
|
||||
}
|
||||
formatter.add(reportItem.wellPathNameForExport());
|
||||
formatter.add(reportItem.fractureName());
|
||||
formatter.add(reportItem.pressureDepletionWBHPString());
|
||||
formatter.add(reportItem.pressureDepletionActualWBHP());
|
||||
formatter.add(reportItem.pressureDepletionMinPressureDrop());
|
||||
formatter.add(reportItem.pressureDepletionMaxPressureDrop());
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
}
|
||||
if (createdTable)
|
||||
{
|
||||
formatter.tableCompleted();
|
||||
}
|
||||
|
||||
formatter.tableCompleted();
|
||||
|
||||
return tableText;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ void RicSnapshotAllPlotsToFileFeature::saveAllPlots()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(QString snapshotFolderName)
|
||||
void RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(const QString& snapshotFolderName, const QString& prefix)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
@@ -91,6 +91,11 @@ void RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(QStrin
|
||||
if (viewWindow->isMdiWindow() && viewWindow->viewWidget())
|
||||
{
|
||||
QString fileName = RicSnapshotFilenameGenerator::generateSnapshotFileName(viewWindow);
|
||||
if (!prefix.isEmpty())
|
||||
{
|
||||
fileName = prefix + fileName;
|
||||
}
|
||||
|
||||
fileName.replace(" ", "_");
|
||||
|
||||
QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png");
|
||||
|
||||
@@ -32,7 +32,7 @@ class RicSnapshotAllPlotsToFileFeature : public caf::CmdFeature
|
||||
public:
|
||||
static void saveAllPlots();
|
||||
|
||||
static void exportSnapshotOfAllPlotsIntoFolder(QString snapshotFolderName);
|
||||
static void exportSnapshotOfAllPlotsIntoFolder(const QString& snapshotFolderName, const QString& prefix = "");
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
|
||||
@@ -70,7 +70,7 @@ void RicSnapshotAllViewsToFileFeature::saveAllViews()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(QString snapshotFolderName)
|
||||
void RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(const QString& snapshotFolderName, const QString& prefix)
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
|
||||
@@ -114,6 +114,10 @@ void RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(QStrin
|
||||
viewer->repaint();
|
||||
|
||||
QString fileName = RicSnapshotFilenameGenerator::generateSnapshotFileName(riv);
|
||||
if (!prefix.isEmpty())
|
||||
{
|
||||
fileName = prefix + fileName;
|
||||
}
|
||||
|
||||
QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png");
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class RicSnapshotAllViewsToFileFeature : public caf::CmdFeature
|
||||
public:
|
||||
static void saveAllViews();
|
||||
|
||||
static void exportSnapshotOfAllViewsIntoFolder(QString snapshotFolderName);
|
||||
static void exportSnapshotOfAllViewsIntoFolder(const QString& snapshotFolderName, const QString& prefix = "");
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
|
||||
@@ -198,6 +198,7 @@ void RicCreateTemporaryLgrFeature::onActionTriggered(bool isChecked)
|
||||
void RicCreateTemporaryLgrFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Create Temporary LGR");
|
||||
actionToSetup->setIcon(QIcon(":/TempLGR16x16.png"));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -79,12 +79,22 @@ void RicDeleteWellPathAttributeFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
}
|
||||
|
||||
if (wellPathAttributeCollection->attributes().empty())
|
||||
if (wellPathAttributeCollection)
|
||||
{
|
||||
RimWellPath* wellPath = nullptr;
|
||||
wellPathAttributeCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
wellPath->updateConnectedEditors();
|
||||
Riu3DMainWindowTools::selectAsCurrentItem(wellPath);
|
||||
if (wellPathAttributeCollection->attributes().empty())
|
||||
{
|
||||
RimWellPath* wellPath = nullptr;
|
||||
wellPathAttributeCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
wellPath->updateConnectedEditors();
|
||||
Riu3DMainWindowTools::selectAsCurrentItem(wellPath);
|
||||
}
|
||||
|
||||
RimProject* proj = nullptr;
|
||||
wellPathAttributeCollection->firstAncestorOrThisOfType(proj);
|
||||
if (proj)
|
||||
{
|
||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -344,6 +344,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode(const smspec_node_type * ertSu
|
||||
case ECL_SMSPEC_SEGMENT_VAR:
|
||||
{
|
||||
sumCategory = RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT;
|
||||
wellName = smspec_node_get_wgname(ertSumVarNode);
|
||||
wellSegmentNumber = smspec_node_get_num(ertSumVarNode);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -97,7 +97,7 @@ void RivContourMapProjectionPartMgr::appendPickPointVisToModel(cvf::ModelBasicLi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Vec2fArray> RivContourMapProjectionPartMgr::createTextureCoords() const
|
||||
{
|
||||
cvf::Vec2ui patchSize = m_contourMapProjection->vertexGridSize();
|
||||
cvf::Vec2ui patchSize = m_contourMapProjection->numberOfVerticesIJ();
|
||||
|
||||
cvf::ref<cvf::Vec2fArray> textureCoords = new cvf::Vec2fArray(m_contourMapProjection->numberOfVertices());
|
||||
|
||||
@@ -155,7 +155,7 @@ cvf::ref<cvf::DrawableGeo> RivContourMapProjectionPartMgr::createProjectionMapDr
|
||||
{
|
||||
cvf::ref<cvf::Vec3fArray> vertexArray = new cvf::Vec3fArray;
|
||||
m_contourMapProjection->generateVertices(vertexArray.p(), displayCoordTransform);
|
||||
cvf::Vec2ui patchSize = m_contourMapProjection->vertexGridSize();
|
||||
cvf::Vec2ui patchSize = m_contourMapProjection->numberOfVerticesIJ();
|
||||
|
||||
// Surface
|
||||
cvf::ref<cvf::UIntArray> faceList = new cvf::UIntArray;
|
||||
|
||||
@@ -502,8 +502,8 @@ QString Rim3dOverlayInfoConfig::caseInfoText(RimEclipseView* eclipseView)
|
||||
QString totCellCount = QString::number(contourMap->contourMapProjection()->numberOfCells());
|
||||
cvf::uint validCellCount = contourMap->contourMapProjection()->numberOfValidCells();
|
||||
QString activeCellCountText = QString::number(validCellCount);
|
||||
QString iSize = QString::number(contourMap->contourMapProjection()->mapSize().x());
|
||||
QString jSize = QString::number(contourMap->contourMapProjection()->mapSize().y());
|
||||
QString iSize = QString::number(contourMap->contourMapProjection()->numberOfElementsIJ().x());
|
||||
QString jSize = QString::number(contourMap->contourMapProjection()->numberOfElementsIJ().y());
|
||||
QString aggregationType = contourMap->contourMapProjection()->resultAggregationText();
|
||||
QString weightingParameterString;
|
||||
if (contourMap->contourMapProjection()->weightingParameter() != "None")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -65,105 +65,116 @@ public:
|
||||
RimContourMapProjection();
|
||||
~RimContourMapProjection() override;
|
||||
|
||||
void generateVertices(cvf::Vec3fArray* vertices, const caf::DisplayCoordTransform* displayCoordTransform);
|
||||
|
||||
void generateVertices(cvf::Vec3fArray* vertices, const caf::DisplayCoordTransform* displayCoordTransform);
|
||||
ContourPolygons generateContourPolygons(const caf::DisplayCoordTransform* displayCoordTransform);
|
||||
cvf::ref<cvf::Vec3fArray> generatePickPointPolygon(const caf::DisplayCoordTransform* displayCoordTransform);
|
||||
|
||||
void generateResults();
|
||||
|
||||
ResultAggregation resultAggregation() const;
|
||||
double sampleSpacing() const;
|
||||
double sampleSpacingFactor() const;
|
||||
bool showContourLines() const;
|
||||
|
||||
QString resultAggregationText() const;
|
||||
QString resultDescriptionText() const;
|
||||
QString weightingParameter() const;
|
||||
|
||||
double maxValue() const;
|
||||
double minValue() const;
|
||||
double meanValue() const;
|
||||
double sumAllValues() const;
|
||||
double sampleSpacing() const;
|
||||
double sampleSpacingFactor() const;
|
||||
cvf::Vec2ui mapSize() const;
|
||||
cvf::Vec2ui vertexGridSize() const;
|
||||
|
||||
bool showContourLines() const;
|
||||
cvf::Vec2ui numberOfElementsIJ() const;
|
||||
cvf::Vec2ui numberOfVerticesIJ() const;
|
||||
|
||||
const std::vector<double>& aggregatedResults() const;
|
||||
QString weightingParameter() const;
|
||||
bool isMeanResult() const;
|
||||
bool isSummationResult() const;
|
||||
bool isStraightSummationResult() const;
|
||||
static bool isStraightSummationResult(ResultAggregationEnum aggregationType);
|
||||
bool isColumnResult() const;
|
||||
|
||||
double valueAtVertex(uint i, uint j) const;
|
||||
bool hasResultAtVertex(uint i, uint j) const;
|
||||
|
||||
RimRegularLegendConfig* legendConfig() const;
|
||||
|
||||
size_t cellIndex(uint i, uint j) const;
|
||||
size_t vertexIndex(uint i, uint j) const;
|
||||
cvf::Vec2ui ijFromVertexIndex(size_t gridIndex) const;
|
||||
cvf::Vec2ui ijFromCellIndex(size_t mapIndex) const;
|
||||
void updateLegend();
|
||||
|
||||
size_t numberOfVertices() const;
|
||||
uint numberOfCells() const;
|
||||
uint numberOfValidCells() const;
|
||||
size_t numberOfVertices() const;
|
||||
|
||||
ResultAggregation resultAggregation() const;
|
||||
QString resultAggregationText() const;
|
||||
QString resultDescriptionText() const;
|
||||
void updatedWeightingResult();
|
||||
|
||||
bool checkForMapIntersection(const cvf::Vec3d& localPoint3d, cvf::Vec2d* contourMapPoint, cvf::Vec2ui* contourMapCell, double* valueAtPoint) const;
|
||||
void setPickPoint(cvf::Vec2d pickedPoint);
|
||||
bool checkForMapIntersection(const cvf::Vec3d& localPoint3d, cvf::Vec2d* contourMapPoint, cvf::Vec2ui* contourMapCell, double* valueAtPoint) const;
|
||||
void setPickPoint(cvf::Vec2d pickedPoint);
|
||||
|
||||
protected:
|
||||
double valueInCell(uint i, uint j) const;
|
||||
bool hasResultInCell(uint i, uint j) const;
|
||||
|
||||
double calculateValueInCell(uint i, uint j) const;
|
||||
double calculateValueAtVertex(uint i, uint j) const;
|
||||
|
||||
void generateGridMapping();
|
||||
void calculateTotalCellVisibility();
|
||||
cvf::Vec2d globalCellCenterPosition(uint i, uint j) const;
|
||||
cvf::Vec2ui ijFromLocalPos(const cvf::Vec2d& localPos2d) const;
|
||||
|
||||
std::vector<std::pair<size_t, double>> cellsAtIJ(uint i, uint j) const;
|
||||
std::vector<double> xVertexPositions() const;
|
||||
std::vector<double> yVertexPositions() const;
|
||||
|
||||
std::vector<std::pair<size_t, double>> visibleCellsAndOverlapVolumeFrom2dPoint(const cvf::Vec2d& globalPos2d, const std::vector<double>* weightingResultValues = nullptr) const;
|
||||
std::vector<std::pair<size_t, double>> visibleCellsAndLengthInCellFrom2dPoint(const cvf::Vec2d& globalPos2d, const std::vector<double>* weightingResultValues = nullptr) const;
|
||||
double findColumnResult(ResultAggregation resultAggregation, size_t cellGlobalIdx) const;
|
||||
const RimEclipseResultCase* eclipseCase() const;
|
||||
RimEclipseResultCase* eclipseCase();
|
||||
RimContourMapView* view() const;
|
||||
RigMainGrid* mainGrid() const;
|
||||
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute) override;
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
void initAfterRead() override;
|
||||
bool getLegendRangeFrom3dGrid() const;
|
||||
void updateGridInformation();
|
||||
cvf::Vec2ui calculateMapSize() const;
|
||||
void initAfterRead() override;
|
||||
|
||||
private:
|
||||
typedef std::pair<size_t, double> CellIndexAndResult;
|
||||
|
||||
private:
|
||||
void generateGridMapping();
|
||||
|
||||
double valueInCell(uint i, uint j) const;
|
||||
bool hasResultInCell(uint i, uint j) const;
|
||||
|
||||
double calculateValueInCell(uint i, uint j) const;
|
||||
double calculateValueAtVertex(uint i, uint j) const;
|
||||
|
||||
|
||||
std::vector<CellIndexAndResult> cellsAtIJ(uint i, uint j) const;
|
||||
|
||||
std::vector<CellIndexAndResult> visibleCellsAndOverlapVolumeFrom2dPoint(const cvf::Vec2d& globalPos2d, const std::vector<double>* weightingResultValues = nullptr) const;
|
||||
std::vector<CellIndexAndResult> visibleCellsAndLengthInCellFrom2dPoint(const cvf::Vec2d& globalPos2d, const std::vector<double>* weightingResultValues = nullptr) const;
|
||||
double findColumnResult(ResultAggregation resultAggregation, size_t cellGlobalIdx) const;
|
||||
|
||||
bool isMeanResult() const;
|
||||
bool isSummationResult() const;
|
||||
bool isStraightSummationResult() const;
|
||||
static bool isStraightSummationResult(ResultAggregationEnum aggregationType);
|
||||
|
||||
size_t cellIndexFromIJ(uint i, uint j) const;
|
||||
size_t vertexIndexFromIJ(uint i, uint j) const;
|
||||
|
||||
cvf::Vec2ui ijFromVertexIndex(size_t gridIndex) const;
|
||||
cvf::Vec2ui ijFromCellIndex(size_t mapIndex) const;
|
||||
cvf::Vec2ui ijFromLocalPos(const cvf::Vec2d& localPos2d) const;
|
||||
cvf::Vec2d globalCellCenterPosition(uint i, uint j) const;
|
||||
|
||||
std::vector<double> xVertexPositions() const;
|
||||
std::vector<double> yVertexPositions() const;
|
||||
|
||||
bool getLegendRangeFrom3dGrid() const;
|
||||
void updateGridInformation();
|
||||
cvf::Vec2ui calculateMapSize() const;
|
||||
|
||||
RimEclipseResultCase* eclipseCase() const;
|
||||
RimContourMapView* view() const;
|
||||
|
||||
protected:
|
||||
caf::PdmField<double> m_relativeSampleSpacing;
|
||||
caf::PdmField<ResultAggregation> m_resultAggregation;
|
||||
caf::PdmField<bool> m_showContourLines;
|
||||
caf::PdmField<bool> m_weightByParameter;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_weightingResult;
|
||||
cvf::ref<cvf::UByteArray> m_cellGridIdxVisibility;
|
||||
caf::PdmField<double> m_relativeSampleSpacing;
|
||||
caf::PdmField<ResultAggregation> m_resultAggregation;
|
||||
caf::PdmField<bool> m_showContourLines;
|
||||
caf::PdmField<bool> m_weightByParameter;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_weightingResult;
|
||||
cvf::ref<cvf::UByteArray> m_cellGridIdxVisibility;
|
||||
|
||||
std::vector<double> m_aggregatedResults;
|
||||
std::vector<double> m_aggregatedVertexResults;
|
||||
std::vector<double> m_aggregatedResults;
|
||||
std::vector<double> m_aggregatedVertexResults;
|
||||
|
||||
std::vector<std::vector<std::pair<size_t, double>>> m_projected3dGridIndices;
|
||||
|
||||
cvf::ref<RigResultAccessor> m_resultAccessor;
|
||||
cvf::ref<RigResultAccessor> m_resultAccessor;
|
||||
|
||||
cvf::Vec2d m_pickPoint;
|
||||
cvf::Vec2d m_pickPoint;
|
||||
|
||||
cvf::Vec2ui m_mapSize;
|
||||
cvf::BoundingBox m_fullBoundingBox;
|
||||
double m_sampleSpacing;
|
||||
caf::PdmPointer<RimEclipseResultCase> m_eclipseCase;
|
||||
cvf::ref<RigMainGrid> m_mainGrid;
|
||||
cvf::Vec2ui m_mapSize;
|
||||
cvf::BoundingBox m_fullBoundingBox;
|
||||
double m_sampleSpacing;
|
||||
};
|
||||
|
||||
@@ -120,18 +120,6 @@ QString RimContourMapView::createAutoName() const
|
||||
return autoName.join(": ");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimContourMapView::isTimeStepDependentDataVisible() const
|
||||
{
|
||||
if (RimEclipseView::isTimeStepDependentDataVisible())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return m_contourMapProjection->isChecked();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -153,6 +141,12 @@ void RimContourMapView::createDisplayModel()
|
||||
{
|
||||
RimEclipseView::createDisplayModel();
|
||||
|
||||
if (!this->isTimeStepDependentDataVisible())
|
||||
{
|
||||
// Need to add geometry even if it hasn't happened during dynamic time step update.
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
if (this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix)
|
||||
{
|
||||
this->zoomAll();
|
||||
@@ -199,9 +193,16 @@ void RimContourMapView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
|
||||
void RimContourMapView::updateCurrentTimeStep()
|
||||
{
|
||||
static_cast<RimEclipsePropertyFilterCollection*>(nativePropertyFilterCollection())->updateFromCurrentTimeStep();
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimContourMapView::updateGeometry()
|
||||
{
|
||||
this->updateVisibleGeometriesAndCellColors();
|
||||
|
||||
|
||||
if (m_contourMapProjection->isChecked())
|
||||
{
|
||||
m_contourMapProjection->generateResults();
|
||||
|
||||
@@ -33,7 +33,6 @@ public:
|
||||
RimContourMapProjection* contourMapProjection() const;
|
||||
|
||||
QString createAutoName() const override;
|
||||
bool isTimeStepDependentDataVisible() const override;
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
@@ -41,7 +40,7 @@ protected:
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
void updateCurrentTimeStep() override;
|
||||
|
||||
void updateGeometry();
|
||||
void setFaultVisParameters();
|
||||
void appendContourMapProjectionToModel();
|
||||
void appendPickPointVisToModel();
|
||||
|
||||
@@ -476,7 +476,10 @@ void RimGridCollection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
|
||||
{
|
||||
uiTreeOrdering.add(m_persistentLgrs());
|
||||
}
|
||||
uiTreeOrdering.add(m_temporaryLgrs());
|
||||
if (hasTemporaryLgrs())
|
||||
{
|
||||
uiTreeOrdering.add(m_temporaryLgrs());
|
||||
}
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
@@ -505,3 +508,20 @@ bool RimGridCollection::hasPersistentLgrs() const
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGridCollection::hasTemporaryLgrs() const
|
||||
{
|
||||
auto mainGrid = this->mainGrid();
|
||||
if (!mainGrid) return false;
|
||||
|
||||
for (size_t i = 1; i < mainGrid->gridCount(); i++)
|
||||
{
|
||||
const auto grid = mainGrid->gridByIndex(i);
|
||||
if (grid->isTempGrid()) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,7 @@ protected:
|
||||
private:
|
||||
const RigMainGrid* mainGrid() const;
|
||||
bool hasPersistentLgrs() const;
|
||||
bool hasTemporaryLgrs() const;
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmChildField<RimGridInfo*> m_mainGrid;
|
||||
|
||||
@@ -218,6 +218,13 @@ void RimWellPathAttribute::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
|
||||
m_startMD = wellPath->wellPathGeometry()->measureDepths().front();
|
||||
}
|
||||
}
|
||||
if (changedField == &m_startMD)
|
||||
{
|
||||
if (m_type() == RiaDefines::PACKER)
|
||||
{
|
||||
m_endMD = m_startMD + 50;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
RimWellPathAttributeCollection* collection = nullptr;
|
||||
@@ -237,9 +244,7 @@ void RimWellPathAttribute::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
|
||||
void RimWellPathAttribute::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
bool startDepthAvailable = m_type() != RiaDefines::CASING;
|
||||
bool endDepthAvailable = m_type() != RiaDefines::PACKER;
|
||||
|
||||
m_startMD.uiCapability()->setUiReadOnly(!startDepthAvailable);
|
||||
m_endMD.uiCapability()->setUiReadOnly(!endDepthAvailable);
|
||||
m_diameterInInches.uiCapability()->setUiReadOnly(!isDiameterSupported());
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ void RimSummaryCurveAutoName::appendAddressDetails(std::string&
|
||||
if (m_wellSegmentNumber)
|
||||
{
|
||||
if (!text.empty()) text += ":";
|
||||
text += ":" + summaryAddress.wellSegmentNumber();
|
||||
text += std::to_string(summaryAddress.wellSegmentNumber());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "RiuSummaryCurveDefSelection.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
#include "RiaCurveSetDefinition.h"
|
||||
|
||||
@@ -421,13 +422,10 @@ void RiuSummaryCurveDefSelection::setDefaultSelection(const std::vector<SummaryS
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
auto allSumCases = proj->allSummaryCases();
|
||||
auto allSumGroups = proj->summaryGroups();
|
||||
bool hasEnsembles = std::count_if(allSumGroups.begin(), allSumGroups.end(),
|
||||
[](const RimSummaryCaseCollection* sumGroup) { return sumGroup->isEnsemble(); }) > 0;
|
||||
|
||||
if (allSumCases.size() > 0)
|
||||
{
|
||||
RifEclipseSummaryAddress defaultAddress = !hasEnsembles ?
|
||||
RifEclipseSummaryAddress::fieldAddress("FOPT") : RifEclipseSummaryAddress();
|
||||
RifEclipseSummaryAddress defaultAddress = RifEclipseSummaryAddress();
|
||||
|
||||
std::vector<SummarySource*> selectTheseSources = defaultSources;
|
||||
if (selectTheseSources.empty()) selectTheseSources.push_back(allSumCases[0]);
|
||||
@@ -727,7 +725,34 @@ QList<caf::PdmOptionItemInfo> RiuSummaryCurveDefSelection::calculateValueOptions
|
||||
}
|
||||
|
||||
auto itemPostfix = (isVectorField && i == OBS_DATA) ? QString(OBSERVED_DATA_AVALUE_POSTFIX) : QString("");
|
||||
for (const auto& itemName : itemNames[i])
|
||||
|
||||
// Sort numeric identifiers by numeric val
|
||||
std::vector<std::string> itemNamesVector;
|
||||
{
|
||||
switch (identifierAndField->summaryIdentifier())
|
||||
{
|
||||
case RifEclipseSummaryAddress::INPUT_REGION_NUMBER:
|
||||
case RifEclipseSummaryAddress::INPUT_SEGMENT_NUMBER:
|
||||
case RifEclipseSummaryAddress::INPUT_AQUIFER_NUMBER:
|
||||
{
|
||||
std::set<int> values;
|
||||
for (const std::string& itemName : itemNames[i])
|
||||
{
|
||||
values.insert(RiaStdStringTools::toInt(itemName));
|
||||
}
|
||||
for (int v : values)
|
||||
{
|
||||
itemNamesVector.push_back(std::to_string(v));
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
itemNamesVector.insert(itemNamesVector.end(), itemNames[i].begin(), itemNames[i].end());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& itemName : itemNamesVector)
|
||||
{
|
||||
QString displayName;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user