mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Command menu item is now "Export Contour Map to Text". Also update file names to match.
This commit is contained in:
@@ -81,8 +81,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiUi.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.h
|
||||
)
|
||||
|
||||
|
||||
@@ -162,8 +162,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiUi.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RicExportContourMapToAsciiFeature.h"
|
||||
#include "RicExportContourMapToTextFeature.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RicExportContourMapToAsciiUi.h"
|
||||
#include "RicExportContourMapToTextUi.h"
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
#include "RimContourMapProjection.h"
|
||||
#include "RimEclipseContourMapProjection.h"
|
||||
@@ -38,9 +38,9 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
RICF_SOURCE_INIT( RicExportContourMapToAsciiFeature, "RicExportContourMapToAsciiFeature", "exportContourMapToText" );
|
||||
RICF_SOURCE_INIT( RicExportContourMapToTextFeature, "RicExportContourMapToTextFeature", "exportContourMapToText" );
|
||||
|
||||
RicExportContourMapToAsciiFeature::RicExportContourMapToAsciiFeature()
|
||||
RicExportContourMapToTextFeature::RicExportContourMapToTextFeature()
|
||||
{
|
||||
RICF_InitFieldNoDefault( &m_exportFileName, "exportFileName", "", "", "", "" );
|
||||
RICF_InitFieldNoDefault( &m_exportLocalCoordinates, "exportLocalCoordinates", "", "", "", "" );
|
||||
@@ -52,7 +52,7 @@ RicExportContourMapToAsciiFeature::RicExportContourMapToAsciiFeature()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicExportContourMapToAsciiFeature::isCommandEnabled()
|
||||
bool RicExportContourMapToTextFeature::isCommandEnabled()
|
||||
{
|
||||
RimEclipseContourMapView* existingEclipseContourMap = caf::SelectionManager::instance()
|
||||
->selectedItemOfType<RimEclipseContourMapView>();
|
||||
@@ -64,7 +64,7 @@ bool RicExportContourMapToAsciiFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportContourMapToAsciiFeature::onActionTriggered( bool isChecked )
|
||||
void RicExportContourMapToTextFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimContourMapProjection* contourMapProjection = nullptr;
|
||||
RimEclipseContourMapView* existingEclipseContourMap = caf::SelectionManager::instance()
|
||||
@@ -98,12 +98,12 @@ void RicExportContourMapToAsciiFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
startPath = startPath + "/" + fileBaseName + ".txt";
|
||||
|
||||
RicExportContourMapToAsciiUi featureUi;
|
||||
RicExportContourMapToTextUi featureUi;
|
||||
featureUi.setExportFileName( startPath );
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog( nullptr,
|
||||
&featureUi,
|
||||
"Export Contour Map as Text",
|
||||
"Export Contour Map to Text",
|
||||
"",
|
||||
QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
|
||||
|
||||
@@ -138,7 +138,7 @@ void RicExportContourMapToAsciiFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportContourMapToAsciiFeature::writeMetaDataToStream( QTextStream& stream,
|
||||
void RicExportContourMapToTextFeature::writeMetaDataToStream( QTextStream& stream,
|
||||
const RimContourMapProjection* contourMapProjection,
|
||||
const QString& caseName,
|
||||
bool exportLocalCoordinates )
|
||||
@@ -159,7 +159,7 @@ void RicExportContourMapToAsciiFeature::writeMetaDataToStream( QTextStream&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportContourMapToAsciiFeature::writeContourMapToStream( QTextStream& stream,
|
||||
void RicExportContourMapToTextFeature::writeContourMapToStream( QTextStream& stream,
|
||||
const RimContourMapProjection* contourMapProjection,
|
||||
bool exportLocalCoordinates,
|
||||
const QString& undefinedValueLabel,
|
||||
@@ -215,12 +215,12 @@ void RicExportContourMapToAsciiFeature::writeContourMapToStream( QTextStream&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportContourMapToAsciiFeature::setupActionLook( QAction* actionToSetup )
|
||||
void RicExportContourMapToTextFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Export Contour Map to Ascii" );
|
||||
actionToSetup->setText( "Export Contour Map to Text" );
|
||||
}
|
||||
|
||||
RicfCommandResponse RicExportContourMapToAsciiFeature::execute()
|
||||
RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
||||
{
|
||||
RicfCommandResponse response;
|
||||
QStringList errorMessages, warningMessages;
|
||||
@@ -264,7 +264,7 @@ RicfCommandResponse RicExportContourMapToAsciiFeature::execute()
|
||||
QFile exportFile( m_exportFileName );
|
||||
if ( !exportFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
|
||||
{
|
||||
errorMessages << QString( "Export Contour Map as Text : Could not open the file: %1" ).arg( m_exportFileName );
|
||||
errorMessages << QString( "Export Contour Map to Text : Could not open the file: %1" ).arg( m_exportFileName );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -28,12 +28,12 @@ class QTextStream;
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicExportContourMapToAsciiFeature : public caf::CmdFeature, public RicfCommandObject
|
||||
class RicExportContourMapToTextFeature : public caf::CmdFeature, public RicfCommandObject
|
||||
{
|
||||
RICF_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RicExportContourMapToAsciiFeature();
|
||||
RicExportContourMapToTextFeature();
|
||||
RicfCommandResponse execute() override;
|
||||
|
||||
protected:
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "RicExportContourMapToAsciiUi.h"
|
||||
#include "RicExportContourMapToTextUi.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "cafPdmUiFilePathEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicExportContourMapToAsciiUi, "RicExportContourMapToAsciiUi" );
|
||||
CAF_PDM_SOURCE_INIT( RicExportContourMapToTextUi, "RicExportContourMapToTextUi" );
|
||||
|
||||
RicExportContourMapToAsciiUi::RicExportContourMapToAsciiUi()
|
||||
RicExportContourMapToTextUi::RicExportContourMapToTextUi()
|
||||
{
|
||||
CAF_PDM_InitObject( "Export Contour Map to Text", "", "", "" );
|
||||
|
||||
@@ -21,7 +21,7 @@ RicExportContourMapToAsciiUi::RicExportContourMapToAsciiUi()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicExportContourMapToAsciiUi::exportFileName() const
|
||||
QString RicExportContourMapToTextUi::exportFileName() const
|
||||
{
|
||||
return m_exportFileName;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ QString RicExportContourMapToAsciiUi::exportFileName() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportContourMapToAsciiUi::setExportFileName( const QString& exportFileName )
|
||||
void RicExportContourMapToTextUi::setExportFileName( const QString& exportFileName )
|
||||
{
|
||||
m_exportFileName = exportFileName;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ void RicExportContourMapToAsciiUi::setExportFileName( const QString& exportFileN
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicExportContourMapToAsciiUi::exportLocalCoordinates() const
|
||||
bool RicExportContourMapToTextUi::exportLocalCoordinates() const
|
||||
{
|
||||
return m_exportLocalCoordinates;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ bool RicExportContourMapToAsciiUi::exportLocalCoordinates() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicExportContourMapToAsciiUi::undefinedValueLabel() const
|
||||
QString RicExportContourMapToTextUi::undefinedValueLabel() const
|
||||
{
|
||||
return m_undefinedValueLabel;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ QString RicExportContourMapToAsciiUi::undefinedValueLabel() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicExportContourMapToAsciiUi::excludeUndefinedValues() const
|
||||
bool RicExportContourMapToTextUi::excludeUndefinedValues() const
|
||||
{
|
||||
return m_excludeUndefinedValues;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ bool RicExportContourMapToAsciiUi::excludeUndefinedValues() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportContourMapToAsciiUi::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
void RicExportContourMapToTextUi::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
@@ -24,12 +24,12 @@
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicExportContourMapToAsciiUi : public caf::PdmObject
|
||||
class RicExportContourMapToTextUi : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RicExportContourMapToAsciiUi();
|
||||
RicExportContourMapToTextUi();
|
||||
|
||||
QString exportFileName() const;
|
||||
void setExportFileName( const QString& exportFileName );
|
||||
@@ -176,7 +176,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
||||
menuBuilder << "RicExportContourMapToAsciiFeature";
|
||||
menuBuilder << "RicExportContourMapToTextFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimEclipseView*>( uiItem ) )
|
||||
{
|
||||
@@ -189,7 +189,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
||||
menuBuilder << "RicExportEclipseInputGridFeature";
|
||||
menuBuilder << "RicExportContourMapToAsciiFeature";
|
||||
menuBuilder << "RicExportContourMapToTextFeature";
|
||||
menuBuilder << "RicSaveEclipseInputVisibleCellsFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimEclipseContourMapViewCollection*>( uiItem ) )
|
||||
|
||||
Reference in New Issue
Block a user