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:
parent
65827f9c1c
commit
daf02571c2
@ -28,7 +28,7 @@
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicGridCalculatorDialog::RicGridCalculatorDialog( QWidget* parent )
|
RicGridCalculatorDialog::RicGridCalculatorDialog( QWidget* parent )
|
||||||
: RicUserDefinedCalculatorDialog( parent, "Grid Calculator" )
|
: RicUserDefinedCalculatorDialog( parent, "Grid Property Calculator" )
|
||||||
{
|
{
|
||||||
setUp();
|
setUp();
|
||||||
}
|
}
|
||||||
|
@ -89,6 +89,6 @@ void RicShowGridCalculatorFeature::onActionTriggered( bool isChecked )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicShowGridCalculatorFeature::setupActionLook( QAction* actionToSetup )
|
void RicShowGridCalculatorFeature::setupActionLook( QAction* actionToSetup )
|
||||||
{
|
{
|
||||||
actionToSetup->setText( "Grid Calculator" );
|
actionToSetup->setText( "Grid Property Calculator" );
|
||||||
actionToSetup->setIcon( QIcon( ":/Calculator.svg" ) );
|
actionToSetup->setIcon( QIcon( ":/Calculator.svg" ) );
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ void RicUserDefinedCalculatorUi::defineUiOrdering( QString uiConfigName, caf::Pd
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
caf::PdmUiGroup* group = uiOrdering.addNewGroupWithKeyword( "Calculated Summaries", calculationsGroupName() );
|
caf::PdmUiGroup* group = uiOrdering.addNewGroupWithKeyword( "Calculations", calculationsGroupName() );
|
||||||
group->add( &m_currentCalculation );
|
group->add( &m_currentCalculation );
|
||||||
group->add( &m_newCalculation );
|
group->add( &m_newCalculation );
|
||||||
group->add( &m_deleteCalculation );
|
group->add( &m_deleteCalculation );
|
||||||
|
@ -124,6 +124,8 @@ set(SOURCE_GROUP_HEADER_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionBand.h
|
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionBand.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionCurve.h
|
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionCurve.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionCollection.h
|
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionCollection.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultAddress.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultAddressCollection.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SOURCE_GROUP_SOURCE_FILES
|
set(SOURCE_GROUP_SOURCE_FILES
|
||||||
@ -247,6 +249,8 @@ set(SOURCE_GROUP_SOURCE_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionBand.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionBand.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionCurve.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionCurve.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionCollection.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceIntersectionCollection.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultAddress.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultAddressCollection.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if(RESINSIGHT_USE_QT_CHARTS)
|
if(RESINSIGHT_USE_QT_CHARTS)
|
||||||
|
@ -21,7 +21,9 @@
|
|||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
|
|
||||||
#include "RiaColorTables.h"
|
#include "RiaColorTables.h"
|
||||||
|
#include "RiaDefines.h"
|
||||||
#include "RiaFieldHandleTools.h"
|
#include "RiaFieldHandleTools.h"
|
||||||
|
#include "RiaLogging.h"
|
||||||
#include "RiaPreferences.h"
|
#include "RiaPreferences.h"
|
||||||
#include "RiaQDateTimeTools.h"
|
#include "RiaQDateTimeTools.h"
|
||||||
|
|
||||||
@ -50,6 +52,8 @@
|
|||||||
#include "RimEclipseInputPropertyCollection.h"
|
#include "RimEclipseInputPropertyCollection.h"
|
||||||
#include "RimEclipsePropertyFilter.h"
|
#include "RimEclipsePropertyFilter.h"
|
||||||
#include "RimEclipsePropertyFilterCollection.h"
|
#include "RimEclipsePropertyFilterCollection.h"
|
||||||
|
#include "RimEclipseResultAddress.h"
|
||||||
|
#include "RimEclipseResultAddressCollection.h"
|
||||||
#include "RimEclipseStatisticsCase.h"
|
#include "RimEclipseStatisticsCase.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimFaultInViewCollection.h"
|
#include "RimFaultInViewCollection.h"
|
||||||
@ -119,6 +123,10 @@ RimEclipseCase::RimEclipseCase()
|
|||||||
m_inputPropertyCollection = new RimEclipseInputPropertyCollection;
|
m_inputPropertyCollection = new RimEclipseInputPropertyCollection;
|
||||||
m_inputPropertyCollection->parentField()->uiCapability()->setUiTreeHidden( true );
|
m_inputPropertyCollection->parentField()->uiCapability()->setUiTreeHidden( true );
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_resultAddressCollections, "ResultAddressCollections", "Result Addresses" );
|
||||||
|
m_resultAddressCollections.uiCapability()->setUiHidden( true );
|
||||||
|
m_resultAddressCollections.xmlCapability()->disableIO();
|
||||||
|
|
||||||
// Init
|
// Init
|
||||||
|
|
||||||
m_matrixModelResults = new RimReservoirCellResultsStorage;
|
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;
|
if ( uiConfigName == "MainWindow.ProjectTree" )
|
||||||
reservoirViews.childObjects( &children );
|
|
||||||
|
|
||||||
for ( auto child : children )
|
|
||||||
uiTreeOrdering.add( child );
|
|
||||||
|
|
||||||
if ( !m_2dIntersectionViewCollection->views().empty() )
|
|
||||||
{
|
{
|
||||||
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if ( uiConfigName == "MainWindow.DataSources" )
|
||||||
if ( !m_contourMapCollection->views().empty() )
|
|
||||||
{
|
{
|
||||||
uiTreeOrdering.add( &m_contourMapCollection );
|
if ( m_resultAddressCollections.empty() ) buildChildNodes();
|
||||||
|
uiTreeOrdering.add( &m_resultAddressCollections );
|
||||||
}
|
}
|
||||||
|
|
||||||
uiTreeOrdering.skipRemainingChildren( true );
|
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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -50,6 +50,7 @@ class RimEclipseInputPropertyCollection;
|
|||||||
class RimEclipseView;
|
class RimEclipseView;
|
||||||
class RimIdenticalGridCaseGroup;
|
class RimIdenticalGridCaseGroup;
|
||||||
class RimReservoirCellResultsStorage;
|
class RimReservoirCellResultsStorage;
|
||||||
|
class RimEclipseResultAddressCollection;
|
||||||
class RifReaderSettings;
|
class RifReaderSettings;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@ -139,6 +140,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void createTimeStepFormatString();
|
void createTimeStepFormatString();
|
||||||
std::vector<Rim3dView*> allSpecialViews() const override;
|
std::vector<Rim3dView*> allSpecialViews() const override;
|
||||||
|
void buildChildNodes();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmField<bool> m_flipXAxis;
|
caf::PdmField<bool> m_flipXAxis;
|
||||||
@ -156,6 +158,8 @@ private:
|
|||||||
QString m_timeStepFormatString;
|
QString m_timeStepFormatString;
|
||||||
std::map<QString, cvf::Color3f> m_wellToColorMap;
|
std::map<QString, cvf::Color3f> m_wellToColorMap;
|
||||||
|
|
||||||
|
caf::PdmChildArrayField<RimEclipseResultAddressCollection*> m_resultAddressCollections;
|
||||||
|
|
||||||
caf::PdmChildField<RimReservoirCellResultsStorage*> m_matrixModelResults;
|
caf::PdmChildField<RimReservoirCellResultsStorage*> m_matrixModelResults;
|
||||||
caf::PdmChildField<RimReservoirCellResultsStorage*> m_fractureModelResults;
|
caf::PdmChildField<RimReservoirCellResultsStorage*> m_fractureModelResults;
|
||||||
|
|
||||||
|
@ -0,0 +1,90 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2022 Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RimEclipseResultAddress.h"
|
||||||
|
|
||||||
|
#include "RimEclipseCase.h"
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT( RimEclipseResultAddress, "EclipseResultAddress" );
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimEclipseResultAddress::RimEclipseResultAddress()
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject( "EclipseResultAddress", ":/DataVector.png", "", "" );
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_resultName, "ResultName", "Result Name" );
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_resultType, "ResultType", "Type" );
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_eclipseCase, "EclipseCase", "Eclipse Case" );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimEclipseResultAddress::~RimEclipseResultAddress()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimEclipseResultAddress::resultName() const
|
||||||
|
{
|
||||||
|
return m_resultName;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseResultAddress::setResultName( const QString& resultName )
|
||||||
|
{
|
||||||
|
m_resultName = resultName;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseResultAddress::setResultType( RiaDefines::ResultCatType val )
|
||||||
|
{
|
||||||
|
m_resultType = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiaDefines::ResultCatType RimEclipseResultAddress::resultType() const
|
||||||
|
{
|
||||||
|
return m_resultType();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseResultAddress::setEclipseCase( RimEclipseCase* eclipseCase )
|
||||||
|
{
|
||||||
|
m_eclipseCase = eclipseCase;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimEclipseCase* RimEclipseResultAddress::eclipseCase() const
|
||||||
|
{
|
||||||
|
return m_eclipseCase;
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2022 Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafPdmField.h"
|
||||||
|
#include "cafPdmObject.h"
|
||||||
|
#include "cafPdmPtrField.h"
|
||||||
|
|
||||||
|
#include "RiaDefines.h"
|
||||||
|
|
||||||
|
class RimEclipseCase;
|
||||||
|
|
||||||
|
class RimEclipseResultAddress : public caf::PdmObject
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimEclipseResultAddress();
|
||||||
|
~RimEclipseResultAddress() override;
|
||||||
|
|
||||||
|
void setResultName( const QString& resultName );
|
||||||
|
QString resultName() const;
|
||||||
|
|
||||||
|
void setResultType( RiaDefines::ResultCatType val );
|
||||||
|
RiaDefines::ResultCatType resultType() const;
|
||||||
|
|
||||||
|
void setEclipseCase( RimEclipseCase* eclipseCase );
|
||||||
|
RimEclipseCase* eclipseCase() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
caf::PdmField<QString> m_resultName;
|
||||||
|
caf::PdmField<caf::AppEnum<RiaDefines::ResultCatType>> m_resultType;
|
||||||
|
caf::PdmPtrField<RimEclipseCase*> m_eclipseCase;
|
||||||
|
};
|
@ -0,0 +1,87 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2022 Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RimEclipseResultAddressCollection.h"
|
||||||
|
|
||||||
|
#include "RimEclipseResultAddress.h"
|
||||||
|
|
||||||
|
#include "cafPdmUiTreeOrdering.h"
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT( RimEclipseResultAddressCollection, "RimEclipseResultAddressCollection" );
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimEclipseResultAddressCollection::RimEclipseResultAddressCollection()
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject( "Folder", ":/Folder.png", "", "" );
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_adresses, "Addresses", "Addresses" );
|
||||||
|
m_adresses.uiCapability()->setUiTreeHidden( true );
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_resultType, "ResultType", "Type" );
|
||||||
|
m_resultType.uiCapability()->setUiHidden( true );
|
||||||
|
|
||||||
|
nameField()->uiCapability()->setUiHidden( true );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimEclipseResultAddressCollection::~RimEclipseResultAddressCollection()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseResultAddressCollection::setResultType( RiaDefines::ResultCatType val )
|
||||||
|
{
|
||||||
|
m_resultType = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseResultAddressCollection::addAddress( const QString& resultName,
|
||||||
|
RiaDefines::ResultCatType resultType,
|
||||||
|
RimEclipseCase* eclipseCase )
|
||||||
|
{
|
||||||
|
auto addr = new RimEclipseResultAddress;
|
||||||
|
addr->setUiName( resultName );
|
||||||
|
addr->setResultName( resultName );
|
||||||
|
addr->setResultType( resultType );
|
||||||
|
addr->setEclipseCase( eclipseCase );
|
||||||
|
m_adresses.push_back( addr );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseResultAddressCollection::clear()
|
||||||
|
{
|
||||||
|
m_adresses.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimEclipseResultAddressCollection::isEmpty() const
|
||||||
|
{
|
||||||
|
return m_adresses.empty();
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2022 Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "RiaDefines.h"
|
||||||
|
#include "RimNamedObject.h"
|
||||||
|
|
||||||
|
#include "cafPdmChildArrayField.h"
|
||||||
|
#include "cafPdmPtrField.h"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class RimEclipseResultAddress;
|
||||||
|
class RimEclipseCase;
|
||||||
|
|
||||||
|
class RimEclipseResultAddressCollection : public RimNamedObject
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimEclipseResultAddressCollection();
|
||||||
|
~RimEclipseResultAddressCollection() override;
|
||||||
|
|
||||||
|
void setResultType( RiaDefines::ResultCatType val );
|
||||||
|
|
||||||
|
void addAddress( const QString& resultName, RiaDefines::ResultCatType resultType, RimEclipseCase* eclipseCase );
|
||||||
|
|
||||||
|
bool isEmpty() const;
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
private:
|
||||||
|
caf::PdmChildArrayField<RimEclipseResultAddress*> m_adresses;
|
||||||
|
caf::PdmField<caf::AppEnum<RiaDefines::ResultCatType>> m_resultType;
|
||||||
|
caf::PdmPtrField<RimEclipseCase*> m_eclipseCase;
|
||||||
|
};
|
@ -23,9 +23,12 @@
|
|||||||
#include "RiaPorosityModel.h"
|
#include "RiaPorosityModel.h"
|
||||||
#include "RiaResultNames.h"
|
#include "RiaResultNames.h"
|
||||||
|
|
||||||
|
#include "RiuDragDrop.h"
|
||||||
|
|
||||||
#include "RigCaseCellResultsData.h"
|
#include "RigCaseCellResultsData.h"
|
||||||
|
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
|
#include "RimEclipseResultAddress.h"
|
||||||
#include "RimTools.h"
|
#include "RimTools.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RimGridCalculationVariable, "RimGridCalculationVariable" );
|
CAF_PDM_SOURCE_INIT( RimGridCalculationVariable, "RimGridCalculationVariable" );
|
||||||
@ -179,3 +182,29 @@ int RimGridCalculationVariable::allTimeStepsValue()
|
|||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGridCalculationVariable::handleDroppedMimeData( const QMimeData* data,
|
||||||
|
Qt::DropAction action,
|
||||||
|
caf::PdmFieldHandle* destinationField )
|
||||||
|
{
|
||||||
|
auto objects = RiuDragDrop::convertToObjects( data );
|
||||||
|
if ( !objects.empty() )
|
||||||
|
{
|
||||||
|
auto address = dynamic_cast<RimEclipseResultAddress*>( objects.front() );
|
||||||
|
if ( address ) setEclipseResultAddress( *address );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGridCalculationVariable::setEclipseResultAddress( const RimEclipseResultAddress& address )
|
||||||
|
{
|
||||||
|
m_resultVariable = address.resultName();
|
||||||
|
m_resultType = address.resultType();
|
||||||
|
m_eclipseCase = address.eclipseCase();
|
||||||
|
updateConnectedEditors();
|
||||||
|
}
|
||||||
|
@ -22,13 +22,12 @@
|
|||||||
|
|
||||||
#include "RiaDefines.h"
|
#include "RiaDefines.h"
|
||||||
|
|
||||||
#include "cafPdmChildField.h"
|
|
||||||
#include "cafPdmField.h"
|
#include "cafPdmField.h"
|
||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
#include "cafPdmProxyValueField.h"
|
|
||||||
#include "cafPdmPtrField.h"
|
#include "cafPdmPtrField.h"
|
||||||
|
|
||||||
class RimEclipseCase;
|
class RimEclipseCase;
|
||||||
|
class RimEclipseResultAddress;
|
||||||
class RigCaseCellResultsData;
|
class RigCaseCellResultsData;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@ -51,6 +50,10 @@ public:
|
|||||||
|
|
||||||
static int allTimeStepsValue();
|
static int allTimeStepsValue();
|
||||||
|
|
||||||
|
void handleDroppedMimeData( const QMimeData* data, Qt::DropAction action, caf::PdmFieldHandle* destinationField ) override;
|
||||||
|
|
||||||
|
void setEclipseResultAddress( const RimEclipseResultAddress& address );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||||
|
|
||||||
|
@ -1457,10 +1457,18 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( uiConfigName == "PlotWindow.Scripts" )
|
else if ( uiConfigName == "PlotWindow.Scripts" || uiConfigName == "MainWindow.Scripts" )
|
||||||
{
|
{
|
||||||
uiTreeOrdering.add( scriptCollection() );
|
uiTreeOrdering.add( scriptCollection() );
|
||||||
}
|
}
|
||||||
|
else if ( uiConfigName == "MainWindow.DataSources" )
|
||||||
|
{
|
||||||
|
RimOilField* oilField = activeOilField();
|
||||||
|
if ( oilField )
|
||||||
|
{
|
||||||
|
if ( oilField->analysisModels() ) uiTreeOrdering.add( oilField->analysisModels() );
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( viewLinkerCollection()->viewLinker() )
|
if ( viewLinkerCollection()->viewLinker() )
|
||||||
@ -1483,7 +1491,6 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
|
|||||||
}
|
}
|
||||||
|
|
||||||
uiTreeOrdering.add( colorLegendCollection() );
|
uiTreeOrdering.add( colorLegendCollection() );
|
||||||
uiTreeOrdering.add( scriptCollection() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uiTreeOrdering.skipRemainingChildren( true );
|
uiTreeOrdering.skipRemainingChildren( true );
|
||||||
|
@ -108,6 +108,30 @@ QString RiuDockWidgetTools::summaryPlotManagerName()
|
|||||||
return "dockSummaryPlotManager";
|
return "dockSummaryPlotManager";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RiuDockWidgetTools::mainWindowProjectTreeName()
|
||||||
|
{
|
||||||
|
return "mainWindow_dockProjectTree";
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RiuDockWidgetTools::mainWindowDataSourceTreeName()
|
||||||
|
{
|
||||||
|
return "mainWindow_dockDataSourceTree";
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RiuDockWidgetTools::mainWindowScriptsTreeName()
|
||||||
|
{
|
||||||
|
return "mainWindow_dockScriptsTree";
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -48,6 +48,10 @@ public:
|
|||||||
static QString undoStackName();
|
static QString undoStackName();
|
||||||
static QString summaryPlotManagerName();
|
static QString summaryPlotManagerName();
|
||||||
|
|
||||||
|
static QString mainWindowProjectTreeName();
|
||||||
|
static QString mainWindowDataSourceTreeName();
|
||||||
|
static QString mainWindowScriptsTreeName();
|
||||||
|
|
||||||
static QString plotMainWindowDataSourceTreeName();
|
static QString plotMainWindowDataSourceTreeName();
|
||||||
static QString plotMainWindowPlotsTreeName();
|
static QString plotMainWindowPlotsTreeName();
|
||||||
static QString plotMainWindowScriptsTreeName();
|
static QString plotMainWindowScriptsTreeName();
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "RimCaseCollection.h"
|
#include "RimCaseCollection.h"
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
|
#include "RimEclipseResultAddress.h"
|
||||||
#include "RimEclipseResultCase.h"
|
#include "RimEclipseResultCase.h"
|
||||||
#include "RimIdenticalGridCaseGroup.h"
|
#include "RimIdenticalGridCaseGroup.h"
|
||||||
#include "RimMimeData.h"
|
#include "RimMimeData.h"
|
||||||
@ -49,6 +50,7 @@
|
|||||||
#include "RimWellLogFileChannel.h"
|
#include "RimWellLogFileChannel.h"
|
||||||
#include "RimWellLogPlot.h"
|
#include "RimWellLogPlot.h"
|
||||||
#include "RimWellLogTrack.h"
|
#include "RimWellLogTrack.h"
|
||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
#include "RicWellLogTools.h"
|
#include "RicWellLogTools.h"
|
||||||
@ -271,6 +273,11 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
|
|||||||
{
|
{
|
||||||
itemflags |= Qt::ItemIsDragEnabled;
|
itemflags |= Qt::ItemIsDragEnabled;
|
||||||
}
|
}
|
||||||
|
auto eclipseResultAdr = dynamic_cast<RimEclipseResultAddress*>( uiItem );
|
||||||
|
if ( eclipseResultAdr )
|
||||||
|
{
|
||||||
|
itemflags |= Qt::ItemIsDragEnabled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_dragItems.empty() ) return itemflags;
|
if ( m_dragItems.empty() ) return itemflags;
|
||||||
|
@ -710,16 +710,24 @@ void RiuMainWindow::createToolBars()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMainWindow::createDockPanels()
|
void RiuMainWindow::createDockPanels()
|
||||||
{
|
{
|
||||||
const int nTreeViews = 1;
|
const int nTreeViews = 3;
|
||||||
|
const std::vector<QString> treeViewTitles = { "Project Tree", "Data Sources", "Scripts" };
|
||||||
|
const std::vector<QString> treeViewConfigs = { "MainWindow.ProjectTree", "MainWindow.DataSources", "MainWindow.Scripts" };
|
||||||
|
const std::vector<QString> treeViewDockNames = { RiuDockWidgetTools::mainWindowProjectTreeName(),
|
||||||
|
RiuDockWidgetTools::mainWindowDataSourceTreeName(),
|
||||||
|
RiuDockWidgetTools::mainWindowScriptsTreeName() };
|
||||||
|
|
||||||
createTreeViews( nTreeViews );
|
createTreeViews( nTreeViews );
|
||||||
|
|
||||||
|
QDockWidget* dockOntopOfWidget = nullptr;
|
||||||
|
|
||||||
|
for ( int i = 0; i < nTreeViews; i++ )
|
||||||
{
|
{
|
||||||
QDockWidget* dockWidget = new QDockWidget( "Project Tree", this );
|
QDockWidget* dockWidget = new QDockWidget( treeViewTitles[i], this );
|
||||||
dockWidget->setObjectName( RiuDockWidgetTools::projectTreeName() );
|
dockWidget->setObjectName( treeViewDockNames[i] );
|
||||||
dockWidget->setAllowedAreas( Qt::AllDockWidgetAreas );
|
dockWidget->setAllowedAreas( Qt::AllDockWidgetAreas );
|
||||||
|
|
||||||
caf::PdmUiTreeView* projectTree = projectTreeView( 0 );
|
caf::PdmUiTreeView* projectTree = projectTreeView( i );
|
||||||
projectTree->enableSelectionManagerUpdating( true );
|
projectTree->enableSelectionManagerUpdating( true );
|
||||||
|
|
||||||
projectTree->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
projectTree->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||||
@ -741,11 +749,25 @@ void RiuMainWindow::createDockPanels()
|
|||||||
|
|
||||||
addDockWidget( Qt::LeftDockWidgetArea, dockWidget );
|
addDockWidget( Qt::LeftDockWidgetArea, dockWidget );
|
||||||
|
|
||||||
|
if ( dockOntopOfWidget )
|
||||||
|
{
|
||||||
|
tabifyDockWidget( dockOntopOfWidget, dockWidget );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dockOntopOfWidget = dockWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
connect( dockWidget, SIGNAL( visibilityChanged( bool ) ), projectTree, SLOT( treeVisibilityChanged( bool ) ) );
|
||||||
|
|
||||||
connect( projectTree, SIGNAL( selectionChanged() ), this, SLOT( selectedObjectsChanged() ) );
|
connect( projectTree, SIGNAL( selectionChanged() ), this, SLOT( selectedObjectsChanged() ) );
|
||||||
|
|
||||||
projectTree->treeView()->setContextMenuPolicy( Qt::CustomContextMenu );
|
projectTree->treeView()->setContextMenuPolicy( Qt::CustomContextMenu );
|
||||||
connect( projectTree->treeView(),
|
connect( projectTree->treeView(),
|
||||||
SIGNAL( customContextMenuRequested( const QPoint& ) ),
|
SIGNAL( customContextMenuRequested( const QPoint& ) ),
|
||||||
SLOT( customMenuRequested( const QPoint& ) ) );
|
SLOT( customMenuRequested( const QPoint& ) ) );
|
||||||
|
|
||||||
|
projectTree->setUiConfigurationName( treeViewConfigs[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
QDockWidget* resultPlotDock = nullptr;
|
QDockWidget* resultPlotDock = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user