From 9aa98a38958f0a80356d77d6faf858d530198985 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 13 Feb 2017 13:26:05 +0100 Subject: [PATCH] #1078 Assign default colors when a new well is created --- ApplicationCode/Application/RiaApplication.cpp | 2 -- ApplicationCode/ProjectDataModel/RimEclipseView.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index 565c427f8d..234f1b9b92 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -868,8 +868,6 @@ bool RiaApplication::openEclipseCase(const QString& caseName, const QString& cas riv->loadDataAndUpdate(); - riv->wellCollection()->assignDefaultWellColors(); - // Add a corresponding summary case if it exists { RimSummaryCaseCollection* sumCaseColl = m_project->activeOilField() ? m_project->activeOilField()->summaryCaseCollection() : NULL; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index b49239e2ac..ffb9c3310f 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -1089,6 +1089,8 @@ void RimEclipseView::syncronizeWellsWithResults() well->setWellResults(NULL, -1); } + bool isAnyWellCreated = false; + // Find corresponding well from well result, or create a new for (size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx) @@ -1099,6 +1101,8 @@ void RimEclipseView::syncronizeWellsWithResults() { well = new RimEclipseWell; well->name = wellResults[wIdx]->m_wellName; + + isAnyWellCreated = true; } newWells.push_back(well); @@ -1121,6 +1125,10 @@ void RimEclipseView::syncronizeWellsWithResults() // Set the new wells into the field. this->wellCollection()->wells().insert(0, newWells); + if (isAnyWellCreated) + { + this->wellCollection()->assignDefaultWellColors(); + } // Make sure all the wells have their reservoirView ptr setup correctly this->wellCollection()->setReservoirView(this);