-
Notifications
You must be signed in to change notification settings - Fork 102
Misc orion events improvements #14530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
de9a670
#14514 Add option to include list of dates into schedule file
kriben ad2a87b
#14514 Remove PERFID and DSHIFT from the ORIONEVENTS format
kriben 18920d8
#14537 Well events: Refresh tree after timeline changes
kriben aa025ae
#14535 Orion events: Validate keyword field names
kriben 9e9cc5f
#14535 Orion events: Parse boolean keyword values
kriben a7198f5
#14533 Orion events: Add group sections
kriben File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
ApplicationLibCode/ProjectDataModel/RiaOpmKeywordTools.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| ///////////////////////////////////////////////////////////////////////////////// | ||
| // | ||
| // Copyright (C) 2026- Equinor ASA | ||
| // | ||
| // ResInsight is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU General Public License as published by | ||
| // the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
| // | ||
| // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY | ||
| // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
| // A PARTICULAR PURPOSE. | ||
| // | ||
| // See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> | ||
| // for more details. | ||
| // | ||
| ///////////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| #include "RiaOpmKeywordTools.h" | ||
|
|
||
| #include "opm/input/eclipse/Parser/Parser.hpp" | ||
| #include "opm/input/eclipse/Parser/ParserItem.hpp" | ||
| #include "opm/input/eclipse/Parser/ParserKeyword.hpp" | ||
| #include "opm/input/eclipse/Parser/ParserRecord.hpp" | ||
|
|
||
| #include <iterator> | ||
| #include <set> | ||
|
|
||
| namespace | ||
| { | ||
| const Opm::Parser& sharedParser() | ||
| { | ||
| static const Opm::Parser parser( true ); | ||
| return parser; | ||
| } | ||
| } // namespace | ||
|
|
||
| //-------------------------------------------------------------------------------------------------- | ||
| /// | ||
| //-------------------------------------------------------------------------------------------------- | ||
| std::optional<RiaOpmKeywordInfo> RiaOpmKeywordTools::keywordInfo( const QString& keywordName ) | ||
| { | ||
| const QString keyword = keywordName.toUpper(); | ||
| const auto& parser = sharedParser(); | ||
| const auto deckName = keyword.toStdString(); | ||
|
|
||
| if ( !parser.isRecognizedKeyword( deckName ) ) return std::nullopt; | ||
|
|
||
| const auto& parserKeyword = parser.getParserKeywordFromDeckName( deckName ); | ||
|
|
||
| RiaOpmKeywordInfo info; | ||
| info.name = QString::fromStdString( parserKeyword.getName() ); | ||
|
|
||
| const auto recordCount = static_cast<size_t>( std::distance( parserKeyword.begin(), parserKeyword.end() ) ); | ||
| if ( recordCount == 1 ) | ||
| { | ||
| const auto& record = parserKeyword.getRecord( 0 ); | ||
| info.acceptsArbitraryItems = record.size() == 1 && record.get( 0 ).sizeType() == Opm::ParserItem::item_size::ALL; | ||
| } | ||
|
|
||
| std::set<std::string> seenNames; | ||
| for ( const auto& record : parserKeyword ) | ||
| { | ||
| for ( const auto& item : record ) | ||
| { | ||
| if ( seenNames.insert( item.name() ).second ) | ||
| { | ||
| info.itemNames.push_back( QString::fromStdString( item.name() ) ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return info; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| ///////////////////////////////////////////////////////////////////////////////// | ||
| // | ||
| // Copyright (C) 2026- Equinor ASA | ||
| // | ||
| // ResInsight is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU General Public License as published by | ||
| // the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
| // | ||
| // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY | ||
| // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
| // A PARTICULAR PURPOSE. | ||
| // | ||
| // See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> | ||
| // for more details. | ||
| // | ||
| ///////////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <QString> | ||
|
|
||
| #include <optional> | ||
| #include <vector> | ||
|
|
||
| struct RiaOpmKeywordInfo | ||
| { | ||
| QString name; | ||
| std::vector<QString> itemNames; | ||
| bool acceptsArbitraryItems = false; | ||
| }; | ||
|
|
||
| namespace RiaOpmKeywordTools | ||
| { | ||
| std::optional<RiaOpmKeywordInfo> keywordInfo( const QString& keywordName ); | ||
| } // namespace RiaOpmKeywordTools |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.