Merge branch 'dev' into feature-analysis-plots-initial

This commit is contained in:
Gaute Lindkvist
2020-04-22 16:17:09 +02:00
91 changed files with 13342 additions and 8494 deletions

View File

@@ -80,6 +80,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.h
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimDepthTrackPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.h
@@ -235,6 +236,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.cpp
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimDepthTrackPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWbsParameters.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp

View File

@@ -861,6 +861,24 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const HistogramData& histData, R
QString( "<b>Cell result:</b> %1, %2, %3<br>" ).arg( resultPos ).arg( fieldName ).arg( compName );
}
if ( geoMechView->cellResultResultDefinition()->isBiotCoefficientDependent() )
{
if ( geoMechCase->biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_NONE )
{
infoText += QString( "<b>Biot Coefficient</b>: 1.0 (None)<br>" );
}
else if ( geoMechCase->biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_FIXED )
{
infoText +=
QString( "<b>Biot Coefficient</b>: %1 (Fixed)<br>" ).arg( geoMechCase->biotFixedCoefficient() );
}
else if ( geoMechCase->biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_PER_ELEMENT )
{
infoText += QString( "<b>Biot Coefficient</b>: %1 (From element property)<br>" )
.arg( geoMechCase->biotResultAddress() );
}
}
const RimGeoMechContourMapView* contourMapView = dynamic_cast<const RimGeoMechContourMapView*>( geoMechView );
if ( contourMapView )
{

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,174 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
// 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 "cafAppEnum.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmFieldHandle.h"
#include "cafPdmObject.h"
#include "RiaDefines.h"
#include "RimPlotWindow.h"
#include "RimWellLogPlotNameConfig.h"
#include <QPointer>
#include <set>
class RimWellLogCurveCommonDataSource;
class RiuWellLogPlot;
class RimPlot;
class QKeyEvent;
//==================================================================================================
///
///
//==================================================================================================
class RimDepthTrackPlot : public RimPlotWindow, public RimNameConfigHolderInterface
{
CAF_PDM_HEADER_INIT;
public:
enum AxisGridVisibility
{
AXIS_GRID_NONE = 0x00,
AXIS_GRID_MAJOR = 0x01,
AXIS_GRID_MINOR = 0x02,
AXIS_GRID_MAJOR_AND_MINOR = 0x03
};
typedef caf::AppEnum<AxisGridVisibility> AxisGridEnum;
using DepthTypeEnum = RiaDefines::DepthTypeEnum;
public:
RimDepthTrackPlot();
~RimDepthTrackPlot() override;
QWidget* viewWidget() override;
QWidget* createPlotWidget( QWidget* mainWindowParent = nullptr );
QString description() const override;
bool isPlotTitleVisible() const;
void setPlotTitleVisible( bool visible );
void addPlot( RimPlot* plot );
void insertPlot( RimPlot* plot, size_t index );
void removePlot( RimPlot* plot );
size_t plotCount() const;
size_t plotIndex( const RimPlot* plot ) const;
RimPlot* plotByIndex( size_t index ) const;
std::vector<RimPlot*> plots() const;
std::vector<RimPlot*> visiblePlots() const;
DepthTypeEnum depthType() const;
void setDepthType( DepthTypeEnum depthType );
RiaDefines::DepthUnitType depthUnit() const;
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
QString depthAxisTitle() const;
void enableDepthAxisGridLines( AxisGridVisibility gridVisibility );
AxisGridVisibility depthAxisGridLinesEnabled() const;
void setAutoScaleXEnabled( bool enabled );
void setAutoScaleDepthEnabled( bool enabled );
void zoomAll() override;
void updateZoom();
void setDepthAxisRangeByFactorAndCenter( double zoomFactor, double zoomCenter );
void setDepthAxisRangeByPanDepth( double panFactor );
void setDepthAxisRange( double minimumDepth, double maximumDepth );
void calculateAvailableDepthRange();
void availableDepthRange( double* minimumDepth, double* maximumDepth ) const;
void visibleDepthRange( double* minimumDepth, double* maximumDepth ) const;
void uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
QString createAutoName() const override;
RimWellLogPlotNameConfig* nameConfig() const;
RimWellLogCurveCommonDataSource* commonDataSource() const;
void updateCommonDataSource();
void setCommonDataSourceEnabled( bool enable );
void setAvailableDepthUnits( const std::set<RiaDefines::DepthUnitType>& depthUnits );
void setAvailableDepthTypes( const std::set<DepthTypeEnum>& depthTypes );
QString asciiDataForPlotExport() const;
void handleKeyPressEvent( QKeyEvent* keyEvent );
protected:
QImage snapshotWindowContent() override;
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
void deleteViewWidget() override;
void performAutoNameUpdate() override;
void recreatePlotWidgets();
// Overridden PDM methods
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
void initAfterRead() override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void onLoadDataAndUpdate() override;
void updatePlots();
caf::PdmFieldHandle* userDescriptionField() override;
private:
void cleanupBeforeClose();
void updateSubPlotNames();
void onPlotAdditionOrRemoval();
void doRenderWindowContent( QPaintDevice* paintDevice ) override;
void doUpdateLayout() override;
protected:
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
bool m_commonDataSourceEnabled;
caf::PdmField<bool> m_showPlotWindowTitle;
caf::PdmField<QString> m_plotWindowTitle;
caf::PdmField<caf::AppEnum<DepthTypeEnum>> m_depthType;
caf::PdmField<caf::AppEnum<RiaDefines::DepthUnitType>> m_depthUnit;
caf::PdmField<double> m_minVisibleDepth;
caf::PdmField<double> m_maxVisibleDepth;
caf::PdmField<AxisGridEnum> m_depthAxisGridVisibility;
caf::PdmField<bool> m_isAutoScaleDepthEnabled;
caf::PdmChildField<RimWellLogPlotNameConfig*> m_nameConfig;
caf::PdmChildArrayField<RimPlot*> m_plots;
QPointer<RiuWellLogPlot> m_viewer;
std::set<RiaDefines::DepthUnitType> m_availableDepthUnits;
std::set<DepthTypeEnum> m_availableDepthTypes;
double m_minAvailableDepth;
double m_maxAvailableDepth;
};

View File

@@ -97,7 +97,7 @@ QString RimEclipseGeometrySelectionItem::geometrySelectionText() const
}
else
{
text = "No case";
return "No case";
}
text += ", ";

