Files
ResInsight/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h
Jørgen Herje 40e0f471d0 Upgrade reference well adjustment algorithm (#9569)
* Add checkbox for enable/disable usage of ref well for curve

- Individual control of utilizing reference well selected on plot-level.
- Default use state = true
- Make ref well path read only

* Upgrade adjustment algorithm to map values from ref well

- Map values from reference well into selected well
- Linearize depth values between top and bottom of k-layer.
- Neglect values and depths outside of common k-layer region
- Handle smoothing of curves after mapping

* Set curve name based on use ref well flag

* Use auto name for parameter track curves

Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com>
2022-12-13 08:29:00 +01:00

124 lines
5.8 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions 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 "RiaDefines.h"
#include "RiaWellLogUnitTools.h"
#include "RimStackablePlotCurve.h"
#include "cafPdmPtrField.h"
#include "cafSignal.h"
#include "cvfObject.h"
class RigWellLogCurveData;
class RimWellPath;
//==================================================================================================
///
///
//==================================================================================================
class RimWellLogCurve : public RimStackablePlotCurve
{
CAF_PDM_HEADER_INIT;
public:
RimWellLogCurve();
~RimWellLogCurve() override;
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
bool propertyValueRangeInData( double* minimumValue, double* maximumValue ) const;
bool depthValueRangeInData( double* minimumValue, double* maximumValue ) const;
const RigWellLogCurveData* curveData() const;
void setReferenceWellPath( RimWellPath* refWellPath );
void updateCurveAppearance() override;
virtual QString wellName() const = 0;
virtual QString wellLogChannelUiName() const = 0;
virtual QString wellLogChannelName() const;
virtual QString wellLogChannelUnits() const = 0;
virtual QString wellDate() const { return ""; };
static QString wellLogCurveIconName();
void setOverrideCurveData( const std::vector<double>& propertyValues,
const std::vector<double>& depthValues,
const RiaCurveDataTools::CurveIntervals& curveIntervals );
double closestYValueForX( double xValue ) const override;
protected:
void updateZoomInParentPlot() override;
void updateLegendsInPlot() override;
void setOverrideCurveDataPropertyValueRange( double minimumValue, double maximumValue );
void calculateCurveDataPropertyValueRange();
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
void setPropertyValuesWithMdAndTVD( const std::vector<double>& propertyValues,
const std::vector<double>& measuredDepths,
const std::vector<double>& tvDepths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
void setPropertyAndDepthValuesToPlotCurve( const std::vector<double>& propertyValues,
const std::vector<double>& depthValues );
void setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
void setPropertyAndDepthsAndErrors( const std::vector<double>& propertyValues,
const std::vector<double>& depthValues,
const std::vector<double>& errorValues );
bool isVerticalCurve() const;
RiuPlotAxis depthAxis() const;
RiuPlotAxis valueAxis() const;
protected:
caf::PdmPtrField<RimWellPath*> m_refWellPath;
caf::PdmField<bool> m_useRefWell;
private:
cvf::ref<RigWellLogCurveData> m_curveData;
std::pair<double, double> m_curveDataPropertyValueRange;
};