mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
Summary Plot adjustments
* #9435 Do not auto update curve appearance during source stepping * Update toolbar after vector is dropped into empty plot * Use summary vector text in RiaSummaryDefines * Fix missing update of curve color when curve is highlighted
This commit is contained in:
1 parent
8dfaae512f
commit
95813f510e
14 files changed
+386
-128
No files matched your search
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "RimCalculatedSummaryCase.h"
|
||||
|
||||
#include "RiaSummaryDefines.h"
|
||||
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
|
||||
@@ -31,7 +33,7 @@ RimCalculatedSummaryCase::RimCalculatedSummaryCase()
|
||||
CAF_PDM_InitObject( "Calculated", ":/SummaryCase.svg" );
|
||||
|
||||
m_calculatedCurveReader = nullptr;
|
||||
m_displayName = "Calculated";
|
||||
m_displayName = RiaDefines::summaryCalculated();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -46,7 +48,7 @@ RimCalculatedSummaryCase::~RimCalculatedSummaryCase()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimCalculatedSummaryCase::caseName() const
|
||||
{
|
||||
return "Calculated";
|
||||
return RiaDefines::summaryCalculated();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "RimSummaryAddress.h"
|
||||
|
||||
#include "RiaSummaryDefines.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
@@ -29,24 +31,26 @@ namespace caf
|
||||
template <>
|
||||
void caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>::setUp()
|
||||
{
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_FIELD, "SUMMARY_FIELD", "Field" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_AQUIFER, "SUMMARY_AQUIFER", "Aquifer" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_NETWORK, "SUMMARY_NETWORK", "Network" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_MISC, "SUMMARY_MISC", "Misc" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_REGION, "SUMMARY_REGION", "Region" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION, "SUMMARY_REGION_2_REGION", "Region-Region" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_GROUP, "SUMMARY_WELL_GROUP", "Group" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_WELL, "SUMMARY_WELL", "Well" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION, "SUMMARY_WELL_COMPLETION", "Completion" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION_LGR, "SUMMARY_WELL_COMPLETION_LGR", "Lgr-Completion" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_WELL_LGR, "SUMMARY_WELL_LGR", "Lgr-Well" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT, "SUMMARY_SEGMENT", "Segment" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_BLOCK, "SUMMARY_BLOCK", "Block" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_BLOCK_LGR, "SUMMARY_BLOCK_LGR", "Lgr-Block" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_CALCULATED, "SUMMARY_CALCULATED", "Calculated" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_IMPORTED, "SUMMARY_IMPORTED", "Imported" );
|
||||
addItem( RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS, "SUMMARY_ENSEMBLE_STATISTICS", "Ensemble Statistics" );
|
||||
setDefault( RifEclipseSummaryAddress::SUMMARY_FIELD );
|
||||
using RifAdr = RifEclipseSummaryAddress;
|
||||
|
||||
addItem( RifAdr::SUMMARY_FIELD, "SUMMARY_FIELD", RiaDefines::summaryField() );
|
||||
addItem( RifAdr::SUMMARY_AQUIFER, "SUMMARY_AQUIFER", RiaDefines::summaryAquifer() );
|
||||
addItem( RifAdr::SUMMARY_NETWORK, "SUMMARY_NETWORK", RiaDefines::summaryNetwork() );
|
||||
addItem( RifAdr::SUMMARY_MISC, "SUMMARY_MISC", RiaDefines::summaryMisc() );
|
||||
addItem( RifAdr::SUMMARY_REGION, "SUMMARY_REGION", RiaDefines::summaryRegion() );
|
||||
addItem( RifAdr::SUMMARY_REGION_2_REGION, "SUMMARY_REGION_2_REGION", RiaDefines::summaryRegion2Region() );
|
||||
addItem( RifAdr::SUMMARY_GROUP, "SUMMARY_WELL_GROUP", RiaDefines::summaryWellGroup() );
|
||||
addItem( RifAdr::SUMMARY_WELL, "SUMMARY_WELL", RiaDefines::summaryWell() );
|
||||
addItem( RifAdr::SUMMARY_WELL_COMPLETION, "SUMMARY_WELL_COMPLETION", RiaDefines::summaryCompletion() );
|
||||
addItem( RifAdr::SUMMARY_WELL_COMPLETION_LGR, "SUMMARY_WELL_COMPLETION_LGR", RiaDefines::summaryLgrCompletion() );
|
||||
addItem( RifAdr::SUMMARY_WELL_LGR, "SUMMARY_WELL_LGR", RiaDefines::summaryLgrWell() );
|
||||
addItem( RifAdr::SUMMARY_WELL_SEGMENT, "SUMMARY_SEGMENT", RiaDefines::summarySegment() );
|
||||
addItem( RifAdr::SUMMARY_BLOCK, "SUMMARY_BLOCK", RiaDefines::summaryBlock() );
|
||||
addItem( RifAdr::SUMMARY_BLOCK_LGR, "SUMMARY_BLOCK_LGR", RiaDefines::summaryLgrBlock() );
|
||||
addItem( RifAdr::SUMMARY_CALCULATED, "SUMMARY_CALCULATED", RiaDefines::summaryCalculated() );
|
||||
addItem( RifAdr::SUMMARY_IMPORTED, "SUMMARY_IMPORTED", "Imported" );
|
||||
addItem( RifAdr::SUMMARY_ENSEMBLE_STATISTICS, "SUMMARY_ENSEMBLE_STATISTICS", "Ensemble Statistics" );
|
||||
setDefault( RifAdr::SUMMARY_FIELD );
|
||||
}
|
||||
|
||||
} // namespace caf
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "RimSummaryAddressCollection.h"
|
||||
|
||||
#include "RiaSummaryDefines.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "RimSummaryAddress.h"
|
||||
@@ -27,26 +29,29 @@
|
||||
template <>
|
||||
void caf::AppEnum<RimSummaryAddressCollection::CollectionContentType>::setUp()
|
||||
{
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::NOT_DEFINED, "NOT_DEFINED", "Not Defined" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::FIELD, "FIELD", "Field" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::AQUIFER, "AQUIFER", "Aquifer" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::NETWORK, "NETWORK", "Network" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::MISC, "MISC", "Miscellaneous" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::REGION, "REGION", "Region" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::REGION_2_REGION, "REGION_2_REGION", "Region-Region" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::GROUP, "GROUP", "Group" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::WELL, "WELL", "Well" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::WELL_COMPLETION, "WELL_COMPLETION", "Completion" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::WELL_SEGMENT, "WELL_SEGMENT", "Segment" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::BLOCK, "BLOCK", "Block" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::WELL_LGR, "WELL_LGR", "Lgr-Well" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::WELL_COMPLETION_LGR,
|
||||
"WELL_COMPLETION_LGR",
|
||||
"Lgr Completion" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::BLOCK_LGR, "BLOCK_LGR", "Lgr-Block" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::CALCULATED, "CALCULATED", "Calculated" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::IMPORTED, "IMPORTED", "Imported" );
|
||||
setDefault( RimSummaryAddressCollection::CollectionContentType::NOT_DEFINED );
|
||||
using CollectionContentType = RimSummaryAddressCollection::CollectionContentType;
|
||||
addItem( CollectionContentType::NOT_DEFINED, "NOT_DEFINED", "Not Defined" );
|
||||
addItem( CollectionContentType::WELL, "WELL", RiaDefines::summaryWell() );
|
||||
addItem( CollectionContentType::GROUP, "GROUP", RiaDefines::summaryWellGroup() );
|
||||
addItem( CollectionContentType::REGION, "REGION", RiaDefines::summaryRegion() );
|
||||
addItem( CollectionContentType::FIELD, "FIELD", RiaDefines::summaryField() );
|
||||
addItem( CollectionContentType::MISC, "MISC", RiaDefines::summaryMisc() );
|
||||
addItem( CollectionContentType::WELL_FOLDER, "WELL_FOLDER", RiaDefines::summaryWell() );
|
||||
addItem( CollectionContentType::GROUP_FOLDER, "GROUP_FOLDER", RiaDefines::summaryWellGroup() );
|
||||
addItem( CollectionContentType::REGION_FOLDER, "REGION_FOLDER", RiaDefines::summaryRegion() );
|
||||
addItem( CollectionContentType::BLOCK, "BLOCK", RiaDefines::summaryBlock() );
|
||||
addItem( CollectionContentType::SUMMARY_CASE, "SUMMARY_CASE", "Summary Case" );
|
||||
addItem( CollectionContentType::AQUIFER, "AQUIFER", RiaDefines::summaryAquifer() );
|
||||
addItem( CollectionContentType::NETWORK, "NETWORK", RiaDefines::summaryNetwork() );
|
||||
addItem( CollectionContentType::REGION_2_REGION, "REGION_2_REGION", RiaDefines::summaryRegion2Region() );
|
||||
addItem( CollectionContentType::WELL_COMPLETION, "WELL_COMPLETION", RiaDefines::summaryCompletion() );
|
||||
addItem( CollectionContentType::WELL_LGR, "WELL_LGR", RiaDefines::summaryLgrWell() );
|
||||
addItem( CollectionContentType::WELL_COMPLETION_LGR, "WELL_COMPLETION_LGR", RiaDefines::summaryLgrCompletion() );
|
||||
addItem( CollectionContentType::WELL_SEGMENT, "WELL_SEGMENT", RiaDefines::summaryWellSegment() );
|
||||
addItem( CollectionContentType::BLOCK_LGR, "BLOCK_LGR", RiaDefines::summaryLgrBlock() );
|
||||
addItem( CollectionContentType::CALCULATED, "CALCULATED", RiaDefines::summaryCalculated() );
|
||||
addItem( CollectionContentType::IMPORTED, "IMPORTED", "Imported" );
|
||||
setDefault( CollectionContentType::NOT_DEFINED );
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimSummaryAddressCollection, "RimSummaryAddressCollection" );
|
||||
@@ -159,24 +164,24 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::set<RifEclip
|
||||
int caseId,
|
||||
int ensembleId )
|
||||
{
|
||||
if ( addresses.size() == 0 ) return;
|
||||
if ( addresses.empty() ) return;
|
||||
|
||||
auto* fields = getOrCreateSubfolder( "Field", CollectionContentType::FIELD );
|
||||
auto* aquifer = getOrCreateSubfolder( "Aquifer", CollectionContentType::AQUIFER );
|
||||
auto* network = getOrCreateSubfolder( "Network", CollectionContentType::NETWORK );
|
||||
auto* misc = getOrCreateSubfolder( "Miscellaneous", CollectionContentType::MISC );
|
||||
auto* regions = getOrCreateSubfolder( "Region", CollectionContentType::REGION_FOLDER );
|
||||
auto* region2region = getOrCreateSubfolder( "Region-Region", CollectionContentType::REGION_2_REGION );
|
||||
auto* groups = getOrCreateSubfolder( "Group", CollectionContentType::GROUP_FOLDER );
|
||||
auto* wells = getOrCreateSubfolder( "Well", CollectionContentType::WELL_FOLDER );
|
||||
auto* completion = getOrCreateSubfolder( "Completion", CollectionContentType::WELL_COMPLETION );
|
||||
auto* segment = getOrCreateSubfolder( "Segment", CollectionContentType::WELL_SEGMENT );
|
||||
auto* blocks = getOrCreateSubfolder( "Block", CollectionContentType::BLOCK );
|
||||
auto* lgrwell = getOrCreateSubfolder( "Lgr-Well", CollectionContentType::WELL_LGR );
|
||||
auto* lgrcompletion = getOrCreateSubfolder( "Lgr-Completion", CollectionContentType::WELL_COMPLETION_LGR );
|
||||
auto* lgrblock = getOrCreateSubfolder( "Lgr-Block", CollectionContentType::BLOCK_LGR );
|
||||
auto* calculated = getOrCreateSubfolder( "Calculated", CollectionContentType::CALCULATED );
|
||||
auto* imported = getOrCreateSubfolder( "Imported", CollectionContentType::IMPORTED );
|
||||
auto* fields = getOrCreateSubfolder( CollectionContentType::FIELD );
|
||||
auto* aquifer = getOrCreateSubfolder( CollectionContentType::AQUIFER );
|
||||
auto* network = getOrCreateSubfolder( CollectionContentType::NETWORK );
|
||||
auto* misc = getOrCreateSubfolder( CollectionContentType::MISC );
|
||||
auto* regions = getOrCreateSubfolder( CollectionContentType::REGION_FOLDER );
|
||||
auto* region2region = getOrCreateSubfolder( CollectionContentType::REGION_2_REGION );
|
||||
auto* groups = getOrCreateSubfolder( CollectionContentType::GROUP_FOLDER );
|
||||
auto* wells = getOrCreateSubfolder( CollectionContentType::WELL_FOLDER );
|
||||
auto* completion = getOrCreateSubfolder( CollectionContentType::WELL_COMPLETION );
|
||||
auto* segment = getOrCreateSubfolder( CollectionContentType::WELL_SEGMENT );
|
||||
auto* blocks = getOrCreateSubfolder( CollectionContentType::BLOCK );
|
||||
auto* lgrwell = getOrCreateSubfolder( CollectionContentType::WELL_LGR );
|
||||
auto* lgrcompletion = getOrCreateSubfolder( CollectionContentType::WELL_COMPLETION_LGR );
|
||||
auto* lgrblock = getOrCreateSubfolder( CollectionContentType::BLOCK_LGR );
|
||||
auto* calculated = getOrCreateSubfolder( CollectionContentType::CALCULATED );
|
||||
auto* imported = getOrCreateSubfolder( CollectionContentType::IMPORTED );
|
||||
|
||||
for ( const auto& address : addresses )
|
||||
{
|
||||
@@ -324,13 +329,23 @@ RimSummaryAddressCollection* RimSummaryAddressCollection::getOrCreateSubfolder(
|
||||
}
|
||||
}
|
||||
|
||||
RimSummaryAddressCollection* newFolder = new RimSummaryAddressCollection();
|
||||
auto* newFolder = new RimSummaryAddressCollection();
|
||||
newFolder->setName( folderName );
|
||||
newFolder->setContentType( createFolderType );
|
||||
m_subfolders.push_back( newFolder );
|
||||
return newFolder;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryAddressCollection* RimSummaryAddressCollection::getOrCreateSubfolder( CollectionContentType createFolderType )
|
||||
{
|
||||
auto name = caf::AppEnum<CollectionContentType>::uiText( createFolderType );
|
||||
|
||||
return getOrCreateSubfolder( name, createFolderType );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -345,7 +360,7 @@ void RimSummaryAddressCollection::deleteChildren()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryAddressCollection::isEmpty() const
|
||||
{
|
||||
return ( ( m_adresses.size() == 0 ) && ( m_subfolders.size() == 0 ) );
|
||||
return ( ( m_adresses.empty() ) && ( m_subfolders.empty() ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -353,7 +368,7 @@ bool RimSummaryAddressCollection::isEmpty() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryAddressCollection::canBeDragged() const
|
||||
{
|
||||
bool ok = m_subfolders.size() == 0;
|
||||
bool ok = m_subfolders.empty();
|
||||
|
||||
ok = ok && ( m_contentType == CollectionContentType::WELL || m_contentType == CollectionContentType::GROUP ||
|
||||
m_contentType == CollectionContentType::REGION );
|
||||
|
||||
@@ -89,6 +89,8 @@ private:
|
||||
getOrCreateSubfolder( const QString folderName,
|
||||
CollectionContentType createFolderType = CollectionContentType::NOT_DEFINED );
|
||||
|
||||
RimSummaryAddressCollection* getOrCreateSubfolder( CollectionContentType createFolderType );
|
||||
|
||||
bool hasDataVector( const QString quantityName ) const;
|
||||
bool hasDataVector( const std::string quantityName ) const;
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "RimSummaryDataSourceStepping.h"
|
||||
|
||||
#include "RiaSummaryDefines.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
namespace caf
|
||||
@@ -26,13 +28,13 @@ template <>
|
||||
void AppEnum<RimSummaryDataSourceStepping::SourceSteppingDimension>::setUp()
|
||||
{
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR, "VECTOR", "Vector" );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::WELL, "WELL", "Well" );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::WELL, "WELL", RiaDefines::summaryWell() );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::SUMMARY_CASE, "SUMMARY_CASE", "Summary Case" );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::ENSEMBLE, "ENSEMBLE", "Ensemble" );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::GROUP, "GROUP", "Group" );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::REGION, "REGION", "Region" );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK, "BLOCK", "Block" );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER, "AQUIFER", "Aquifer" );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::GROUP, "GROUP", RiaDefines::summaryWellGroup() );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::REGION, "REGION", RiaDefines::summaryRegion() );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK, "BLOCK", RiaDefines::summaryBlock() );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER, "AQUIFER", RiaDefines::summaryAquifer() );
|
||||
setDefault( RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR );
|
||||
}
|
||||
} // namespace caf
|
||||
@@ -93,6 +93,8 @@ RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
|
||||
CAF_PDM_InitField( &m_indexLabel, "IndexLabel", QString( "Step By" ), "Step By" );
|
||||
m_indexLabel.uiCapability()->setUiEditorTypeName( caf::PdmUiLabelEditor::uiEditorTypeName() );
|
||||
m_indexLabel.xmlCapability()->disableIO();
|
||||
|
||||
CAF_PDM_InitField( &m_autoUpdateAppearance, "AutoUpdateAppearance", false, "Update Appearance" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -157,6 +159,8 @@ void RimSummaryPlotSourceStepping::defineUiOrdering( QString uiConfigName, caf::
|
||||
uiOrdering.add( f );
|
||||
}
|
||||
|
||||
uiOrdering.add( &m_autoUpdateAppearance );
|
||||
|
||||
uiOrdering.skipRemainingFields();
|
||||
}
|
||||
|
||||
@@ -166,18 +170,14 @@ void RimSummaryPlotSourceStepping::defineUiOrdering( QString uiConfigName, caf::
|
||||
QList<caf::PdmOptionItemInfo>
|
||||
RimSummaryPlotSourceStepping::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
|
||||
{
|
||||
if ( ( fieldNeedingOptions == &m_placeholderForLabel ) || ( fieldNeedingOptions == &m_indexLabel ) ||
|
||||
( fieldNeedingOptions == &m_autoUpdateAppearance ) ||
|
||||
( fieldNeedingOptions == &m_includeEnsembleCasesForCaseStepping ) || ( fieldNeedingOptions == &m_stepDimension ) )
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if ( ( fieldNeedingOptions == &m_includeEnsembleCasesForCaseStepping ) || ( fieldNeedingOptions == &m_stepDimension ) )
|
||||
{
|
||||
return caf::PdmObject::calculateValueOptions( fieldNeedingOptions );
|
||||
}
|
||||
|
||||
if ( ( fieldNeedingOptions == &m_placeholderForLabel ) || ( fieldNeedingOptions == &m_indexLabel ) )
|
||||
{
|
||||
return options;
|
||||
}
|
||||
|
||||
if ( fieldNeedingOptions == &m_summaryCase )
|
||||
{
|
||||
auto summaryCases = RimSummaryPlotSourceStepping::summaryCasesForSourceStepping();
|
||||
@@ -376,7 +376,11 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
if ( previousCase == curve->summaryCaseY() )
|
||||
{
|
||||
curve->setSummaryCaseY( m_summaryCase );
|
||||
curve->setCurveAppearanceFromCaseType();
|
||||
|
||||
if ( m_autoUpdateAppearance )
|
||||
{
|
||||
curve->setCurveAppearanceFromCaseType();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,24 +426,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
}
|
||||
else if ( changedField == &m_vectorName )
|
||||
{
|
||||
for ( auto curve : curves )
|
||||
{
|
||||
if ( isYAxisStepping() )
|
||||
{
|
||||
auto adr = curve->summaryAddressY();
|
||||
if ( RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, &adr ) )
|
||||
curve->setSummaryAddressY( adr );
|
||||
}
|
||||
|
||||
if ( isXAxisStepping() )
|
||||
{
|
||||
auto adr = curve->summaryAddressX();
|
||||
if ( RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, &adr ) )
|
||||
curve->setSummaryAddressX( adr );
|
||||
}
|
||||
|
||||
curve->setDefaultCurveAppearance();
|
||||
}
|
||||
updateVectorNameInCurves( curves, oldValue, newValue );
|
||||
|
||||
if ( dataSourceSteppingObject() )
|
||||
{
|
||||
@@ -450,6 +437,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
curveSet->setSummaryAddress( adr );
|
||||
}
|
||||
}
|
||||
|
||||
m_vectorName.uiCapability()->updateConnectedEditors();
|
||||
triggerLoadDataAndUpdate = true;
|
||||
isAutoZoomAllowed = true;
|
||||
@@ -952,7 +940,7 @@ void RimSummaryPlotSourceStepping::defineEditorAttribute( const caf::PdmFieldHan
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
caf::PdmUiComboBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
|
||||
auto* myAttr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
|
||||
if ( myAttr )
|
||||
{
|
||||
if ( field == &m_stepDimension )
|
||||
@@ -1283,6 +1271,61 @@ std::map<QString, QString> RimSummaryPlotSourceStepping::optionsForQuantity( Ria
|
||||
return displayAndValueStrings;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::updateVectorNameInCurves( std::vector<RimSummaryCurve*>& curves,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
std::map<RimSummaryPlot*, std::vector<RimSummaryCurve*>> curvesInPlot;
|
||||
for ( auto curve : curves )
|
||||
{
|
||||
if ( isYAxisStepping() )
|
||||
{
|
||||
auto adr = curve->summaryAddressY();
|
||||
if ( RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, &adr ) )
|
||||
curve->setSummaryAddressY( adr );
|
||||
}
|
||||
|
||||
if ( isXAxisStepping() )
|
||||
{
|
||||
auto adr = curve->summaryAddressX();
|
||||
if ( RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, &adr ) )
|
||||
curve->setSummaryAddressX( adr );
|
||||
}
|
||||
|
||||
if ( m_autoUpdateAppearance )
|
||||
{
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
curve->firstAncestorOfType( summaryPlot );
|
||||
if ( summaryPlot )
|
||||
{
|
||||
if ( curvesInPlot.count( summaryPlot ) )
|
||||
{
|
||||
curvesInPlot[summaryPlot].push_back( curve );
|
||||
}
|
||||
else
|
||||
{
|
||||
curvesInPlot[summaryPlot] = { curve };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_autoUpdateAppearance )
|
||||
{
|
||||
// Apply the curve appearance for all curves in one go. If appearance of each curve was updated as part of the
|
||||
// loop, the appearance of curves was based on a mix of old and new curves causing a mix of different curve
|
||||
// styles
|
||||
|
||||
for ( const auto& [plot, curves] : curvesInPlot )
|
||||
{
|
||||
plot->applyDefaultCurveAppearances( curves );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -106,6 +106,8 @@ private:
|
||||
std::map<QString, QString> optionsForQuantity( std::set<RifEclipseSummaryAddress> addresses );
|
||||
std::map<QString, QString> optionsForQuantity( RiaSummaryAddressAnalyzer* analyzser );
|
||||
|
||||
void updateVectorNameInCurves( std::vector<RimSummaryCurve*>& curves, const QVariant& oldValue, const QVariant& newValue );
|
||||
|
||||
private:
|
||||
caf::PdmPointer<caf::PdmObject> m_objectForSourceStepping;
|
||||
|
||||
@@ -129,6 +131,7 @@ private:
|
||||
caf::PdmField<int> m_aquifer;
|
||||
|
||||
caf::PdmField<bool> m_includeEnsembleCasesForCaseStepping;
|
||||
caf::PdmField<bool> m_autoUpdateAppearance;
|
||||
|
||||
RimSummaryDataSourceStepping::Axis m_sourceSteppingType;
|
||||
std::vector<QString> m_cachedIdentifiers;
|
||||
|
||||
Reference in new issue
Block a user