Improve plot manager behavior

Create plots for vectors with no grouping identifier
Do not invalidate GUI on selection changed
Use same name as in project tree
This commit is contained in:
Magne Sjaastad 2022-05-22 11:27:51 +02:00
parent ccfc0e25bc
commit 26f1387bc6
5 changed files with 18 additions and 14 deletions

View File

@ -198,6 +198,8 @@ std::vector<std::vector<RifEclipseSummaryAddress>> RiaSummaryAddressAnalyzer::ad
groupedByObject.insert( groupedByObject.end(), blockAdr.begin(), blockAdr.end() );
groupedByObject.insert( groupedByObject.end(), aquiferAdr.begin(), aquiferAdr.end() );
groupedByObject.push_back( m_otherCategory );
return groupedByObject;
}
@ -418,6 +420,11 @@ void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAdd
{
m_aquifers.insert( { address.aquiferNumber(), address } );
}
else if ( address.category() == RifEclipseSummaryAddress::SUMMARY_FIELD ||
address.category() == RifEclipseSummaryAddress::SUMMARY_MISC )
{
m_otherCategory.push_back( address );
}
if ( address.category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
{

View File

@ -89,6 +89,7 @@ private:
mutable std::set<std::string> m_quantitiesWithMatchingHistory;
mutable std::set<std::string> m_quantitiesNoMatchingHistory;
std::vector<RifEclipseSummaryAddress> m_otherCategory;
std::multimap<std::string, RifEclipseSummaryAddress> m_wellNames;
std::multimap<std::string, RifEclipseSummaryAddress> m_groupNames;
std::multimap<int, RifEclipseSummaryAddress> m_regionNumbers;

View File

@ -153,7 +153,7 @@ void RimSummaryMultiPlotCollection::summaryPlotItemInfos( QList<caf::PdmOptionIt
{
for ( RimSummaryPlot* plot : multiPlot->summaryPlots() )
{
QString displayName = plot->description();
QString displayName = plot->userDescriptionField()->uiCapability()->uiValue().toString();
optionInfos->push_back(
caf::PdmOptionItemInfo( displayName, plot, false, plot->uiCapability()->uiIconProvider() ) );
}

View File

@ -215,6 +215,8 @@ public:
void handleDroppedObjects( const std::vector<caf::PdmObjectHandle*>& objects ) override;
caf::PdmFieldHandle* userDescriptionField() override;
private:
RiuPlotWidget* doCreatePlotViewWidget( QWidget* mainWindowParent = nullptr ) override;
@ -232,7 +234,6 @@ private:
RimPlotAxisProperties* addNewAxisProperties( RiuPlotAxis plotAxis, const QString& name );
protected:
caf::PdmFieldHandle* userDescriptionField() override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void childFieldChangedByUi( const caf::PdmFieldHandle* changedChildField ) override;
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,

View File

@ -50,6 +50,7 @@
#include "cafPdmUiLabelEditor.h"
#include "cafPdmUiLineEditor.h"
#include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiTextEditor.h"
#include "cafPdmUiTreeSelectionEditor.h"
#include "cafSelectionManager.h"
@ -76,6 +77,8 @@ RimSummaryPlotManager::RimSummaryPlotManager()
CAF_PDM_InitFieldNoDefault( &m_addressCandidates, "AddressCandidates", "Vectors" );
m_addressCandidates.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
m_addressCandidates.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_selectedDataSources, "SelectedDataSources", "Data Sources" );
m_selectedDataSources.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
m_selectedDataSources.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
@ -472,14 +475,6 @@ void RimSummaryPlotManager::updateUiFromSelection()
updateCurveCandidates();
}
if ( !summaryPlot )
{
m_summaryPlot = nullptr;
std::vector<QString> tmp;
m_addressCandidates = tmp;
}
updateConnectedEditors();
}