|
|
|
|
@@ -28,12 +28,12 @@
|
|
|
|
|
|
|
|
|
|
#include "cafPdmUiListEditor.h"
|
|
|
|
|
|
|
|
|
|
CAF_PDM_SOURCE_INIT(RimResultDefinition, "ResultDefinition");
|
|
|
|
|
CAF_PDM_SOURCE_INIT(RimEclipseResultDefinition, "ResultDefinition");
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RimResultDefinition::RimResultDefinition()
|
|
|
|
|
RimEclipseResultDefinition::RimEclipseResultDefinition()
|
|
|
|
|
//: m_gridScalarResultIndex(cvf::UNDEFINED_SIZE_T)
|
|
|
|
|
{
|
|
|
|
|
CAF_PDM_InitObject("Result Definition", "", "", "");
|
|
|
|
|
@@ -62,7 +62,7 @@ RimResultDefinition::RimResultDefinition()
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RimResultDefinition::~RimResultDefinition()
|
|
|
|
|
RimEclipseResultDefinition::~RimEclipseResultDefinition()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -70,14 +70,14 @@ RimResultDefinition::~RimResultDefinition()
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimResultDefinition::setReservoirView(RimEclipseView* ownerReservoirView)
|
|
|
|
|
void RimEclipseResultDefinition::setReservoirView(RimEclipseView* ownerReservoirView)
|
|
|
|
|
{
|
|
|
|
|
m_reservoirView = ownerReservoirView;
|
|
|
|
|
|
|
|
|
|
updateFieldVisibility();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList RimResultDefinition::getResultVariableListForCurrentUIFieldSettings()
|
|
|
|
|
QStringList RimEclipseResultDefinition::getResultVariableListForCurrentUIFieldSettings()
|
|
|
|
|
{
|
|
|
|
|
if (!m_reservoirView || !m_reservoirView->eclipseCase() ) return QStringList();
|
|
|
|
|
|
|
|
|
|
@@ -87,7 +87,7 @@ QStringList RimResultDefinition::getResultVariableListForCurrentUIFieldSettings(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RimReservoirCellResultsStorage* RimResultDefinition::currentGridCellResults() const
|
|
|
|
|
RimReservoirCellResultsStorage* RimEclipseResultDefinition::currentGridCellResults() const
|
|
|
|
|
{
|
|
|
|
|
if (!m_reservoirView || !m_reservoirView->eclipseCase()) return NULL;
|
|
|
|
|
|
|
|
|
|
@@ -99,7 +99,7 @@ RimReservoirCellResultsStorage* RimResultDefinition::currentGridCellResults() co
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
|
|
|
|
void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
|
|
|
|
{
|
|
|
|
|
if ( &m_resultTypeUiField == changedField
|
|
|
|
|
|| &m_porosityModelUiField == changedField )
|
|
|
|
|
@@ -132,7 +132,7 @@ void RimResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
QList<caf::PdmOptionItemInfo> RimResultDefinition::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
|
|
|
|
|
QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
|
|
|
|
|
{
|
|
|
|
|
return calculateValueOptionsForSpecifiedDerivedListPosition(false, fieldNeedingOptions, useOptionsOnly);
|
|
|
|
|
}
|
|
|
|
|
@@ -140,7 +140,7 @@ QList<caf::PdmOptionItemInfo> RimResultDefinition::calculateValueOptions(const c
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
QList<caf::PdmOptionItemInfo> RimResultDefinition::calculateValueOptionsForSpecifiedDerivedListPosition(bool showDerivedResultsFirstInList, const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
|
|
|
|
QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptionsForSpecifiedDerivedListPosition(bool showDerivedResultsFirstInList, const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
|
|
|
|
{
|
|
|
|
|
if (fieldNeedingOptions == &m_resultVariableUiField)
|
|
|
|
|
{
|
|
|
|
|
@@ -201,7 +201,7 @@ QList<caf::PdmOptionItemInfo> RimResultDefinition::calculateValueOptionsForSpeci
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
size_t RimResultDefinition::scalarResultIndex() const
|
|
|
|
|
size_t RimEclipseResultDefinition::scalarResultIndex() const
|
|
|
|
|
{
|
|
|
|
|
size_t gridScalarResultIndex = cvf::UNDEFINED_SIZE_T;
|
|
|
|
|
|
|
|
|
|
@@ -214,7 +214,7 @@ size_t RimResultDefinition::scalarResultIndex() const
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimResultDefinition::loadResult()
|
|
|
|
|
void RimEclipseResultDefinition::loadResult()
|
|
|
|
|
{
|
|
|
|
|
RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults();
|
|
|
|
|
if (gridCellResults)
|
|
|
|
|
@@ -230,7 +230,7 @@ void RimResultDefinition::loadResult()
|
|
|
|
|
/// Returns whether the result requested by the definition is a single frame result
|
|
|
|
|
/// The result needs to be loaded before asking
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
bool RimResultDefinition::hasStaticResult() const
|
|
|
|
|
bool RimEclipseResultDefinition::hasStaticResult() const
|
|
|
|
|
{
|
|
|
|
|
const RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults();
|
|
|
|
|
size_t gridScalarResultIndex = this->scalarResultIndex();
|
|
|
|
|
@@ -248,7 +248,7 @@ bool RimResultDefinition::hasStaticResult() const
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
/// Returns whether the result requested by the definition is loaded or possible to load from the result file
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
bool RimResultDefinition::hasResult() const
|
|
|
|
|
bool RimEclipseResultDefinition::hasResult() const
|
|
|
|
|
{
|
|
|
|
|
if (this->currentGridCellResults() && this->currentGridCellResults()->cellResults())
|
|
|
|
|
{
|
|
|
|
|
@@ -264,7 +264,7 @@ bool RimResultDefinition::hasResult() const
|
|
|
|
|
/// Returns whether the result requested by the definition is a multi frame result
|
|
|
|
|
/// The result needs to be loaded before asking
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
bool RimResultDefinition::hasDynamicResult() const
|
|
|
|
|
bool RimEclipseResultDefinition::hasDynamicResult() const
|
|
|
|
|
{
|
|
|
|
|
if (hasResult())
|
|
|
|
|
{
|
|
|
|
|
@@ -290,7 +290,7 @@ bool RimResultDefinition::hasDynamicResult() const
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RimEclipseView* RimResultDefinition::reservoirView()
|
|
|
|
|
RimEclipseView* RimEclipseResultDefinition::reservoirView()
|
|
|
|
|
{
|
|
|
|
|
return m_reservoirView;
|
|
|
|
|
}
|
|
|
|
|
@@ -298,7 +298,7 @@ RimEclipseView* RimResultDefinition::reservoirView()
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimResultDefinition::initAfterRead()
|
|
|
|
|
void RimEclipseResultDefinition::initAfterRead()
|
|
|
|
|
{
|
|
|
|
|
m_porosityModelUiField = m_porosityModel;
|
|
|
|
|
m_resultTypeUiField = m_resultType;
|
|
|
|
|
@@ -310,7 +310,7 @@ void RimResultDefinition::initAfterRead()
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimResultDefinition::setResultType(RimDefines::ResultCatType val)
|
|
|
|
|
void RimEclipseResultDefinition::setResultType(RimDefines::ResultCatType val)
|
|
|
|
|
{
|
|
|
|
|
m_resultType = val;
|
|
|
|
|
m_resultTypeUiField = val;
|
|
|
|
|
@@ -319,7 +319,7 @@ void RimResultDefinition::setResultType(RimDefines::ResultCatType val)
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimResultDefinition::setPorosityModel(RimDefines::PorosityModelType val)
|
|
|
|
|
void RimEclipseResultDefinition::setPorosityModel(RimDefines::PorosityModelType val)
|
|
|
|
|
{
|
|
|
|
|
m_porosityModel = val;
|
|
|
|
|
m_porosityModelUiField = val;
|
|
|
|
|
@@ -328,7 +328,7 @@ void RimResultDefinition::setPorosityModel(RimDefines::PorosityModelType val)
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimResultDefinition::setResultVariable(const QString& val)
|
|
|
|
|
void RimEclipseResultDefinition::setResultVariable(const QString& val)
|
|
|
|
|
{
|
|
|
|
|
m_resultVariable = val;
|
|
|
|
|
m_resultVariableUiField = val;
|
|
|
|
|
@@ -337,7 +337,7 @@ void RimResultDefinition::setResultVariable(const QString& val)
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
bool RimResultDefinition::isTernarySaturationSelected() const
|
|
|
|
|
bool RimEclipseResultDefinition::isTernarySaturationSelected() const
|
|
|
|
|
{
|
|
|
|
|
bool isTernary = (m_resultType() == RimDefines::DYNAMIC_NATIVE) &&
|
|
|
|
|
(m_resultVariable().compare(RimDefines::ternarySaturationResultName(), Qt::CaseInsensitive) == 0);
|
|
|
|
|
@@ -348,7 +348,7 @@ bool RimResultDefinition::isTernarySaturationSelected() const
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimResultDefinition::updateFieldVisibility()
|
|
|
|
|
void RimEclipseResultDefinition::updateFieldVisibility()
|
|
|
|
|
{
|
|
|
|
|
if (m_reservoirView &&
|
|
|
|
|
m_reservoirView->eclipseCase() &&
|
|
|
|
|
|