mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
Show error message if no flow data is available
This commit is contained in:
1 parent
a993841671
commit
2b25ac87e7
4 files changed
+30
-12
No files matched your search
@@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
#include "RicNewPltPlotFeature.h"
|
#include "RicNewPltPlotFeature.h"
|
||||||
|
|
||||||
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
#include "RicNewWellLogPlotFeatureImpl.h"
|
#include "RicNewWellLogPlotFeatureImpl.h"
|
||||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||||
|
|
||||||
@@ -84,6 +86,15 @@ bool RicNewPltPlotFeature::isCommandEnabled() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewPltPlotFeature::onActionTriggered( bool isChecked )
|
void RicNewPltPlotFeature::onActionTriggered( bool isChecked )
|
||||||
{
|
{
|
||||||
|
if ( RimWellPlotTools::wellPathsContainingFlow().empty() )
|
||||||
|
{
|
||||||
|
QString displayMessage =
|
||||||
|
"To create a PLT plot, either import a LAS file with observed production data or import a well path trajectory.";
|
||||||
|
|
||||||
|
RiaLogging::errorInMessageBox( nullptr, "No well data available to create a PLT plot", displayMessage );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RimPltPlotCollection* pltPlotColl = RimMainPlotCollection::current()->pltPlotCollection();
|
RimPltPlotCollection* pltPlotColl = RimMainPlotCollection::current()->pltPlotCollection();
|
||||||
if ( pltPlotColl )
|
if ( pltPlotColl )
|
||||||
{
|
{
|
||||||
@@ -116,7 +127,6 @@ void RicNewPltPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
pltPlot->nameConfig()->setCustomName( plotName );
|
pltPlot->nameConfig()->setCustomName( plotName );
|
||||||
pltPlot->setNamingMethod( RiaDefines::ObjectNamingMethod::CUSTOM );
|
pltPlot->setNamingMethod( RiaDefines::ObjectNamingMethod::CUSTOM );
|
||||||
|
|
||||||
// pltPlot->applyInitialSelections();
|
|
||||||
pltPlot->loadDataAndUpdate();
|
pltPlot->loadDataAndUpdate();
|
||||||
pltPlotColl->updateConnectedEditors();
|
pltPlotColl->updateConnectedEditors();
|
||||||
|
|
||||||
|
|||||||
@@ -705,6 +705,20 @@ RimWellPath* RimWellPlotTools::wellPathByWellPathNameOrSimWellName( const QStrin
|
|||||||
return wellPath != nullptr ? wellPath : proj->wellPathFromSimWellName( wellPathNameOrSimwellName );
|
return wellPath != nullptr ? wellPath : proj->wellPathFromSimWellName( wellPathNameOrSimwellName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<RimWellPath*> RimWellPlotTools::wellPathsContainingFlow()
|
||||||
|
{
|
||||||
|
std::vector<RimWellPath*> wellPaths;
|
||||||
|
for ( RimWellPath* wellPath : RimProject::current()->allWellPaths() )
|
||||||
|
{
|
||||||
|
if ( wellPath->wellPathGeometry() || RimWellPlotTools::hasFlowData( wellPath ) ) wellPaths.push_back( wellPath );
|
||||||
|
}
|
||||||
|
|
||||||
|
return wellPaths;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ public:
|
|||||||
|
|
||||||
static std::vector<RimWellLogFile*> wellLogFilesContainingFlow( const QString& wellName );
|
static std::vector<RimWellLogFile*> wellLogFilesContainingFlow( const QString& wellName );
|
||||||
static RimWellPath* wellPathByWellPathNameOrSimWellName( const QString& wellPathNameOrSimwellName );
|
static RimWellPath* wellPathByWellPathNameOrSimWellName( const QString& wellPathNameOrSimwellName );
|
||||||
|
static std::vector<RimWellPath*> wellPathsContainingFlow();
|
||||||
|
|
||||||
// RFT Only
|
// RFT Only
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -1031,18 +1031,11 @@ void RimWellPltPlot::syncSourcesIoFieldFromGuiField()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellPltPlot::calculateValueOptionsForWells( QList<caf::PdmOptionItemInfo>& options )
|
void RimWellPltPlot::calculateValueOptionsForWells( QList<caf::PdmOptionItemInfo>& options )
|
||||||
{
|
{
|
||||||
RimProject* proj = RimProject::current();
|
auto wellPathsContainingFlowData = RimWellPlotTools::wellPathsContainingFlow();
|
||||||
|
for ( const RimWellPath* const wellPath : wellPathsContainingFlowData )
|
||||||
if ( proj != nullptr )
|
|
||||||
{
|
{
|
||||||
// Observed wells
|
const QString wellName = wellPath->name();
|
||||||
for ( const RimWellPath* const wellPath : proj->allWellPaths() )
|
options.push_back( caf::PdmOptionItemInfo( wellName, wellName ) );
|
||||||
{
|
|
||||||
const QString wellName = wellPath->name();
|
|
||||||
|
|
||||||
if ( wellPath->wellPathGeometry() || RimWellPlotTools::hasFlowData( wellPath ) )
|
|
||||||
options.push_back( caf::PdmOptionItemInfo( wellName, wellName ) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
options.push_back( caf::PdmOptionItemInfo( "None", "" ) );
|
options.push_back( caf::PdmOptionItemInfo( "None", "" ) );
|
||||||
|
|||||||
Reference in new issue
Block a user