mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-26 00:06:49 -06:00
Added function used to filter out per cell results by result name
This commit is contained in:
parent
eb96c5a7ed
commit
72daff665d
@ -149,7 +149,7 @@ QList<caf::PdmOptionItemInfo> RimCellEdgeResultSlot::calculateValueOptions(const
|
||||
int i;
|
||||
for (i = 0; i < varList.size(); ++i)
|
||||
{
|
||||
if (varList[i].compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0) continue;
|
||||
if (RimDefines::isPerCellFaceResult(varList[i])) continue;
|
||||
|
||||
size_t cubeFaceIdx;
|
||||
for (cubeFaceIdx = 0; cubeFaceIdx < EdgeFaceEnum::size(); ++cubeFaceIdx)
|
||||
@ -220,7 +220,7 @@ QStringList RimCellEdgeResultSlot::findResultVariableNames()
|
||||
int i;
|
||||
for (i = 0; i < varList.size(); ++i)
|
||||
{
|
||||
if (varList[i].compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0) continue;
|
||||
if (RimDefines::isPerCellFaceResult(varList[i])) continue;
|
||||
|
||||
if (varList[i].contains(resultVariable))
|
||||
{
|
||||
|
@ -133,15 +133,7 @@ QList<caf::PdmOptionItemInfo> RimCellPropertyFilter::calculateValueOptions(const
|
||||
{
|
||||
QString text = optionItems[i].optionUiText;
|
||||
|
||||
if (text.compare(RimDefines::ternarySaturationResultName(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
indicesToRemove.push_back(i);
|
||||
}
|
||||
else if (text.compare(RimDefines::combinedMultResultName(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
indicesToRemove.push_back(i);
|
||||
}
|
||||
else if (text.compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0)
|
||||
if (RimDefines::isPerCellFaceResult(text))
|
||||
{
|
||||
indicesToRemove.push_back(i);
|
||||
}
|
||||
|
@ -46,3 +46,24 @@ namespace caf
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimDefines::isPerCellFaceResult(const QString& resultName)
|
||||
{
|
||||
if (resultName.compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (resultName.compare(RimDefines::combinedMultResultName(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (resultName.compare(RimDefines::ternarySaturationResultName(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -39,6 +39,8 @@ public:
|
||||
FRACTURE_MODEL
|
||||
};
|
||||
|
||||
static bool isPerCellFaceResult(const QString& resultName);
|
||||
|
||||
static QString undefinedResultName() { return "None"; }
|
||||
static QString undefinedGridFaultName() { return "Undefined grid faults"; }
|
||||
static QString combinedTransmissibilityResultName() { return "TRANSXYZ"; }
|
||||
|
@ -143,13 +143,10 @@ QList<caf::PdmOptionItemInfo> RimResultDefinition::calculateValueOptions(const c
|
||||
QList<caf::PdmOptionItemInfo> optionList;
|
||||
for (int i = 0; i < varList.size(); ++i)
|
||||
{
|
||||
if (varList[i].compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0)
|
||||
if (RimDefines::isPerCellFaceResult(varList[i]))
|
||||
{
|
||||
optionList.push_front(caf::PdmOptionItemInfo(RimDefines::combinedTransmissibilityResultName(), RimDefines::combinedTransmissibilityResultName()));
|
||||
}
|
||||
else if (varList[i].compare(RimDefines::combinedMultResultName(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
optionList.push_front(caf::PdmOptionItemInfo(RimDefines::combinedMultResultName(), RimDefines::combinedMultResultName()));
|
||||
// Move combined per cell face results to top of list
|
||||
optionList.push_front(caf::PdmOptionItemInfo(varList[i], varList[i]));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user