Skip to content

Commit

Permalink
#11993 Improve ensemble search dialog
Browse files Browse the repository at this point in the history
Use tree view instead of list view. Add filtering based on text match using realization numbers. Clean up user interface. Rename several GUI items.
  • Loading branch information
magnesj committed Dec 19, 2024
1 parent fb90844 commit 997e14c
Show file tree
Hide file tree
Showing 5 changed files with 377 additions and 214 deletions.
15 changes: 13 additions & 2 deletions ApplicationLibCode/Application/Tools/RiaStdStringTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,30 @@ std::set<int> RiaStdStringTools::valuesFromRangeSelection( const std::string& s

std::istringstream tokenStream( token );
int startIndex, endIndex;
char dash;
char dash, colon;
int step = 1;

if ( tokenStream >> startIndex )
{
if ( tokenStream >> dash && dash == '-' && tokenStream >> endIndex )
{
if ( tokenStream >> colon && colon == ':' )
{
tokenStream >> step;
}

if ( step <= 0 )
{
step = 1; // Ensure step is positive
}

if ( startIndex > endIndex )
{
// If start is greater than end, swap them
std::swap( startIndex, endIndex );
}

for ( int i = startIndex; i <= endIndex; ++i )
for ( int i = startIndex; i <= endIndex; i += step )
{
result.insert( i );
}
Expand Down
Loading

0 comments on commit 997e14c

Please sign in to comment.