mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6136 Info view : Add check for histogram vector values
This commit is contained in:
parent
c49e9ea1bc
commit
78689ae43d
@ -174,7 +174,7 @@ void RicGridStatisticsDialog::setHistogramData( RimGridView* view )
|
||||
|
||||
Rim3dOverlayInfoConfig::HistogramData histogramData = overlayInfo->histogramData();
|
||||
|
||||
if ( histogramData.isValid() )
|
||||
if ( histogramData.isHistogramVectorValid() )
|
||||
{
|
||||
QVector<QwtIntervalSample> histSamples;
|
||||
QVector<QPointF> aggrSamples;
|
||||
|
@ -199,9 +199,9 @@ Rim3dOverlayInfoConfig::HistogramData Rim3dOverlayInfoConfig::histogramData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool Rim3dOverlayInfoConfig::HistogramData::isValid() const
|
||||
bool Rim3dOverlayInfoConfig::HistogramData::isMinMaxValid() const
|
||||
{
|
||||
return histogram && histogram->size() > 0 && isValid( min ) && isValid( max );
|
||||
return isValid( min ) && isValid( max );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -212,6 +212,14 @@ bool Rim3dOverlayInfoConfig::HistogramData::isValid( double parameter ) const
|
||||
return parameter != HUGE_VAL && parameter != -HUGE_VAL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool Rim3dOverlayInfoConfig::HistogramData::isHistogramVectorValid() const
|
||||
{
|
||||
return histogram && histogram->size() > 0 && isMinMaxValid();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -708,7 +716,7 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const HistogramData& histData,
|
||||
{
|
||||
infoText += QString( "%1<br>" ).arg( diffResString );
|
||||
}
|
||||
if ( histData.isValid() )
|
||||
if ( histData.isMinMaxValid() )
|
||||
{
|
||||
infoText += QString( "<br><b>Statistics:</b> Current Time Step and Visible Cells" );
|
||||
infoText += QString( "<table border=0 cellspacing=5 >"
|
||||
@ -761,7 +769,7 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const HistogramData& histData,
|
||||
infoText += QString( "<b>Dual Porosity Type:</b> %1<br>" ).arg( porosityModelText );
|
||||
}
|
||||
|
||||
if ( histData.isValid() )
|
||||
if ( histData.isMinMaxValid() )
|
||||
{
|
||||
infoText += QString( "<br><b>Statistics:</b> " ) + timeRangeText + " and " +
|
||||
m_statisticsCellRange().uiText();
|
||||
@ -911,7 +919,7 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const HistogramData& histData, R
|
||||
infoText += QString( "%1<br>" ).arg( diffResString );
|
||||
}
|
||||
|
||||
if ( histData.isValid() )
|
||||
if ( histData.isMinMaxValid() )
|
||||
{
|
||||
infoText += QString( "<br><b>Statistics:</b> " ) + m_statisticsTimeRange().uiText() + " and " +
|
||||
m_statisticsCellRange().uiText();
|
||||
@ -931,7 +939,7 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const HistogramData& histData, R
|
||||
infoText += QString( "%1<br>" ).arg( diffResString );
|
||||
}
|
||||
|
||||
if ( histData.isValid() )
|
||||
if ( histData.isMinMaxValid() )
|
||||
{
|
||||
infoText += QString( "<br><b>Statistics:</b> " ) + m_statisticsTimeRange().uiText() + " and " +
|
||||
m_statisticsCellRange().uiText();
|
||||
@ -1149,7 +1157,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo( RimEclipseView* eclipseView )
|
||||
{
|
||||
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclipseView->cellResult()->hasResult();
|
||||
|
||||
if ( isResultsInfoRelevant && histData.histogram )
|
||||
if ( isResultsInfoRelevant && histData.isHistogramVectorValid() )
|
||||
{
|
||||
eclipseView->viewer()->showHistogram( true );
|
||||
eclipseView->viewer()->setHistogram( histData.min, histData.max, *histData.histogram );
|
||||
@ -1198,7 +1206,7 @@ void Rim3dOverlayInfoConfig::updateGeoMech3DInfo( RimGeoMechView* geoMechView )
|
||||
bool isResultsInfoRelevant = caseData && geoMechView->hasUserRequestedAnimation() &&
|
||||
geoMechView->cellResultResultDefinition()->hasResult();
|
||||
|
||||
if ( isResultsInfoRelevant )
|
||||
if ( isResultsInfoRelevant && histData.isHistogramVectorValid() )
|
||||
{
|
||||
geoMechView->viewer()->showHistogram( true );
|
||||
geoMechView->viewer()->setHistogram( histData.min, histData.max, *histData.histogram );
|
||||
|
@ -71,8 +71,11 @@ class Rim3dOverlayInfoConfig : public caf::PdmObject
|
||||
double weightedMean;
|
||||
const std::vector<size_t>* histogram;
|
||||
|
||||
bool isMinMaxValid() const;
|
||||
bool isHistogramVectorValid() const;
|
||||
|
||||
private:
|
||||
bool isValid( double parameter ) const;
|
||||
bool isValid() const;
|
||||
};
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user