mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Result Info: Add support for multiple properties when clicking on a cell
* Result Info: Use monospace font * #9447 Result Info: Add support for multiple properties when clicking on a cell * Improve alignment in generated text
This commit is contained in:
parent
b1b0fd9d35
commit
3a99c039be
@ -127,6 +127,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultAddress.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultAddressCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimMultipleEclipseResults.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -253,6 +254,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultAddress.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultAddressCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimMultipleEclipseResults.cpp
|
||||
)
|
||||
|
||||
if(RESINSIGHT_USE_QT_CHARTS)
|
||||
|
@ -244,6 +244,11 @@ void RimEclipseCellColors::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeO
|
||||
uiTreeOrdering.add( m_legendConfigPtrField() );
|
||||
}
|
||||
|
||||
for ( const auto& obj : m_additionalUiTreeObjects )
|
||||
{
|
||||
uiTreeOrdering.add( obj );
|
||||
}
|
||||
|
||||
uiTreeOrdering.skipRemainingChildren( true );
|
||||
}
|
||||
|
||||
@ -271,6 +276,14 @@ void RimEclipseCellColors::useDiscreteLogLevels( bool enable )
|
||||
m_useDiscreteLogLevels = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCellColors::setAdditionalUiTreeObjects( const std::vector<caf::PdmObject*>& objects )
|
||||
{
|
||||
m_additionalUiTreeObjects = objects;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -62,6 +62,8 @@ public:
|
||||
|
||||
void useDiscreteLogLevels( bool enable );
|
||||
|
||||
void setAdditionalUiTreeObjects( const std::vector<caf::PdmObject*>& objects );
|
||||
|
||||
protected:
|
||||
// Overridden methods
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
@ -85,6 +87,8 @@ private:
|
||||
|
||||
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
||||
|
||||
std::vector<caf::PdmObject*> m_additionalUiTreeObjects;
|
||||
|
||||
bool m_useDiscreteLogLevels;
|
||||
|
||||
// Obsolete
|
||||
|
@ -66,6 +66,7 @@
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimIntersectionResultDefinition.h"
|
||||
#include "RimIntersectionResultsDefinitionCollection.h"
|
||||
#include "RimMultipleEclipseResults.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
@ -211,6 +212,14 @@ RimEclipseView::RimEclipseView()
|
||||
nameConfig()->hidePropertyField( false );
|
||||
nameConfig()->hideSampleSpacingField( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_additionalResultsForResultInfo,
|
||||
"AdditionalResultsForResultInfo",
|
||||
"Additional Result Info" );
|
||||
m_additionalResultsForResultInfo = new RimMultipleEclipseResults;
|
||||
m_additionalResultsForResultInfo->setEclipseView( this );
|
||||
|
||||
m_cellResult()->setAdditionalUiTreeObjects( { m_additionalResultsForResultInfo() } );
|
||||
|
||||
setDeletable( true );
|
||||
|
||||
this->updateAnimations.connect( this, &RimEclipseView::onAnimationsUpdate );
|
||||
@ -1639,6 +1648,14 @@ void RimEclipseView::syncronizeLocalAnnotationsFromGlobal()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigEclipseResultAddress> RimEclipseView::additionalResultsForResultInfo() const
|
||||
{
|
||||
return m_additionalResultsForResultInfo()->additionalResultAddresses();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1904,7 +1921,6 @@ void RimEclipseView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
|
||||
{
|
||||
uiTreeOrdering.add( m_overlayInfoConfig() );
|
||||
uiTreeOrdering.add( m_gridCollection() );
|
||||
|
||||
uiTreeOrdering.add( cellResult() );
|
||||
uiTreeOrdering.add( cellEdgeResult() );
|
||||
uiTreeOrdering.add( cellFilterCollection() );
|
||||
|
@ -66,6 +66,8 @@ class RimTernaryLegendConfig;
|
||||
class RimEclipseResultDefinition;
|
||||
class RimElementVectorResult;
|
||||
class RimStreamlineInViewCollection;
|
||||
class RimMultipleEclipseResults;
|
||||
class RigEclipseResultAddress;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
@ -156,6 +158,8 @@ public:
|
||||
|
||||
void syncronizeLocalAnnotationsFromGlobal();
|
||||
|
||||
std::vector<RigEclipseResultAddress> additionalResultsForResultInfo() const;
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
@ -237,4 +241,6 @@ private:
|
||||
cvf::ref<RivStreamlinesPartMgr> m_streamlinesPartManager;
|
||||
|
||||
std::vector<RivCellSetEnum> m_visibleGridParts;
|
||||
|
||||
caf::PdmChildField<RimMultipleEclipseResults*> m_additionalResultsForResultInfo;
|
||||
};
|
||||
|
@ -0,0 +1,121 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022 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 "RimMultipleEclipseResults.h"
|
||||
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseView.h"
|
||||
|
||||
#include "cafPdmUiTreeSelectionEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimMultipleEclipseResults, "RimMultipleEclipseResults" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMultipleEclipseResults::RimMultipleEclipseResults()
|
||||
{
|
||||
CAF_PDM_InitObject( "Result Info Data", ":/TextAnnotation16x16.png" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_selectedKeywords, "SelectedProperties", "Properties" );
|
||||
m_selectedKeywords.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
m_selectedKeywords.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMultipleEclipseResults::setEclipseView( RimEclipseView* eclipseView )
|
||||
{
|
||||
m_eclipseView = eclipseView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigEclipseResultAddress> RimMultipleEclipseResults::additionalResultAddresses() const
|
||||
{
|
||||
if ( !m_eclipseView || !m_eclipseView->currentGridCellResults() ) return {};
|
||||
|
||||
std::set<QString> selectedResults;
|
||||
for ( const auto& result : m_selectedKeywords() )
|
||||
{
|
||||
selectedResults.insert( result );
|
||||
}
|
||||
|
||||
std::vector<RigEclipseResultAddress> resultAddresses;
|
||||
|
||||
auto gridCellResult = m_eclipseView->currentGridCellResults();
|
||||
for ( const auto& res : gridCellResult->existingResults() )
|
||||
{
|
||||
auto candidate = res.resultName();
|
||||
if ( selectedResults.count( candidate ) > 0 )
|
||||
{
|
||||
resultAddresses.emplace_back( res );
|
||||
}
|
||||
}
|
||||
|
||||
return resultAddresses;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo>
|
||||
RimMultipleEclipseResults::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
|
||||
{
|
||||
if ( fieldNeedingOptions == &m_selectedKeywords )
|
||||
{
|
||||
if ( !m_eclipseView || !m_eclipseView->currentGridCellResults() ) return {};
|
||||
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
RigCaseCellResultsData* resultData = m_eclipseView->currentGridCellResults();
|
||||
std::vector<RiaDefines::ResultCatType> resultCategories = { RiaDefines::ResultCatType::STATIC_NATIVE,
|
||||
RiaDefines::ResultCatType::DYNAMIC_NATIVE,
|
||||
RiaDefines::ResultCatType::INPUT_PROPERTY };
|
||||
for ( auto catType : resultCategories )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> allOptions =
|
||||
RimEclipseResultDefinition::calcOptionsForVariableUiFieldStandard( catType, resultData );
|
||||
|
||||
bool isFirstOfCategory = true;
|
||||
for ( const caf::PdmOptionItemInfo& option : allOptions )
|
||||
{
|
||||
if ( resultData->hasResultEntry( RigEclipseResultAddress( catType, option.optionUiText() ) ) )
|
||||
{
|
||||
if ( isFirstOfCategory )
|
||||
{
|
||||
// Add the category title only when there is at least one valid result
|
||||
options.push_back(
|
||||
caf::PdmOptionItemInfo::createHeader( caf::AppEnum<RiaDefines::ResultCatType>::uiText( catType ),
|
||||
true ) );
|
||||
isFirstOfCategory = false;
|
||||
}
|
||||
|
||||
options.push_back( option );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022 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 "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RigEclipseResultAddress;
|
||||
class RimEclipseView;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimMultipleEclipseResults : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimMultipleEclipseResults();
|
||||
|
||||
void setEclipseView( RimEclipseView* eclipseView );
|
||||
|
||||
std::vector<RigEclipseResultAddress> additionalResultAddresses() const;
|
||||
|
||||
private:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<std::vector<QString>> m_selectedKeywords;
|
||||
caf::PdmPointer<RimEclipseView> m_eclipseView;
|
||||
};
|
@ -43,6 +43,12 @@ RiuResultInfoPanel::RiuResultInfoPanel( QWidget* parent )
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
layout->addWidget( m_textEdit );
|
||||
|
||||
// Use a nonexisting font family to trigger the use of QFont::Monospace
|
||||
// https://forum.qt.io/topic/35999/solved-qplaintextedit-how-to-change-the-font-to-be-monospaced/7
|
||||
QFont font( "does not exist" );
|
||||
font.setStyleHint( QFont::Monospace );
|
||||
m_textEdit->setFont( font );
|
||||
|
||||
layout->setContentsMargins( 0, 0, 0, 0 );
|
||||
|
||||
setLayout( layout );
|
||||
|
@ -57,12 +57,12 @@ RiuResultTextBuilder::RiuResultTextBuilder( RimGridView* settings
|
||||
{
|
||||
CVF_ASSERT( eclResDef );
|
||||
|
||||
m_displayCoordView = settingsView;
|
||||
m_viewWithFaultsSettings = dynamic_cast<RimEclipseView*>( settingsView );
|
||||
m_eclResDef = eclResDef;
|
||||
m_gridIndex = gridIndex;
|
||||
m_cellIndex = cellIndex;
|
||||
m_timeStepIndex = timeStepIndex;
|
||||
m_displayCoordView = settingsView;
|
||||
m_eclipseView = dynamic_cast<RimEclipseView*>( settingsView );
|
||||
m_eclResDef = eclResDef;
|
||||
m_gridIndex = gridIndex;
|
||||
m_cellIndex = cellIndex;
|
||||
m_timeStepIndex = timeStepIndex;
|
||||
|
||||
m_nncIndex = cvf::UNDEFINED_SIZE_T;
|
||||
m_intersectionPointInDisplay = cvf::Vec3d::UNDEFINED;
|
||||
@ -79,12 +79,12 @@ RiuResultTextBuilder::RiuResultTextBuilder( RimGridView* settings
|
||||
{
|
||||
CVF_ASSERT( eclResDef );
|
||||
|
||||
m_displayCoordView = settingsView;
|
||||
m_viewWithFaultsSettings = dynamic_cast<RimEclipseView*>( settingsView );
|
||||
m_eclResDef = eclResDef;
|
||||
m_gridIndex = 0;
|
||||
m_cellIndex = 0;
|
||||
m_timeStepIndex = timeStepIndex;
|
||||
m_displayCoordView = settingsView;
|
||||
m_eclipseView = dynamic_cast<RimEclipseView*>( settingsView );
|
||||
m_eclResDef = eclResDef;
|
||||
m_gridIndex = 0;
|
||||
m_cellIndex = 0;
|
||||
m_timeStepIndex = timeStepIndex;
|
||||
|
||||
RimEclipseCase* eclipseCase = eclResDef->eclipseCase();
|
||||
if ( eclipseCase && eclipseCase->eclipseCaseData() )
|
||||
@ -283,20 +283,35 @@ QString RiuResultTextBuilder::geometrySelectionText( QString itemSeparator )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuResultTextBuilder::gridResultDetails()
|
||||
{
|
||||
QString text;
|
||||
std::vector<RimEclipseResultDefinition*> resultDefinitions;
|
||||
|
||||
if ( m_eclResDef->eclipseCase() && m_eclResDef->eclipseCase()->eclipseCaseData() )
|
||||
std::vector<std::unique_ptr<RimEclipseResultDefinition>> tmp;
|
||||
|
||||
resultDefinitions.push_back( m_eclResDef );
|
||||
if ( m_eclipseView )
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = m_eclResDef->eclipseCase()->eclipseCaseData();
|
||||
auto additionalResults = m_eclipseView->additionalResultsForResultInfo();
|
||||
|
||||
this->appendTextFromResultColors( eclipseCaseData, m_gridIndex, m_cellIndex, m_timeStepIndex, m_eclResDef, &text );
|
||||
|
||||
if ( !text.isEmpty() )
|
||||
for ( const auto& resultName : additionalResults )
|
||||
{
|
||||
text.prepend( "-- Grid cell result details --\n" );
|
||||
auto myResDef = std::make_unique<RimEclipseResultDefinition>();
|
||||
myResDef->setEclipseCase( m_eclResDef->eclipseCase() );
|
||||
myResDef->simpleCopy( m_eclResDef );
|
||||
myResDef->setFromEclipseResultAddress( resultName );
|
||||
myResDef->loadResult();
|
||||
|
||||
resultDefinitions.push_back( myResDef.get() );
|
||||
tmp.push_back( std::move( myResDef ) );
|
||||
}
|
||||
}
|
||||
|
||||
QString text = cellResultText( resultDefinitions );
|
||||
if ( !text.isEmpty() )
|
||||
{
|
||||
text.prepend( "-- Grid cell result details --\n" );
|
||||
}
|
||||
text += "\n";
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
@ -323,9 +338,9 @@ QString RiuResultTextBuilder::faultResultDetails()
|
||||
cvf::StructGridInterface::FaceEnum faceHelper( m_face );
|
||||
text += "Fault Face : " + faceHelper.text() + "\n";
|
||||
|
||||
if ( m_viewWithFaultsSettings && m_viewWithFaultsSettings->faultResultSettings()->hasValidCustomResult() )
|
||||
if ( m_eclipseView && m_eclipseView->faultResultSettings()->hasValidCustomResult() )
|
||||
{
|
||||
if ( m_viewWithFaultsSettings->faultResultSettings()->customFaultResult()->resultType() !=
|
||||
if ( m_eclipseView->faultResultSettings()->customFaultResult()->resultType() !=
|
||||
RiaDefines::ResultCatType::ALLAN_DIAGRAMS )
|
||||
{
|
||||
text += "Fault result data:\n";
|
||||
@ -333,7 +348,7 @@ QString RiuResultTextBuilder::faultResultDetails()
|
||||
m_gridIndex,
|
||||
m_cellIndex,
|
||||
m_timeStepIndex,
|
||||
m_viewWithFaultsSettings->currentFaultResultColors(),
|
||||
m_eclipseView->currentFaultResultColors(),
|
||||
&text );
|
||||
}
|
||||
}
|
||||
@ -392,7 +407,8 @@ QString RiuResultTextBuilder::formationDetails()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuResultTextBuilder::gridResultText()
|
||||
{
|
||||
QString text = cellResultText( m_eclResDef );
|
||||
QString text = cellResultText( { m_eclResDef } );
|
||||
text.replace( "\n", " " );
|
||||
|
||||
return text;
|
||||
}
|
||||
@ -416,9 +432,9 @@ QString RiuResultTextBuilder::faultResultText()
|
||||
if ( fault )
|
||||
{
|
||||
cvf::StructGridInterface::FaceEnum faceHelper( m_face );
|
||||
if ( m_viewWithFaultsSettings && m_viewWithFaultsSettings->faultResultSettings()->hasValidCustomResult() )
|
||||
if ( m_eclipseView && m_eclipseView->faultResultSettings()->hasValidCustomResult() )
|
||||
{
|
||||
text = cellResultText( m_viewWithFaultsSettings->currentFaultResultColors() );
|
||||
text = cellResultText( { m_eclipseView->currentFaultResultColors() } );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -451,12 +467,11 @@ QString RiuResultTextBuilder::nncResultText()
|
||||
|
||||
cvf::StructGridInterface::FaceEnum face( conn.face() );
|
||||
|
||||
if ( m_viewWithFaultsSettings && m_viewWithFaultsSettings->currentFaultResultColors() )
|
||||
if ( m_eclipseView && m_eclipseView->currentFaultResultColors() )
|
||||
{
|
||||
RigEclipseResultAddress eclipseResultAddress =
|
||||
m_viewWithFaultsSettings->currentFaultResultColors()->eclipseResultAddress();
|
||||
RiaDefines::ResultCatType resultType =
|
||||
m_viewWithFaultsSettings->currentFaultResultColors()->resultType();
|
||||
m_eclipseView->currentFaultResultColors()->eclipseResultAddress();
|
||||
RiaDefines::ResultCatType resultType = m_eclipseView->currentFaultResultColors()->resultType();
|
||||
|
||||
const std::vector<double>* nncValues = nullptr;
|
||||
|
||||
@ -475,7 +490,7 @@ QString RiuResultTextBuilder::nncResultText()
|
||||
|
||||
if ( nncValues && ( m_nncIndex < nncValues->size() ) )
|
||||
{
|
||||
QString resultVar = m_viewWithFaultsSettings->currentFaultResultColors()->resultVariableUiName();
|
||||
QString resultVar = m_eclipseView->currentFaultResultColors()->resultVariableUiName();
|
||||
double scalarValue = ( *nncValues )[m_nncIndex];
|
||||
|
||||
text = QString( "%1 : %2" ).arg( resultVar ).arg( scalarValue );
|
||||
@ -486,7 +501,7 @@ QString RiuResultTextBuilder::nncResultText()
|
||||
nncValues = nncData->staticConnectionScalarResult( eclipseResultAddress );
|
||||
QString resultValueText;
|
||||
|
||||
if ( m_viewWithFaultsSettings->currentFaultResultColors()->resultVariable() ==
|
||||
if ( m_eclipseView->currentFaultResultColors()->resultVariable() ==
|
||||
RiaResultNames::formationAllanResultName() )
|
||||
{
|
||||
std::pair<int, int> fmIndexPair =
|
||||
@ -505,13 +520,13 @@ QString RiuResultTextBuilder::nncResultText()
|
||||
}
|
||||
// clang-format on
|
||||
}
|
||||
else if ( m_viewWithFaultsSettings->currentFaultResultColors()->resultVariable() ==
|
||||
else if ( m_eclipseView->currentFaultResultColors()->resultVariable() ==
|
||||
RiaResultNames::formationBinaryAllanResultName() )
|
||||
{
|
||||
resultValueText = ( *nncValues )[m_nncIndex] == 0 ? "Same formation" : "Different formation";
|
||||
}
|
||||
|
||||
QString resultVar = m_viewWithFaultsSettings->currentFaultResultColors()->resultVariableUiName();
|
||||
QString resultVar = m_eclipseView->currentFaultResultColors()->resultVariableUiName();
|
||||
text = QString( "%1 : %2" ).arg( resultVar ).arg( resultValueText );
|
||||
}
|
||||
}
|
||||
@ -722,7 +737,7 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
|
||||
}
|
||||
}
|
||||
|
||||
resultInfoText->append( cellResultText( resultColors ) );
|
||||
resultInfoText->append( cellResultText( { resultColors } ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -732,14 +747,14 @@ QString RiuResultTextBuilder::cellEdgeResultDetails()
|
||||
{
|
||||
QString text;
|
||||
|
||||
if ( m_viewWithFaultsSettings && m_viewWithFaultsSettings->cellEdgeResult()->showTextResult() )
|
||||
if ( m_eclipseView && m_eclipseView->cellEdgeResult()->showTextResult() )
|
||||
{
|
||||
m_viewWithFaultsSettings->cellEdgeResult()->loadResult();
|
||||
m_eclipseView->cellEdgeResult()->loadResult();
|
||||
|
||||
text += "-- Cell edge result data --\n";
|
||||
|
||||
std::vector<RimCellEdgeMetaData> metaData;
|
||||
m_viewWithFaultsSettings->cellEdgeResult()->cellEdgeMetaData( &metaData );
|
||||
m_eclipseView->cellEdgeResult()->cellEdgeMetaData( &metaData );
|
||||
|
||||
std::set<RigEclipseResultAddress> uniqueResultAddresses;
|
||||
|
||||
@ -880,9 +895,39 @@ void RiuResultTextBuilder::appendDetails( QString& text, const QString& details
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuResultTextBuilder::cellResultText( RimEclipseResultDefinition* eclResDef )
|
||||
QString RiuResultTextBuilder::cellResultText( const std::vector<RimEclipseResultDefinition*>& resultDefinitions )
|
||||
{
|
||||
std::map<QString, QString> keyValues;
|
||||
|
||||
int maxKeyLength = 0;
|
||||
for ( const auto& resDef : resultDefinitions )
|
||||
{
|
||||
auto resultTextAndValues = cellResultTextAndValueText( resDef );
|
||||
for ( const auto& [key, value] : resultTextAndValues )
|
||||
{
|
||||
maxKeyLength = std::max( maxKeyLength, key.length() );
|
||||
keyValues[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
QString text;
|
||||
for ( const auto& [key, value] : keyValues )
|
||||
{
|
||||
if ( !text.isEmpty() ) text += "\n";
|
||||
text += QString( "%1 : %2" ).arg( key, -maxKeyLength ).arg( value );
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<QString, QString> RiuResultTextBuilder::cellResultTextAndValueText( RimEclipseResultDefinition* eclResDef )
|
||||
{
|
||||
if ( !eclResDef ) return {};
|
||||
|
||||
std::map<QString, QString> keyValues;
|
||||
|
||||
if ( m_eclResDef->eclipseCase() && m_eclResDef->eclipseCase()->eclipseCaseData() )
|
||||
{
|
||||
@ -930,19 +975,21 @@ QString RiuResultTextBuilder::cellResultText( RimEclipseResultDefinition* eclRes
|
||||
scalarValue = dataAccessObjectX->cellScalar( m_cellIndex );
|
||||
else
|
||||
scalarValue = 0.0;
|
||||
text += QString( "SOIL : %1 " ).arg( scalarValue );
|
||||
|
||||
keyValues["SOIL"] = QString( "%1" ).arg( scalarValue );
|
||||
|
||||
if ( dataAccessObjectY.notNull() )
|
||||
scalarValue = dataAccessObjectY->cellScalar( m_cellIndex );
|
||||
else
|
||||
scalarValue = 0.0;
|
||||
text += QString( "SGAS : %1 " ).arg( scalarValue );
|
||||
|
||||
keyValues["SGAS"] = QString( "%1" ).arg( scalarValue );
|
||||
|
||||
if ( dataAccessObjectZ.notNull() )
|
||||
scalarValue = dataAccessObjectZ->cellScalar( m_cellIndex );
|
||||
else
|
||||
scalarValue = 0.0;
|
||||
text += QString( "SWAT : %1 " ).arg( scalarValue );
|
||||
keyValues["SWAT"] = QString( "%1" ).arg( scalarValue );
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -981,19 +1028,22 @@ QString RiuResultTextBuilder::cellResultText( RimEclipseResultDefinition* eclRes
|
||||
}
|
||||
}
|
||||
|
||||
resultValueText += legendConfig->categoryNameFromCategoryValue( scalarValue );
|
||||
if ( legendConfig )
|
||||
resultValueText += legendConfig->categoryNameFromCategoryValue( scalarValue );
|
||||
else
|
||||
resultValueText += QString( "%1" ).arg( scalarValue );
|
||||
}
|
||||
else
|
||||
{
|
||||
resultValueText = QString( "%1" ).arg( scalarValue );
|
||||
}
|
||||
|
||||
text = QString( "%1 : %2" ).arg( resultDescriptionText ).arg( resultValueText );
|
||||
keyValues[resultDescriptionText] = resultValueText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
return keyValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "cafPdmPointer.h"
|
||||
#include "cvfStructGrid.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
class RimEclipseView;
|
||||
class RimEclipseCellColors;
|
||||
class Rim2dIntersectionView;
|
||||
@ -76,7 +78,8 @@ private:
|
||||
QString nncResultText();
|
||||
QString wellResultText();
|
||||
|
||||
QString cellResultText( RimEclipseResultDefinition* resultColors );
|
||||
QString cellResultText( const std::vector<RimEclipseResultDefinition*>& resultDefinitions );
|
||||
std::map<QString, QString> cellResultTextAndValueText( RimEclipseResultDefinition* resultDefinition );
|
||||
|
||||
void appendTextFromResultColors( RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
@ -87,7 +90,7 @@ private:
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimGridView> m_displayCoordView;
|
||||
caf::PdmPointer<RimEclipseView> m_viewWithFaultsSettings;
|
||||
caf::PdmPointer<RimEclipseView> m_eclipseView;
|
||||
|
||||
caf::PdmPointer<RimEclipseResultDefinition> m_eclResDef;
|
||||
caf::PdmPointer<Rim2dIntersectionView> m_2dIntersectionView;
|
||||
|
Loading…
Reference in New Issue
Block a user