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}/RicResampleDialog.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiUi.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}/RicResampleDialog.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiUi.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,11 +15,11 @@
|
|||||||
// for more details.
|
// for more details.
|
||||||
//
|
//
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
#include "RicExportContourMapToAsciiFeature.h"
|
#include "RicExportContourMapToTextFeature.h"
|
||||||
|
|
||||||
#include "RiaGuiApplication.h"
|
#include "RiaGuiApplication.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
#include "RicExportContourMapToAsciiUi.h"
|
#include "RicExportContourMapToTextUi.h"
|
||||||
#include "RifTextDataTableFormatter.h"
|
#include "RifTextDataTableFormatter.h"
|
||||||
#include "RimContourMapProjection.h"
|
#include "RimContourMapProjection.h"
|
||||||
#include "RimEclipseContourMapProjection.h"
|
#include "RimEclipseContourMapProjection.h"
|
||||||
@@ -38,9 +38,9 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#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_exportFileName, "exportFileName", "", "", "", "" );
|
||||||
RICF_InitFieldNoDefault( &m_exportLocalCoordinates, "exportLocalCoordinates", "", "", "", "" );
|
RICF_InitFieldNoDefault( &m_exportLocalCoordinates, "exportLocalCoordinates", "", "", "", "" );
|
||||||
@@ -52,7 +52,7 @@ RicExportContourMapToAsciiFeature::RicExportContourMapToAsciiFeature()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicExportContourMapToAsciiFeature::isCommandEnabled()
|
bool RicExportContourMapToTextFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
RimEclipseContourMapView* existingEclipseContourMap = caf::SelectionManager::instance()
|
RimEclipseContourMapView* existingEclipseContourMap = caf::SelectionManager::instance()
|
||||||
->selectedItemOfType<RimEclipseContourMapView>();
|
->selectedItemOfType<RimEclipseContourMapView>();
|
||||||
@@ -64,7 +64,7 @@ bool RicExportContourMapToAsciiFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicExportContourMapToAsciiFeature::onActionTriggered( bool isChecked )
|
void RicExportContourMapToTextFeature::onActionTriggered( bool isChecked )
|
||||||
{
|
{
|
||||||
RimContourMapProjection* contourMapProjection = nullptr;
|
RimContourMapProjection* contourMapProjection = nullptr;
|
||||||
RimEclipseContourMapView* existingEclipseContourMap = caf::SelectionManager::instance()
|
RimEclipseContourMapView* existingEclipseContourMap = caf::SelectionManager::instance()
|
||||||
@@ -98,12 +98,12 @@ void RicExportContourMapToAsciiFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
startPath = startPath + "/" + fileBaseName + ".txt";
|
startPath = startPath + "/" + fileBaseName + ".txt";
|
||||||
|
|
||||||
RicExportContourMapToAsciiUi featureUi;
|
RicExportContourMapToTextUi featureUi;
|
||||||
featureUi.setExportFileName( startPath );
|
featureUi.setExportFileName( startPath );
|
||||||
|
|
||||||
caf::PdmUiPropertyViewDialog propertyDialog( nullptr,
|
caf::PdmUiPropertyViewDialog propertyDialog( nullptr,
|
||||||
&featureUi,
|
&featureUi,
|
||||||
"Export Contour Map as Text",
|
"Export Contour Map to Text",
|
||||||
"",
|
"",
|
||||||
QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
|
QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
|
||||||
|
|
||||||
@@ -138,10 +138,10 @@ void RicExportContourMapToAsciiFeature::onActionTriggered( bool isChecked )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicExportContourMapToAsciiFeature::writeMetaDataToStream( QTextStream& stream,
|
void RicExportContourMapToTextFeature::writeMetaDataToStream( QTextStream& stream,
|
||||||
const RimContourMapProjection* contourMapProjection,
|
const RimContourMapProjection* contourMapProjection,
|
||||||
const QString& caseName,
|
const QString& caseName,
|
||||||
bool exportLocalCoordinates )
|
bool exportLocalCoordinates )
|
||||||
{
|
{
|
||||||
cvf::Vec2ui numVerticesIJ = contourMapProjection->numberOfVerticesIJ();
|
cvf::Vec2ui numVerticesIJ = contourMapProjection->numberOfVerticesIJ();
|
||||||
stream << "# case name : " << contourMapProjection->caseName() << "\n";
|
stream << "# case name : " << contourMapProjection->caseName() << "\n";
|
||||||
@@ -159,11 +159,11 @@ void RicExportContourMapToAsciiFeature::writeMetaDataToStream( QTextStream&
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicExportContourMapToAsciiFeature::writeContourMapToStream( QTextStream& stream,
|
void RicExportContourMapToTextFeature::writeContourMapToStream( QTextStream& stream,
|
||||||
const RimContourMapProjection* contourMapProjection,
|
const RimContourMapProjection* contourMapProjection,
|
||||||
bool exportLocalCoordinates,
|
bool exportLocalCoordinates,
|
||||||
const QString& undefinedValueLabel,
|
const QString& undefinedValueLabel,
|
||||||
bool excludeUndefinedValues )
|
bool excludeUndefinedValues )
|
||||||
{
|
{
|
||||||
RifTextDataTableFormatter formatter( stream );
|
RifTextDataTableFormatter formatter( stream );
|
||||||
formatter.setTableRowLineAppendText( "" );
|
formatter.setTableRowLineAppendText( "" );
|
||||||
@@ -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;
|
RicfCommandResponse response;
|
||||||
QStringList errorMessages, warningMessages;
|
QStringList errorMessages, warningMessages;
|
||||||
@@ -264,7 +264,7 @@ RicfCommandResponse RicExportContourMapToAsciiFeature::execute()
|
|||||||
QFile exportFile( m_exportFileName );
|
QFile exportFile( m_exportFileName );
|
||||||
if ( !exportFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -28,12 +28,12 @@ class QTextStream;
|
|||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicExportContourMapToAsciiFeature : public caf::CmdFeature, public RicfCommandObject
|
class RicExportContourMapToTextFeature : public caf::CmdFeature, public RicfCommandObject
|
||||||
{
|
{
|
||||||
RICF_HEADER_INIT;
|
RICF_HEADER_INIT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RicExportContourMapToAsciiFeature();
|
RicExportContourMapToTextFeature();
|
||||||
RicfCommandResponse execute() override;
|
RicfCommandResponse execute() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
#include "RicExportContourMapToAsciiUi.h"
|
#include "RicExportContourMapToTextUi.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
#include "cafPdmUiFilePathEditor.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", "", "", "" );
|
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;
|
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;
|
m_exportFileName = exportFileName;
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ void RicExportContourMapToAsciiUi::setExportFileName( const QString& exportFileN
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicExportContourMapToAsciiUi::exportLocalCoordinates() const
|
bool RicExportContourMapToTextUi::exportLocalCoordinates() const
|
||||||
{
|
{
|
||||||
return m_exportLocalCoordinates;
|
return m_exportLocalCoordinates;
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ bool RicExportContourMapToAsciiUi::exportLocalCoordinates() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RicExportContourMapToAsciiUi::undefinedValueLabel() const
|
QString RicExportContourMapToTextUi::undefinedValueLabel() const
|
||||||
{
|
{
|
||||||
return m_undefinedValueLabel;
|
return m_undefinedValueLabel;
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ QString RicExportContourMapToAsciiUi::undefinedValueLabel() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicExportContourMapToAsciiUi::excludeUndefinedValues() const
|
bool RicExportContourMapToTextUi::excludeUndefinedValues() const
|
||||||
{
|
{
|
||||||
return m_excludeUndefinedValues;
|
return m_excludeUndefinedValues;
|
||||||
}
|
}
|
||||||
@@ -61,9 +61,9 @@ bool RicExportContourMapToAsciiUi::excludeUndefinedValues() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicExportContourMapToAsciiUi::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
void RicExportContourMapToTextUi::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||||
QString uiConfigName,
|
QString uiConfigName,
|
||||||
caf::PdmUiEditorAttribute* attribute )
|
caf::PdmUiEditorAttribute* attribute )
|
||||||
{
|
{
|
||||||
if ( field == &m_exportFileName )
|
if ( field == &m_exportFileName )
|
||||||
{
|
{
|
||||||
@@ -24,12 +24,12 @@
|
|||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicExportContourMapToAsciiUi : public caf::PdmObject
|
class RicExportContourMapToTextUi : public caf::PdmObject
|
||||||
{
|
{
|
||||||
CAF_PDM_HEADER_INIT;
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RicExportContourMapToAsciiUi();
|
RicExportContourMapToTextUi();
|
||||||
|
|
||||||
QString exportFileName() const;
|
QString exportFileName() const;
|
||||||
void setExportFileName( const QString& exportFileName );
|
void setExportFileName( const QString& exportFileName );
|
||||||
@@ -176,7 +176,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
|||||||
|
|
||||||
menuBuilder << "Separator";
|
menuBuilder << "Separator";
|
||||||
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
||||||
menuBuilder << "RicExportContourMapToAsciiFeature";
|
menuBuilder << "RicExportContourMapToTextFeature";
|
||||||
}
|
}
|
||||||
else if ( dynamic_cast<RimEclipseView*>( uiItem ) )
|
else if ( dynamic_cast<RimEclipseView*>( uiItem ) )
|
||||||
{
|
{
|
||||||
@@ -189,7 +189,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
|||||||
menuBuilder << "Separator";
|
menuBuilder << "Separator";
|
||||||
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
||||||
menuBuilder << "RicExportEclipseInputGridFeature";
|
menuBuilder << "RicExportEclipseInputGridFeature";
|
||||||
menuBuilder << "RicExportContourMapToAsciiFeature";
|
menuBuilder << "RicExportContourMapToTextFeature";
|
||||||
menuBuilder << "RicSaveEclipseInputVisibleCellsFeature";
|
menuBuilder << "RicSaveEclipseInputVisibleCellsFeature";
|
||||||
}
|
}
|
||||||
else if ( dynamic_cast<RimEclipseContourMapViewCollection*>( uiItem ) )
|
else if ( dynamic_cast<RimEclipseContourMapViewCollection*>( uiItem ) )
|
||||||
|
|||||||
Reference in New Issue
Block a user