Skip to content

Commit f564f22

Browse files
committed
Move oil volume result to experimental features and demote ROFF logs to debug
Gate the derived oil volume cell result behind the new 'oil-volume-result' experimental feature instead of RiaApplication::enableDevelopmentFeatures(). In the ROFF file reader, drop the enableDevelopmentFeatures() gates around the grid dimension, timing and array diagnostics and log them at debug level instead, so the output is available without RESINSIGHT_DEVEL but stays quiet in normal runs.
1 parent 0ad31b5 commit f564f22

3 files changed

Lines changed: 17 additions & 25 deletions

File tree

ApplicationLibCode/Application/RiaExperimentalFeatures.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const std::vector<RiaExperimentalFeatures::Feature>& RiaExperimentalFeatures::av
3333
{ "osdu-well-logs", "OSDU Well Logs", "Enable import of well logs from OSDU." },
3434
{ "undo-redo-view", "Undo/Redo View", "Show the command undo/redo history view." },
3535
{ "export-dock-layout", "Export Dock Layout", "Add a window menu action to export the dock layout to the clipboard." },
36+
{ "oil-volume-result", "Oil Volume Result", "Compute the derived oil volume cell result." },
3637
};
3738

3839
return features;

ApplicationLibCode/FileInterface/RifRoffFileTools.cpp

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,9 @@ bool RifRoffFileTools::openGridFile( const QString& fileName, RigEclipseCaseData
149149
float yScale = getFloat( values, "scale.yscale" );
150150
float zScale = getFloat( values, "scale.zscale" );
151151

152-
if ( RiaApplication::enableDevelopmentFeatures() )
153-
{
154-
RiaLogging::info( std::format( "Grid dimensions: {} {} {}", nx, ny, nz ) );
155-
RiaLogging::info( std::format( "Offset: {} {} {}", xOffset, yOffset, zOffset ) );
156-
RiaLogging::info( std::format( "Scale: {} {} {}", xScale, yScale, zScale ) );
157-
}
152+
RiaLogging::debug( std::format( "Grid dimensions: {} {} {}", nx, ny, nz ) );
153+
RiaLogging::debug( std::format( "Offset: {} {} {}", xOffset, yOffset, zOffset ) );
154+
RiaLogging::debug( std::format( "Scale: {} {} {}", xScale, yScale, zScale ) );
158155

159156
std::vector<float> cornerLines = reader.getFloatArray( "cornerLines" + roff::Parser::postFixData() );
160157
std::vector<float> zValues = reader.getFloatArray( "zvalues" + roff::Parser::postFixData() );
@@ -259,22 +256,19 @@ bool RifRoffFileTools::openGridFile( const QString& fileName, RigEclipseCaseData
259256
activeCellInfo->computeDerivedData();
260257
fractureActiveCellInfo->computeDerivedData();
261258

262-
if ( RiaApplication::enableDevelopmentFeatures() )
263-
{
264-
auto gridConstructionDone = high_resolution_clock::now();
259+
auto gridConstructionDone = high_resolution_clock::now();
265260

266-
auto tokenizeDuration = duration_cast<milliseconds>( tokenizeDone - totalStart );
267-
RiaLogging::info( std::format( "Tokenizing: {} ms", tokenizeDuration.count() ) );
261+
auto tokenizeDuration = duration_cast<milliseconds>( tokenizeDone - totalStart );
262+
RiaLogging::debug( std::format( "Tokenizing: {} ms", tokenizeDuration.count() ) );
268263

269-
auto parsingDuration = duration_cast<milliseconds>( parsingDone - tokenizeDone );
270-
RiaLogging::info( std::format( "Parsing: {} ms", parsingDuration.count() ) );
264+
auto parsingDuration = duration_cast<milliseconds>( parsingDone - tokenizeDone );
265+
RiaLogging::debug( std::format( "Parsing: {} ms", parsingDuration.count() ) );
271266

272-
auto gridConstructionDuration = duration_cast<milliseconds>( gridConstructionDone - parsingDone );
273-
RiaLogging::info( std::format( "Grid Construction: {} ms", gridConstructionDuration.count() ) );
267+
auto gridConstructionDuration = duration_cast<milliseconds>( gridConstructionDone - parsingDone );
268+
RiaLogging::debug( std::format( "Grid Construction: {} ms", gridConstructionDuration.count() ) );
274269

275-
auto totalDuration = duration_cast<milliseconds>( gridConstructionDone - totalStart );
276-
RiaLogging::info( std::format( "Total: {} ms", totalDuration.count() ) );
277-
}
270+
auto totalDuration = duration_cast<milliseconds>( gridConstructionDone - totalStart );
271+
RiaLogging::debug( std::format( "Total: {} ms", totalDuration.count() ) );
278272
}
279273
catch ( std::runtime_error& err )
280274
{
@@ -541,11 +535,8 @@ std::pair<bool, std::map<QString, QString>> RifRoffFileTools::createInputPropert
541535
for ( auto [keyword, kind] : arrayTypes )
542536
{
543537
size_t keywordLength = reader.getArrayLength( keyword );
544-
if ( RiaApplication::enableDevelopmentFeatures() )
545-
{
546-
RiaLogging::info(
547-
std::format( "Array found: '{}'. Type: {} with size: {}.", keyword, roff::Token::kindToString( kind ), keywordLength ) );
548-
}
538+
RiaLogging::debug(
539+
std::format( "Array found: '{}'. Type: {} with size: {}.", keyword, roff::Token::kindToString( kind ), keywordLength ) );
549540

550541
QString keywordUpperCase = QString::fromStdString( keyword ).toUpper();
551542

ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
#include "RigCaseCellResultsData.h"
2222

23-
#include "RiaApplication.h"
2423
#include "RiaDefines.h"
2524
#include "RiaEclipseUnitTools.h"
2625
#include "RiaLogging.h"
2726
#include "RiaPreferencesGrid.h"
27+
#include "RiaPreferencesSystem.h"
2828
#include "RiaResultNames.h"
2929

3030
#include "RifReaderEclipseOutput.h"
@@ -1016,7 +1016,7 @@ void RigCaseCellResultsData::createPlaceholderResultEntries()
10161016
}
10171017

10181018
// Oil Volume
1019-
if ( RiaApplication::enableDevelopmentFeatures() )
1019+
if ( RiaPreferencesSystem::current()->isFeatureEnabled( "oil-volume-result" ) )
10201020
{
10211021
if ( hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() ) ) )
10221022
{

0 commit comments

Comments
 (0)