mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Show error message if no flow data is available
This commit is contained in:
parent
a993841671
commit
2b25ac87e7
@ -19,6 +19,8 @@
|
||||
|
||||
#include "RicNewPltPlotFeature.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RicNewWellLogPlotFeatureImpl.h"
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
@ -84,6 +86,15 @@ bool RicNewPltPlotFeature::isCommandEnabled() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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();
|
||||
if ( pltPlotColl )
|
||||
{
|
||||
@ -116,7 +127,6 @@ void RicNewPltPlotFeature::onActionTriggered( bool isChecked )
|
||||
pltPlot->nameConfig()->setCustomName( plotName );
|
||||
pltPlot->setNamingMethod( RiaDefines::ObjectNamingMethod::CUSTOM );
|
||||
|
||||
// pltPlot->applyInitialSelections();
|
||||
pltPlot->loadDataAndUpdate();
|
||||
pltPlotColl->updateConnectedEditors();
|
||||
|
||||
|
@ -705,6 +705,20 @@ RimWellPath* RimWellPlotTools::wellPathByWellPathNameOrSimWellName( const QStrin
|
||||
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 RimWellPath* wellPathByWellPathNameOrSimWellName( const QString& wellPathNameOrSimwellName );
|
||||
static std::vector<RimWellPath*> wellPathsContainingFlow();
|
||||
|
||||
// RFT Only
|
||||
private:
|
||||
|
@ -1031,18 +1031,11 @@ void RimWellPltPlot::syncSourcesIoFieldFromGuiField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPltPlot::calculateValueOptionsForWells( QList<caf::PdmOptionItemInfo>& options )
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
|
||||
if ( proj != nullptr )
|
||||
auto wellPathsContainingFlowData = RimWellPlotTools::wellPathsContainingFlow();
|
||||
for ( const RimWellPath* const wellPath : wellPathsContainingFlowData )
|
||||
{
|
||||
// Observed wells
|
||||
for ( const RimWellPath* const wellPath : proj->allWellPaths() )
|
||||
{
|
||||
const QString wellName = wellPath->name();
|
||||
|
||||
if ( wellPath->wellPathGeometry() || RimWellPlotTools::hasFlowData( wellPath ) )
|
||||
options.push_back( caf::PdmOptionItemInfo( wellName, wellName ) );
|
||||
}
|
||||
const QString wellName = wellPath->name();
|
||||
options.push_back( caf::PdmOptionItemInfo( wellName, wellName ) );
|
||||
}
|
||||
|
||||
options.push_back( caf::PdmOptionItemInfo( "None", "" ) );
|
||||
|
Loading…
Reference in New Issue
Block a user