mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-07 06:33:05 -06:00
#4893 Formations : Make sure "layer_zone_table.txt" is defined once
This commit is contained in:
parent
3f617c93d2
commit
6d7b29bb29
@ -75,11 +75,15 @@ void RicImportFormationNamesFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QString defaultDir = app->lastUsedDialogDirectory( "BINARY_GRID" );
|
||||
QStringList fileNames = QFileDialog::getOpenFileNames( Riu3DMainWindowTools::mainWindowWidget(),
|
||||
|
||||
QString filterText = QString(
|
||||
"Formation Names description File (*.lyr);;FMU Layer Zone Table(%1);;All Files (*.*)" )
|
||||
.arg( RimFormationNames::layerZoneTableFileName() );
|
||||
|
||||
QStringList fileNames = QFileDialog::getOpenFileNames( Riu3DMainWindowTools::mainWindowWidget(),
|
||||
"Import Formation Names",
|
||||
defaultDir,
|
||||
"Formation Names description File (*.lyr);;FMU Layer Zone "
|
||||
"Table(layer_zone_table.txt);;All Files (*.*)" );
|
||||
filterText );
|
||||
|
||||
if ( fileNames.isEmpty() ) return;
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
#include "RifReaderFmuRft.h"
|
||||
|
||||
#include "RimFormationNames.h"
|
||||
#include "RimObservedDataCollection.h"
|
||||
#include "RimObservedFmuRftData.h"
|
||||
#include "RimObservedSummaryData.h"
|
||||
@ -88,7 +89,7 @@ void RicImportObservedFmuDataFeature::selectObservedDataPathInDialog()
|
||||
{
|
||||
importedData = observedDataCollection->createAndAddFmuRftDataFromPath( subDir );
|
||||
QDir dir( subDir );
|
||||
QString layerZoneFile = dir.absoluteFilePath( "layer_zone_table.txt" );
|
||||
QString layerZoneFile = dir.absoluteFilePath( RimFormationNames::layerZoneTableFileName() );
|
||||
if ( QFileInfo::exists( layerZoneFile ) )
|
||||
{
|
||||
QStringList fileNames;
|
||||
|
@ -151,7 +151,7 @@ void RimFormationNames::readFormationNamesFile( QString* errorMessage )
|
||||
|
||||
QFileInfo fileInfo( m_formationNamesFileName() );
|
||||
|
||||
if ( fileInfo.fileName() == "layer_zone_table.txt" )
|
||||
if ( fileInfo.fileName() == RimFormationNames::layerZoneTableFileName() )
|
||||
{
|
||||
readFmuFormationNameFile( stream, errorMessage );
|
||||
}
|
||||
@ -174,6 +174,14 @@ void RimFormationNames::updateFilePathsFromProjectPath( const QString& newProjec
|
||||
nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFormationNames::layerZoneTableFileName()
|
||||
{
|
||||
return "layer_zone_table.txt";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -49,6 +49,8 @@ public:
|
||||
void readFormationNamesFile( QString* errorMessage );
|
||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
||||
|
||||
static QString layerZoneTableFileName();
|
||||
|
||||
protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
|
Loading…
Reference in New Issue
Block a user