View File

@@ -652,7 +652,7 @@ QList<caf::PdmOptionItemInfo>
{
RigCaseCellResultsData* cellResultsData = m_eclipseCase->results( this->porosityModel() );
if ( cellResultsData->hasFlowDiagUsableFluxes() )
if ( cellResultsData && cellResultsData->hasFlowDiagUsableFluxes() )
{
enableSouring = true;
}

View File

@@ -23,6 +23,7 @@
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RicImportElementPropertyFeature.h"
#include "RicfCommandObject.h"
#include "RifOdbReader.h"
@@ -49,8 +50,11 @@
#include "RimTools.h"
#include "RimWellLogPlotCollection.h"
#include "cafCmdFeatureManager.h"
#include "cafPdmFieldIOScriptability.h"
#include "cafPdmObjectScriptability.h"
#include "cafPdmUiDoubleValueEditor.h"
#include "cafPdmUiListEditor.h"
#include "cafPdmUiPropertyViewDialog.h"
#include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiTreeOrdering.h"
@@ -58,13 +62,27 @@
#include "cvfVector3.h"
#include <QFile>
#include <QIcon>
#include <QFileInfo>
#include <array>
CAF_PDM_SOURCE_INIT( RimGeoMechCase, "ResInsightGeoMechCase" );
namespace caf
{
template <>
void caf::AppEnum<RimGeoMechCase::BiotCoefficientType>::setUp()
{
addItem( RimGeoMechCase::BiotCoefficientType::BIOT_NONE, "BIOT_NONE", "None" );
addItem( RimGeoMechCase::BiotCoefficientType::BIOT_FIXED, "BIOT_FIXED", "Fixed biot coefficient" );
addItem( RimGeoMechCase::BiotCoefficientType::BIOT_PER_ELEMENT,
"BIOT_PER_ELEMENT",
"Biot coefficient from element properties" );
setDefault( RimGeoMechCase::BiotCoefficientType::BIOT_NONE );
}
} // End namespace caf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -106,12 +124,23 @@ RimGeoMechCase::RimGeoMechCase( void )
"" );
m_elementPropertyFileNameIndexUiSelection.xmlCapability()->disableIO();
CAF_PDM_InitField( &m_importElementPropertyFileCommand, "importElementPropertyFileCommad", false, "", "", "", "" );
caf::PdmUiPushButtonEditor::configureEditorForField( &m_importElementPropertyFileCommand );
CAF_PDM_InitField( &m_closeElementPropertyFileCommand, "closeElementPropertyFileCommad", false, "", "", "", "" );
caf::PdmUiPushButtonEditor::configureEditorForField( &m_closeElementPropertyFileCommand );
CAF_PDM_InitField( &m_reloadElementPropertyFileCommand, "reloadElementPropertyFileCommand", false, "", "", "", "" );
caf::PdmUiPushButtonEditor::configureEditorForField( &m_reloadElementPropertyFileCommand );
caf::AppEnum<BiotCoefficientType> defaultBiotCoefficientType = RimGeoMechCase::BiotCoefficientType::BIOT_NONE;
CAF_PDM_InitField( &m_biotCoefficientType, "BiotCoefficientType", defaultBiotCoefficientType, "Biot Coefficient", "", "", "" );
CAF_PDM_InitField( &m_biotFixedCoefficient, "BiotFixedCoefficient", 1.0, "Fixed coefficient", "", "", "" );
m_biotFixedCoefficient.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_biotResultAddress, "BiotResultAddress", QString( "" ), "Value", "", "", "" );
m_biotResultAddress.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_contourMapCollection, "ContourMaps", "2d Contour Maps", "", "", "" );
m_contourMapCollection = new RimGeoMechContourMapViewCollection;
m_contourMapCollection.uiCapability()->setUiTreeHidden( true );
@@ -564,6 +593,30 @@ double RimGeoMechCase::frictionAngleDeg() const
return m_frictionAngleDeg;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechCase::BiotCoefficientType RimGeoMechCase::biotCoefficientType() const
{
return m_biotCoefficientType();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimGeoMechCase::biotFixedCoefficient() const
{
return m_biotFixedCoefficient;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGeoMechCase::biotResultAddress() const
{
return m_biotResultAddress;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -636,14 +689,56 @@ void RimGeoMechCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
cvf::Math::toRadians( m_frictionAngleDeg() ) );
}
std::vector<Rim3dView*> views = this->views();
for ( Rim3dView* view : views )
updateConnectedViews();
}
else if ( changedField == &m_biotFixedCoefficient || changedField == &m_biotCoefficientType ||
changedField == &m_biotResultAddress )
{
RigGeoMechCaseData* rigCaseData = geoMechData();
if ( rigCaseData && rigCaseData->femPartResults() )
{
if ( view ) // Todo: only those using the variable actively
if ( m_biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_NONE )
{
view->scheduleCreateDisplayModelAndRedraw();
rigCaseData->femPartResults()->setBiotCoefficientParameters( 1.0, "" );
}
else if ( m_biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_FIXED )
{
rigCaseData->femPartResults()->setBiotCoefficientParameters( m_biotFixedCoefficient(), "" );
}
else if ( m_biotCoefficientType() == RimGeoMechCase::BiotCoefficientType::BIOT_PER_ELEMENT )
{
if ( changedField == &m_biotCoefficientType )
{
// Show info message to user when selecting "from file" option before
// an element property has been imported
std::vector<std::string> elementProperties = possibleElementPropertyFieldNames();
if ( elementProperties.empty() )
{
QString importMessage =
QString( "Please import biot coefficients from file (typically called alpha.inp) by "
"selecting 'Import Element Property Table' on the Geomechanical Model." );
RiaLogging::info( importMessage );
// Set back to default value
m_biotCoefficientType = RimGeoMechCase::BiotCoefficientType::BIOT_NONE;
return;
}
}
if ( biotResultAddress().isEmpty() )
{
// Automatically select the first available property element if empty
std::vector<std::string> elementProperties = possibleElementPropertyFieldNames();
if ( !elementProperties.empty() )
{
m_biotResultAddress = QString::fromStdString( elementProperties[0] );
}
}
rigCaseData->femPartResults()->setBiotCoefficientParameters( 1.0, biotResultAddress() );
}
}
updateConnectedViews();
}
else if ( changedField == &m_reloadElementPropertyFileCommand )
{
@@ -657,6 +752,12 @@ void RimGeoMechCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
closeSelectedElementPropertyFiles();
updateConnectedEditors();
}
else if ( changedField == &m_importElementPropertyFileCommand )
{
m_importElementPropertyFileCommand = false;
importElementPropertyFile();
updateConnectedEditors();
}
}
//--------------------------------------------------------------------------------------------------
@@ -795,6 +896,12 @@ void RimGeoMechCase::closeSelectedElementPropertyFiles()
view->cellResult()->setResultAddress( RigFemResultAddress() );
}
if ( address.fieldName == biotResultAddress().toStdString() )
{
// If the used biot value is being removed we need to change the biot type back to default
m_biotCoefficientType = RimGeoMechCase::BiotCoefficientType::BIOT_NONE;
}
for ( RimGeoMechPropertyFilter* propertyFilter : view->geoMechPropertyFilterCollection()->propertyFilters() )
{
if ( address == propertyFilter->resultDefinition->resultAddress() )
@@ -834,6 +941,14 @@ void RimGeoMechCase::reloadSelectedElementPropertyFiles()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechCase::importElementPropertyFile()
{
RicImportElementPropertyFeature::importElementProperties();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -850,9 +965,19 @@ void RimGeoMechCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
caf::PdmUiGroup* elmPropGroup = uiOrdering.addNewGroup( "Element Properties" );
elmPropGroup->add( &m_elementPropertyFileNameIndexUiSelection );
elmPropGroup->add( &m_importElementPropertyFileCommand );
elmPropGroup->add( &m_reloadElementPropertyFileCommand );
elmPropGroup->add( &m_closeElementPropertyFileCommand );
caf::PdmUiGroup* biotGroup = uiOrdering.addNewGroup( "Biot Coefficient" );
biotGroup->add( &m_biotCoefficientType );
biotGroup->add( &m_biotFixedCoefficient );
biotGroup->add( &m_biotResultAddress );
m_biotFixedCoefficient.uiCapability()->setUiHidden( m_biotCoefficientType !=
RimGeoMechCase::BiotCoefficientType::BIOT_FIXED );
m_biotResultAddress.uiCapability()->setUiHidden( m_biotCoefficientType !=
RimGeoMechCase::BiotCoefficientType::BIOT_PER_ELEMENT );
caf::PdmUiGroup* timeStepFilterGroup = uiOrdering.addNewGroup( "Time Step Filter" );
timeStepFilterGroup->setCollapsedByDefault( true );
m_timeStepFilter->uiOrdering( uiConfigName, *timeStepFilterGroup );
@@ -865,13 +990,27 @@ void RimGeoMechCase::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{
if ( field == &m_importElementPropertyFileCommand )
{
dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute )->m_buttonText = "Import Element Property";
}
if ( field == &m_reloadElementPropertyFileCommand )
{
dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute )->m_buttonText = "Reload Case(s)";
dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute )->m_buttonText = "Reload Element Property";
}
if ( field == &m_closeElementPropertyFileCommand )
{
dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute )->m_buttonText = "Close Case(s)";
dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute )->m_buttonText = "Close Element Property";
}
if ( field == &m_biotFixedCoefficient )
{
auto uiDoubleValueEditorAttr = dynamic_cast<caf::PdmUiDoubleValueEditorAttribute*>( attribute );
if ( uiDoubleValueEditorAttr )
{
uiDoubleValueEditorAttr->m_decimals = 2;
uiDoubleValueEditorAttr->m_validator = new QDoubleValidator( 0.0, 1.0, 2 );
}
}
}
@@ -892,6 +1031,80 @@ QList<caf::PdmOptionItemInfo> RimGeoMechCase::calculateValueOptions( const caf::
options.push_back( caf::PdmOptionItemInfo( m_elementPropertyFileNames.v().at( i ).path(), (int)i, true ) );
}
}
else if ( fieldNeedingOptions == &m_biotResultAddress )
{
std::vector<std::string> elementProperties = possibleElementPropertyFieldNames();
std::vector<QString> paths;
for ( auto path : m_elementPropertyFileNames.v() )
{
paths.push_back( path.path() );
}
std::map<std::string, QString> addressesInFile =
geoMechData()->femPartResults()->addressesInElementPropertyFiles( paths );
for ( const std::string elementProperty : elementProperties )
{
QString result = QString::fromStdString( elementProperty );
QString filename = findFileNameForElementProperty( elementProperty, addressesInFile );
options.push_back( caf::PdmOptionItemInfo( result + " (" + filename + ")", result ) );
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGeoMechCase::findFileNameForElementProperty( const std::string& elementProperty,
const std::map<std::string, QString> addressesInFiles ) const
{
auto it = addressesInFiles.find( elementProperty );
if ( it != addressesInFiles.end() )
{
QFileInfo fileInfo( it->second );
return fileInfo.fileName();
}
else
{
return QString( "Unknown file" );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechCase::updateConnectedViews()
{
std::vector<Rim3dView*> views = this->views();
for ( Rim3dView* view : views )
{
if ( view )
{
view->scheduleCreateDisplayModelAndRedraw();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RimGeoMechCase::possibleElementPropertyFieldNames()
{
std::vector<std::string> fieldNames;
if ( geoMechData() )
{
std::map<std::string, std::vector<std::string>> fieldWithComponentNames =
geoMechData()->femPartResults()->scalarFieldAndComponentNames( RIG_ELEMENT );
std::map<std::string, std::vector<std::string>>::const_iterator fieldIt;
for ( fieldIt = fieldWithComponentNames.begin(); fieldIt != fieldWithComponentNames.end(); ++fieldIt )
{
fieldNames.push_back( fieldIt->first );
}
}
return fieldNames;
}

View File

@@ -52,6 +52,14 @@ public:
CASE_OPEN_CANCELLED,
CASE_OPEN_ERROR
};
enum class BiotCoefficientType
{
BIOT_NONE = 0,
BIOT_FIXED,
BIOT_PER_ELEMENT
};
RimGeoMechCase( void );
~RimGeoMechCase( void ) override;
@@ -88,6 +96,10 @@ public:
// Fields:
caf::PdmChildArrayField<RimGeoMechView*> geoMechViews;
BiotCoefficientType biotCoefficientType() const;
double biotFixedCoefficient() const;
QString biotResultAddress() const;
private:
cvf::Vec3d displayModelOffset() const override;
static std::vector<QDateTime> vectorOfValidDateTimesFromTimeStepStrings( const QStringList& timeStepStrings );
@@ -102,14 +114,20 @@ private:
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
QString findFileNameForElementProperty( const std::string& elementProperty,
const std::map<std::string, QString> addressesInFiles ) const;
void updateFormationNamesData() override;
void initAfterRead() override;
static QString subStringOfDigits( const QString& timeStepString, int numberOfDigitsToFind );
void closeSelectedElementPropertyFiles();
void reloadSelectedElementPropertyFiles();
std::vector<Rim3dView*> allSpecialViews() const override;
void importElementPropertyFile();
void closeSelectedElementPropertyFiles();
void reloadSelectedElementPropertyFiles();
std::vector<Rim3dView*> allSpecialViews() const override;
void updateConnectedViews();
std::vector<std::string> possibleElementPropertyFieldNames();
private:
cvf::ref<RigGeoMechCaseData> m_geoMechCaseData;
@@ -117,9 +135,14 @@ private:
caf::PdmField<double> m_frictionAngleDeg;
caf::PdmField<std::vector<caf::FilePath>> m_elementPropertyFileNames;
caf::PdmField<std::vector<int>> m_elementPropertyFileNameIndexUiSelection;
caf::PdmField<bool> m_importElementPropertyFileCommand;
caf::PdmField<bool> m_closeElementPropertyFileCommand;
caf::PdmField<bool> m_reloadElementPropertyFileCommand;
caf::PdmField<caf::AppEnum<BiotCoefficientType>> m_biotCoefficientType;
caf::PdmField<double> m_biotFixedCoefficient;
caf::PdmField<QString> m_biotResultAddress;
caf::PdmChildField<RimGeoMechContourMapViewCollection*> m_contourMapCollection;
bool m_applyTimeFilter;

View File

@@ -931,3 +931,11 @@ void RimGeoMechResultDefinition::updateLegendTextAndRanges( RimRegularLegendConf
legendConfigToUpdate->setTitle( legendTitle );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGeoMechResultDefinition::isBiotCoefficientDependent() const
{
return ( this->resultFieldName() == "SE" || this->resultFieldName() == "ST" );
}

View File

@@ -80,6 +80,8 @@ public:
const QString& legendHeading,
int timeStepIndex );
bool isBiotCoefficientDependent() const;
protected:
virtual void updateLegendCategorySettings(){};
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;

View File

@@ -225,13 +225,16 @@ std::vector<double> RimGridTimeHistoryCurve::yValues() const
RigCaseCellResultsData* cellResultsData = m_eclipseResultDefinition->currentGridCellResults();
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
if ( cellResultsData )
{
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
values = RigTimeHistoryResultAccessor::timeHistoryValues( eclTopItem->eclipseCase()->eclipseCaseData(),
m_eclipseResultDefinition(),
gridIndex,
cellIndex,
timeStepDates.size() );
values = RigTimeHistoryResultAccessor::timeHistoryValues( eclTopItem->eclipseCase()->eclipseCaseData(),
m_eclipseResultDefinition(),
gridIndex,
cellIndex,
timeStepDates.size() );
}
}
if ( geoMechGeomSelectionItem() && geoMechGeomSelectionItem()->geoMechCase() )
@@ -464,11 +467,14 @@ std::vector<time_t> RimGridTimeHistoryCurve::timeStepValues() const
{
RigCaseCellResultsData* cellResultsData = m_eclipseResultDefinition->currentGridCellResults();
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
for ( QDateTime dt : timeStepDates )
if ( cellResultsData )
{
dateTimes.push_back( dt.toTime_t() );
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
for ( QDateTime dt : timeStepDates )
{
dateTimes.push_back( dt.toTime_t() );
}
}
}
@@ -512,7 +518,10 @@ std::vector<double> RimGridTimeHistoryCurve::daysSinceSimulationStart() const
{
RigCaseCellResultsData* cellResultsData = m_eclipseResultDefinition->currentGridCellResults();
daysSinceSimulationStart = cellResultsData->daysSinceSimulationStart();
if ( cellResultsData )
{
daysSinceSimulationStart = cellResultsData->daysSinceSimulationStart();
}
}
RimGeoMechGeometrySelectionItem* geoMechTopItem = geoMechGeomSelectionItem();

View File

@@ -42,7 +42,7 @@ CAF_PDM_SOURCE_INIT( RimIntersectionResultDefinition, "IntersectionResultDefinit
//--------------------------------------------------------------------------------------------------
RimIntersectionResultDefinition::RimIntersectionResultDefinition()
{
CAF_PDM_InitObject( "Intersection Result Definition", "", "", "" );
CAF_PDM_InitObject( "Intersection Result Definition", ":/CellResult.png", "", "" );
CAF_PDM_InitField( &m_isActive, "IsActive", true, "Active", "", "", "" );
m_isActive.uiCapability()->setUiHidden( true );
@@ -327,12 +327,21 @@ void RimIntersectionResultDefinition::fieldChangedByUi( const caf::PdmFieldHandl
if ( changedField == &m_isActive || ( changedField == &m_timeStep && isInAction ) )
{
std::vector<PdmObject*> referringObjects;
this->objectsWithReferringPtrFieldsOfType( referringObjects );
for ( auto* obj : referringObjects )
{
obj->updateConnectedEditors();
}
RimGridView* gridView = nullptr;
this->firstAncestorOrThisOfType( gridView );
if ( gridView ) gridView->scheduleCreateDisplayModelAndRedraw();
update2dIntersectionViews();
}
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------
@@ -440,6 +449,8 @@ void RimIntersectionResultDefinition::initAfterRead()
{
m_geomResultDefinition->setGeoMechCase( geomCase );
}
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -304,6 +304,8 @@ void RimRegularLegendConfig::fieldChangedByUi( const caf::PdmFieldHandle* change
{
rftPlot->onLegendDefinitionChanged();
}
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------
@@ -540,8 +542,13 @@ void RimRegularLegendConfig::setAutomaticRanges( double globalMin, double global
void RimRegularLegendConfig::initAfterRead()
{
updateFieldVisibility();
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimRegularLegendConfig::objectToggleField()
{
return &m_showLegend;

View File

@@ -649,6 +649,7 @@ double RimSimWellInView::calculateInjectionProductionFractions( const RimWellDis
const RimEclipseView* reservoirView = nullptr;
this->firstAncestorOrThisOfType( reservoirView );
if ( !reservoirView ) return false;
if ( !reservoirView->eclipseCase() ) return false;
size_t timeStep = static_cast<size_t>( reservoirView->currentTimeStep() );
std::vector<QDateTime> caseTimeSteps = reservoirView->eclipseCase()->timeStepDates();

File diff suppressed because it is too large Load Diff

View File

@@ -19,158 +19,21 @@
#pragma once
#include "cafAppEnum.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmFieldHandle.h"
#include "cafPdmObject.h"
#include "RiaDefines.h"
#include "RimPlotWindow.h"
#include "RimWellLogPlotNameConfig.h"
#include <QPointer>
#include <set>
class RimWellLogCurveCommonDataSource;
class RiuWellLogPlot;
class RimPlot;
class QKeyEvent;
#include "RimDepthTrackPlot.h"
//==================================================================================================
///
///
//==================================================================================================
class RimWellLogPlot : public RimPlotWindow, public RimNameConfigHolderInterface
class RimWellLogPlot : public RimDepthTrackPlot
{
CAF_PDM_HEADER_INIT;
public:
enum AxisGridVisibility
{
AXIS_GRID_NONE = 0x00,
AXIS_GRID_MAJOR = 0x01,
AXIS_GRID_MINOR = 0x02,
AXIS_GRID_MAJOR_AND_MINOR = 0x03
};
typedef caf::AppEnum<AxisGridVisibility> AxisGridEnum;
using DepthTypeEnum = RiaDefines::DepthTypeEnum;
public:
RimWellLogPlot();
~RimWellLogPlot() override;
RimWellLogPlot& operator=( RimWellLogPlot&& rhs );
QWidget* viewWidget() override;
QWidget* createPlotWidget( QWidget* mainWindowParent = nullptr );
QString description() const override;
bool isPlotTitleVisible() const;
void setPlotTitleVisible( bool visible );
void addPlot( RimPlot* plot );
void insertPlot( RimPlot* plot, size_t index );
void removePlot( RimPlot* plot );
size_t plotCount() const;
size_t plotIndex( const RimPlot* plot ) const;
RimPlot* plotByIndex( size_t index ) const;
std::vector<RimPlot*> plots() const;
std::vector<RimPlot*> visiblePlots() const;
DepthTypeEnum depthType() const;
void setDepthType( DepthTypeEnum depthType );
RiaDefines::DepthUnitType depthUnit() const;
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
QString depthAxisTitle() const;
void enableDepthAxisGridLines( AxisGridVisibility gridVisibility );
AxisGridVisibility depthAxisGridLinesEnabled() const;
void setAutoScaleXEnabled( bool enabled );
void setAutoScaleDepthEnabled( bool enabled );
void zoomAll() override;
void updateZoom();
void setDepthAxisRangeByFactorAndCenter( double zoomFactor, double zoomCenter );
void setDepthAxisRangeByPanDepth( double panFactor );
void setDepthAxisRange( double minimumDepth, double maximumDepth );
void calculateAvailableDepthRange();
void availableDepthRange( double* minimumDepth, double* maximumDepth ) const;
void visibleDepthRange( double* minimumDepth, double* maximumDepth ) const;
void uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
QString createAutoName() const override;
RimWellLogPlotNameConfig* nameConfig() const;
RimWellLogCurveCommonDataSource* commonDataSource() const;
void updateCommonDataSource();
void setCommonDataSourceEnabled( bool enable );
void setAvailableDepthUnits( const std::set<RiaDefines::DepthUnitType>& depthUnits );
void setAvailableDepthTypes( const std::set<DepthTypeEnum>& depthTypes );
QString asciiDataForPlotExport() const;
void handleKeyPressEvent( QKeyEvent* keyEvent );
protected:
QImage snapshotWindowContent() override;
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
void deleteViewWidget() override;
void performAutoNameUpdate() override;
void recreatePlotWidgets();
// Overridden PDM methods
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
void initAfterRead() override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void onLoadDataAndUpdate() override;
void updatePlots();
caf::PdmFieldHandle* userDescriptionField() override;
private:
void cleanupBeforeClose();
void updateSubPlotNames();
void onPlotAdditionOrRemoval();
void doRenderWindowContent( QPaintDevice* paintDevice ) override;
void doUpdateLayout() override;
protected:
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
bool m_commonDataSourceEnabled;
caf::PdmField<bool> m_showPlotWindowTitle;
caf::PdmField<QString> m_plotWindowTitle;
caf::PdmField<caf::AppEnum<DepthTypeEnum>> m_depthType;
caf::PdmField<caf::AppEnum<RiaDefines::DepthUnitType>> m_depthUnit;
caf::PdmField<double> m_minVisibleDepth;
caf::PdmField<double> m_maxVisibleDepth;
caf::PdmField<AxisGridEnum> m_depthAxisGridVisibility;
caf::PdmField<bool> m_isAutoScaleDepthEnabled;
caf::PdmChildField<RimWellLogPlotNameConfig*> m_nameConfig;
caf::PdmChildArrayField<RimPlot*> m_plots;
QPointer<RiuWellLogPlot> m_viewer;
std::set<RiaDefines::DepthUnitType> m_availableDepthUnits;
std::set<DepthTypeEnum> m_availableDepthTypes;
double m_minAvailableDepth;
double m_maxAvailableDepth;
};