mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2102 Statistics dialog. Refactoring
This commit is contained in:
@@ -62,6 +62,7 @@ RicGridStatisticsDialog::RicGridStatisticsDialog(QWidget* parent)
|
|||||||
|
|
||||||
// Define layout
|
// Define layout
|
||||||
QVBoxLayout* layout = new QVBoxLayout();
|
QVBoxLayout* layout = new QVBoxLayout();
|
||||||
|
layout->setSpacing(0);
|
||||||
layout->addWidget(m_label);
|
layout->addWidget(m_label);
|
||||||
layout->addWidget(m_textEdit);
|
layout->addWidget(m_textEdit);
|
||||||
layout->addWidget(m_historgramPlot);
|
layout->addWidget(m_historgramPlot);
|
||||||
@@ -94,8 +95,8 @@ void RicGridStatisticsDialog::setInfoText(RimEclipseView* eclipseView)
|
|||||||
if (eclipseView && overlayInfo)
|
if (eclipseView && overlayInfo)
|
||||||
{
|
{
|
||||||
QString text;
|
QString text;
|
||||||
text = overlayInfo->caseInfoText(eclipseView);
|
text = overlayInfo->caseInfoText();
|
||||||
text += overlayInfo->resultInfoText(overlayInfo->histogramData(eclipseView), eclipseView);
|
text += overlayInfo->resultInfoText(overlayInfo->histogramData());
|
||||||
m_textEdit->setText(text);
|
m_textEdit->setText(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,7 +120,7 @@ void RicGridStatisticsDialog::setHistogramData(RimEclipseView* eclipseView)
|
|||||||
aggr->setStyle(QwtPlotCurve::Steps);
|
aggr->setStyle(QwtPlotCurve::Steps);
|
||||||
aggr->setCurveAttribute(QwtPlotCurve::Inverted);
|
aggr->setCurveAttribute(QwtPlotCurve::Inverted);
|
||||||
|
|
||||||
Rim3dOverlayInfoConfig::HistogramData histogramData = overlayInfo->histogramData(eclipseView);
|
Rim3dOverlayInfoConfig::HistogramData histogramData = overlayInfo->histogramData();
|
||||||
|
|
||||||
QVector<QwtIntervalSample> histSamples;
|
QVector<QwtIntervalSample> histSamples;
|
||||||
QVector<QPointF> aggrSamples;
|
QVector<QPointF> aggrSamples;
|
||||||
|
|||||||
@@ -163,10 +163,13 @@ void Rim3dOverlayInfoConfig::setPosition(cvf::Vec2ui position)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
Rim3dOverlayInfoConfig::HistogramData Rim3dOverlayInfoConfig::histogramData(RimEclipseView* eclipseView)
|
Rim3dOverlayInfoConfig::HistogramData Rim3dOverlayInfoConfig::histogramData()
|
||||||
{
|
{
|
||||||
HistogramData histData;
|
HistogramData histData;
|
||||||
|
|
||||||
|
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
||||||
|
if (eclipseView)
|
||||||
|
{
|
||||||
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclipseView->cellResult()->hasResult();
|
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclipseView->cellResult()->hasResult();
|
||||||
|
|
||||||
if (isResultsInfoRelevant)
|
if (isResultsInfoRelevant)
|
||||||
@@ -269,17 +272,19 @@ Rim3dOverlayInfoConfig::HistogramData Rim3dOverlayInfoConfig::histogramData(RimE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return histData;
|
return histData;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString Rim3dOverlayInfoConfig::caseInfoText(RimEclipseView* eclipseView)
|
QString Rim3dOverlayInfoConfig::caseInfoText()
|
||||||
{
|
{
|
||||||
QString infoText;
|
QString infoText;
|
||||||
|
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
||||||
|
|
||||||
if (showCaseInfo())
|
if (eclipseView && showCaseInfo())
|
||||||
{
|
{
|
||||||
QString caseName;
|
QString caseName;
|
||||||
QString totCellCount;
|
QString totCellCount;
|
||||||
@@ -318,9 +323,13 @@ QString Rim3dOverlayInfoConfig::caseInfoText(RimEclipseView* eclipseView)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString Rim3dOverlayInfoConfig::resultInfoText(const HistogramData& histData, RimEclipseView* eclipseView)
|
QString Rim3dOverlayInfoConfig::resultInfoText(const HistogramData& histData)
|
||||||
{
|
{
|
||||||
QString infoText;
|
QString infoText;
|
||||||
|
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
||||||
|
|
||||||
|
if (eclipseView)
|
||||||
|
{
|
||||||
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclipseView->cellResult()->hasResult();
|
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclipseView->cellResult()->hasResult();
|
||||||
|
|
||||||
if (eclipseView->cellResult()->isTernarySaturationSelected())
|
if (eclipseView->cellResult()->isTernarySaturationSelected())
|
||||||
@@ -390,7 +399,7 @@ QString Rim3dOverlayInfoConfig::resultInfoText(const HistogramData& histData, Ri
|
|||||||
{
|
{
|
||||||
infoText += QString("<b>Mobile Volume Weighted Mean:</b> %1").arg(histData.weightedMean);
|
infoText += QString("<b>Mobile Volume Weighted Mean:</b> %1").arg(histData.weightedMean);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return infoText;
|
return infoText;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,19 +517,19 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
|||||||
|
|
||||||
if (showHistogram() || showResultInfo())
|
if (showHistogram() || showResultInfo())
|
||||||
{
|
{
|
||||||
histData = histogramData(eclipseView);
|
histData = histogramData();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString infoText;
|
QString infoText;
|
||||||
|
|
||||||
if (showCaseInfo())
|
if (showCaseInfo())
|
||||||
{
|
{
|
||||||
infoText = caseInfoText(eclipseView);
|
infoText = caseInfoText();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showResultInfo())
|
if (showResultInfo())
|
||||||
{
|
{
|
||||||
infoText += resultInfoText(histData, eclipseView);
|
infoText += resultInfoText(histData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!infoText.isEmpty())
|
if (!infoText.isEmpty())
|
||||||
|
|||||||
@@ -69,9 +69,9 @@ public:
|
|||||||
|
|
||||||
void setPosition(cvf::Vec2ui position);
|
void setPosition(cvf::Vec2ui position);
|
||||||
|
|
||||||
HistogramData histogramData(RimEclipseView* eclipseView);
|
HistogramData histogramData();
|
||||||
QString caseInfoText(RimEclipseView* eclipseView);
|
QString caseInfoText();
|
||||||
QString resultInfoText(const HistogramData& histData, RimEclipseView* eclipseView);
|
QString resultInfoText(const HistogramData& histData);
|
||||||
|
|
||||||
void showStatisticsInfoDialog();
|
void showStatisticsInfoDialog();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user