Remove obsolete template commands (#8851)

* Remove obsolete template commands

Use first object in object list when creating plots for templates and a case is selected. (use first well in well list, first group in group list, ...)

* Always create the reference string
This commit is contained in:
Magne Sjaastad
2022-04-28 18:28:24 +02:00
committed by GitHub
parent b030e617c6
commit 172f891be9
13 changed files with 136 additions and 311 deletions

View File

@@ -23,11 +23,10 @@
#include "RicSummaryPlotTemplateTools.h"
#include "RimSummaryCase.h"
#include "RimSummaryMultiPlot.h"
#include "RiuPlotMainWindow.h"
#include "cafSelectionManager.h"
#include "RiuPlotMainWindowTools.h"
#include <QAction>
#include <QFile>
@@ -40,10 +39,7 @@ CAF_CMD_SOURCE_INIT( RicCreatePlotFromTemplateByShortcutFeature, "RicCreatePlotF
//--------------------------------------------------------------------------------------------------
bool RicCreatePlotFromTemplateByShortcutFeature::isCommandEnabled()
{
bool anySummaryCases = !RicSummaryPlotTemplateTools::selectedSummaryCases().empty();
bool anySummaryCaseCollections = !RicSummaryPlotTemplateTools::selectedSummaryCaseCollections().empty();
return ( anySummaryCases || anySummaryCaseCollections );
return true;
}
//--------------------------------------------------------------------------------------------------
@@ -70,11 +66,9 @@ void RicCreatePlotFromTemplateByShortcutFeature::onActionTriggered( bool isCheck
fileName = fileNameSelectedInUi;
}
auto sumCases = RicSummaryPlotTemplateTools::selectedSummaryCases();
auto sumCaseCollections = RicSummaryPlotTemplateTools::selectedSummaryCaseCollections();
auto newSummaryPlot = RicSummaryPlotTemplateTools::create( fileName );
RimSummaryPlot* newSummaryPlot = RicSummaryPlotTemplateTools::createPlotFromTemplateFile( fileName );
RicSummaryPlotTemplateTools::appendSummaryPlotToPlotCollection( newSummaryPlot, sumCases, sumCaseCollections );
RiuPlotMainWindowTools::selectAsCurrentItem( newSummaryPlot );
}
//--------------------------------------------------------------------------------------------------