2012-06-26 09:10:41 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-06-26 09:10:41 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-06-26 09:10:41 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2012-06-26 09:10:41 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-06-25 06:23:36 -05:00
|
|
|
#include "RimEclipseResultCase.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
|
2018-11-05 07:28:07 -06:00
|
|
|
#include "RiaApplication.h"
|
|
|
|
#include "RiaFieldHandleTools.h"
|
2017-11-28 05:47:39 -06:00
|
|
|
#include "RiaLogging.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RiaPreferences.h"
|
2018-10-09 06:54:38 -05:00
|
|
|
#include "RiaRegressionTestRunner.h"
|
2016-06-29 08:45:20 -05:00
|
|
|
|
2019-07-15 07:05:34 -05:00
|
|
|
#include "RicfCommandObject.h"
|
|
|
|
|
2019-10-30 10:52:25 -05:00
|
|
|
#include "RifEclipseInputPropertyLoader.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RifEclipseOutputFileTools.h"
|
2012-06-26 09:10:41 -05:00
|
|
|
#include "RifReaderEclipseOutput.h"
|
2017-10-05 02:29:19 -05:00
|
|
|
#include "RifReaderEclipseRft.h"
|
2012-06-26 09:10:41 -05:00
|
|
|
#include "RifReaderMockModel.h"
|
2014-07-30 02:13:47 -05:00
|
|
|
#include "RifReaderSettings.h"
|
2016-06-29 08:45:20 -05:00
|
|
|
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RigCaseCellResultsData.h"
|
2017-01-10 02:51:39 -06:00
|
|
|
#include "RigEclipseCaseData.h"
|
2017-08-11 00:34:54 -05:00
|
|
|
#include "RigFlowDiagSolverInterface.h"
|
2017-01-09 13:27:46 -06:00
|
|
|
#include "RigMainGrid.h"
|
2016-06-29 08:45:20 -05:00
|
|
|
|
2018-10-09 06:54:38 -05:00
|
|
|
#include "RimDialogData.h"
|
2017-08-29 00:30:07 -05:00
|
|
|
#include "RimEclipseCellColors.h"
|
2019-10-30 10:52:25 -05:00
|
|
|
#include "RimEclipseInputProperty.h"
|
|
|
|
#include "RimEclipseInputPropertyCollection.h"
|
2017-08-29 00:30:07 -05:00
|
|
|
#include "RimEclipseView.h"
|
2017-08-11 00:34:54 -05:00
|
|
|
#include "RimFlowDiagSolution.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RimMockModelSettings.h"
|
2013-02-11 01:16:51 -06:00
|
|
|
#include "RimProject.h"
|
2014-07-24 07:03:17 -05:00
|
|
|
#include "RimReservoirCellResultsStorage.h"
|
2017-08-11 00:34:54 -05:00
|
|
|
#include "RimTimeStepFilter.h"
|
2016-06-29 08:45:20 -05:00
|
|
|
#include "RimTools.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
|
2017-03-31 04:37:07 -05:00
|
|
|
#include "cafPdmUiFilePathEditor.h"
|
2015-08-04 04:47:06 -05:00
|
|
|
#include "cafPdmUiPropertyViewDialog.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "cafProgressInfo.h"
|
2017-05-11 02:23:13 -05:00
|
|
|
#include "cafUtils.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
|
|
|
|
#include <QDir>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QFileInfo>
|
2017-10-05 02:29:19 -05:00
|
|
|
#include <fstream>
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <string>
|
2017-10-05 02:29:19 -05:00
|
|
|
|
2020-02-24 08:42:23 -06:00
|
|
|
CAF_PDM_SOURCE_INIT( RimEclipseResultCase, "EclipseCase" );
|
2012-06-26 09:10:41 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-06-26 09:10:41 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 04:56:18 -05:00
|
|
|
RimEclipseResultCase::RimEclipseResultCase()
|
2015-05-15 01:40:27 -05:00
|
|
|
: RimEclipseCase()
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
2020-02-24 08:42:23 -06:00
|
|
|
RICF_InitObject( "Eclipse Case", ":/Case48x48.png", "", "The Regular Eclipse Results Case" );
|
2013-04-11 05:06:38 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_unitSystem, "UnitSystem", "Unit System", "", "", "" );
|
|
|
|
m_unitSystem.registerGetMethod( RiaApplication::instance()->project(), &RimProject::commonUnitSystemForAllCases );
|
|
|
|
m_unitSystem.uiCapability()->setUiReadOnly( true );
|
2018-10-09 05:23:44 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_flowDiagSolutions, "FlowDiagSolutions", "Flow Diagnostics Solutions", "", "", "" );
|
|
|
|
m_flowDiagSolutions.uiCapability()->setUiHidden( true );
|
|
|
|
m_flowDiagSolutions.uiCapability()->setUiTreeHidden( true );
|
|
|
|
m_flowDiagSolutions.uiCapability()->setUiTreeChildrenHidden( true );
|
2016-12-14 02:50:30 -06:00
|
|
|
|
2013-04-11 05:06:38 -05:00
|
|
|
// Obsolete, unused field
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &caseDirectory, "CaseFolder", QString(), "Directory", "", "", "" );
|
|
|
|
RiaFieldhandleTools::disableWriteAndSetFieldHidden( &caseDirectory );
|
2013-04-11 05:06:38 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_flipXAxis.xmlCapability()->setIOWritable( true );
|
|
|
|
// flipXAxis.uiCapability()->setUiHidden(true);
|
|
|
|
m_flipYAxis.xmlCapability()->setIOWritable( true );
|
|
|
|
// flipYAxis.uiCapability()->setUiHidden(true);
|
2013-04-26 06:19:34 -05:00
|
|
|
|
2019-12-13 03:27:38 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_sourSimFileName, "SourSimFileName", "SourSim File Name", "", "", "" );
|
2019-09-06 03:40:57 -05:00
|
|
|
m_sourSimFileName.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
2017-08-11 08:49:38 -05:00
|
|
|
#ifndef USE_HDF5
|
2019-09-06 03:40:57 -05:00
|
|
|
m_sourSimFileName.uiCapability()->setUiHidden( true );
|
2017-08-11 08:49:38 -05:00
|
|
|
#endif
|
2016-12-20 04:41:05 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_activeCellInfoIsReadFromFile = false;
|
2013-04-12 05:03:04 -05:00
|
|
|
m_gridAndWellDataIsReadFromFile = false;
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 04:56:18 -05:00
|
|
|
bool RimEclipseResultCase::openEclipseGridFile()
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return importGridAndResultMetaData( false );
|
2017-08-24 23:51:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-08-24 23:51:56 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
bool RimEclipseResultCase::importGridAndResultMetaData( bool showTimeStepFilter )
|
2017-08-24 23:51:56 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::ProgressInfo progInfo( 50, "Reading Eclipse Grid File" );
|
|
|
|
|
|
|
|
progInfo.setProgressDescription( "Open Grid File" );
|
|
|
|
progInfo.setNextProgressIncrement( 48 );
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2013-04-12 05:03:04 -05:00
|
|
|
// Early exit if data is already read
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_gridAndWellDataIsReadFromFile ) return true;
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
cvf::ref<RifReaderInterface> readerInterface;
|
|
|
|
|
2020-02-21 05:07:15 -06:00
|
|
|
if ( gridFileName().contains( "Result Mock Debug Model" ) )
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
2020-02-21 05:07:15 -06:00
|
|
|
readerInterface = this->createMockModel( this->gridFileName() );
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-02-21 05:07:15 -06:00
|
|
|
if ( !caf::Utils::fileExists( gridFileName() ) )
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
2013-02-11 01:16:51 -06:00
|
|
|
return false;
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
|
|
|
|
2017-08-24 23:51:56 -05:00
|
|
|
cvf::ref<RifReaderEclipseOutput> readerEclipseOutput = new RifReaderEclipseOutput;
|
2019-09-06 03:40:57 -05:00
|
|
|
readerEclipseOutput->setFilenamesWithFaults( this->filesContainingFaults() );
|
2017-08-24 23:51:56 -05:00
|
|
|
|
2020-02-12 04:43:15 -06:00
|
|
|
cvf::ref<RifEclipseRestartDataAccess> restartDataAccess =
|
2020-02-21 05:07:15 -06:00
|
|
|
RifEclipseOutputFileTools::createDynamicResultAccess( gridFileName() );
|
2017-08-24 23:51:56 -05:00
|
|
|
|
2018-06-14 03:59:28 -05:00
|
|
|
{
|
|
|
|
std::vector<QDateTime> timeSteps;
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<double> daysSinceSimulationStart;
|
2017-08-24 23:51:56 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( restartDataAccess.notNull() )
|
2018-06-28 03:36:38 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
restartDataAccess->timeSteps( &timeSteps, &daysSinceSimulationStart );
|
2018-06-28 03:36:38 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
m_timeStepFilter->setTimeStepsFromFile( timeSteps );
|
2018-06-14 03:59:28 -05:00
|
|
|
}
|
2017-08-24 23:51:56 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( showTimeStepFilter )
|
|
|
|
{
|
|
|
|
caf::PdmUiPropertyViewDialog propertyDialog( nullptr,
|
|
|
|
m_timeStepFilter,
|
|
|
|
"Time Step Filter",
|
|
|
|
"",
|
|
|
|
QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
|
|
|
|
propertyDialog.resize( QSize( 400, 400 ) );
|
2018-06-21 06:56:10 -05:00
|
|
|
|
|
|
|
// Push arrow cursor onto the cursor stack so it takes over from the wait cursor.
|
2019-09-06 03:40:57 -05:00
|
|
|
QApplication::setOverrideCursor( QCursor( Qt::ArrowCursor ) );
|
|
|
|
// Show GUI to select time steps
|
2018-06-21 06:56:10 -05:00
|
|
|
int dialogReturnValue = propertyDialog.exec();
|
|
|
|
// Pop arrow cursor off the cursor stack so that the previous (wait) cursor takes over.
|
|
|
|
QApplication::restoreOverrideCursor();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( dialogReturnValue != QDialog::Accepted )
|
2018-06-14 03:59:28 -05:00
|
|
|
{
|
|
|
|
return false;
|
2017-08-24 23:51:56 -05:00
|
|
|
}
|
2018-06-14 03:59:28 -05:00
|
|
|
m_timeStepFilter->updateFilteredTimeStepsFromUi();
|
2017-08-24 23:51:56 -05:00
|
|
|
}
|
2019-12-10 09:19:39 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
readerEclipseOutput->setFileDataAccess( restartDataAccess.p() );
|
|
|
|
readerEclipseOutput->setTimeStepFilter( m_timeStepFilter->filteredTimeSteps() );
|
|
|
|
|
|
|
|
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData( this );
|
2020-02-21 05:07:15 -06:00
|
|
|
if ( !readerEclipseOutput->open( gridFileName(), eclipseCase.p() ) )
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
this->setFilesContainingFaults( readerEclipseOutput->filenamesWithFaults() );
|
2013-12-17 04:37:58 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
this->setReservoirData( eclipseCase.p() );
|
2017-08-24 23:51:56 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
readerInterface = readerEclipseOutput;
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
results( RiaDefines::MATRIX_MODEL )->setReaderInterface( readerInterface.p() );
|
|
|
|
results( RiaDefines::FRACTURE_MODEL )->setReaderInterface( readerInterface.p() );
|
2013-03-18 08:34:29 -05:00
|
|
|
|
2013-02-06 06:44:27 -06:00
|
|
|
progInfo.incrementProgress();
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_flowDagSolverInterface = new RigFlowDiagSolverInterface( this );
|
2019-01-29 04:54:39 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( this->eclipseCaseData() );
|
|
|
|
CVF_ASSERT( readerInterface.notNull() );
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
progInfo.setProgressDescription( "Computing Case Cache" );
|
2013-02-22 03:12:06 -06:00
|
|
|
computeCachedData();
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2013-04-12 05:03:04 -05:00
|
|
|
m_gridAndWellDataIsReadFromFile = true;
|
2019-09-06 03:40:57 -05:00
|
|
|
m_activeCellInfoIsReadFromFile = true;
|
2013-04-12 05:03:04 -05:00
|
|
|
|
2020-02-21 05:07:15 -06:00
|
|
|
QFileInfo eclipseCaseFileInfo( gridFileName() );
|
2019-09-06 03:40:57 -05:00
|
|
|
QString rftFileName = eclipseCaseFileInfo.path() + "/" + eclipseCaseFileInfo.completeBaseName() + ".RFT";
|
|
|
|
QFileInfo rftFileInfo( rftFileName );
|
2017-10-06 07:38:20 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( rftFileInfo.exists() )
|
2017-11-30 11:57:09 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RiaLogging::info( QString( "RFT file found" ) );
|
|
|
|
m_readerEclipseRft = new RifReaderEclipseRft( rftFileInfo.filePath() );
|
2017-10-05 02:29:19 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_flowDiagSolutions.size() == 0 )
|
2017-01-12 07:16:39 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_flowDiagSolutions.push_back( new RimFlowDiagSolution() );
|
2017-01-12 07:16:39 -06:00
|
|
|
}
|
2017-03-23 01:00:00 -05:00
|
|
|
|
2019-12-13 03:27:38 -06:00
|
|
|
if ( !m_sourSimFileName().path().isEmpty() )
|
2017-03-23 01:00:00 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifReaderEclipseOutput* outReader = dynamic_cast<RifReaderEclipseOutput*>( readerInterface.p() );
|
2019-12-13 03:27:38 -06:00
|
|
|
outReader->setHdf5FileName( m_sourSimFileName().path() );
|
2017-03-23 01:00:00 -05:00
|
|
|
}
|
2018-07-30 03:33:23 -05:00
|
|
|
|
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( app->preferences()->autocomputeDepthRelatedProperties )
|
2018-07-30 03:33:23 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
results( RiaDefines::MATRIX_MODEL )->computeDepthRelatedResults();
|
|
|
|
results( RiaDefines::FRACTURE_MODEL )->computeDepthRelatedResults();
|
2018-07-30 03:33:23 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
results( RiaDefines::MATRIX_MODEL )->computeCellVolumes();
|
2018-11-08 03:18:49 -06:00
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
return true;
|
2017-08-24 23:51:56 -05:00
|
|
|
}
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2019-10-30 10:52:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimEclipseResultCase::importAsciiInputProperties( const QStringList& fileNames )
|
|
|
|
{
|
|
|
|
bool importFaults = false;
|
|
|
|
return RifEclipseInputPropertyLoader::readInputPropertiesFromFiles( m_inputPropertyCollection,
|
|
|
|
this->eclipseCaseData(),
|
|
|
|
importFaults,
|
|
|
|
fileNames.toVector().toStdVector() );
|
|
|
|
}
|
|
|
|
|
2017-04-21 05:02:48 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimEclipseResultCase::reloadEclipseGridFile()
|
|
|
|
{
|
|
|
|
m_gridAndWellDataIsReadFromFile = false;
|
2019-09-06 03:40:57 -05:00
|
|
|
m_activeCellInfoIsReadFromFile = false;
|
|
|
|
setReservoirData( nullptr );
|
2019-01-29 03:06:30 -06:00
|
|
|
openReserviorCase();
|
2017-04-21 05:02:48 -05:00
|
|
|
}
|
|
|
|
|
2013-02-27 08:27:33 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-02-27 08:27:33 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
bool RimEclipseResultCase::openAndReadActiveCellData( RigEclipseCaseData* mainEclipseCase )
|
2013-02-27 08:27:33 -06:00
|
|
|
{
|
2013-04-12 05:03:04 -05:00
|
|
|
// Early exit if data is already read
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_activeCellInfoIsReadFromFile ) return true;
|
2013-02-27 08:27:33 -06:00
|
|
|
|
2013-04-12 05:03:04 -05:00
|
|
|
cvf::ref<RifReaderInterface> readerInterface;
|
2020-02-21 05:07:15 -06:00
|
|
|
if ( gridFileName().contains( "Result Mock Debug Model" ) )
|
2013-02-27 08:27:33 -06:00
|
|
|
{
|
2020-02-21 05:07:15 -06:00
|
|
|
readerInterface = this->createMockModel( this->gridFileName() );
|
2013-02-27 08:27:33 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-02-21 05:07:15 -06:00
|
|
|
if ( !caf::Utils::fileExists( gridFileName() ) )
|
2013-02-27 08:27:33 -06:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData( this );
|
2013-03-05 06:10:26 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( mainEclipseCase && mainEclipseCase->mainGrid() );
|
|
|
|
eclipseCase->setMainGrid( mainEclipseCase->mainGrid() );
|
2013-02-27 08:27:33 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<QDateTime> timeStepDates = mainEclipseCase->results( RiaDefines::MATRIX_MODEL )->timeStepDates();
|
2013-03-19 02:21:55 -05:00
|
|
|
cvf::ref<RifReaderEclipseOutput> readerEclipseOutput = new RifReaderEclipseOutput;
|
2020-02-21 05:07:15 -06:00
|
|
|
if ( !readerEclipseOutput->openAndReadActiveCellData( gridFileName(), timeStepDates, eclipseCase.p() ) )
|
2013-03-19 02:21:55 -05:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-03-18 08:34:29 -05:00
|
|
|
this->setReservoirData( eclipseCase.p() );
|
2013-03-19 02:21:55 -05:00
|
|
|
|
|
|
|
readerInterface = readerEclipseOutput;
|
2013-02-27 08:27:33 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
results( RiaDefines::MATRIX_MODEL )->setReaderInterface( readerInterface.p() );
|
|
|
|
results( RiaDefines::FRACTURE_MODEL )->setReaderInterface( readerInterface.p() );
|
2013-03-18 08:34:29 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( this->eclipseCaseData() );
|
|
|
|
CVF_ASSERT( readerInterface.notNull() );
|
2013-02-27 08:27:33 -06:00
|
|
|
|
2017-03-15 03:10:16 -05:00
|
|
|
eclipseCaseData()->computeActiveCellBoundingBoxes();
|
2013-02-27 08:27:33 -06:00
|
|
|
|
2013-04-12 05:03:04 -05:00
|
|
|
m_activeCellInfoIsReadFromFile = true;
|
|
|
|
|
2013-02-27 08:27:33 -06:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-03-31 04:37:07 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-31 04:37:07 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimEclipseResultCase::loadAndUpdateSourSimData()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !results( RiaDefines::MATRIX_MODEL ) ) return;
|
2017-03-31 04:37:07 -05:00
|
|
|
|
2019-12-13 03:27:38 -06:00
|
|
|
results( RiaDefines::MATRIX_MODEL )->setHdf5Filename( m_sourSimFileName().path() );
|
2017-08-17 08:36:08 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !hasSourSimFile() )
|
2017-08-17 08:36:08 -05:00
|
|
|
{
|
|
|
|
// Deselect SourSimRL cell results
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( Rim3dView* view : views() )
|
2017-08-17 08:36:08 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( view );
|
|
|
|
if ( eclipseView != nullptr )
|
2017-08-17 08:36:08 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( eclipseView->cellResult()->resultType() == RiaDefines::SOURSIMRL )
|
2017-08-17 08:36:08 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
eclipseView->cellResult()->setResultType( RiaDefines::DYNAMIC_NATIVE );
|
|
|
|
eclipseView->cellResult()->setResultVariable( "SOIL" );
|
2017-08-17 08:36:08 -05:00
|
|
|
eclipseView->loadDataAndUpdate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-03-31 04:37:07 -05:00
|
|
|
}
|
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-06-26 09:10:41 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::ref<RifReaderInterface> RimEclipseResultCase::createMockModel( QString modelName )
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
|
|
|
cvf::ref<RifReaderMockModel> mockFileInterface = new RifReaderMockModel;
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::ref<RigEclipseCaseData> reservoir = new RigEclipseCaseData( this );
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( modelName == RiaDefines::mockModelBasic() )
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
|
|
|
// Create the mock file interface and and RigSerervoir and set them up.
|
2019-09-06 03:40:57 -05:00
|
|
|
mockFileInterface->setWorldCoordinates( cvf::Vec3d( 10, 10, 10 ), cvf::Vec3d( 20, 20, 20 ) );
|
|
|
|
mockFileInterface->setGridPointDimensions( cvf::Vec3st( 4, 5, 6 ) );
|
|
|
|
mockFileInterface->addLocalGridRefinement( cvf::Vec3st( 0, 2, 2 ), cvf::Vec3st( 0, 2, 2 ), cvf::Vec3st( 3, 3, 3 ) );
|
|
|
|
mockFileInterface->enableWellData( false );
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
mockFileInterface->open( "", reservoir.p() );
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( modelName == RiaDefines::mockModelBasicWithResults() )
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
mockFileInterface->setWorldCoordinates( cvf::Vec3d( 10, 10, 10 ), cvf::Vec3d( -20, -20, -20 ) );
|
|
|
|
mockFileInterface->setGridPointDimensions( cvf::Vec3st( 5, 10, 20 ) );
|
|
|
|
mockFileInterface->addLocalGridRefinement( cvf::Vec3st( 0, 3, 3 ), cvf::Vec3st( 1, 4, 9 ), cvf::Vec3st( 2, 2, 2 ) );
|
|
|
|
mockFileInterface->setResultInfo( 3, 10 );
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
mockFileInterface->open( "", reservoir.p() );
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
// Make a fault
|
|
|
|
cvf::Vec3d& tmp = reservoir->mainGrid()->nodes()[1];
|
2019-09-06 03:40:57 -05:00
|
|
|
tmp += cvf::Vec3d( 1, 0, 0 );
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( modelName == RiaDefines::mockModelLargeWithResults() )
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
|
|
|
double startX = 0;
|
|
|
|
double startY = 0;
|
|
|
|
double startZ = 0;
|
|
|
|
|
|
|
|
double widthX = 6000;
|
|
|
|
double widthY = 12000;
|
|
|
|
double widthZ = 500;
|
|
|
|
|
|
|
|
double offsetX = 0;
|
|
|
|
double offsetY = 0;
|
|
|
|
double offsetZ = 0;
|
|
|
|
|
|
|
|
// Test code to simulate UTM coordinates
|
|
|
|
offsetX = 400000;
|
|
|
|
offsetY = 6000000;
|
|
|
|
offsetZ = 0;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
mockFileInterface->setWorldCoordinates( cvf::Vec3d( startX + offsetX, startY + offsetY, startZ + offsetZ ),
|
|
|
|
cvf::Vec3d( startX + widthX + offsetX,
|
|
|
|
startY + widthY + offsetY,
|
|
|
|
startZ + widthZ + offsetZ ) );
|
|
|
|
mockFileInterface->setGridPointDimensions( cvf::Vec3st( 50, 100, 200 ) );
|
|
|
|
mockFileInterface->addLocalGridRefinement( cvf::Vec3st( 0, 30, 30 ),
|
|
|
|
cvf::Vec3st( 1, 40, 90 ),
|
|
|
|
cvf::Vec3st( 2, 2, 2 ) );
|
|
|
|
mockFileInterface->setResultInfo( 3, 10 );
|
|
|
|
|
|
|
|
mockFileInterface->open( "", reservoir.p() );
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( modelName == RiaDefines::mockModelCustomized() )
|
2013-10-28 04:32:24 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QApplication::setOverrideCursor( QCursor( Qt::ArrowCursor ) );
|
2013-10-28 06:05:06 -05:00
|
|
|
|
2018-10-09 06:54:38 -05:00
|
|
|
RimMockModelSettings* mockModelSettings = RiaApplication::instance()->project()->dialogData()->mockModelSettings();
|
2013-10-28 04:32:24 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !RiaRegressionTestRunner::instance()->isRunningRegressionTests() )
|
2013-10-28 06:05:06 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiPropertyViewDialog propertyDialog( nullptr, mockModelSettings, "Customize Mock Model", "" );
|
|
|
|
if ( propertyDialog.exec() == QDialog::Accepted )
|
2018-10-09 06:54:38 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2013-10-28 04:32:24 -05:00
|
|
|
|
2018-10-09 06:54:38 -05:00
|
|
|
{
|
2013-10-28 06:05:06 -05:00
|
|
|
double startX = 0;
|
|
|
|
double startY = 0;
|
|
|
|
double startZ = 0;
|
2013-10-28 04:32:24 -05:00
|
|
|
|
2013-10-28 06:05:06 -05:00
|
|
|
double widthX = 6000;
|
|
|
|
double widthY = 12000;
|
|
|
|
double widthZ = 500;
|
2013-10-28 04:32:24 -05:00
|
|
|
|
2013-10-28 06:05:06 -05:00
|
|
|
// Test code to simulate UTM coordinates
|
|
|
|
double offsetX = 400000;
|
|
|
|
double offsetY = 6000000;
|
|
|
|
double offsetZ = 0;
|
2013-10-28 04:32:24 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
mockFileInterface->setWorldCoordinates( cvf::Vec3d( startX + offsetX, startY + offsetY, startZ + offsetZ ),
|
|
|
|
cvf::Vec3d( startX + widthX + offsetX,
|
|
|
|
startY + widthY + offsetY,
|
|
|
|
startZ + widthZ + offsetZ ) );
|
|
|
|
mockFileInterface->setGridPointDimensions( cvf::Vec3st( mockModelSettings->cellCountX + 1,
|
|
|
|
mockModelSettings->cellCountY + 1,
|
|
|
|
mockModelSettings->cellCountZ + 1 ) );
|
|
|
|
mockFileInterface->setResultInfo( mockModelSettings->resultCount, mockModelSettings->timeStepCount );
|
|
|
|
mockFileInterface->enableWellData( false );
|
|
|
|
|
|
|
|
mockFileInterface->open( "", reservoir.p() );
|
2013-10-28 06:05:06 -05:00
|
|
|
}
|
2018-10-09 06:54:38 -05:00
|
|
|
|
|
|
|
QApplication::restoreOverrideCursor();
|
2013-10-28 04:32:24 -05:00
|
|
|
}
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2013-03-18 08:34:29 -05:00
|
|
|
this->setReservoirData( reservoir.p() );
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
return mockFileInterface.p();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-06-26 09:10:41 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 04:56:18 -05:00
|
|
|
RimEclipseResultCase::~RimEclipseResultCase()
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
|
|
|
reservoirViews.deleteAllChildObjects();
|
2016-12-14 02:50:30 -06:00
|
|
|
m_flowDiagSolutions.deleteAllChildObjects();
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-06-26 09:10:41 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 04:56:18 -05:00
|
|
|
QString RimEclipseResultCase::locationOnDisc() const
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
2020-02-21 05:07:15 -06:00
|
|
|
QFileInfo fi( gridFileName() );
|
2013-04-11 05:06:38 -05:00
|
|
|
return fi.absolutePath();
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
|
|
|
|
2013-02-11 01:16:51 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-02-11 01:16:51 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimEclipseResultCase::readGridDimensions( std::vector<std::vector<int>>& gridDimensions )
|
2013-02-11 01:16:51 -06:00
|
|
|
{
|
2020-02-21 05:07:15 -06:00
|
|
|
RifEclipseOutputFileTools::readGridDimensions( gridFileName(), gridDimensions );
|
2013-04-08 01:36:34 -05:00
|
|
|
}
|
2013-02-11 01:16:51 -06:00
|
|
|
|
2013-04-08 01:36:34 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-04-08 01:36:34 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimEclipseResultCase::updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath )
|
2013-04-08 01:36:34 -05:00
|
|
|
{
|
2019-12-10 09:36:07 -06:00
|
|
|
// bool foundFile = false;
|
|
|
|
// std::vector<QString> searchedPaths;
|
2013-02-11 01:16:51 -06:00
|
|
|
|
2013-04-12 01:31:59 -05:00
|
|
|
// Update filename and folder paths when opening project from a different file location
|
2020-02-21 05:07:15 -06:00
|
|
|
// caseFileName = RimTools::relocateFile( caseFileName(), newProjectPath, oldProjectPath, &foundFile,
|
2020-02-12 04:43:15 -06:00
|
|
|
// &searchedPaths );
|
2017-04-27 05:11:43 -05:00
|
|
|
|
2019-12-10 09:36:07 -06:00
|
|
|
// std::vector<QString> relocatedFaultFiles;
|
|
|
|
// const std::vector<QString>& orgFilesContainingFaults = filesContainingFaults();
|
|
|
|
// for ( auto faultFileName : orgFilesContainingFaults )
|
|
|
|
// {
|
|
|
|
// QString relocatedFaultFile =
|
|
|
|
// RimTools::relocateFile( faultFileName, newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
|
|
|
// relocatedFaultFiles.push_back( relocatedFaultFile );
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// setFilesContainingFaults( relocatedFaultFiles );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2013-10-07 04:45:54 -05:00
|
|
|
#if 0 // Output the search path for debugging
|
|
|
|
for (size_t i = 0; i < searchedPaths.size(); ++i)
|
|
|
|
qDebug() << searchedPaths[i];
|
2019-09-06 03:40:57 -05:00
|
|
|
#endif
|
2013-02-11 01:16:51 -06:00
|
|
|
}
|
|
|
|
|
2017-03-09 15:45:47 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-09 15:45:47 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimFlowDiagSolution* RimEclipseResultCase::defaultFlowDiagSolution()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_flowDiagSolutions.size() > 0 )
|
2017-03-09 15:45:47 -06:00
|
|
|
{
|
|
|
|
return m_flowDiagSolutions[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimFlowDiagSolution*> RimEclipseResultCase::flowDiagSolutions()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<RimFlowDiagSolution*> flowSols;
|
|
|
|
for ( const caf::PdmPointer<RimFlowDiagSolution>& fsol : m_flowDiagSolutions )
|
|
|
|
{
|
|
|
|
flowSols.push_back( fsol.p() );
|
2016-12-14 02:50:30 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
return flowSols;
|
|
|
|
}
|
|
|
|
|
2016-12-20 04:41:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-20 04:41:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RigFlowDiagSolverInterface* RimEclipseResultCase::flowDiagSolverInterface()
|
|
|
|
{
|
|
|
|
return m_flowDagSolverInterface.p();
|
|
|
|
}
|
|
|
|
|
2013-12-02 01:55:13 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-02 01:55:13 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-05 02:29:19 -05:00
|
|
|
RifReaderEclipseRft* RimEclipseResultCase::rftReader()
|
|
|
|
{
|
|
|
|
return m_readerEclipseRft.p();
|
|
|
|
}
|
|
|
|
|
2013-04-08 07:29:43 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-04-08 07:29:43 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimEclipseResultCase::setCaseInfo( const QString& userDescription, const QString& fileName )
|
2013-04-08 07:29:43 -05:00
|
|
|
{
|
2013-05-08 03:41:56 -05:00
|
|
|
this->caseUserDescription = userDescription;
|
2020-02-21 05:07:15 -06:00
|
|
|
setGridFileName( fileName );
|
2013-05-08 03:41:56 -05:00
|
|
|
|
|
|
|
RimProject* proj = RiaApplication::instance()->project();
|
2019-09-06 03:40:57 -05:00
|
|
|
proj->assignCaseIdToCase( this );
|
2013-04-11 05:06:38 -05:00
|
|
|
}
|
|
|
|
|
2017-03-23 01:00:00 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-23 01:00:00 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimEclipseResultCase::setSourSimFileName( const QString& fileName )
|
2017-03-23 01:00:00 -05:00
|
|
|
{
|
|
|
|
m_sourSimFileName = fileName;
|
|
|
|
|
2017-03-31 04:37:07 -05:00
|
|
|
loadAndUpdateSourSimData();
|
2017-03-23 01:00:00 -05:00
|
|
|
}
|
|
|
|
|
2017-07-07 06:31:14 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-07-07 06:31:14 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimEclipseResultCase::hasSourSimFile()
|
|
|
|
{
|
2019-12-13 03:27:38 -06:00
|
|
|
return !m_sourSimFileName().path().isEmpty();
|
2017-07-07 06:31:14 -05:00
|
|
|
}
|
|
|
|
|
2013-04-11 05:06:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-04-11 05:06:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 04:56:18 -05:00
|
|
|
void RimEclipseResultCase::initAfterRead()
|
2013-04-11 05:06:38 -05:00
|
|
|
{
|
2015-05-15 01:40:27 -05:00
|
|
|
RimEclipseCase::initAfterRead();
|
2013-04-11 05:06:38 -05:00
|
|
|
|
|
|
|
// Convert from old (9.0.2) way of storing the case file
|
2020-02-21 05:07:15 -06:00
|
|
|
if ( gridFileName().isEmpty() )
|
2013-04-11 05:06:38 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !this->m_caseName_OBSOLETE().isEmpty() && !caseDirectory().isEmpty() )
|
2013-04-11 05:06:38 -05:00
|
|
|
{
|
2020-02-21 05:07:15 -06:00
|
|
|
setGridFileName( QDir::fromNativeSeparators( caseDirectory() ) + "/" + m_caseName_OBSOLETE() + ".EGRID" );
|
2013-04-11 05:06:38 -05:00
|
|
|
}
|
|
|
|
}
|
2013-04-08 07:29:43 -05:00
|
|
|
}
|
|
|
|
|
2013-06-26 02:02:37 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-06-26 02:02:37 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimEclipseResultCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2013-06-26 02:02:37 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
uiOrdering.add( &caseUserDescription );
|
|
|
|
uiOrdering.add( &caseId );
|
2020-02-21 05:07:15 -06:00
|
|
|
uiOrdering.add( &m_caseFileName );
|
2019-09-06 03:40:57 -05:00
|
|
|
uiOrdering.add( &m_unitSystem );
|
|
|
|
|
|
|
|
auto group = uiOrdering.addNewGroup( "Case Options" );
|
2020-01-06 07:33:54 -06:00
|
|
|
group->add( &m_activeFormationNames );
|
2019-09-06 03:40:57 -05:00
|
|
|
group->add( &m_flipXAxis );
|
|
|
|
group->add( &m_flipYAxis );
|
|
|
|
|
|
|
|
if ( eclipseCaseData() && eclipseCaseData()->results( RiaDefines::MATRIX_MODEL ) &&
|
|
|
|
eclipseCaseData()->results( RiaDefines::MATRIX_MODEL )->maxTimeStepCount() > 0 )
|
2017-08-29 06:01:55 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
auto group1 = uiOrdering.addNewGroup( "Time Step Filter" );
|
|
|
|
group1->setCollapsedByDefault( true );
|
|
|
|
m_timeStepFilter->uiOrdering( uiConfigName, *group1 );
|
2017-08-29 06:01:55 -05:00
|
|
|
}
|
2013-06-26 02:02:37 -05:00
|
|
|
}
|
|
|
|
|
2017-03-31 04:37:07 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-31 04:37:07 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimEclipseResultCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
const QVariant& oldValue,
|
|
|
|
const QVariant& newValue )
|
2017-03-31 04:37:07 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( changedField == &m_sourSimFileName )
|
2017-03-31 04:37:07 -05:00
|
|
|
{
|
|
|
|
loadAndUpdateSourSimData();
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return RimEclipseCase::fieldChangedByUi( changedField, oldValue, newValue );
|
2017-03-31 04:37:07 -05:00
|
|
|
}
|
|
|
|
|
2017-08-11 08:59:19 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-08-11 08:59:19 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimEclipseResultCase::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
|
|
|
QString uiConfigName,
|
|
|
|
caf::PdmUiEditorAttribute* attribute )
|
2017-08-11 08:59:19 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( field == &m_sourSimFileName )
|
2017-08-11 08:59:19 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
|
|
|
|
if ( myAttr )
|
2017-08-11 08:59:19 -05:00
|
|
|
{
|
|
|
|
myAttr->m_fileSelectionFilter = "SourSim (*.sourres)";
|
2020-02-21 05:07:15 -06:00
|
|
|
myAttr->m_defaultPath = QFileInfo( gridFileName() ).absolutePath();
|
2017-08-11 08:59:19 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|