mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Mainwindow datasources (#8883)
* Main Window: add three dock widgets for splitting project tree * Main Window: move scripts to separate tree widget * Add eclipse result addresses to data source project tree. * Grid Calculator: drag-and-drop for calculation variables. * Grid Calculator: rename to 'Grid Property Calculator'.
This commit is contained in:
committed by
GitHub
parent
65827f9c1c
commit
daf02571c2
@@ -21,7 +21,9 @@
|
||||
#include "RimEclipseCase.h"
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaFieldHandleTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
@@ -50,6 +52,8 @@
|
||||
#include "RimEclipseInputPropertyCollection.h"
|
||||
#include "RimEclipsePropertyFilter.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimEclipseResultAddress.h"
|
||||
#include "RimEclipseResultAddressCollection.h"
|
||||
#include "RimEclipseStatisticsCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFaultInViewCollection.h"
|
||||
@@ -119,6 +123,10 @@ RimEclipseCase::RimEclipseCase()
|
||||
m_inputPropertyCollection = new RimEclipseInputPropertyCollection;
|
||||
m_inputPropertyCollection->parentField()->uiCapability()->setUiTreeHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_resultAddressCollections, "ResultAddressCollections", "Result Addresses" );
|
||||
m_resultAddressCollections.uiCapability()->setUiHidden( true );
|
||||
m_resultAddressCollections.xmlCapability()->disableIO();
|
||||
|
||||
// Init
|
||||
|
||||
m_matrixModelResults = new RimReservoirCellResultsStorage;
|
||||
@@ -559,27 +567,63 @@ void RimEclipseCase::updateFormationNamesData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
||||
void RimEclipseCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName )
|
||||
{
|
||||
std::vector<PdmObjectHandle*> children;
|
||||
reservoirViews.childObjects( &children );
|
||||
|
||||
for ( auto child : children )
|
||||
uiTreeOrdering.add( child );
|
||||
|
||||
if ( !m_2dIntersectionViewCollection->views().empty() )
|
||||
if ( uiConfigName == "MainWindow.ProjectTree" )
|
||||
{
|
||||
uiTreeOrdering.add( &m_2dIntersectionViewCollection );
|
||||
std::vector<PdmObjectHandle*> children;
|
||||
reservoirViews.childObjects( &children );
|
||||
|
||||
for ( auto child : children )
|
||||
uiTreeOrdering.add( child );
|
||||
|
||||
if ( !m_2dIntersectionViewCollection->views().empty() )
|
||||
{
|
||||
uiTreeOrdering.add( &m_2dIntersectionViewCollection );
|
||||
}
|
||||
|
||||
if ( !m_contourMapCollection->views().empty() )
|
||||
{
|
||||
uiTreeOrdering.add( &m_contourMapCollection );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !m_contourMapCollection->views().empty() )
|
||||
else if ( uiConfigName == "MainWindow.DataSources" )
|
||||
{
|
||||
uiTreeOrdering.add( &m_contourMapCollection );
|
||||
if ( m_resultAddressCollections.empty() ) buildChildNodes();
|
||||
uiTreeOrdering.add( &m_resultAddressCollections );
|
||||
}
|
||||
|
||||
uiTreeOrdering.skipRemainingChildren( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCase::buildChildNodes()
|
||||
{
|
||||
m_resultAddressCollections.clear();
|
||||
|
||||
std::vector<RiaDefines::ResultCatType> resultTypes = { RiaDefines::ResultCatType::STATIC_NATIVE,
|
||||
RiaDefines::ResultCatType::DYNAMIC_NATIVE,
|
||||
RiaDefines::ResultCatType::INPUT_PROPERTY,
|
||||
RiaDefines::ResultCatType::GENERATED };
|
||||
for ( auto resultType : resultTypes )
|
||||
{
|
||||
auto resultAddressCollection = new RimEclipseResultAddressCollection;
|
||||
resultAddressCollection->setResultType( resultType );
|
||||
QString name = caf::AppEnum<RiaDefines::ResultCatType>::uiText( resultType );
|
||||
resultAddressCollection->setName( name );
|
||||
|
||||
QStringList resultNames = results( RiaDefines::PorosityModelType::MATRIX_MODEL )->resultNames( resultType );
|
||||
for ( auto resultName : resultNames )
|
||||
{
|
||||
resultAddressCollection->addAddress( resultName, resultType, this );
|
||||
}
|
||||
|
||||
m_resultAddressCollections.push_back( resultAddressCollection );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user