Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summary cross plot refactoring #10625

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
92499a2
Rename to plotAxis()
magnesj Sep 17, 2023
c5d049a
Add isHorizontal and isVertical
magnesj Sep 17, 2023
882775b
Add summary category time
magnesj Sep 18, 2023
5ae47c6
Rename to SummaryCategory
magnesj Sep 18, 2023
2adb5a2
Fixes by clang-format
magnesj Sep 18, 2023
b89d403
Add data source for x-values
magnesj Sep 18, 2023
381ff37
Support cross plot curves in plot templates
magnesj Sep 18, 2023
df6ef5f
Working version of summary cross plot curves
magnesj Sep 17, 2023
aa3a24a
Add support for drag/drop of object names
magnesj Sep 18, 2023
5cad225
Include both axes data source info in curveDefinition
magnesj Sep 18, 2023
7b6bdaf
wip
magnesj Sep 18, 2023
8b07e38
Support drag/drop of summary case
magnesj Sep 18, 2023
a593f01
Reuse x-axis object if possible
magnesj Sep 18, 2023
964c5fa
Fix bug for cross plot curves
magnesj Sep 18, 2023
4329666
Add summarycurveaddress
magnesj Sep 18, 2023
6269110
Summary titles WIP
magnesj Sep 18, 2023
2e71a9c
Improvements for cross plot curves from multiple realizations
magnesj Sep 18, 2023
46f0845
Fixes by clang-format
magnesj Sep 18, 2023
7b92f26
Fix display of ensemble curves
magnesj Sep 19, 2023
3421801
Add helper functions for assignment of data source and axis
magnesj Sep 19, 2023
69e2a61
Add missing initializer
magnesj Sep 19, 2023
890beee
Fix for bottom summary axis
magnesj Sep 19, 2023
cf51a4b
Cleanup
magnesj Sep 20, 2023
0ab2261
Cleanup
magnesj Sep 20, 2023
2b28c4b
Mark obsolete
magnesj Sep 20, 2023
67c5cc2
Cleanup
magnesj Sep 20, 2023
0a8ab62
Fixes by clang-format
magnesj Sep 20, 2023
055eaa9
Improve curve name for cross plot curves
magnesj Sep 20, 2023
3db1bc5
Merge remote-tracking branch 'origin/clang-format-patches-onrb3ya' in…
magnesj Sep 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ApplicationLibCode/Application/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaLasDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.h
)

set(SOURCE_GROUP_SOURCE_FILES
Expand Down Expand Up @@ -72,6 +73,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RiaSeismicDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaLasDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.cpp
)

list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
Expand Down
53 changes: 53 additions & 0 deletions ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////

#include "RiaSummaryCurveAddress.h"

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaSummaryCurveAddress::RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressX, const RifEclipseSummaryAddress& summaryAddressY )
: m_summaryAddressX( summaryAddressX )
, m_summaryAddressY( summaryAddressY )
{
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaSummaryCurveAddress::RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressY )
: m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() )
, m_summaryAddressY( summaryAddressY )
{
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseSummaryAddress RiaSummaryCurveAddress::summaryAddressX() const
{
return m_summaryAddressX;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseSummaryAddress RiaSummaryCurveAddress::summaryAddressY() const
{
return m_summaryAddressY;
}
40 changes: 40 additions & 0 deletions ApplicationLibCode/Application/RiaSummaryCurveAddress.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RifEclipseSummaryAddress.h"

//==================================================================================================
///
//==================================================================================================
class RiaSummaryCurveAddress
{
public:
explicit RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressY );
explicit RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressX, const RifEclipseSummaryAddress& summaryAddressY );

RifEclipseSummaryAddress summaryAddressX() const;
RifEclipseSummaryAddress summaryAddressY() const;

auto operator<=>( const RiaSummaryCurveAddress& rhs ) const = default;

private:
RifEclipseSummaryAddress m_summaryAddressX;
RifEclipseSummaryAddress m_summaryAddressY;
};
73 changes: 73 additions & 0 deletions ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
/////////////////////////////////////////////////////////////////////////////////

