mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4819 Minor review tweaks.
This commit is contained in:
@@ -19,8 +19,11 @@
|
|||||||
|
|
||||||
#include "RiaGuiApplication.h"
|
#include "RiaGuiApplication.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
#include "RicExportContourMapToTextUi.h"
|
#include "RicExportContourMapToTextUi.h"
|
||||||
|
|
||||||
#include "RifTextDataTableFormatter.h"
|
#include "RifTextDataTableFormatter.h"
|
||||||
|
|
||||||
#include "RimContourMapProjection.h"
|
#include "RimContourMapProjection.h"
|
||||||
#include "RimEclipseContourMapProjection.h"
|
#include "RimEclipseContourMapProjection.h"
|
||||||
#include "RimEclipseContourMapView.h"
|
#include "RimEclipseContourMapView.h"
|
||||||
@@ -91,12 +94,9 @@ void RicExportContourMapToTextFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
RiaGuiApplication* app = RiaGuiApplication::instance();
|
RiaGuiApplication* app = RiaGuiApplication::instance();
|
||||||
CAF_ASSERT( app && "Must be gui mode" );
|
CAF_ASSERT( app && "Must be gui mode" );
|
||||||
|
QString startPath = app->lastUsedDialogDirectoryWithFallbackToProjectFolder( "CONTOUR_EXPORT" );
|
||||||
QString startPath = app->lastUsedDialogDirectoryWithFallbackToProjectFolder( "CONTOUR_EXPORT" );
|
|
||||||
|
|
||||||
QString fileBaseName = caf::Utils::makeValidFileBasename( contourMapName );
|
QString fileBaseName = caf::Utils::makeValidFileBasename( contourMapName );
|
||||||
|
startPath = startPath + "/" + fileBaseName + ".txt";
|
||||||
startPath = startPath + "/" + fileBaseName + ".txt";
|
|
||||||
|
|
||||||
RicExportContourMapToTextUi featureUi;
|
RicExportContourMapToTextUi featureUi;
|
||||||
featureUi.setExportFileName( startPath );
|
featureUi.setExportFileName( startPath );
|
||||||
@@ -220,6 +220,9 @@ void RicExportContourMapToTextFeature::setupActionLook( QAction* actionToSetup )
|
|||||||
actionToSetup->setText( "Export Contour Map to Text" );
|
actionToSetup->setText( "Export Contour Map to Text" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
||||||
{
|
{
|
||||||
RicfCommandResponse response;
|
RicfCommandResponse response;
|
||||||
@@ -242,6 +245,12 @@ RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !myView )
|
||||||
|
{
|
||||||
|
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, "No contour map view found" );
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
RimContourMapProjection* contourMapProjection = nullptr;
|
RimContourMapProjection* contourMapProjection = nullptr;
|
||||||
RimEclipseContourMapView* existingEclipseContourMap = dynamic_cast<RimEclipseContourMapView*>( myView );
|
RimEclipseContourMapView* existingEclipseContourMap = dynamic_cast<RimEclipseContourMapView*>( myView );
|
||||||
RimGeoMechContourMapView* existingGeoMechContourMap = dynamic_cast<RimGeoMechContourMapView*>( myView );
|
RimGeoMechContourMapView* existingGeoMechContourMap = dynamic_cast<RimGeoMechContourMapView*>( myView );
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ public:
|
|||||||
RicfCommandResponse execute() override;
|
RicfCommandResponse execute() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overrides
|
|
||||||
bool isCommandEnabled() override;
|
bool isCommandEnabled() override;
|
||||||
void onActionTriggered( bool isChecked ) override;
|
void onActionTriggered( bool isChecked ) override;
|
||||||
|
void setupActionLook( QAction* actionToSetup ) override;
|
||||||
|
|
||||||
static void writeMetaDataToStream( QTextStream& stream,
|
static void writeMetaDataToStream( QTextStream& stream,
|
||||||
const RimContourMapProjection* contourMapProjection,
|
const RimContourMapProjection* contourMapProjection,
|
||||||
@@ -52,8 +52,6 @@ protected:
|
|||||||
const QString& undefinedValueLabel,
|
const QString& undefinedValueLabel,
|
||||||
bool excludeUndefinedValues );
|
bool excludeUndefinedValues );
|
||||||
|
|
||||||
void setupActionLook( QAction* actionToSetup ) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_exportFileName;
|
caf::PdmField<QString> m_exportFileName;
|
||||||
caf::PdmField<bool> m_exportLocalCoordinates;
|
caf::PdmField<bool> m_exportLocalCoordinates;
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RicExportContourMapToTextUi, "RicExportContourMapToTextUi" );
|
CAF_PDM_SOURCE_INIT( RicExportContourMapToTextUi, "RicExportContourMapToTextUi" );
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicExportContourMapToTextUi::RicExportContourMapToTextUi()
|
RicExportContourMapToTextUi::RicExportContourMapToTextUi()
|
||||||
{
|
{
|
||||||
CAF_PDM_InitObject( "Export Contour Map to Text", "", "", "" );
|
CAF_PDM_InitObject( "Export Contour Map to Text", "", "", "" );
|
||||||
|
|||||||
Reference in New Issue
Block a user