#1078 Assign default colors when a new well is created

This commit is contained in:
Magne Sjaastad 2017-02-13 13:26:05 +01:00
parent 62f73260fc
commit 9aa98a3895
2 changed files with 8 additions and 2 deletions

View File

@ -868,8 +868,6 @@ bool RiaApplication::openEclipseCase(const QString& caseName, const QString& cas
riv->loadDataAndUpdate(); riv->loadDataAndUpdate();
riv->wellCollection()->assignDefaultWellColors();
// Add a corresponding summary case if it exists // Add a corresponding summary case if it exists
{ {
RimSummaryCaseCollection* sumCaseColl = m_project->activeOilField() ? m_project->activeOilField()->summaryCaseCollection() : NULL; RimSummaryCaseCollection* sumCaseColl = m_project->activeOilField() ? m_project->activeOilField()->summaryCaseCollection() : NULL;

View File

@ -1089,6 +1089,8 @@ void RimEclipseView::syncronizeWellsWithResults()
well->setWellResults(NULL, -1); well->setWellResults(NULL, -1);
} }
bool isAnyWellCreated = false;
// Find corresponding well from well result, or create a new // Find corresponding well from well result, or create a new
for (size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx) for (size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx)
@ -1099,6 +1101,8 @@ void RimEclipseView::syncronizeWellsWithResults()
{ {
well = new RimEclipseWell; well = new RimEclipseWell;
well->name = wellResults[wIdx]->m_wellName; well->name = wellResults[wIdx]->m_wellName;
isAnyWellCreated = true;
} }
newWells.push_back(well); newWells.push_back(well);
@ -1121,6 +1125,10 @@ void RimEclipseView::syncronizeWellsWithResults()
// Set the new wells into the field. // Set the new wells into the field.
this->wellCollection()->wells().insert(0, newWells); this->wellCollection()->wells().insert(0, newWells);
if (isAnyWellCreated)
{
this->wellCollection()->assignDefaultWellColors();
}
// Make sure all the wells have their reservoirView ptr setup correctly // Make sure all the wells have their reservoirView ptr setup correctly
this->wellCollection()->setReservoirView(this); this->wellCollection()->setReservoirView(this);