mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix "Export Property To File" for RimEclipseResultCase.
This commit is contained in:
parent
470fab787d
commit
ed59f0b618
@ -25,7 +25,7 @@
|
|||||||
#include "RicEclipseCellResultToFileImpl.h"
|
#include "RicEclipseCellResultToFileImpl.h"
|
||||||
#include "RicExportFeatureImpl.h"
|
#include "RicExportFeatureImpl.h"
|
||||||
|
|
||||||
#include "RimEclipseInputCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RimEclipseInputProperty.h"
|
#include "RimEclipseInputProperty.h"
|
||||||
#include "RimEclipseInputPropertyCollection.h"
|
#include "RimEclipseInputPropertyCollection.h"
|
||||||
#include "RimExportInputPropertySettings.h"
|
#include "RimExportInputPropertySettings.h"
|
||||||
@ -81,23 +81,23 @@ void RicSaveEclipseInputPropertyFeature::onActionTriggered( bool isChecked )
|
|||||||
exportSettings.eclipseKeyword = inputProperty->eclipseKeyword;
|
exportSettings.eclipseKeyword = inputProperty->eclipseKeyword;
|
||||||
|
|
||||||
// Find input reservoir for this property
|
// Find input reservoir for this property
|
||||||
RimEclipseInputCase* inputReservoir = nullptr;
|
RimEclipseCase* eclipseCase = nullptr;
|
||||||
{
|
{
|
||||||
RimEclipseInputPropertyCollection* inputPropertyCollection = dynamic_cast<RimEclipseInputPropertyCollection*>(
|
RimEclipseInputPropertyCollection* inputPropertyCollection = dynamic_cast<RimEclipseInputPropertyCollection*>(
|
||||||
inputProperty->parentField()->ownerObject() );
|
inputProperty->parentField()->ownerObject() );
|
||||||
if ( !inputPropertyCollection ) return;
|
if ( !inputPropertyCollection ) return;
|
||||||
|
|
||||||
inputReservoir = dynamic_cast<RimEclipseInputCase*>( inputPropertyCollection->parentField()->ownerObject() );
|
eclipseCase = dynamic_cast<RimEclipseCase*>( inputPropertyCollection->parentField()->ownerObject() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !inputReservoir ) return;
|
if ( !eclipseCase ) return;
|
||||||
|
|
||||||
{
|
{
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
QString projectFolder = app->currentProjectPath();
|
QString projectFolder = app->currentProjectPath();
|
||||||
if ( projectFolder.isEmpty() )
|
if ( projectFolder.isEmpty() )
|
||||||
{
|
{
|
||||||
projectFolder = inputReservoir->locationOnDisc();
|
projectFolder = eclipseCase->locationOnDisc();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString outputFileName = projectFolder + "/" + inputProperty->eclipseKeyword;
|
QString outputFileName = projectFolder + "/" + inputProperty->eclipseKeyword;
|
||||||
@ -117,7 +117,7 @@ void RicSaveEclipseInputPropertyFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
bool isOk = RicEclipseCellResultToFileImpl::writePropertyToTextFile( exportSettings.fileName,
|
bool isOk = RicEclipseCellResultToFileImpl::writePropertyToTextFile( exportSettings.fileName,
|
||||||
inputReservoir->eclipseCaseData(),
|
eclipseCase->eclipseCaseData(),
|
||||||
0,
|
0,
|
||||||
inputProperty->resultName,
|
inputProperty->resultName,
|
||||||
exportSettings.eclipseKeyword,
|
exportSettings.eclipseKeyword,
|
||||||
|
Loading…
Reference in New Issue
Block a user