#include "RiaSummaryCurveDefinition.h"
#include "RiaStdStringTools.h"

#include "RifSummaryReaderInterface.h"

#include "RimSummaryCase.h"
#include "RimSummaryCaseCollection.h"

Expand All @@ -29,6 +31,8 @@
//--------------------------------------------------------------------------------------------------
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition()
: m_summaryCase( nullptr )
, m_summaryCaseX( nullptr )
, m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() )
, m_ensemble( nullptr )
, m_isEnsembleCurve( false )
{
Expand All @@ -42,6 +46,8 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase*
bool isEnsembleCurve )
: m_summaryCase( summaryCase )
, m_summaryAddress( summaryAddress )
, m_summaryCaseX( nullptr )
, m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() )
, m_ensemble( nullptr )
, m_isEnsembleCurve( isEnsembleCurve )
{
Expand All @@ -53,6 +59,8 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase*
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress )
: m_summaryCase( nullptr )
, m_summaryAddress( summaryAddress )
, m_summaryCaseX( nullptr )
, m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() )
, m_ensemble( ensemble )
, m_isEnsembleCurve( true )
{
Expand Down Expand Up @@ -98,6 +106,71 @@ void RiaSummaryCurveDefinition::setSummaryAddress( const RifEclipseSummaryAddres
m_summaryAddress = address;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaSummaryCurveDefinition::setSummaryCaseX( RimSummaryCase* summaryCase )
{
m_summaryCaseX = summaryCase;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaSummaryCurveDefinition::setSummaryAddressX( const RifEclipseSummaryAddress& summaryAddress )
{
m_summaryAddressX = summaryAddress;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryCase* RiaSummaryCurveDefinition::summaryCaseX() const
{
return m_summaryCaseX;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseSummaryAddress RiaSummaryCurveDefinition::summaryAddressX() const
{
return m_summaryAddressX;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaSummaryCurveDefinition::setIdentifierText( SummaryCategory category, const std::string& name )
{
if ( RifEclipseSummaryAddress::isDependentOnWellName( category ) )
{
m_summaryAddress.setWellName( name );
m_summaryAddressX.setWellName( name );
}

int id = RiaStdStringTools::toInt( name );

switch ( category )
{
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER:
m_summaryAddress.setAquiferNumber( id );
m_summaryAddressX.setAquiferNumber( id );
break;
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION:
m_summaryAddress.setRegion( id );
m_summaryAddressX.setRegion( id );
break;
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP:
m_summaryAddress.setGroupName( name );
m_summaryAddressX.setGroupName( name );
break;
default:
break;
}
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions ApplicationLibCode/Application/RiaSummaryCurveDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#pragma once

#include "RifEclipseSummaryAddress.h"
#include "RifEclipseSummaryAddressDefines.h"

#include <QString>

Expand All @@ -40,12 +41,21 @@ class RiaSummaryCurveDefinition
explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& summaryAddress, bool isEnsembleCurve );
explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress );

// Y Axis
RimSummaryCase* summaryCase() const;
const RifEclipseSummaryAddress& summaryAddress() const;
RimSummaryCaseCollection* ensemble() const;
bool isEnsembleCurve() const;
void setSummaryAddress( const RifEclipseSummaryAddress& address );

// X Axis
void setSummaryCaseX( RimSummaryCase* summaryCase );
void setSummaryAddressX( const RifEclipseSummaryAddress& summaryAddress );
RimSummaryCase* summaryCaseX() const;
RifEclipseSummaryAddress summaryAddressX() const;

void setIdentifierText( SummaryCategory category, const std::string& name );

bool operator<( const RiaSummaryCurveDefinition& other ) const;

// TODO: Consider moving to a separate tools class
Expand All @@ -59,6 +69,8 @@ class RiaSummaryCurveDefinition
private:
RimSummaryCase* m_summaryCase;
RifEclipseSummaryAddress m_summaryAddress;
RimSummaryCase* m_summaryCaseX;
RifEclipseSummaryAddress m_summaryAddressX;
RimSummaryCaseCollection* m_ensemble;
bool m_isEnsembleCurve;
};
Expand Down
12 changes: 12 additions & 0 deletions ApplicationLibCode/Application/RiaSummaryDefines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
/////////////////////////////////////////////////////////////////////////////////

#include "RiaSummaryDefines.h"
#include "cafAppEnum.h"

namespace caf
{
template <>
void caf::AppEnum<RiaDefines::HorizontalAxisType>::setUp()
{
addItem( RiaDefines::HorizontalAxisType::TIME, "TIME", "Time" );
addItem( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR, "SUMMARY_VECTOR", "Summary Vector" );
setDefault( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR );
}
} // namespace caf

//--------------------------------------------------------------------------------------------------
///
Expand Down
6 changes: 6 additions & 0 deletions ApplicationLibCode/Application/RiaSummaryDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ enum class FileType
STIMPLAN_SUMMARY
};

enum class HorizontalAxisType
{
TIME,
SUMMARY_VECTOR
};

QString summaryField();
QString summaryAquifer();
QString summaryNetwork();
Expand Down
38 changes: 19 additions & 19 deletions ApplicationLibCode/Application/Tools/RiaOptionItemFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,65 +55,65 @@ void RiaOptionItemFactory::appendOptionItemsForEnsembleCurveSets( QList<caf::Pdm
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmOptionItemInfo RiaOptionItemFactory::optionItemFromSummaryType( RifEclipseSummaryAddressDefines::SummaryVarCategory summaryType )
caf::PdmOptionItemInfo RiaOptionItemFactory::optionItemFromSummaryType( RifEclipseSummaryAddressDefines::SummaryCategory summaryType )
{
auto uiText = caf::AppEnum<RifEclipseSummaryAddressDefines::SummaryVarCategory>::uiText( summaryType );
auto uiText = caf::AppEnum<RifEclipseSummaryAddressDefines::SummaryCategory>::uiText( summaryType );

// Use icons from https://github.com/equinor/webviz-subsurface-components

QString iconText;

switch ( summaryType )
{
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID:
iconText = ":/summary/components/images/invalid.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD:
iconText = ":/summary/components/images/field.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER:
iconText = ":/summary/components/images/aquifer.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK:
iconText = ":/summary/components/images/network.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC:
iconText = ":/summary/components/images/misc.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION:
iconText = ":/summary/components/images/region.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION:
iconText = ":/summary/components/images/region-region.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP:
iconText = ":/summary/components/images/group.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL:
iconText = ":/summary/components/images/well.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION:
iconText = ":/summary/components/images/well-completion.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR:
iconText = ":/summary/components/images/well.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR:
iconText = ":/summary/components/images/well-completion.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT:
iconText = ":/summary/components/images/segment.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK:
iconText = ":/summary/components/images/block.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR:
iconText = ":/summary/components/images/block.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED:
iconText = ":/summary/components/images/others.svg";
break;
case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS:
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS:
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ class RiaOptionItemFactory
public:
static void appendOptionItemFromViewNameAndCaseName( Rim3dView* view, QList<caf::PdmOptionItemInfo>* optionItems );
static void appendOptionItemsForEnsembleCurveSets( QList<caf::PdmOptionItemInfo>* options );
static caf::PdmOptionItemInfo optionItemFromSummaryType( RifEclipseSummaryAddressDefines::SummaryVarCategory summaryType );
static caf::PdmOptionItemInfo optionItemFromSummaryType( RifEclipseSummaryAddressDefines::SummaryCategory summaryType );
};
Loading
Loading