mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1078 Added possibility to show/hide connection status colors
This commit is contained in:
parent
329bed71a4
commit
d0f613520e
@ -240,49 +240,57 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex)
|
|||||||
wellCellStates.clear();
|
wellCellStates.clear();
|
||||||
wellCellStates.resize(brIt->m_cellIds.size(), closed);
|
wellCellStates.resize(brIt->m_cellIds.size(), closed);
|
||||||
|
|
||||||
const std::vector <RigWellResultPoint>& cellIds = brIt->m_cellIds;
|
RimEclipseWellCollection* wellColl = nullptr;
|
||||||
|
if (m_rimWell)
|
||||||
for (size_t wcIdx = 0; wcIdx < cellIds.size(); ++wcIdx)
|
|
||||||
{
|
{
|
||||||
// we need a faster lookup, I guess
|
m_rimWell->firstAncestorOrThisOfType(wellColl);
|
||||||
const RigWellResultPoint* wResCell = NULL;
|
}
|
||||||
|
|
||||||
if (cellIds[wcIdx].isCell())
|
if (wellColl && wellColl->showConnectionStatusColors())
|
||||||
|
{
|
||||||
|
const std::vector <RigWellResultPoint>& cellIds = brIt->m_cellIds;
|
||||||
|
for (size_t wcIdx = 0; wcIdx < cellIds.size(); ++wcIdx)
|
||||||
{
|
{
|
||||||
wResCell = wResFrame.findResultCell(cellIds[wcIdx].m_gridIndex, cellIds[wcIdx].m_gridCellIndex);
|
// we need a faster lookup, I guess
|
||||||
}
|
const RigWellResultPoint* wResCell = NULL;
|
||||||
|
|
||||||
if (wResCell == NULL)
|
if (cellIds[wcIdx].isCell())
|
||||||
{
|
|
||||||
// We cant find any state. This well cell is closed.
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
double cellState = closed;
|
|
||||||
|
|
||||||
if (wResCell->m_isOpen)
|
|
||||||
{
|
{
|
||||||
switch (wResFrame.m_productionType)
|
wResCell = wResFrame.findResultCell(cellIds[wcIdx].m_gridIndex, cellIds[wcIdx].m_gridCellIndex);
|
||||||
{
|
|
||||||
case RigWellResultFrame::PRODUCER:
|
|
||||||
cellState = producing;
|
|
||||||
break;
|
|
||||||
case RigWellResultFrame::OIL_INJECTOR:
|
|
||||||
cellState = hcInjection;
|
|
||||||
break;
|
|
||||||
case RigWellResultFrame::GAS_INJECTOR:
|
|
||||||
cellState = hcInjection;
|
|
||||||
break;
|
|
||||||
case RigWellResultFrame::WATER_INJECTOR:
|
|
||||||
cellState = water;
|
|
||||||
break;
|
|
||||||
case RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE:
|
|
||||||
cellState = closed;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wellCellStates[wcIdx] = cellState;
|
if (wResCell == NULL)
|
||||||
|
{
|
||||||
|
// We cant find any state. This well cell is closed.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
double cellState = closed;
|
||||||
|
|
||||||
|
if (wResCell->m_isOpen)
|
||||||
|
{
|
||||||
|
switch (wResFrame.m_productionType)
|
||||||
|
{
|
||||||
|
case RigWellResultFrame::PRODUCER:
|
||||||
|
cellState = producing;
|
||||||
|
break;
|
||||||
|
case RigWellResultFrame::OIL_INJECTOR:
|
||||||
|
cellState = hcInjection;
|
||||||
|
break;
|
||||||
|
case RigWellResultFrame::GAS_INJECTOR:
|
||||||
|
cellState = hcInjection;
|
||||||
|
break;
|
||||||
|
case RigWellResultFrame::WATER_INJECTOR:
|
||||||
|
cellState = water;
|
||||||
|
break;
|
||||||
|
case RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE:
|
||||||
|
cellState = closed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wellCellStates[wcIdx] = cellState;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,25 +250,39 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
|
|||||||
part->setDrawable(geo1.p());
|
part->setDrawable(geo1.p());
|
||||||
|
|
||||||
cvf::Color4f headColor(cvf::Color3::GRAY);
|
cvf::Color4f headColor(cvf::Color3::GRAY);
|
||||||
if (wellResultFrame.m_isOpen)
|
|
||||||
|
RimEclipseWellCollection* wellColl = nullptr;
|
||||||
|
if (m_rimWell)
|
||||||
{
|
{
|
||||||
if (wellResultFrame.m_productionType == RigWellResultFrame::PRODUCER)
|
m_rimWell->firstAncestorOrThisOfType(wellColl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wellColl && wellColl->showConnectionStatusColors())
|
||||||
|
{
|
||||||
|
if (wellResultFrame.m_isOpen)
|
||||||
{
|
{
|
||||||
headColor = cvf::Color4f(cvf::Color3::GREEN);
|
if (wellResultFrame.m_productionType == RigWellResultFrame::PRODUCER)
|
||||||
}
|
{
|
||||||
else if (wellResultFrame.m_productionType == RigWellResultFrame::OIL_INJECTOR)
|
headColor = cvf::Color4f(cvf::Color3::GREEN);
|
||||||
{
|
}
|
||||||
headColor = cvf::Color4f(cvf::Color3::ORANGE);
|
else if (wellResultFrame.m_productionType == RigWellResultFrame::OIL_INJECTOR)
|
||||||
}
|
{
|
||||||
else if (wellResultFrame.m_productionType == RigWellResultFrame::GAS_INJECTOR)
|
headColor = cvf::Color4f(cvf::Color3::ORANGE);
|
||||||
{
|
}
|
||||||
headColor = cvf::Color4f(cvf::Color3::RED);
|
else if (wellResultFrame.m_productionType == RigWellResultFrame::GAS_INJECTOR)
|
||||||
}
|
{
|
||||||
else if (wellResultFrame.m_productionType == RigWellResultFrame::WATER_INJECTOR)
|
headColor = cvf::Color4f(cvf::Color3::RED);
|
||||||
{
|
}
|
||||||
headColor = cvf::Color4f(cvf::Color3::BLUE);
|
else if (wellResultFrame.m_productionType == RigWellResultFrame::WATER_INJECTOR)
|
||||||
|
{
|
||||||
|
headColor = cvf::Color4f(cvf::Color3::BLUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
headColor = cvf::Color4f(m_rimWell->wellPipeColor());
|
||||||
|
}
|
||||||
|
|
||||||
caf::SurfaceEffectGenerator surfaceGen(headColor, caf::PO_1);
|
caf::SurfaceEffectGenerator surfaceGen(headColor, caf::PO_1);
|
||||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||||
|
@ -186,29 +186,42 @@ cvf::Color3f RivWellSpheresPartMgr::wellCellColor(const RigWellResultFrame& well
|
|||||||
{
|
{
|
||||||
// Colours should be synchronized with RivWellPipesPartMgr::updatePipeResultColor
|
// Colours should be synchronized with RivWellPipesPartMgr::updatePipeResultColor
|
||||||
|
|
||||||
cvf::Color3f cellColor(cvf::Color3f::GRAY);
|
cvf::Color3f cellColor(m_rimWell->wellPipeColor());
|
||||||
|
|
||||||
if (wellResultPoint.m_isOpen)
|
RimEclipseWellCollection* wellColl = nullptr;
|
||||||
|
if (m_rimWell)
|
||||||
{
|
{
|
||||||
switch (wellResultFrame.m_productionType)
|
m_rimWell->firstAncestorOrThisOfType(wellColl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wellColl && wellColl->showConnectionStatusColors())
|
||||||
|
{
|
||||||
|
if (wellResultPoint.m_isOpen)
|
||||||
{
|
{
|
||||||
case RigWellResultFrame::PRODUCER:
|
switch (wellResultFrame.m_productionType)
|
||||||
cellColor = cvf::Color3f::GREEN;
|
{
|
||||||
break;
|
case RigWellResultFrame::PRODUCER:
|
||||||
case RigWellResultFrame::OIL_INJECTOR:
|
cellColor = cvf::Color3f::GREEN;
|
||||||
cellColor = cvf::Color3f::RED;
|
break;
|
||||||
break;
|
case RigWellResultFrame::OIL_INJECTOR:
|
||||||
case RigWellResultFrame::GAS_INJECTOR:
|
cellColor = cvf::Color3f::RED;
|
||||||
cellColor = cvf::Color3f::RED;
|
break;
|
||||||
break;
|
case RigWellResultFrame::GAS_INJECTOR:
|
||||||
case RigWellResultFrame::WATER_INJECTOR:
|
cellColor = cvf::Color3f::RED;
|
||||||
cellColor = cvf::Color3f::BLUE;
|
break;
|
||||||
break;
|
case RigWellResultFrame::WATER_INJECTOR:
|
||||||
case RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE:
|
cellColor = cvf::Color3f::BLUE;
|
||||||
cellColor = cvf::Color3f::GRAY;
|
break;
|
||||||
break;
|
case RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE:
|
||||||
|
cellColor = cvf::Color3f::GRAY;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cellColor = m_rimWell->wellPipeColor();
|
||||||
|
}
|
||||||
|
|
||||||
return cellColor;
|
return cellColor;
|
||||||
}
|
}
|
||||||
|
@ -75,8 +75,8 @@ namespace caf
|
|||||||
template<>
|
template<>
|
||||||
void RimEclipseWellCollection::WellHeadPositionEnum::setUp()
|
void RimEclipseWellCollection::WellHeadPositionEnum::setUp()
|
||||||
{
|
{
|
||||||
addItem(RimEclipseWellCollection::WELLHEAD_POS_ACTIVE_CELLS_BB, "WELLHEAD_POS_ACTIVE_CELLS_BB", "Top of active cells BB");
|
addItem(RimEclipseWellCollection::WELLHEAD_POS_ACTIVE_CELLS_BB, "WELLHEAD_POS_ACTIVE_CELLS_BB", "All Active Cells");
|
||||||
addItem(RimEclipseWellCollection::WELLHEAD_POS_TOP_COLUMN, "WELLHEAD_POS_TOP_COLUMN", "Top of active cells IJ-column");
|
addItem(RimEclipseWellCollection::WELLHEAD_POS_TOP_COLUMN, "WELLHEAD_POS_TOP_COLUMN", "Active Cell Column");
|
||||||
setDefault(RimEclipseWellCollection::WELLHEAD_POS_TOP_COLUMN);
|
setDefault(RimEclipseWellCollection::WELLHEAD_POS_TOP_COLUMN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -121,16 +121,18 @@ RimEclipseWellCollection::RimEclipseWellCollection()
|
|||||||
cvf::Color3f defWellLabelColor = RiaApplication::instance()->preferences()->defaultWellLabelColor();
|
cvf::Color3f defWellLabelColor = RiaApplication::instance()->preferences()->defaultWellLabelColor();
|
||||||
CAF_PDM_InitField(&wellLabelColor, "WellLabelColor", defWellLabelColor, "Well label color", "", "", "");
|
CAF_PDM_InitField(&wellLabelColor, "WellLabelColor", defWellLabelColor, "Well label color", "", "", "");
|
||||||
|
|
||||||
cvf::Color3f defaultApplyColor = cvf::Color3f::YELLOW;
|
CAF_PDM_InitField(&showConnectionStatusColors, "ShowConnectionStatusColors", true, "Show Connection Status Colors Along Well", "", "", "");
|
||||||
CAF_PDM_InitField(&m_wellColorForApply, "WellColorForApply", defaultApplyColor, "Color", "", "", "");
|
|
||||||
|
|
||||||
CAF_PDM_InitField(&m_applySingleColorToWells, "ApplySingleColorToWells", false, "Apply Single Color", "", "", "");
|
cvf::Color3f defaultApplyColor = cvf::Color3f::YELLOW;
|
||||||
|
CAF_PDM_InitField(&m_wellColorForApply, "WellColorForApply", defaultApplyColor, "Single Well Color", "", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&m_applySingleColorToWells, "ApplySingleColorToWells", false, "", "", "", "");
|
||||||
m_applySingleColorToWells.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
m_applySingleColorToWells.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
||||||
m_applySingleColorToWells.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
m_applySingleColorToWells.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||||
m_applySingleColorToWells.xmlCapability()->setIOReadable(false);
|
m_applySingleColorToWells.xmlCapability()->setIOReadable(false);
|
||||||
m_applySingleColorToWells.xmlCapability()->setIOWritable(false);
|
m_applySingleColorToWells.xmlCapability()->setIOWritable(false);
|
||||||
|
|
||||||
CAF_PDM_InitField(&m_applyIndividualColorsToWells, "ApplyIndividualColorsToWells", false, "Apply Individual Colors", "", "", "");
|
CAF_PDM_InitField(&m_applyIndividualColorsToWells, "ApplyIndividualColorsToWells", false, "", "", "", "");
|
||||||
m_applyIndividualColorsToWells.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
m_applyIndividualColorsToWells.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
||||||
m_applyIndividualColorsToWells.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
m_applyIndividualColorsToWells.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||||
m_applyIndividualColorsToWells.xmlCapability()->setIOReadable(false);
|
m_applyIndividualColorsToWells.xmlCapability()->setIOReadable(false);
|
||||||
@ -138,15 +140,15 @@ RimEclipseWellCollection::RimEclipseWellCollection()
|
|||||||
|
|
||||||
CAF_PDM_InitField(&pipeCrossSectionVertexCount, "WellPipeVertexCount", 12, "Pipe vertex count", "", "", "");
|
CAF_PDM_InitField(&pipeCrossSectionVertexCount, "WellPipeVertexCount", 12, "Pipe vertex count", "", "", "");
|
||||||
pipeCrossSectionVertexCount.uiCapability()->setUiHidden(true);
|
pipeCrossSectionVertexCount.uiCapability()->setUiHidden(true);
|
||||||
CAF_PDM_InitField(&wellPipeCoordType, "WellPipeCoordType", WellPipeCoordEnum(WELLPIPE_INTERPOLATED), "Well Pipe Coords", "", "", "");
|
CAF_PDM_InitField(&wellPipeCoordType, "WellPipeCoordType", WellPipeCoordEnum(WELLPIPE_INTERPOLATED), "Well Pipe Geometry", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitField(&wellCellsToRangeFilterMode, "GlobalWellCellVisibility", WellCellsRangeFilterEnum(RANGE_ADD_NONE), "Add cells to range filter", "", "", "");
|
CAF_PDM_InitField(&wellCellsToRangeFilterMode, "GlobalWellCellVisibility", WellCellsRangeFilterEnum(RANGE_ADD_NONE), "Add cells to range filter", "", "", "");
|
||||||
CAF_PDM_InitField(&showWellCellFences, "ShowWellFences", false, "Use well fence", "", "", "");
|
CAF_PDM_InitField(&showWellCellFences, "ShowWellFences", false, "Use well fence", "", "", "");
|
||||||
CAF_PDM_InitField(&wellCellFenceType, "DefaultWellFenceDirection", WellFenceEnum(K_DIRECTION), "Well Fence direction", "", "", "");
|
CAF_PDM_InitField(&wellCellFenceType, "DefaultWellFenceDirection", WellFenceEnum(K_DIRECTION), "Well Fence direction", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitField(&wellCellTransparencyLevel, "WellCellTransparency", 0.5, "Well cell transparency", "", "", "");
|
CAF_PDM_InitField(&wellCellTransparencyLevel, "WellCellTransparency", 0.5, "Well Cell Transparency", "", "", "");
|
||||||
CAF_PDM_InitField(&isAutoDetectingBranches, "IsAutoDetectingBranches", true, "Geometry based branch detection", "", "Toggle wether the well pipe visualization will try to detect when a part of the well \nis really a branch, and thus is starting from wellhead", "");
|
CAF_PDM_InitField(&isAutoDetectingBranches, "IsAutoDetectingBranches", true, "Branch Detection", "", "Toggle wether the well pipe visualization will try to detect when a part of the well \nis really a branch, and thus is starting from wellhead", "");
|
||||||
CAF_PDM_InitField(&wellHeadPosition, "WellHeadPosition", WellHeadPositionEnum(WELLHEAD_POS_TOP_COLUMN), "Well head position", "", "", "");
|
CAF_PDM_InitField(&wellHeadPosition, "WellHeadPosition", WellHeadPositionEnum(WELLHEAD_POS_TOP_COLUMN), "Well Head Position On Top Of", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&wells, "Wells", "Wells", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&wells, "Wells", "Wells", "", "", "");
|
||||||
wells.uiCapability()->setUiHidden(true);
|
wells.uiCapability()->setUiHidden(true);
|
||||||
@ -253,7 +255,8 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
|||||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
else if ( &spheresScaleFactor == changedField
|
else if ( &spheresScaleFactor == changedField
|
||||||
|| &showWellSpheres == changedField)
|
|| &showWellSpheres == changedField
|
||||||
|
|| &showConnectionStatusColors == changedField)
|
||||||
{
|
{
|
||||||
m_reservoirView->schedulePipeGeometryRegen();
|
m_reservoirView->schedulePipeGeometryRegen();
|
||||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||||
@ -346,19 +349,18 @@ void RimEclipseWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
|||||||
colorGroup->add(&wellLabelColor);
|
colorGroup->add(&wellLabelColor);
|
||||||
colorGroup->add(&m_applyIndividualColorsToWells);
|
colorGroup->add(&m_applyIndividualColorsToWells);
|
||||||
|
|
||||||
caf::PdmUiGroup* singleColorGroup = colorGroup->addNewGroup("Single Well Color");
|
colorGroup->add(&m_wellColorForApply);
|
||||||
singleColorGroup->add(&m_wellColorForApply);
|
colorGroup->add(&m_applySingleColorToWells);
|
||||||
singleColorGroup->add(&m_applySingleColorToWells);
|
|
||||||
|
|
||||||
caf::PdmUiGroup* wellPipe = uiOrdering.addNewGroup("Well pipe");
|
colorGroup->add(&showConnectionStatusColors);
|
||||||
wellPipe->add(&wellPipeCoordType);
|
|
||||||
|
uiOrdering.add(&wellPipeCoordType);
|
||||||
|
|
||||||
caf::PdmUiGroup* advancedGroup = uiOrdering.addNewGroup("Advanced");
|
caf::PdmUiGroup* advancedGroup = uiOrdering.addNewGroup("Advanced");
|
||||||
advancedGroup->add(&wellCellTransparencyLevel);
|
|
||||||
advancedGroup->add(&isAutoDetectingBranches);
|
advancedGroup->add(&isAutoDetectingBranches);
|
||||||
|
advancedGroup->add(&wellCellTransparencyLevel);
|
||||||
|
|
||||||
caf::PdmUiGroup* wellHeadGroup = uiOrdering.addNewGroup("Well head");
|
uiOrdering.add(&wellHeadPosition);
|
||||||
wellHeadGroup->add(&wellHeadPosition);
|
|
||||||
|
|
||||||
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Well range filter");
|
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Well range filter");
|
||||||
filterGroup->add(&wellCellsToRangeFilterMode);
|
filterGroup->add(&wellCellsToRangeFilterMode);
|
||||||
|
@ -99,6 +99,8 @@ public:
|
|||||||
caf::PdmField<double> spheresScaleFactor;
|
caf::PdmField<double> spheresScaleFactor;
|
||||||
|
|
||||||
caf::PdmField<cvf::Color3f> wellLabelColor;
|
caf::PdmField<cvf::Color3f> wellLabelColor;
|
||||||
|
caf::PdmField<bool> showConnectionStatusColors;
|
||||||
|
|
||||||
|
|
||||||
caf::PdmField<WellCellsRangeFilterEnum> wellCellsToRangeFilterMode;
|
caf::PdmField<WellCellsRangeFilterEnum> wellCellsToRangeFilterMode;
|
||||||
caf::PdmField<bool> showWellCellFences;
|
caf::PdmField<bool> showWellCellFences;
|
||||||
@ -110,11 +112,8 @@ public:
|
|||||||
|
|
||||||
caf::PdmField<WellHeadPositionEnum> wellHeadPosition;
|
caf::PdmField<WellHeadPositionEnum> wellHeadPosition;
|
||||||
|
|
||||||
|
|
||||||
caf::PdmField<bool> isAutoDetectingBranches;
|
caf::PdmField<bool> isAutoDetectingBranches;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
caf::PdmChildArrayField<RimEclipseWell*> wells;
|
caf::PdmChildArrayField<RimEclipseWell*> wells;
|
||||||
|
|
||||||
RimEclipseWell* findWell(QString name);
|
RimEclipseWell* findWell(QString name);
|
||||||
|
Loading…
Reference in New Issue
Block a user