///////////////////////////////////////////////////////////////////////////////// // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RimWellLogCurve.h" #include "RifEclipseRftAddress.h" #include "cafAppEnum.h" #include "cafPdmField.h" #include "cafPdmPtrField.h" #include "cvfObject.h" #include class RifReaderRftInterface; class RigEclipseWellLogExtractor; class RimEclipseResultCase; class RimObservedFmuRftData; class RimSummaryCase; class RimSummaryCaseCollection; class RimWellPath; //================================================================================================== /// /// //================================================================================================== class RimWellLogRftCurve : public RimWellLogCurve { CAF_PDM_HEADER_INIT; public: enum DerivedMDSource { NO_SOURCE, WELL_PATH, OBSERVED_DATA }; public: RimWellLogRftCurve(); ~RimWellLogRftCurve() override; QString wellName() const override; QString wellLogChannelUiName() const override; QString wellLogChannelUnits() const override; void setEclipseResultCase( RimEclipseResultCase* eclipseResultCase ); RimEclipseResultCase* eclipseResultCase() const; void setSummaryCase( RimSummaryCase* summaryCase ); RimSummaryCase* summaryCase() const; void setEnsemble( RimSummaryCaseCollection* ensemble ); RimSummaryCaseCollection* ensemble() const; void setObservedFmuRftData( RimObservedFmuRftData* observedFmuRftData ); RimObservedFmuRftData* observedFmuRftData() const; void setRftAddress( RifEclipseRftAddress address ); RifEclipseRftAddress rftAddress() const; void setDefaultAddress( QString wellName ); void updateWellChannelNameAndTimeStep(); void setSimWellBranchData( bool branchDetection, int branchIndex ); protected: // Overrides from RimWellLogPlotCurve QString createCurveAutoName() override; void onLoadDataAndUpdate( bool updateParentPlot ) override; // Pdm overrrides void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; std::vector perPointLabels() const; private: RifReaderRftInterface* rftReader() const; RigEclipseWellLogExtractor* extractor(); bool createWellPathIdxToRftFileIdxMapping(); size_t rftFileIndex( size_t wellPathIndex ); std::vector sortedIndicesInRftFile(); std::vector xValues(); std::vector errorValues(); std::vector tvDepthValues(); std::vector measuredDepthValues(); bool deriveMeasuredDepthValuesFromWellPath( const std::vector& tvDepthValues, std::vector& derivedMDValues ); bool deriveMeasuredDepthFromObservedData( const std::vector& tvDepthValues, std::vector& derivedMDValues ); private: caf::PdmPtrField m_eclipseResultCase; caf::PdmPtrField m_summaryCase; caf::PdmPtrField m_ensemble; caf::PdmPtrField m_observedFmuRftData; caf::PdmField m_timeStep; caf::PdmField m_wellName; caf::PdmField m_branchIndex; caf::PdmField m_branchDetection; std::map m_idxInWellPathToIdxInRftFile; caf::PdmField> m_wellLogChannelName; };