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
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
layout->setSpacing(0);
|
||||
layout->addWidget(m_label);
|
||||
layout->addWidget(m_textEdit);
|
||||
layout->addWidget(m_historgramPlot);
|
||||
@@ -94,8 +95,8 @@ void RicGridStatisticsDialog::setInfoText(RimEclipseView* eclipseView)
|
||||
if (eclipseView && overlayInfo)
|
||||
{
|
||||
QString text;
|
||||
text = overlayInfo->caseInfoText(eclipseView);
|
||||
text += overlayInfo->resultInfoText(overlayInfo->histogramData(eclipseView), eclipseView);
|
||||
text = overlayInfo->caseInfoText();
|
||||
text += overlayInfo->resultInfoText(overlayInfo->histogramData());
|
||||
m_textEdit->setText(text);
|
||||
}
|
||||
}
|
||||
@@ -119,7 +120,7 @@ void RicGridStatisticsDialog::setHistogramData(RimEclipseView* eclipseView)
|
||||
aggr->setStyle(QwtPlotCurve::Steps);
|
||||
aggr->setCurveAttribute(QwtPlotCurve::Inverted);
|
||||
|
||||
Rim3dOverlayInfoConfig::HistogramData histogramData = overlayInfo->histogramData(eclipseView);
|
||||
Rim3dOverlayInfoConfig::HistogramData histogramData = overlayInfo->histogramData();
|
||||
|
||||
QVector<QwtIntervalSample> histSamples;
|
||||
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;
|
||||
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
||||
if (eclipseView)
|
||||
{
|
||||
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclipseView->cellResult()->hasResult();
|
||||
|
||||
if (isResultsInfoRelevant)
|
||||
@@ -269,17 +272,19 @@ Rim3dOverlayInfoConfig::HistogramData Rim3dOverlayInfoConfig::histogramData(RimE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return histData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString Rim3dOverlayInfoConfig::caseInfoText(RimEclipseView* eclipseView)
|
||||
QString Rim3dOverlayInfoConfig::caseInfoText()
|
||||
{
|
||||
QString infoText;
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
||||
|
||||
if (showCaseInfo())
|
||||
if (eclipseView && showCaseInfo())
|
||||
{
|
||||
QString caseName;
|
||||
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;
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
||||
|
||||
if (eclipseView)
|
||||
{
|
||||
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclipseView->cellResult()->hasResult();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
return infoText;
|
||||
}
|
||||
|
||||
@@ -508,19 +517,19 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
|
||||
if (showHistogram() || showResultInfo())
|
||||
{
|
||||
histData = histogramData(eclipseView);
|
||||
histData = histogramData();
|
||||
}
|
||||
|
||||
QString infoText;
|
||||
|
||||
if (showCaseInfo())
|
||||
{
|
||||
infoText = caseInfoText(eclipseView);
|
||||
infoText = caseInfoText();
|
||||
}
|
||||
|
||||
if (showResultInfo())
|
||||
{
|
||||
infoText += resultInfoText(histData, eclipseView);
|
||||
infoText += resultInfoText(histData);
|
||||
}
|
||||
|
||||
if (!infoText.isEmpty())
|
||||
|
||||
@@ -69,9 +69,9 @@ public:
|
||||
|
||||
void setPosition(cvf::Vec2ui position);
|
||||
|
||||
HistogramData histogramData(RimEclipseView* eclipseView);
|
||||
QString caseInfoText(RimEclipseView* eclipseView);
|
||||
QString resultInfoText(const HistogramData& histData, RimEclipseView* eclipseView);
|
||||
HistogramData histogramData();
|
||||
QString caseInfoText();
|
||||
QString resultInfoText(const HistogramData& histData);
|
||||
|
||||
void showStatisticsInfoDialog();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user