mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1359 Sort tracers in category selection list in property editor
This commit is contained in:
@@ -279,6 +279,30 @@ bool RimEclipsePropertyFilter::isPropertyFilterControlled()
|
||||
return isPropertyFilterControlled;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::setCategoriesFromTracerNames(const std::vector<QString>& tracerNames)
|
||||
{
|
||||
std::vector<std::pair<QString, int>> tracerNameValuesSorted;
|
||||
|
||||
{
|
||||
std::set<std::pair<QString, int>> tracerNameSet;
|
||||
|
||||
for (size_t i = 0; i < tracerNames.size(); i++)
|
||||
{
|
||||
tracerNameSet.insert(std::make_pair(tracerNames[i], static_cast<int>(i)));
|
||||
}
|
||||
|
||||
for (auto it : tracerNameSet)
|
||||
{
|
||||
tracerNameValuesSorted.push_back(it);
|
||||
}
|
||||
}
|
||||
|
||||
setCategoryNamesAndValues(tracerNameValuesSorted);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -337,7 +361,7 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
|
||||
if ( resultDefinition->hasCategoryResult() )
|
||||
{
|
||||
setCategoryNames(resultDefinition->flowDiagSolution()->tracerNames());
|
||||
setCategoriesFromTracerNames(resultDefinition->flowDiagSolution()->tracerNames());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -423,7 +447,7 @@ void RimEclipsePropertyFilter::updateFromCurrentTimeStep()
|
||||
|
||||
if (resultDefinition->hasCategoryResult())
|
||||
{
|
||||
setCategoryNames(resultDefinition->flowDiagSolution()->tracerNames());
|
||||
setCategoriesFromTracerNames(resultDefinition->flowDiagSolution()->tracerNames());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user