Add result type and create and use custom legend if possible

* Update submodule
* Use postfix functions and add custom color legend

* Add type to RigEclipseResultAddress
Read types from ROFF and create default legend based on type or custom created legend.

* Use caseId to connect legend configuration to result in a case
This commit is contained in:
Magne Sjaastad
2023-05-09 11:41:56 +02:00
committed by GitHub
parent 8c91f1b1ac
commit f70d2c4949
34 changed files with 565 additions and 356 deletions

View File

@@ -41,6 +41,17 @@ void caf::AppEnum<RiaDefines::ResultCatType>::setUp()
setDefault( RiaDefines::ResultCatType::DYNAMIC_NATIVE );
}
template <>
void caf::AppEnum<RiaDefines::ResultDataType>::setUp()
{
addItem( RiaDefines::ResultDataType::UNKNOWN, "UNKNOWN", "Unknown" );
addItem( RiaDefines::ResultDataType::FLOAT, "FLOAT", "Float" );
addItem( RiaDefines::ResultDataType::DOUBLE, "DOUBLE", "Double" );
addItem( RiaDefines::ResultDataType::INTEGER, "INTEGER", "Integer" );
setDefault( RiaDefines::ResultDataType::FLOAT );
}
template <>
void caf::AppEnum<RiaDefines::DepthUnitType>::setUp()
{
@@ -159,15 +170,6 @@ void caf::AppEnum<RiaDefines::RowCount>::setUp()
} // namespace caf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaDefines::isNativeCategoryResult( const QString& resultName )
{
return resultName.endsWith( "NUM" ) || resultName == RiaResultNames::indexIResultName() ||
resultName == RiaResultNames::indexJResultName() || resultName == RiaResultNames::indexKResultName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -52,6 +52,14 @@ enum class ResultCatType
UNDEFINED = 999
};
enum class ResultDataType
{
UNKNOWN,
FLOAT,
DOUBLE,
INTEGER
};
// WARNING: DO NOT CHANGE THE ORDER WITHOUT KNOWING WHAT YOU ARE DOING!
// You may well change the behaviour of property filters.
enum class WellPathComponentType
@@ -79,8 +87,6 @@ enum class MeshModeType
NO_MESH
};
bool isNativeCategoryResult( const QString& resultName );
// Mock model text identifiers
QString mockModelBasic();
QString mockModelBasicWithResults();

View File

@@ -20,6 +20,8 @@
#include "RiaResultNames.h"
#include "RigEclipseResultAddress.h"
#include "cafAppEnum.h"
//--------------------------------------------------------------------------------------------------
@@ -361,6 +363,14 @@ QString RiaResultNames::indexKResultName()
return "INDEX_K";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigEclipseResultAddress RiaResultNames::staticIntegerAddress( const QString& resultName )
{
return RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, RiaDefines::ResultDataType::INTEGER, resultName );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -20,7 +20,10 @@
#pragma once
class RigEclipseResultAddress;
#include <QString>
#include <set>
#include <vector>
@@ -66,9 +69,10 @@ QString faultReactAssessmentPrefix();
QString completionTypeResultName();
QString indexIResultName();
QString indexJResultName();
QString indexKResultName();
QString indexIResultName();
QString indexJResultName();
QString indexKResultName();
RigEclipseResultAddress staticIntegerAddress( const QString& resultName );
QString faultDistanceName();

View File

@@ -569,6 +569,7 @@ RimRoffCase* RiaImportEclipseCaseTools::openRoffCaseFromFileName( const QString&
}
analysisModels->cases.push_back( roffCase );
analysisModels->updateConnectedEditors();
RimEclipseView* eclipseView = nullptr;
if ( createDefaultView )
@@ -576,16 +577,17 @@ RimRoffCase* RiaImportEclipseCaseTools::openRoffCaseFromFileName( const QString&
eclipseView = roffCase->createAndAddReservoirView();
eclipseView->cellResult()->setResultType( RiaDefines::ResultCatType::INPUT_PROPERTY );
eclipseView->loadDataAndUpdate();
roffCase->updateAllRequiredEditors();
if ( RiaGuiApplication::isRunning() )
{
if ( RiuMainWindow::instance() ) RiuMainWindow::instance()->selectAsCurrentItem( eclipseView->cellResult() );
// Make sure the call to setExpanded is done after the call to selectAsCurrentItem
Riu3DMainWindowTools::setExpanded( eclipseView );
}
eclipseView->loadDataAndUpdate();
}
analysisModels->updateConnectedEditors();
return roffCase;
}