Merge patch to dev. #2277

This commit is contained in:
Bjørn Erik Jensen
2018-01-30 14:25:53 +01:00
5 changed files with 24 additions and 11 deletions

View File

@@ -51,7 +51,7 @@
#include <vector>
#include <cmath>
static std::vector<double> EMPTY_DOUBLE_VECTOR;
CAF_PDM_SOURCE_INIT(RimStimPlanFractureTemplate, "RimStimPlanFractureTemplate");
@@ -77,6 +77,7 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate()
CAF_PDM_InitField(&m_conductivityResultNameOnFile, "ConductivityResultName", QString(""), "Active Conductivity Result Name", "", "", "");
m_fractureGrid = new RigFractureGrid();
m_readError = false;
}
//--------------------------------------------------------------------------------------------------
@@ -111,6 +112,7 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
if (&m_stimPlanFileName == changedField)
{
m_readError = false;
updateUiTreeName();
loadDataAndUpdate();
setDefaultsBasedOnXMLfile();
@@ -262,16 +264,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();
@@ -530,8 +537,7 @@ void RimStimPlanFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3
{
loadDataAndUpdate();
}
if (m_stimPlanFractureDefinitionData.notNull())
else
{
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry(m_wellPathDepthAtFracture,
neededUnit,
@@ -546,6 +552,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

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

View File

@@ -458,13 +458,15 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
bool enableSouring = false;
#ifdef ENABLE_SOURING
RigCaseCellResultsData* cellResultsData = m_eclipseCase->results(this->porosityModel());
if (cellResultsData->hasFlowDiagUsableFluxes())
if (m_eclipseCase.notNull())
{
enableSouring = true;
}
RigCaseCellResultsData* cellResultsData = m_eclipseCase->results(this->porosityModel());
if (cellResultsData->hasFlowDiagUsableFluxes())
{
enableSouring = true;
}
}
#endif /* ENABLE_SOURING */

View File

@@ -22,6 +22,7 @@
#include "RiuLineSegmentQwtPlotCurve.h"
#include "RiuTextDialog.h"
#include "RigCurveDataTools.h"
#include "RigFlowDiagSolverInterface.h"
#include "cvfBase.h"
@@ -232,7 +233,7 @@ void RiuRelativePermeabilityPlotPanel::plotUiSelectedCurves()
//--------------------------------------------------------------------------------------------------
/// Add a transparent curve to make tooltip available on given points.
//--------------------------------------------------------------------------------------------------
void RiuRelativePermeabilityPlotPanel::addTransparentCurve(QwtPlot* plot, const std::vector<QPointF>& points, const std::vector<WhichYAxis>& axes)
void RiuRelativePermeabilityPlotPanel::addTransparentCurve(QwtPlot* plot, const std::vector<QPointF>& points, const std::vector<WhichYAxis>& axes, bool logScaleLeftAxis)
{
QwtPlotCurve* curveLeftAxis = new QwtPlotCurve();
QwtPlotCurve* curveRightAxis = new QwtPlotCurve();
@@ -245,6 +246,8 @@ void RiuRelativePermeabilityPlotPanel::addTransparentCurve(QwtPlot* plot, const
for (size_t i = 0; i < points.size(); i++)
{
if (!RigCurveDataTools::isValidValue(points[i].y(), logScaleLeftAxis)) continue;
if (axes[i] == LEFT_YAXIS)
{
pointsOnLeftAxis.push_back(points[i]);
@@ -382,7 +385,7 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(RiaEclipseUnitTools::Unit
plot->enableAxis(QwtPlot::yRight, shouldEnableRightYAxis);
addTransparentCurve(plot, points, axes);
addTransparentCurve(plot, points, axes, logScaleLeftAxis);
// Add vertical marker lines to indicate cell SWAT and/or SGAS saturations
if (swat != HUGE_VAL)

View File

@@ -103,7 +103,7 @@ private:
static double interpolatedCurveYValue(const std::vector<double>& xVals, const std::vector<double>& yVals, double x);
static void addTransparentCurve(QwtPlot* plot, const std::vector<QPointF>& points, const std::vector<WhichYAxis>& axes);
static void addTransparentCurve(QwtPlot* plot, const std::vector<QPointF>& points, const std::vector<WhichYAxis>& axes, bool logScaleLeftAxis);
std::vector<RigFlowDiagSolverInterface::RelPermCurve> gatherUiSelectedCurves() const;
QString asciiDataForUiSelectedCurves() const;