mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 23:23:01 -06:00
#4617 Disallow creating ensemble curve sets if you have no ensemble
This commit is contained in:
parent
5b0d77f19a
commit
84c1442af7
@ -78,7 +78,7 @@ RimEnsembleCurveSet* RicNewSummaryEnsembleCurveSetFeature::addDefaultCurveSet(Ri
|
||||
void RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetAndUpdate(RimSummaryCaseCollection* ensemble)
|
||||
{
|
||||
RiaGuiApplication* app = RiaGuiApplication::instance();
|
||||
RimProject* proj = app->project();
|
||||
RimProject* proj = app->project();
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotCollection = proj->mainPlotCollection->summaryPlotCollection();
|
||||
RimSummaryPlot* plot = summaryPlotCollection->createSummaryPlotWithAutoTitle();
|
||||
@ -100,7 +100,17 @@ void RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetAndUpdate(RimSum
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewSummaryEnsembleCurveSetFeature::isCommandEnabled()
|
||||
{
|
||||
return (selectedSummaryPlot());
|
||||
bool summaryPlotSelected = selectedSummaryPlot();
|
||||
if (summaryPlotSelected)
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
CVF_ASSERT(project);
|
||||
if (!project->summaryGroups().empty())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -114,6 +124,7 @@ void RicNewSummaryEnsembleCurveSetFeature::onActionTriggered(bool isChecked)
|
||||
RimSummaryPlot* plot = selectedSummaryPlot();
|
||||
if (plot)
|
||||
{
|
||||
CVF_ASSERT(!project->summaryGroups().empty());
|
||||
auto ensemble = project->summaryGroups().back();
|
||||
|
||||
RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetAndUpdate(ensemble);
|
||||
|
Loading…
Reference in New Issue
Block a user