#1054 Added sensible information to the Result Info window when picking Flow Diag results.

Also rolled out the use of resultVariableUiName() to places that should use it.
This commit is contained in:
Jacob Støren 2017-01-04 13:13:06 +01:00
parent 03cf09d90a
commit ebddaa31e6
11 changed files with 48 additions and 25 deletions

View File

@ -37,6 +37,7 @@
#include <QFileInfo>
#include <QMessageBox>
#include "cafUtils.h"
//--------------------------------------------------------------------------------------------------
///
@ -84,12 +85,13 @@ void RicSaveEclipseResultAsInputPropertyExec::redo()
projectFolder = m_cellColors->reservoirView()->eclipseCase()->locationOnDisc();
}
QString outputFileName = projectFolder + "/" + m_cellColors->resultVariable();
QString outputFileName = projectFolder + "/" + caf::Utils::makeValidFileBasename( m_cellColors->resultVariableUiName());
exportSettings.fileName = outputFileName;
}
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export Binary Eclipse Data to Text File", "");
if (propertyDialog.exec() == QDialog::Accepted)
{
size_t timeStep = m_cellColors->reservoirView()->currentTimeStep();

View File

@ -293,7 +293,7 @@ QString RicExportMultipleSnapshotsFeature::resultName(RimView* rimView)
{
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>(rimView);
return eclView->cellResult()->resultVariable();
return caf::Utils::makeValidFileBasename(eclView->cellResult()->resultVariableUiName());
}
else if (dynamic_cast<RimGeoMechView*>(rimView))
{

View File

@ -472,7 +472,13 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName,
/// Create and write a result vector with values for all cells.
/// undefinedValue is used for cells with no result
//--------------------------------------------------------------------------------------------------
bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileName, RigCaseData* eclipseCase, RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStep, const QString& resultName, const QString& eclipseKeyWord, const double undefinedValue)
bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileName,
RigCaseData* eclipseCase,
RifReaderInterface::PorosityModelResultType porosityModel,
size_t timeStep,
const QString& resultName,
const QString& eclipseKeyWord,
const double undefinedValue)
{
CVF_ASSERT(eclipseCase);

View File

@ -360,13 +360,13 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
if (eclipseView->cellResult()->isTernarySaturationSelected())
{
QString propName = eclipseView->cellResult()->resultVariable();
QString propName = eclipseView->cellResult()->resultVariableUiName();
infoText += QString("<b>Cell Property:</b> %1 ").arg(propName);
}
if (isResultsInfoRelevant)
{
QString propName = eclipseView->cellResult()->resultVariable();
QString propName = eclipseView->cellResult()->resultVariableUiName();
QString timeRangeText = m_statisticsTimeRange().uiText();
if ( eclipseView->cellResult()->resultType() == RimDefines::FLOW_DIAGNOSTICS )
{
@ -406,7 +406,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
}
infoText += QString("<b>Fault results: </b> %1<br>").arg(faultMapping);
infoText += QString("<b>Fault Property:</b> %1 <br>").arg(eclipseView->faultResultSettings()->customFaultResult()->resultVariable());
infoText += QString("<b>Fault Property:</b> %1 <br>").arg(eclipseView->faultResultSettings()->customFaultResult()->resultVariableUiName());
}
}

View File

