From 79b523522d222165616f2282b55af4bde28ee1ef Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 4 Apr 2014 11:16:00 +0200 Subject: [PATCH] Show ternary info in result info by picking on cells --- .../Rim3dOverlayInfoConfig.cpp | 8 ++++- .../ProjectDataModel/RimReservoirView.cpp | 33 ++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp index f0d4ac756a..ada49281c4 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp @@ -140,6 +140,11 @@ void Rim3dOverlayInfoConfig::update3DInfo() "Cell count. Total: %2 Active: %3
" "Main Grid I,J,K: %4, %5, %6 Z-Scale: %7
").arg(caseName, totCellCount, activeCellCountText, iSize, jSize, kSize, zScale); + if (m_reservoirView->cellResult()->isTernarySaturationSelected()) + { + infoText += QString("Cell Property: %1 ").arg(propName); + } + if (m_reservoirView->animationMode() && m_reservoirView->cellResult()->hasResult()) { infoText += QString("Cell Property: %1 ").arg(propName); @@ -196,7 +201,8 @@ void Rim3dOverlayInfoConfig::update3DInfo() if ( m_reservoirView->cellResult()->hasDynamicResult() || m_reservoirView->propertyFilterCollection()->hasActiveDynamicFilters() - || m_reservoirView->wellCollection()->hasVisibleWellPipes()) + || m_reservoirView->wellCollection()->hasVisibleWellPipes() + || m_reservoirView->cellResult()->isTernarySaturationSelected()) { int currentTimeStep = m_reservoirView->currentTimeStep(); QDateTime date = m_reservoirView->currentGridCellResults()->cellResults()->timeStepDate(0, currentTimeStep); diff --git a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp index 84a1af1275..9b77ad9d8e 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp @@ -1107,7 +1107,38 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex, RigCaseData* eclipseCase = m_reservoir->reservoirData(); RigGridBase* grid = eclipseCase->grid(gridIndex); - if (this->cellResult()->hasResult()) + RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult()->porosityModel()); + cvf::ref dataAccessObject; + + if (this->cellResult()->isTernarySaturationSelected()) + { + RimReservoirCellResultsStorage* gridCellResults = this->cellResult()->currentGridCellResults(); + if (gridCellResults) + { + size_t soilScalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SOIL"); + size_t sgasScalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SGAS"); + size_t swatScalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SWAT"); + + cvf::ref dataAccessObjectX = eclipseCase->dataAccessObject(grid, porosityModel, 0, soilScalarSetIndex); + cvf::ref dataAccessObjectY = eclipseCase->dataAccessObject(grid, porosityModel, 0, sgasScalarSetIndex); + cvf::ref dataAccessObjectZ = eclipseCase->dataAccessObject(grid, porosityModel, 0, swatScalarSetIndex); + + double scalarValue = 0.0; + + if (dataAccessObjectX.notNull()) scalarValue = dataAccessObjectX->cellScalar(cellIndex); + else scalarValue = 0.0; + resultInfoText->append(QString("SOIL : %1\n").arg(scalarValue)); + + if (dataAccessObjectY.notNull()) scalarValue = dataAccessObjectY->cellScalar(cellIndex); + else scalarValue = 0.0; + resultInfoText->append(QString("SGAS : %1\n").arg(scalarValue)); + + if (dataAccessObjectZ.notNull()) scalarValue = dataAccessObjectZ->cellScalar(cellIndex); + else scalarValue = 0.0; + resultInfoText->append(QString("SWAT : %1\n").arg(scalarValue)); + } + } + else if (this->cellResult()->hasResult()) { RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult()->porosityModel()); cvf::ref dataAccessObject;