mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2509 Fracture : Improve UI
This commit is contained in:
@@ -208,7 +208,10 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
|
|||||||
|
|
||||||
QMessageBox::warning(nullptr, "Fracture Template Selection", warningText);
|
QMessageBox::warning(nullptr, "Fracture Template Selection", warningText);
|
||||||
|
|
||||||
m_fractureTemplate = nullptr;
|
PdmObjectHandle* prevValue = oldValue.value<caf::PdmPointer<PdmObjectHandle>>().rawPtr();
|
||||||
|
auto prevTemplate = dynamic_cast<RimFractureTemplate*>(prevValue);
|
||||||
|
|
||||||
|
m_fractureTemplate = prevTemplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
setFractureTemplate(m_fractureTemplate);
|
setFractureTemplate(m_fractureTemplate);
|
||||||
@@ -398,17 +401,23 @@ QList<caf::PdmOptionItemInfo> RimFracture::calculateValueOptions(const caf::PdmF
|
|||||||
RimProject* proj = RiaApplication::instance()->project();
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
CVF_ASSERT(proj);
|
CVF_ASSERT(proj);
|
||||||
|
|
||||||
RimOilField* oilField = proj->activeOilField();
|
|
||||||
if (oilField == nullptr) return options;
|
|
||||||
|
|
||||||
if (fieldNeedingOptions == &m_fractureTemplate)
|
if (fieldNeedingOptions == &m_fractureTemplate)
|
||||||
{
|
{
|
||||||
RimFractureTemplateCollection* fracDefColl = oilField->fractureDefinitionCollection();
|
RimOilField* oilField = proj->activeOilField();
|
||||||
if (fracDefColl == nullptr) return options;
|
if (oilField && oilField->fractureDefinitionCollection)
|
||||||
|
|
||||||
for (RimFractureTemplate* fracDef : fracDefColl->fractureDefinitions())
|
|
||||||
{
|
{
|
||||||
options.push_back(caf::PdmOptionItemInfo(fracDef->nameAndUnit(), fracDef));
|
RimFractureTemplateCollection* fracDefColl = oilField->fractureDefinitionCollection();
|
||||||
|
|
||||||
|
for (RimFractureTemplate* fracDef : fracDefColl->fractureDefinitions())
|
||||||
|
{
|
||||||
|
QString displayText = fracDef->nameAndUnit();
|
||||||
|
if (fracDef->fractureTemplateUnit() != fractureUnit())
|
||||||
|
{
|
||||||
|
displayText += " (non-matching unit)";
|
||||||
|
}
|
||||||
|
|
||||||
|
options.push_back(caf::PdmOptionItemInfo(displayText, fracDef));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fieldNeedingOptions == &m_stimPlanTimeIndexToPlot)
|
else if (fieldNeedingOptions == &m_stimPlanTimeIndexToPlot)
|
||||||
|
|||||||
Reference in New Issue
Block a user