//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RicNewSummaryEnsembleCurveSetFeature::onActionTriggered(bool isChecked) { RimProject* project = RiaApplication::instance()->project(); CVF_ASSERT(project); RimSummaryPlot* plot = selectedSummaryPlot(); if (plot) { auto ensemble = project->summaryGroups().back(); RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetAndUpdate(ensemble); } }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- QString RicImportEnsembleFeature::askForEnsembleName() { RimProject* project = RiaApplication::instance()->project(); std::vector<RimSummaryCaseCollection*> groups = project->summaryGroups(); int ensembleCount = std::count_if(groups.begin(), groups.end(), [](RimSummaryCaseCollection* group) { return group->isEnsemble(); }); ensembleCount += 1; QInputDialog dialog; dialog.setInputMode(QInputDialog::TextInput); dialog.setWindowTitle("Ensemble Name"); dialog.setLabelText("Ensemble Name"); dialog.setTextValue(QString("Ensemble %1").arg(ensembleCount)); dialog.resize(300, 50); dialog.exec(); return dialog.result() == QDialog::Accepted ? dialog.textValue() : QString(""); }