#8102 Ensemble Well Log Plot: Fix crash when using TVD

This commit is contained in:
Kristian Bendiksen
2021-10-21 09:55:33 +02:00
parent ccf2116d20
commit ea496072b8
8 changed files with 150 additions and 62 deletions

View File

@@ -23,18 +23,19 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellLogIndexDepthOffset::setIndexOffsetDepth( int kIndex, double topDepth, double bottomDepth )
void RigWellLogIndexDepthOffset::setIndexOffsetDepth( int kIndex, double topMd, double bottomMd, double topTvd, double bottomTvd )
{
m_depthOffsets[kIndex] = std::pair<double, double>( topDepth, bottomDepth );
m_mdOffsets[kIndex] = std::pair<double, double>( topMd, bottomMd );
m_tvdOffsets[kIndex] = std::pair<double, double>( topTvd, bottomTvd );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigWellLogIndexDepthOffset::getTopDepth( int kIndex ) const
double RigWellLogIndexDepthOffset::getTopMd( int kIndex ) const
{
auto hit = m_depthOffsets.find( kIndex );
if ( hit != m_depthOffsets.end() )
auto hit = m_mdOffsets.find( kIndex );
if ( hit != m_mdOffsets.end() )
{
return hit->second.first;
}
@@ -45,10 +46,38 @@ double RigWellLogIndexDepthOffset::getTopDepth( int kIndex ) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigWellLogIndexDepthOffset::getBottomDepth( int kIndex ) const
double RigWellLogIndexDepthOffset::getBottomMd( int kIndex ) const
{
auto hit = m_depthOffsets.find( kIndex );
if ( hit != m_depthOffsets.end() )
auto hit = m_mdOffsets.find( kIndex );
if ( hit != m_mdOffsets.end() )
{
return hit->second.second;
}
return std::numeric_limits<double>::infinity();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigWellLogIndexDepthOffset::getTopTvd( int kIndex ) const
{
auto hit = m_tvdOffsets.find( kIndex );
if ( hit != m_tvdOffsets.end() )
{
return hit->second.first;
}
return std::numeric_limits<double>::infinity();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigWellLogIndexDepthOffset::getBottomTvd( int kIndex ) const
{
auto hit = m_tvdOffsets.find( kIndex );
if ( hit != m_tvdOffsets.end() )
{
return hit->second.second;
}
@@ -62,7 +91,7 @@ double RigWellLogIndexDepthOffset::getBottomDepth( int kIndex ) const
std::vector<int> RigWellLogIndexDepthOffset::sortedIndexes() const
{
std::vector<int> indexes;
for ( auto m : m_depthOffsets )
for ( auto m : m_mdOffsets )
{
indexes.push_back( m.first );
}

View File

@@ -28,11 +28,14 @@ public:
RigWellLogIndexDepthOffset() = default;
~RigWellLogIndexDepthOffset() override = default;
void setIndexOffsetDepth( int kIndex, double topDepth, double bottomDepth );
double getTopDepth( int kIndex ) const;
double getBottomDepth( int kIndex ) const;
void setIndexOffsetDepth( int kIndex, double topMd, double bottomMd, double topTvd, double bottomTvd );
double getTopMd( int kIndex ) const;
double getBottomMd( int kIndex ) const;
double getTopTvd( int kIndex ) const;
double getBottomTvd( int kIndex ) const;
std::vector<int> sortedIndexes() const;
private:
std::map<int, std::pair<double, double>> m_depthOffsets;
std::map<int, std::pair<double, double>> m_mdOffsets;
std::map<int, std::pair<double, double>> m_tvdOffsets;
};