2023-05-22 04:37:57 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2023- Equinor 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>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "RimWellLogCurve.h"
|
|
|
|
|
|
|
|
#include "cafPdmPtrField.h"
|
|
|
|
#include "cvfObject.h"
|
|
|
|
|
|
|
|
class RimCase;
|
|
|
|
class RimWellPath;
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
2023-05-27 03:30:03 -05:00
|
|
|
class RimWellLogCalculatedCurve : public RimWellLogCurve
|
2023-05-22 04:37:57 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
public:
|
2023-05-27 03:30:03 -05:00
|
|
|
enum class Operators
|
|
|
|
{
|
|
|
|
ADD,
|
|
|
|
SUBTRACT,
|
|
|
|
DIVIDE,
|
|
|
|
MULTIPLY
|
|
|
|
};
|
|
|
|
enum class DepthSource
|
|
|
|
{
|
|
|
|
FIRST,
|
|
|
|
SECOND,
|
|
|
|
UNION
|
|
|
|
};
|
2023-05-22 04:37:57 -05:00
|
|
|
|
2023-05-27 03:30:03 -05:00
|
|
|
public:
|
|
|
|
RimWellLogCalculatedCurve();
|
|
|
|
~RimWellLogCalculatedCurve() override;
|
|
|
|
|
|
|
|
void setOperator( Operators operatorValue );
|
2023-05-22 04:37:57 -05:00
|
|
|
void setWellLogCurves( RimWellLogCurve* firstWellLogCurve, RimWellLogCurve* secondWellLogCurve );
|
|
|
|
|
|
|
|
// Inherited via RimWellLogCurve
|
2023-05-22 21:07:04 -05:00
|
|
|
QString wellName() const override;
|
|
|
|
QString wellLogChannelUiName() const override;
|
|
|
|
QString wellLogChannelUnits() const override;
|
2023-05-22 04:37:57 -05:00
|
|
|
|
2023-05-27 03:30:03 -05:00
|
|
|
static double calculateValue( double firstValue, double secondValue, Operators operatorValue );
|
|
|
|
static std::vector<double>
|
|
|
|
unionDepthValuesFromVectors( const std::vector<double>& firstDepths, const std::vector<double>& secondDepths, double threshold );
|
|
|
|
|
2023-05-22 04:37:57 -05:00
|
|
|
protected:
|
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
|
|
|
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Inherited via RimWellLogCurve
|
2023-05-22 21:07:04 -05:00
|
|
|
QString createCurveAutoName() override;
|
|
|
|
void onLoadDataAndUpdate( bool updateParentPlot ) override;
|
2023-05-22 04:37:57 -05:00
|
|
|
|
|
|
|
void setAutomaticName();
|
|
|
|
|
|
|
|
void onWellLogCurveChanged( const SignalEmitter* emitter );
|
|
|
|
void connectWellLogCurveChangedToSlots( RimWellLogCurve* wellLogCurve );
|
|
|
|
void disconnectWellLogCurveChangedFromSlots( RimWellLogCurve* wellLogCurve );
|
|
|
|
|
2023-05-27 03:30:03 -05:00
|
|
|
std::vector<double> depthValuesFromSource( RiaDefines::DepthTypeEnum depthType ) const;
|
|
|
|
std::vector<double> unionDepthValuesFromCurves( RiaDefines::DepthTypeEnum depthType ) const;
|
|
|
|
|
2023-05-22 04:37:57 -05:00
|
|
|
private:
|
|
|
|
caf::PdmPtrField<RimCase*> m_case;
|
|
|
|
|
2023-05-27 03:30:03 -05:00
|
|
|
caf::PdmField<caf::AppEnum<Operators>> m_operator;
|
|
|
|
caf::PdmField<caf::AppEnum<DepthSource>> m_depthSource;
|
|
|
|
|
2023-05-22 04:37:57 -05:00
|
|
|
caf::PdmPtrField<RimWellLogCurve*> m_firstWellLogCurve;
|
|
|
|
caf::PdmPtrField<RimWellLogCurve*> m_secondWellLogCurve;
|
|
|
|
};
|