@ -353,7 +353,7 @@ void RimEclipsePropertyFilter::computeResultValueRange()
//--------------------------------------------------------------------------------------------------
void RimEclipsePropertyFilter::updateFilterName()
{
QString newFiltername = resultDefinition->resultVariable();
QString newFiltername = resultDefinition->resultVariableUiName();
if (isCategorySelectionActive())
{

View File

@ -515,6 +515,19 @@ RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const
return RigFlowDiagResultAddress(m_resultVariable().toStdString(), selTracerNames);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimEclipseResultDefinition::resultVariableUiName()
{
if (resultType() == RimDefines::FLOW_DIAGNOSTICS)
{
return QString::fromStdString(flowDiagResAddress().uiText());
}
return m_resultVariable();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -59,6 +59,8 @@ public:
RimFlowDiagSolution* flowDiagSolution();
RigFlowDiagResultAddress flowDiagResAddress() const;
QString resultVariableUiName();
void loadResult();
size_t scalarResultIndex() const;
bool hasStaticResult() const;

View File

@ -1000,18 +1000,18 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel, R
{
double globalMin, globalMax;
double globalPosClosestToZero, globalNegClosestToZero;
RigFlowDiagResults* cellResultsData = resultColors->flowDiagSolution()->flowDiagResults();
RigFlowDiagResults* flowResultsData = resultColors->flowDiagSolution()->flowDiagResults();
RigFlowDiagResultAddress resAddr = resultColors->flowDiagResAddress();
cellResultsData->minMaxScalarValues(resAddr, m_currentTimeStep, &globalMin, &globalMax);
cellResultsData->posNegClosestToZero(resAddr, m_currentTimeStep, &globalPosClosestToZero, &globalNegClosestToZero);
flowResultsData->minMaxScalarValues(resAddr, m_currentTimeStep, &globalMin, &globalMax);
flowResultsData->posNegClosestToZero(resAddr, m_currentTimeStep, &globalPosClosestToZero, &globalNegClosestToZero);
double localMin, localMax;
double localPosClosestToZero, localNegClosestToZero;
if ( resultColors->hasDynamicResult() )
{
cellResultsData->minMaxScalarValues(resAddr, m_currentTimeStep, &localMin, &localMax);
cellResultsData->posNegClosestToZero(resAddr, m_currentTimeStep, &localPosClosestToZero, &localNegClosestToZero);
flowResultsData->minMaxScalarValues(resAddr, m_currentTimeStep, &localMin, &localMax);
flowResultsData->posNegClosestToZero(resAddr, m_currentTimeStep, &localPosClosestToZero, &localNegClosestToZero);
}
else
{
@ -1033,9 +1033,7 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel, R
resultColors->legendConfig()->setNamedCategories(resultColors->flowDiagSolution()->tracerNames());
}
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->legend());
resultColors->legendConfig()->setTitle(cvfqt::Utils::toString(legendLabel + QString::fromStdString( resultColors->flowDiagResAddress().uiText())));
}
}
else
{
double globalMin, globalMax;
@ -1077,10 +1075,10 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel, R
resultColors->legendConfig()->setNamedCategoriesInverse(fnVector);
}
}
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->legend());
resultColors->legendConfig()->setTitle(cvfqt::Utils::toString(legendLabel + resultColors->resultVariable()));
}
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->legend());
resultColors->legendConfig()->setTitle(cvfqt::Utils::toString(legendLabel + resultColors->resultVariableUiName()));
}

View File

@ -51,6 +51,7 @@
#include "cafPdmUiTreeOrdering.h"
#include <cmath>
#include "cafUtils.h"
//==================================================================================================
///
@ -570,7 +571,7 @@ QString RimWellLogExtractionCurve::wellLogChannelName() const
QString name;
if (eclipseCase)
{
name = m_eclipseResultDefinition->resultVariable();
name = caf::Utils::makeValidFileBasename( m_eclipseResultDefinition->resultVariableUiName());
}
else if (geoMechCase)
{

View File

@ -345,7 +345,7 @@ QString RiuResultTextBuilder::nncResultText()
const std::vector<double>* nncValues = nncData->connectionScalarResult(scalarResultIdx);
if (nncValues)
{
QString resultVar = m_reservoirView->currentFaultResultColors()->resultVariable();
QString resultVar = m_reservoirView->currentFaultResultColors()->resultVariableUiName();
double scalarValue = (*nncValues)[m_nncIndex];
text = QString("%1 : %2").arg(resultVar).arg(scalarValue);
@ -489,14 +489,14 @@ void RiuResultTextBuilder::appendTextFromResultColors(RigCaseData* eclipseCase,
}
else
{
resultAccessor = RigResultAccessorFactory::createFromResultIdx(eclipseCase, gridIndex, porosityModel, timeStepIndex, resultColors->scalarResultIndex());
resultAccessor = RigResultAccessorFactory::createFromResultDefinition(eclipseCase, gridIndex, timeStepIndex, resultColors);
}
if (resultAccessor.notNull())
{
double scalarValue = resultAccessor->cellScalar(cellIndex);
resultInfoText->append("Cell result : ");
resultInfoText->append(resultColors->resultVariable());
resultInfoText->append(resultColors->resultVariableUiName());
resultInfoText->append(QString(" : %1\n").arg(scalarValue));
}
}
@ -649,7 +649,6 @@ QString RiuResultTextBuilder::cellResultText(RimEclipseCellColors* resultColors)
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultColors->porosityModel());
QString resultVar = resultColors->resultVariable();
if (resultColors->isTernarySaturationSelected())
{
@ -687,10 +686,12 @@ QString RiuResultTextBuilder::cellResultText(RimEclipseCellColors* resultColors)
adjustedTimeStep = 0;
}
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, m_gridIndex, porosityModel, adjustedTimeStep, resultVar);
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createFromResultDefinition(eclipseCaseData, m_gridIndex, adjustedTimeStep, resultColors);
if (resultAccessor.notNull())
{
double scalarValue = resultAccessor->cellFaceScalar(m_cellIndex, m_face);
QString resultVar = resultColors->resultVariableUiName();
text = QString("%1 : %2").arg(resultVar).arg(scalarValue);
}
}

View File

@ -123,7 +123,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuEclipseSelec
QString curveName = eclipseView->eclipseCase()->caseUserDescription();
curveName += ", ";
curveName += eclipseView->cellResult()->resultVariable();
curveName += eclipseView->cellResult()->resultVariableUiName();
curveName += ", ";
curveName += QString("Grid index %1").arg(eclipseSelectionItem->m_gridIndex);
curveName += ", ";