mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7380 Correlation Plot : Use complete summary address text when possible
This commit is contained in:
@@ -227,7 +227,7 @@ void RiaSummaryCurveDefinitionAnalyser::setCurveDefinitions( const std::vector<R
|
||||
m_singleSummaryCases.clear();
|
||||
m_ensembles.clear();
|
||||
m_quantityNames.clear();
|
||||
m_summaryItems.clear();
|
||||
m_summaryAdresses.clear();
|
||||
|
||||
for ( const auto& curveDef : curveDefs )
|
||||
{
|
||||
@@ -247,14 +247,13 @@ void RiaSummaryCurveDefinitionAnalyser::setCurveDefinitions( const std::vector<R
|
||||
}
|
||||
valid = true;
|
||||
}
|
||||
|
||||
if ( valid )
|
||||
{
|
||||
RifEclipseSummaryAddress address = curveDef.summaryAddress();
|
||||
const RifEclipseSummaryAddress& address = curveDef.summaryAddress();
|
||||
|
||||
m_quantityNames.insert( address.quantityName() );
|
||||
|
||||
address.setQuantityName( "" );
|
||||
if ( !address.itemUiText().empty() ) m_summaryItems.insert( address );
|
||||
m_summaryAdresses.insert( address );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -74,6 +74,6 @@ public:
|
||||
std::set<RimSummaryCase*> m_singleSummaryCases; // All summary cases used
|
||||
std::set<RimSummaryCaseCollection*> m_ensembles; // All the ensembles referenced by the summary cases
|
||||
|
||||
std::set<RifEclipseSummaryAddress> m_summaryItems; // Quantity name set to "", stores only the identifiers
|
||||
std::set<RifEclipseSummaryAddress> m_summaryAdresses;
|
||||
std::set<std::string> m_quantityNames; // Quantity names from the addresses
|
||||
};
|
||||
|
@@ -664,7 +664,7 @@ QList<caf::PdmOptionItemInfo> RimAnalysisPlot::calculateValueOptions( const caf:
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( SortGroupAppEnum::uiText( NONE ), NONE ) );
|
||||
QStringList currentSummaryItems;
|
||||
for ( auto summaryAddr : getOrCreateSelectedCurveDefAnalyser()->m_summaryItems )
|
||||
for ( auto summaryAddr : getOrCreateSelectedCurveDefAnalyser()->m_summaryAdresses )
|
||||
{
|
||||
currentSummaryItems.push_back( QString::fromStdString( summaryAddr.itemUiText() ) );
|
||||
}
|
||||
@@ -1620,11 +1620,11 @@ void RimAnalysisPlot::updatePlotTitle()
|
||||
}
|
||||
}
|
||||
|
||||
if ( getOrCreateSelectedCurveDefAnalyser()->m_summaryItems.size() == 1 )
|
||||
if ( getOrCreateSelectedCurveDefAnalyser()->m_summaryAdresses.size() == 1 )
|
||||
{
|
||||
if ( !autoTitle.isEmpty() ) autoTitle += separator;
|
||||
autoTitle +=
|
||||
QString::fromStdString( getOrCreateSelectedCurveDefAnalyser()->m_summaryItems.begin()->itemUiText() );
|
||||
QString::fromStdString( getOrCreateSelectedCurveDefAnalyser()->m_summaryAdresses.begin()->itemUiText() );
|
||||
}
|
||||
|
||||
for ( std::string quantName : getOrCreateSelectedCurveDefAnalyser()->m_quantityNames )
|
||||
|
@@ -555,7 +555,7 @@ time_t RimAbstractCorrelationPlot::timeDiff( time_t lhs, time_t rhs )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimAbstractCorrelationPlot::selectedVarsText()
|
||||
QString RimAbstractCorrelationPlot::selectedQuantitiesText()
|
||||
{
|
||||
QString vectorNames;
|
||||
for ( const std::string& quantityName : getOrCreateSelectedCurveDefAnalyser()->m_quantityNames )
|
||||
@@ -571,6 +571,25 @@ QString RimAbstractCorrelationPlot::selectedVarsText()
|
||||
return vectorNames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimAbstractCorrelationPlot::completeAddressText()
|
||||
{
|
||||
QString vectorName;
|
||||
if ( getOrCreateSelectedCurveDefAnalyser()->m_summaryAdresses.size() == 1 )
|
||||
{
|
||||
auto firstItem = getOrCreateSelectedCurveDefAnalyser()->m_summaryAdresses.begin();
|
||||
vectorName = QString::fromStdString( firstItem->uiText() );
|
||||
}
|
||||
else
|
||||
{
|
||||
vectorName = m_selectedVarsUiField;
|
||||
}
|
||||
|
||||
return vectorName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -77,8 +77,6 @@ protected:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
|
||||
RiaSummaryCurveDefinitionAnalyser* getOrCreateSelectedCurveDefAnalyser();
|
||||
|
||||
std::set<RifEclipseSummaryAddress> addresses();
|
||||
std::set<EnsembleParameter> ensembleParameters();
|
||||
std::set<EnsembleParameter> variationSortedEnsembleParameters();
|
||||
@@ -112,7 +110,8 @@ protected:
|
||||
|
||||
static time_t timeDiff( time_t lhs, time_t rhs );
|
||||
|
||||
QString selectedVarsText();
|
||||
QString selectedQuantitiesText();
|
||||
QString completeAddressText();
|
||||
|
||||
void initAfterRead() final;
|
||||
|
||||
@@ -140,4 +139,7 @@ protected:
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_labelFontSize;
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_axisTitleFontSize;
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_axisValueFontSize;
|
||||
|
||||
private:
|
||||
RiaSummaryCurveDefinitionAnalyser* getOrCreateSelectedCurveDefAnalyser();
|
||||
};
|
||||
|
@@ -315,7 +315,7 @@ void RimCorrelationMatrixPlot::defineUiOrdering( QString uiConfigName, caf::PdmU
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector" );
|
||||
m_selectedVarsUiField = selectedVarsText();
|
||||
m_selectedVarsUiField = selectedQuantitiesText();
|
||||
|
||||
curveDataGroup->add( &m_selectedVarsUiField );
|
||||
curveDataGroup->add( &m_pushButtonSelectSummaryAddress, { false, 1, 0 } );
|
||||
@@ -371,7 +371,7 @@ void RimCorrelationMatrixPlot::onLoadDataAndUpdate()
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
|
||||
m_selectedVarsUiField = selectedVarsText();
|
||||
m_selectedVarsUiField = selectedQuantitiesText();
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
|
@@ -181,7 +181,7 @@ void RimCorrelationPlot::onLoadDataAndUpdate()
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
|
||||
m_selectedVarsUiField = selectedVarsText();
|
||||
m_selectedVarsUiField = selectedQuantitiesText();
|
||||
|
||||
if ( m_plotWidget && m_analyserOfSelectedCurveDefs )
|
||||
{
|
||||
@@ -267,9 +267,11 @@ void RimCorrelationPlot::updatePlotTitle()
|
||||
{
|
||||
if ( m_useAutoPlotTitle && !ensembles().empty() )
|
||||
{
|
||||
QString vectorName = completeAddressText();
|
||||
|
||||
auto ensemble = *ensembles().begin();
|
||||
m_description =
|
||||
QString( "Correlations for %2, %3 at %4" ).arg( ensemble->name() ).arg( m_selectedVarsUiField ).arg( timeStepString() );
|
||||
QString( "Correlations for %2, %3 at %4" ).arg( ensemble->name() ).arg( vectorName ).arg( timeStepString() );
|
||||
}
|
||||
m_plotWidget->setPlotTitle( m_description );
|
||||
m_plotWidget->setPlotTitleEnabled( m_showPlotTitle && !isSubPlot() );
|
||||
|
@@ -115,7 +115,7 @@ void RimParameterResultCrossPlot::fieldChangedByUi( const caf::PdmFieldHandle* c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimParameterResultCrossPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
m_selectedVarsUiField = selectedVarsText();
|
||||
m_selectedVarsUiField = selectedQuantitiesText();
|
||||
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector" );
|
||||
curveDataGroup->add( &m_selectedVarsUiField );
|
||||
@@ -165,7 +165,7 @@ void RimParameterResultCrossPlot::onLoadDataAndUpdate()
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
|
||||
m_selectedVarsUiField = selectedVarsText();
|
||||
m_selectedVarsUiField = selectedQuantitiesText();
|
||||
|
||||
if ( m_plotWidget && m_analyserOfSelectedCurveDefs )
|
||||
{
|
||||
@@ -191,7 +191,7 @@ void RimParameterResultCrossPlot::updateAxes()
|
||||
{
|
||||
if ( !m_plotWidget ) return;
|
||||
|
||||
m_plotWidget->setAxisTitleText( QwtPlot::yLeft, m_selectedVarsUiField );
|
||||
m_plotWidget->setAxisTitleText( QwtPlot::yLeft, completeAddressText() );
|
||||
m_plotWidget->setAxisTitleEnabled( QwtPlot::yLeft, true );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::yLeft, axisTitleFontSize(), axisValueFontSize(), false, Qt::AlignCenter );
|
||||
|
||||
@@ -206,6 +206,9 @@ void RimParameterResultCrossPlot::updateAxes()
|
||||
m_plotWidget->setAxisRange( QwtPlot::xBottom, m_xRange.first - xRangeWidth * 0.1, m_xRange.second + xRangeWidth * 0.1 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList caseNamesOfValidEnsembleCases( const RimSummaryCaseCollection* ensemble )
|
||||
{
|
||||
QStringList caseNames;
|
||||
@@ -325,10 +328,13 @@ void RimParameterResultCrossPlot::updatePlotTitle()
|
||||
if ( m_useAutoPlotTitle && !ensembles().empty() )
|
||||
{
|
||||
auto ensemble = *ensembles().begin();
|
||||
|
||||
QString vectorName = completeAddressText();
|
||||
|
||||
m_description = QString( "Cross Plot %1, %2 x %3 at %4" )
|
||||
.arg( ensemble->name() )
|
||||
.arg( m_ensembleParameter )
|
||||
.arg( m_selectedVarsUiField )
|
||||
.arg( vectorName )
|
||||
.arg( timeStepString() );
|
||||
}
|
||||
m_plotWidget->setPlotTitle( m_description );
|
||||
|
Reference in New Issue
Block a user