mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
Rename to "Import VFP Data"
This commit is contained in:
1 parent
b0e0bc5f14
commit
aae5f55dc2
4 files changed
+29
-12
No files matched your search
@@ -62,7 +62,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicStackSelectedCurvesFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicStackSelectedCurvesFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicUnstackSelectedCurvesFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicUnstackSelectedCurvesFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicThemeColorEditorFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicThemeColorEditorFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicImportVfpDataFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionWeightFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionWeightFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPressureTableItemFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicNewPressureTableItemFeature.h
|
||||||
@@ -160,7 +160,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicStackSelectedCurvesFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicStackSelectedCurvesFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicUnstackSelectedCurvesFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicUnstackSelectedCurvesFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicThemeColorEditorFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicThemeColorEditorFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicImportVfpDataFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionWeightFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionWeightFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPressureTableItemFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicNewPressureTableItemFeature.cpp
|
||||||
|
|||||||
+21
-8
@@ -16,7 +16,7 @@
|
|||||||
//
|
//
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RicNewVfpPlotFeature.h"
|
#include "RicImportVfpDataFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaGuiApplication.h"
|
#include "RiaGuiApplication.h"
|
||||||
@@ -36,12 +36,12 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT( RicNewVfpPlotFeature, "RicNewVfpPlotFeature" );
|
CAF_CMD_SOURCE_INIT( RicImportVfpDataFeature, "RicImportVfpDataFeature" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicNewVfpPlotFeature::isCommandEnabled() const
|
bool RicImportVfpDataFeature::isCommandEnabled() const
|
||||||
{
|
{
|
||||||
auto plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimVfpPlotCollection>();
|
auto plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimVfpPlotCollection>();
|
||||||
return ( plotColl != nullptr );
|
return ( plotColl != nullptr );
|
||||||
@@ -50,7 +50,7 @@ bool RicNewVfpPlotFeature::isCommandEnabled() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewVfpPlotFeature::onActionTriggered( bool isChecked )
|
void RicImportVfpDataFeature::onActionTriggered( bool isChecked )
|
||||||
{
|
{
|
||||||
RimVfpPlotCollection* vfpPlotColl = RimMainPlotCollection::current()->vfpPlotCollection();
|
RimVfpPlotCollection* vfpPlotColl = RimMainPlotCollection::current()->vfpPlotCollection();
|
||||||
if ( !vfpPlotColl ) return;
|
if ( !vfpPlotColl ) return;
|
||||||
@@ -60,8 +60,21 @@ void RicNewVfpPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
const QString vfpDataKey = "VFP_DATA";
|
const QString vfpDataKey = "VFP_DATA";
|
||||||
QString defaultDir = app->lastUsedDialogDirectory( vfpDataKey );
|
QString defaultDir = app->lastUsedDialogDirectory( vfpDataKey );
|
||||||
QStringList fileNames =
|
|
||||||
RiuFileDialogTools::getOpenFileNames( mpw, "Import VFP Files", defaultDir, "VFP Text Files (*.ecl *.vfp *.data);;All Files (*.*)" );
|
QString vfpTextFileFilter = "VFP Text Files (*.ecl *.vfp)";
|
||||||
|
QString simulatorInputFilter = "Simulator Input Files (*.data)";
|
||||||
|
QString allFilters = vfpTextFileFilter + ";;" + simulatorInputFilter + ";;" + "All Files (*.*)";
|
||||||
|
|
||||||
|
QString selectedFilter = simulatorInputFilter;
|
||||||
|
|
||||||
|
QVariant userData = this->userData();
|
||||||
|
if ( !userData.isNull() && userData.canConvert<bool>() )
|
||||||
|
{
|
||||||
|
bool isVfpFiles = userData.toBool();
|
||||||
|
if ( isVfpFiles ) selectedFilter = vfpTextFileFilter;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList fileNames = RiuFileDialogTools::getOpenFileNames( mpw, "Import VFP Files", defaultDir, allFilters, &selectedFilter );
|
||||||
|
|
||||||
if ( fileNames.isEmpty() ) return;
|
if ( fileNames.isEmpty() ) return;
|
||||||
|
|
||||||
@@ -116,8 +129,8 @@ void RicNewVfpPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewVfpPlotFeature::setupActionLook( QAction* actionToSetup )
|
void RicImportVfpDataFeature::setupActionLook( QAction* actionToSetup )
|
||||||
{
|
{
|
||||||
actionToSetup->setText( "New VFP Plots" );
|
actionToSetup->setText( "Import VFP Data" );
|
||||||
actionToSetup->setIcon( QIcon( ":/VfpPlot.svg" ) );
|
actionToSetup->setIcon( QIcon( ":/VfpPlot.svg" ) );
|
||||||
}
|
}
|
||||||
+1
-1
@@ -23,7 +23,7 @@
|
|||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicNewVfpPlotFeature : public caf::CmdFeature
|
class RicImportVfpDataFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
+5
-1
@@ -160,5 +160,9 @@ void RimVfpPlotCollection::loadDataAndUpdateAllPlots()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimVfpPlotCollection::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const
|
void RimVfpPlotCollection::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const
|
||||||
{
|
{
|
||||||
menuBuilder << "RicNewVfpPlotFeature";
|
// A variant with a true value is used to indicate that the VFP data is imported from a file
|
||||||
|
// This is used to distinguish between VFP data imported from a file and VFP data imported from a simulator
|
||||||
|
QVariant variant( QVariant::fromValue( true ) );
|
||||||
|
menuBuilder.addCmdFeatureWithUserData( "RicImportVfpDataFeature", "Import VFP Files", variant );
|
||||||
|
menuBuilder.addCmdFeature( "RicImportVfpDataFeature", "Import VFP from Simulator Files" );
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user