#4206 Set new defaults for grid cross plot

This commit is contained in:
Gaute Lindkvist 2019-03-19 09:07:04 +01:00
parent f09f487635
commit 155dba5591
5 changed files with 45 additions and 6 deletions

View File

@ -606,6 +606,14 @@ bool RimGridCrossPlot::isYAxisLogarithmic() const
return m_yAxisProperties->isLogarithmicScaleEnabled();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlot::setYAxisInverted(bool inverted)
{
m_yAxisProperties->setAxisInverted(inverted);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -76,7 +76,7 @@ public:
RiuGridCrossQwtPlot* qwtPlot() const;
bool isXAxisLogarithmic() const;
bool isYAxisLogarithmic() const;
void setYAxisInverted(bool inverted);
public:
// Rim2dPlotInterface overrides
void updateAxisScaling() override;

View File

@ -122,7 +122,29 @@ RimGridCrossPlotCurveSet::RimGridCrossPlotCurveSet()
void RimGridCrossPlotCurveSet::setCellFilterView(RimGridView* cellFilterView)
{
m_cellFilterView = cellFilterView;
m_groupingProperty->setReservoirView(dynamic_cast<RimEclipseView*>(m_cellFilterView()));
auto eclipseView = dynamic_cast<RimEclipseView*>(m_cellFilterView());
if (eclipseView)
{
m_groupingProperty->setReservoirView(eclipseView);
RigEclipseResultAddress resAddr = eclipseView->cellResult()->eclipseResultAddress();
if (resAddr.isValid())
{
m_xAxisProperty->setResultType(resAddr.m_resultCatType);
m_xAxisProperty->setResultVariable(resAddr.m_resultName);
m_yAxisProperty->setResultType(RiaDefines::STATIC_NATIVE);
m_yAxisProperty->setResultVariable("DEPTH");
m_timeStep = eclipseView->currentTimeStep();
m_grouping = NO_GROUPING;
RimGridCrossPlot* parentPlot = nullptr;
firstAncestorOrThisOfType(parentPlot);
if (parentPlot)
{
parentPlot->setYAxisInverted(true);
}
}
}
}
//--------------------------------------------------------------------------------------------------
@ -980,11 +1002,11 @@ void RimGridCrossPlotCurveSet::setDefaults()
m_yAxisProperty->setEclipseCase(eclipseCase);
m_groupingProperty->setEclipseCase(eclipseCase);
m_xAxisProperty->setResultType(RiaDefines::DYNAMIC_NATIVE);
m_xAxisProperty->setResultVariable("SOIL");
m_xAxisProperty->setResultType(RiaDefines::STATIC_NATIVE);
m_xAxisProperty->setResultVariable("PORO");
m_yAxisProperty->setResultType(RiaDefines::DYNAMIC_NATIVE);
m_yAxisProperty->setResultVariable("PRESSURE");
m_yAxisProperty->setResultType(RiaDefines::STATIC_NATIVE);
m_yAxisProperty->setResultVariable("PERMX");
}
}
}

View File

@ -302,6 +302,14 @@ bool RimPlotAxisProperties::isAxisInverted() const
return m_isAxisInverted();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotAxisProperties::setAxisInverted(bool inverted)
{
m_isAxisInverted = inverted;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -68,6 +68,7 @@ public:
bool isAutoZoom() const;
void setAutoZoom(bool enableAutoZoom);
bool isAxisInverted() const;
void setAxisInverted(bool inverted);
caf::PdmField<QString> customTitle;
caf::PdmField<int> titleFontSize;