clang-format: Set column width to 140

* Set column width to 140
* Use c++20
* Remove redundant virtual
This commit is contained in:
Magne Sjaastad 2023-02-26 10:48:40 +01:00 committed by GitHub
parent 8768e186d8
commit f8c5cf389f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1535 changed files with 10456 additions and 19398 deletions

View File

@ -1,12 +1,12 @@
--- ---
Language: Cpp Language: Cpp
# BasedOnStyle: LLVM # BasedOnStyle: LLVM
AccessModifierOffset: -4 AccessModifierOffset: -4
AlignAfterOpenBracket: Align AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: true AlignEscapedNewlinesLeft: true
AlignOperands: true AlignOperands: true
AlignTrailingComments: false AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false AllowShortBlocksOnASingleLine: false
@ -26,30 +26,30 @@ BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true BreakConstructorInitializersBeforeComma: true
BreakAfterJavaFieldAnnotations: false BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true BreakStringLiterals: true
ColumnLimit: 120 ColumnLimit: 140
CommentPragmas: '^ IWYU pragma:' CommentPragmas: "^ IWYU pragma:"
ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4 ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4 ContinuationIndentWidth: 4
Cpp11BracedListStyle: true Cpp11BracedListStyle: true
DerivePointerAlignment: false DerivePointerAlignment: false
DisableFormat: false DisableFormat: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] ForEachMacros: [foreach, Q_FOREACH, BOOST_FOREACH]
IncludeCategories: IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/' - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2 Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)' - Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3 Priority: 3
- Regex: '.*' - Regex: ".*"
Priority: 1 Priority: 1
IncludeIsMainRegex: '$' IncludeIsMainRegex: "$"
IndentCaseLabels: true IndentCaseLabels: true
IndentWidth: 4 IndentWidth: 4
IndentWrappedFunctionNames: true IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave JavaScriptQuotes: Leave
KeepEmptyLinesAtTheStartOfBlocks: false KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '' MacroBlockBegin: ""
MacroBlockEnd: '' MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1 MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner NamespaceIndentation: Inner
PenaltyBreakAssignment: 13 PenaltyBreakAssignment: 13
@ -60,20 +60,19 @@ PenaltyBreakString: 100
PenaltyExcessCharacter: 5 PenaltyExcessCharacter: 5
PenaltyReturnTypeOnItsOwnLine: 30 PenaltyReturnTypeOnItsOwnLine: 30
PointerAlignment: Left PointerAlignment: Left
ReflowComments: true ReflowComments: true
SortIncludes: true SortIncludes: true
SpaceAfterCStyleCast: false SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1 SpacesBeforeTrailingComments: 1
SpacesInAngles: false SpacesInAngles: false
SpacesInContainerLiterals: false SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false SpacesInCStyleCastParentheses: false
SpacesInParentheses: true SpacesInParentheses: true
SpacesInSquareBrackets: false SpacesInSquareBrackets: false
Standard: Cpp11 Standard: c++20
TabWidth: 4 TabWidth: 4
UseTab: Never UseTab: Never
...

View File

@ -243,8 +243,7 @@ void RiaApplication::createMockModelCustomized()
void RiaApplication::createInputMockModel() void RiaApplication::createInputMockModel()
{ {
bool createView = true; bool createView = true;
RiaImportEclipseCaseTools::openEclipseInputCaseFromFileNames( QStringList( RiaDefines::mockModelBasicInputCase() ), RiaImportEclipseCaseTools::openEclipseInputCaseFromFileNames( QStringList( RiaDefines::mockModelBasicInputCase() ), createView );
createView );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -287,8 +286,7 @@ RimGridView* RiaApplication::activeMainOrComparisonGridView()
RimGridView* activeView = RiaApplication::instance()->activeGridView(); RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimGridView* viewOrComparisonView = activeView; RimGridView* viewOrComparisonView = activeView;
if ( activeView != nullptr && activeView->viewer() && if ( activeView != nullptr && activeView->viewer() && activeView->viewer()->viewerCommands()->isCurrentPickInComparisonView() )
activeView->viewer()->viewerCommands()->isCurrentPickInComparisonView() )
{ {
if ( RimGridView* compView = dynamic_cast<RimGridView*>( activeView->activeComparisonView() ) ) if ( RimGridView* compView = dynamic_cast<RimGridView*>( activeView->activeComparisonView() ) )
{ {
@ -347,10 +345,9 @@ bool RiaApplication::openFile( const QString& fileName )
} }
else if ( int( fileType ) & int( RiaDefines::ImportFileType::ANY_ECLIPSE_FILE ) ) else if ( int( fileType ) & int( RiaDefines::ImportFileType::ANY_ECLIPSE_FILE ) )
{ {
bool createView = true; bool createView = true;
bool createPlot = true; bool createPlot = true;
loadingSucceded = loadingSucceded = RicImportGeneralDataFeature::openEclipseFilesFromFileNames( QStringList{ fileName }, createPlot, createView );
RicImportGeneralDataFeature::openEclipseFilesFromFileNames( QStringList{ fileName }, createPlot, createView );
lastUsedDialogTag = RiaDefines::defaultDirectoryLabel( fileType ); lastUsedDialogTag = RiaDefines::defaultDirectoryLabel( fileType );
} }
@ -358,8 +355,7 @@ bool RiaApplication::openFile( const QString& fileName )
{ {
if ( !lastUsedDialogTag.isEmpty() ) if ( !lastUsedDialogTag.isEmpty() )
{ {
RiaApplication::instance()->setLastUsedDialogDirectory( lastUsedDialogTag, RiaApplication::instance()->setLastUsedDialogDirectory( lastUsedDialogTag, QFileInfo( fileName ).absolutePath() );
QFileInfo( fileName ).absolutePath() );
} }
onFileSuccessfullyLoaded( fileName, fileType ); onFileSuccessfullyLoaded( fileName, fileType );
@ -429,9 +425,7 @@ QString RiaApplication::createAbsolutePathFromProjectRelativePath( QString proje
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaApplication::loadProject( const QString& projectFileName, bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAction loadAction, RiaProjectModifier* projectModifier )
ProjectLoadAction loadAction,
RiaProjectModifier* projectModifier )
{ {
// First Close the current project // First Close the current project
@ -468,8 +462,8 @@ bool RiaApplication::loadProject( const QString& projectFileName,
{ {
closeProject(); closeProject();
QString errMsg = QString( "Unknown project file version detected in file \n%1\n\nCould not open project." ) QString errMsg =
.arg( fullPathProjectFileName ); QString( "Unknown project file version detected in file \n%1\n\nCould not open project." ).arg( fullPathProjectFileName );
onProjectOpeningError( errMsg ); onProjectOpeningError( errMsg );
@ -919,9 +913,8 @@ bool RiaApplication::openOdbCaseFromFile( const QString& fileName, bool applyTim
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// Add a list of well path file paths (JSON files) to the well path collection /// Add a list of well path file paths (JSON files) to the well path collection
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<RimWellPath*> RiaApplication::addWellPathsToModel( QList<QString> wellPathFilePaths, std::vector<RimWellPath*>
bool importGrouped, RiaApplication::addWellPathsToModel( QList<QString> wellPathFilePaths, bool importGrouped, gsl::not_null<QStringList*> errorMessages )
gsl::not_null<QStringList*> errorMessages )
{ {
if ( m_project == nullptr || m_project->oilFields.size() < 1 ) return {}; if ( m_project == nullptr || m_project->oilFields.size() < 1 ) return {};
@ -990,8 +983,7 @@ std::vector<RimWellLogFile*> RiaApplication::addWellLogsToModel( const QList<QSt
m_project->updateConnectedEditors(); m_project->updateConnectedEditors();
} }
std::vector<RimWellLogFile*> wellLogFiles = std::vector<RimWellLogFile*> wellLogFiles = oilField->wellPathCollection->addWellLogs( wellLogFilePaths, errorMessages );
oilField->wellPathCollection->addWellLogs( wellLogFilePaths, errorMessages );
oilField->wellPathCollection->updateConnectedEditors(); oilField->wellPathCollection->updateConnectedEditors();
@ -1103,9 +1095,7 @@ QProcessEnvironment RiaApplication::pythonProcessEnvironment() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaApplication::launchProcess( const QString& program, bool RiaApplication::launchProcess( const QString& program, const QStringList& arguments, const QProcessEnvironment& processEnvironment )
const QStringList& arguments,
const QProcessEnvironment& processEnvironment )
{ {
if ( m_workerProcess == nullptr ) if ( m_workerProcess == nullptr )
{ {
@ -1242,8 +1232,7 @@ void RiaApplication::applyPreferences()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RiaApplication::commandLineParameterHelp() QString RiaApplication::commandLineParameterHelp()
{ {
QString helpText = QString helpText = QString( "\n%1 v. %2\n" ).arg( RI_APPLICATION_NAME ).arg( RiaApplication::getVersionStringApp( false ) );
QString( "\n%1 v. %2\n" ).arg( RI_APPLICATION_NAME ).arg( RiaApplication::getVersionStringApp( false ) );
helpText += "Copyright Equinor ASA, Ceetron Solution AS, Ceetron AS\n\n"; helpText += "Copyright Equinor ASA, Ceetron Solution AS, Ceetron AS\n\n";
helpText += m_commandLineHelpText; helpText += m_commandLineHelpText;

View File

@ -147,12 +147,10 @@ public:
bool openOdbCaseFromFile( const QString& fileName, bool applyTimeStepFilter = false ); bool openOdbCaseFromFile( const QString& fileName, bool applyTimeStepFilter = false );
std::vector<RimWellPath*> addWellPathsToModel( QList<QString> wellPathFilePaths, std::vector<RimWellPath*>
bool importGrouped, addWellPathsToModel( QList<QString> wellPathFilePaths, bool importGrouped, gsl::not_null<QStringList*> errorMessages );
gsl::not_null<QStringList*> errorMessages );
void addWellPathFormationsToModel( QList<QString> wellPathFilePaths ); void addWellPathFormationsToModel( QList<QString> wellPathFilePaths );
std::vector<RimWellLogFile*> addWellLogsToModel( const QList<QString>& wellLogFilePaths, std::vector<RimWellLogFile*> addWellLogsToModel( const QList<QString>& wellLogFilePaths, gsl::not_null<QStringList*> errorMessages );
gsl::not_null<QStringList*> errorMessages );
QString scriptDirectories() const; QString scriptDirectories() const;
QString scriptEditorPath() const; QString scriptEditorPath() const;

View File

@ -61,8 +61,7 @@ void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAnd
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAndRedrawAllViews( void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAndRedrawAllViews( const std::vector<RimEclipseCase*>& eclipseCases )
const std::vector<RimEclipseCase*>& eclipseCases )
{ {
clearCompletionTypeResults( eclipseCases ); clearCompletionTypeResults( eclipseCases );

View File

@ -229,8 +229,7 @@ RiaApplication::ApplicationStatus RiaConsoleApplication::handleArguments( gsl::n
{ {
// One argument is available, use replace case for first occurrence in the project // One argument is available, use replace case for first occurrence in the project
std::vector<QString> gridFileNames = std::vector<QString> gridFileNames = readFileListFromTextFile( cvfqt::Utils::toQString( o.safeValue( 0 ) ) );
readFileListFromTextFile( cvfqt::Utils::toQString( o.safeValue( 0 ) ) );
projectModifier->setReplaceSourceCasesFirstOccurrence( gridFileNames ); projectModifier->setReplaceSourceCasesFirstOccurrence( gridFileNames );
} }
else else
@ -238,9 +237,8 @@ RiaApplication::ApplicationStatus RiaConsoleApplication::handleArguments( gsl::n
size_t optionIdx = 0; size_t optionIdx = 0;
while ( optionIdx < o.valueCount() ) while ( optionIdx < o.valueCount() )
{ {
const int groupId = o.safeValue( optionIdx++ ).toInt( -1 ); const int groupId = o.safeValue( optionIdx++ ).toInt( -1 );
std::vector<QString> gridFileNames = std::vector<QString> gridFileNames = readFileListFromTextFile( cvfqt::Utils::toQString( o.safeValue( optionIdx++ ) ) );
readFileListFromTextFile( cvfqt::Utils::toQString( o.safeValue( optionIdx++ ) ) );
if ( groupId != -1 && !gridFileNames.empty() ) if ( groupId != -1 && !gridFileNames.empty() )
{ {
@ -282,8 +280,7 @@ RiaApplication::ApplicationStatus RiaConsoleApplication::handleArguments( gsl::n
if ( cvf::Option o = progOpt->option( "case" ) ) if ( cvf::Option o = progOpt->option( "case" ) )
{ {
QStringList fileNames = QStringList fileNames = RicImportGeneralDataFeature::fileNamesFromCaseNames( cvfqt::Utils::toQStringList( o.values() ) );
RicImportGeneralDataFeature::fileNamesFromCaseNames( cvfqt::Utils::toQStringList( o.values() ) );
bool createView = true; bool createView = true;
bool createPlot = true; bool createPlot = true;

View File

@ -32,8 +32,7 @@ RiaCurveSetDefinition::RiaCurveSetDefinition()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiaCurveSetDefinition::RiaCurveSetDefinition( RimSummaryCaseCollection* ensemble, RiaCurveSetDefinition::RiaCurveSetDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress )
const RifEclipseSummaryAddress& summaryAddress )
: m_ensemble( ensemble ) : m_ensemble( ensemble )
, m_summaryAddress( summaryAddress ) , m_summaryAddress( summaryAddress )
{ {

View File

@ -38,9 +38,7 @@ void caf::AppEnum<RiaDefines::TimeFormatComponents>::setUp()
addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_NONE, "NO_TIME", "No Time of Day" ); addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_NONE, "NO_TIME", "No Time of Day" );
addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR, "HOUR", "Hour Only" ); addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR, "HOUR", "Hour Only" );
addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE, "HOUR_MINUTE", "Hour and Minute" ); addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE, "HOUR_MINUTE", "Hour and Minute" );
addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND, addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND, "HOUR_MINUTE_SECONDS", "Hour, Minutes and Seconds" );
"HOUR_MINUTE_SECONDS",
"Hour, Minutes and Seconds" );
setDefault( RiaDefines::TimeFormatComponents::TIME_FORMAT_NONE ); setDefault( RiaDefines::TimeFormatComponents::TIME_FORMAT_NONE );
} }

View File

@ -232,10 +232,8 @@ QString RiaGuiApplication::promptForProjectSaveAsFileName() const
startPath += "/ResInsightProject.rsp"; startPath += "/ResInsightProject.rsp";
} }
QString fileName = RiuFileDialogTools::getSaveFileName( nullptr, QString fileName =
tr( "Save File" ), RiuFileDialogTools::getSaveFileName( nullptr, tr( "Save File" ), startPath, tr( "Project Files (*.rsp);;All files(*.*)" ) );
startPath,
tr( "Project Files (*.rsp);;All files(*.*)" ) );
return fileName; return fileName;
} }
@ -244,8 +242,7 @@ QString RiaGuiApplication::promptForProjectSaveAsFileName() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaGuiApplication::askUserToSaveModifiedProject() bool RiaGuiApplication::askUserToSaveModifiedProject()
{ {
if ( RiaPreferencesSystem::current()->showProjectChangedDialog() && if ( RiaPreferencesSystem::current()->showProjectChangedDialog() && caf::PdmUiModelChangeDetector::instance()->isModelChanged() )
caf::PdmUiModelChangeDetector::instance()->isModelChanged() )
{ {
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setIcon( QMessageBox::Question ); msgBox.setIcon( QMessageBox::Question );
@ -643,8 +640,7 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
{ {
// One argument is available, use replace case for first occurrence in the project // One argument is available, use replace case for first occurrence in the project
std::vector<QString> gridFileNames = std::vector<QString> gridFileNames = readFileListFromTextFile( cvfqt::Utils::toQString( o.safeValue( 0 ) ) );
readFileListFromTextFile( cvfqt::Utils::toQString( o.safeValue( 0 ) ) );
projectModifier->setReplaceSourceCasesFirstOccurrence( gridFileNames ); projectModifier->setReplaceSourceCasesFirstOccurrence( gridFileNames );
} }
else else
@ -652,9 +648,8 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
size_t optionIdx = 0; size_t optionIdx = 0;
while ( optionIdx < o.valueCount() ) while ( optionIdx < o.valueCount() )
{ {
const int groupId = o.safeValue( optionIdx++ ).toInt( -1 ); const int groupId = o.safeValue( optionIdx++ ).toInt( -1 );
std::vector<QString> gridFileNames = std::vector<QString> gridFileNames = readFileListFromTextFile( cvfqt::Utils::toQString( o.safeValue( optionIdx++ ) ) );
readFileListFromTextFile( cvfqt::Utils::toQString( o.safeValue( optionIdx++ ) ) );
if ( groupId != -1 && !gridFileNames.empty() ) if ( groupId != -1 && !gridFileNames.empty() )
{ {
@ -696,8 +691,7 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
if ( cvf::Option o = progOpt->option( "case" ) ) if ( cvf::Option o = progOpt->option( "case" ) )
{ {
QStringList fileNames = QStringList fileNames = RicImportGeneralDataFeature::fileNamesFromCaseNames( cvfqt::Utils::toQStringList( o.values() ) );
RicImportGeneralDataFeature::fileNamesFromCaseNames( cvfqt::Utils::toQStringList( o.values() ) );
bool createView = true; bool createView = true;
bool createPlot = true; bool createPlot = true;
@ -1106,8 +1100,7 @@ bool RiaGuiApplication::isMainPlotWindowVisible() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaGuiApplication::addToRecentFiles( const QString& fileName ) void RiaGuiApplication::addToRecentFiles( const QString& fileName )
{ {
CVF_ASSERT( m_recentFileActionProvider && CVF_ASSERT( m_recentFileActionProvider && "The provider needs to be created before any attempts to use the recent file actions" );
"The provider needs to be created before any attempts to use the recent file actions" );
m_recentFileActionProvider->addFileName( fileName ); m_recentFileActionProvider->addFileName( fileName );
} }
@ -1116,8 +1109,7 @@ void RiaGuiApplication::addToRecentFiles( const QString& fileName )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<QAction*> RiaGuiApplication::recentFileActions() const std::vector<QAction*> RiaGuiApplication::recentFileActions() const
{ {
CVF_ASSERT( m_recentFileActionProvider && CVF_ASSERT( m_recentFileActionProvider && "The provider needs to be created before any attempts to use the recent file actions" );
"The provider needs to be created before any attempts to use the recent file actions" );
return m_recentFileActionProvider->actions(); return m_recentFileActionProvider->actions();
} }
@ -1461,22 +1453,20 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
auto rim3dView = dynamic_cast<Rim3dView*>( viewWindow ); auto rim3dView = dynamic_cast<Rim3dView*>( viewWindow );
if ( rim3dView ) if ( rim3dView )
{ {
if ( oldPreferences && if ( oldPreferences && ( applySettingsToAllViews || rim3dView->meshMode() == oldPreferences->defaultMeshModeType() ) )
( applySettingsToAllViews || rim3dView->meshMode() == oldPreferences->defaultMeshModeType() ) )
{ {
rim3dView->meshMode = m_preferences->defaultMeshModeType(); rim3dView->meshMode = m_preferences->defaultMeshModeType();
} }
if ( oldPreferences && ( applySettingsToAllViews || rim3dView->backgroundColor() == if ( oldPreferences &&
oldPreferences->defaultViewerBackgroundColor() ) ) ( applySettingsToAllViews || rim3dView->backgroundColor() == oldPreferences->defaultViewerBackgroundColor() ) )
{ {
rim3dView->setBackgroundColor( m_preferences->defaultViewerBackgroundColor() ); rim3dView->setBackgroundColor( m_preferences->defaultViewerBackgroundColor() );
rim3dView->applyBackgroundColorAndFontChanges(); rim3dView->applyBackgroundColorAndFontChanges();
} }
if ( oldPreferences && if ( oldPreferences &&
( applySettingsToAllViews || ( applySettingsToAllViews || rim3dView->scaleZ() == static_cast<double>( oldPreferences->defaultScaleFactorZ() ) ) )
rim3dView->scaleZ() == static_cast<double>( oldPreferences->defaultScaleFactorZ() ) ) )
{ {
rim3dView->setScaleZ( static_cast<double>( m_preferences->defaultScaleFactorZ() ) ); rim3dView->setScaleZ( static_cast<double>( m_preferences->defaultScaleFactorZ() ) );
rim3dView->updateScaling(); rim3dView->updateScaling();
@ -1489,8 +1479,8 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( rim3dView ); RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( rim3dView );
if ( eclipseView ) if ( eclipseView )
{ {
if ( oldPreferences && ( applySettingsToAllViews || eclipseView->wellCollection()->wellLabelColor() == if ( oldPreferences && ( applySettingsToAllViews ||
oldPreferences->defaultWellLabelColor() ) ) eclipseView->wellCollection()->wellLabelColor() == oldPreferences->defaultWellLabelColor() ) )
{ {
eclipseView->wellCollection()->wellLabelColor = m_preferences->defaultWellLabelColor(); eclipseView->wellCollection()->wellLabelColor = m_preferences->defaultWellLabelColor();
} }
@ -1644,8 +1634,7 @@ void RiaGuiApplication::runMultiCaseSnapshots( const QString& templateProj
if ( !m_mainWindow ) return; if ( !m_mainWindow ) return;
QByteArray curState = m_mainWindow->dockManager()->saveState( 0 ); QByteArray curState = m_mainWindow->dockManager()->saveState( 0 );
m_mainWindow->dockManager()->restoreState( m_mainWindow->dockManager()->restoreState( RiuDockWidgetTools::defaultDockState( RiuDockWidgetTools::dockStateHideAll3DWindowName() ) );
RiuDockWidgetTools::defaultDockState( RiuDockWidgetTools::dockStateHideAll3DWindowName() ) );
const size_t numGridFiles = gridFileNames.size(); const size_t numGridFiles = gridFileNames.size();
for ( size_t i = 0; i < numGridFiles; i++ ) for ( size_t i = 0; i < numGridFiles; i++ )
@ -1677,11 +1666,10 @@ bool RiaGuiApplication::notify( QObject* receiver, QEvent* event )
if ( !memoryExhaustedBox && !allocatingMessageBox ) if ( !memoryExhaustedBox && !allocatingMessageBox )
{ {
allocatingMessageBox = true; allocatingMessageBox = true;
memoryExhaustedBox = memoryExhaustedBox = new QMessageBox( QMessageBox::Critical,
new QMessageBox( QMessageBox::Critical, "ResInsight Exhausted Memory",
"ResInsight Exhausted Memory", "Memory is Exhausted!\n ResInsight could not allocate the memory needed, and is now "
"Memory is Exhausted!\n ResInsight could not allocate the memory needed, and is now " "unstable and will probably crash soon." );
"unstable and will probably crash soon." );
} }
bool done = false; bool done = false;

View File

@ -97,9 +97,7 @@ public:
bool askUserToSaveModifiedProject(); bool askUserToSaveModifiedProject();
bool saveProjectAs( const QString& fileName ); bool saveProjectAs( const QString& fileName );
void runMultiCaseSnapshots( const QString& templateProjectFileName, void runMultiCaseSnapshots( const QString& templateProjectFileName, std::vector<QString> gridFileNames, const QString& snapshotFolderName );
std::vector<QString> gridFileNames,
const QString& snapshotFolderName );
bool useShaders() const; bool useShaders() const;
RiaDefines::RINavigationPolicy navigationPolicy() const; RiaDefines::RINavigationPolicy navigationPolicy() const;

View File

@ -196,9 +196,7 @@ std::set<RigEclipseResultAddress> RiaMemoryCleanup::findEclipseResultsInUse() co
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaMemoryCleanup::fieldChangedByUi( const caf::PdmFieldHandle* changedField, void RiaMemoryCleanup::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
const QVariant& oldValue,
const QVariant& newValue )
{ {
if ( changedField == &m_case ) if ( changedField == &m_case )
{ {
@ -243,7 +241,7 @@ QList<caf::PdmOptionItemInfo> RiaMemoryCleanup::calculateValueOptions( const caf
if ( eclipseCase ) if ( eclipseCase )
{ {
std::set<RigEclipseResultAddress> resultsInUse = findEclipseResultsInUse(); std::set<RigEclipseResultAddress> resultsInUse = findEclipseResultsInUse();
RigCaseCellResultsData* caseData = eclipseCase->results( RiaDefines::PorosityModelType::MATRIX_MODEL ); RigCaseCellResultsData* caseData = eclipseCase->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
if ( caseData ) if ( caseData )
{ {
m_eclipseResultAddresses = caseData->existingResults(); m_eclipseResultAddresses = caseData->existingResults();
@ -279,11 +277,10 @@ QList<caf::PdmOptionItemInfo> RiaMemoryCleanup::calculateValueOptions( const caf
for ( size_t i = 0; i < m_geomResultAddresses.size(); ++i ) for ( size_t i = 0; i < m_geomResultAddresses.size(); ++i )
{ {
const RigFemResultAddress& result = m_geomResultAddresses[i]; const RigFemResultAddress& result = m_geomResultAddresses[i];
bool inUse = resultsInUse.count( result ); bool inUse = resultsInUse.count( result );
QString posText = caf::AppEnum<RigFemResultPosEnum>::uiTextFromIndex( result.resultPosType ); QString posText = caf::AppEnum<RigFemResultPosEnum>::uiTextFromIndex( result.resultPosType );
QString resultsText = QString resultsText = QString( "%1, %2" ).arg( posText ).arg( QString::fromStdString( result.fieldName ) );
QString( "%1, %2" ).arg( posText ).arg( QString::fromStdString( result.fieldName ) );
if ( !result.componentName.empty() ) if ( !result.componentName.empty() )
{ {
resultsText += QString( ", %1" ).arg( QString::fromStdString( result.componentName ) ); resultsText += QString( ", %1" ).arg( QString::fromStdString( result.componentName ) );
@ -313,9 +310,7 @@ void RiaMemoryCleanup::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaMemoryCleanup::defineEditorAttribute( const caf::PdmFieldHandle* field, void RiaMemoryCleanup::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{ {
if ( field == &m_performDelete ) if ( field == &m_performDelete )
{ {

View File

@ -50,9 +50,7 @@ private:
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override; QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
private: private:
caf::PdmPtrField<RimCase*> m_case; caf::PdmPtrField<RimCase*> m_case;

View File

@ -41,8 +41,7 @@ RiaPlotWindowRedrawScheduler* RiaPlotWindowRedrawScheduler::instance()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::scheduleMultiPlotBookUpdate( RiuMultiPlotBook* plotBook, void RiaPlotWindowRedrawScheduler::scheduleMultiPlotBookUpdate( RiuMultiPlotBook* plotBook, RiaDefines::MultiPlotPageUpdateType updateType )
RiaDefines::MultiPlotPageUpdateType updateType )
{ {
if ( m_plotBooksToUpdate.count( plotBook ) == 0 ) if ( m_plotBooksToUpdate.count( plotBook ) == 0 )
{ {
@ -59,8 +58,7 @@ void RiaPlotWindowRedrawScheduler::scheduleMultiPlotBookUpdate( RiuMultiPlotBook
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::scheduleMultiPlotPageUpdate( RiuMultiPlotPage* plotPage, void RiaPlotWindowRedrawScheduler::scheduleMultiPlotPageUpdate( RiuMultiPlotPage* plotPage, RiaDefines::MultiPlotPageUpdateType updateType )
RiaDefines::MultiPlotPageUpdateType updateType )
{ {
if ( m_plotPagesToUpdate.count( plotPage ) == 0 ) if ( m_plotPagesToUpdate.count( plotPage ) == 0 )
{ {
@ -170,10 +168,7 @@ void RiaPlotWindowRedrawScheduler::startTimer( int msecs )
if ( !m_plotWindowUpdateTimer ) if ( !m_plotWindowUpdateTimer )
{ {
m_plotWindowUpdateTimer.reset( new QTimer( this ) ); m_plotWindowUpdateTimer.reset( new QTimer( this ) );
connect( m_plotWindowUpdateTimer.data(), connect( m_plotWindowUpdateTimer.data(), SIGNAL( timeout() ), this, SLOT( slotUpdateAndReplotScheduledItemsWhenReady() ) );
SIGNAL( timeout() ),
this,
SLOT( slotUpdateAndReplotScheduledItemsWhenReady() ) );
} }
if ( !m_plotWindowUpdateTimer->isActive() ) if ( !m_plotWindowUpdateTimer->isActive() )

View File

@ -40,12 +40,10 @@ class RiaPlotWindowRedrawScheduler : public QObject
public: public:
static RiaPlotWindowRedrawScheduler* instance(); static RiaPlotWindowRedrawScheduler* instance();
void scheduleMultiPlotBookUpdate( void scheduleMultiPlotBookUpdate( RiuMultiPlotBook* plotWindow,
RiuMultiPlotBook* plotWindow, RiaDefines::MultiPlotPageUpdateType updateType = RiaDefines::MultiPlotPageUpdateType::ALL );
RiaDefines::MultiPlotPageUpdateType updateType = RiaDefines::MultiPlotPageUpdateType::ALL ); void scheduleMultiPlotPageUpdate( RiuMultiPlotPage* plotWindow,
void scheduleMultiPlotPageUpdate( RiaDefines::MultiPlotPageUpdateType updateType = RiaDefines::MultiPlotPageUpdateType::ALL );
RiuMultiPlotPage* plotWindow,
RiaDefines::MultiPlotPageUpdateType updateType = RiaDefines::MultiPlotPageUpdateType::ALL );
void schedulePlotWidgetReplot( RiuPlotWidget* plotWidget ); void schedulePlotWidgetReplot( RiuPlotWidget* plotWidget );
void clearAllScheduledUpdates(); void clearAllScheduledUpdates();
void performScheduledUpdatesAndReplots(); void performScheduledUpdatesAndReplots();

View File

@ -84,13 +84,7 @@ RiaPreferences::RiaPreferences()
caf::AppEnum<RiaDefines::RINavigationPolicy>( RiaDefines::RINavigationPolicy::NAVIGATION_POLICY_RMS ), caf::AppEnum<RiaDefines::RINavigationPolicy>( RiaDefines::RINavigationPolicy::NAVIGATION_POLICY_RMS ),
"Navigation Mode" ); "Navigation Mode" );
CAF_PDM_InitField( &enableGrpcServer, CAF_PDM_InitField( &enableGrpcServer, "enableGrpcServer", true, "Enable Python Script Server", "", "Remote Procedure Call Scripting Engine", "" );
"enableGrpcServer",
true,
"Enable Python Script Server",
"",
"Remote Procedure Call Scripting Engine",
"" );
CAF_PDM_InitField( &defaultGrpcPortNumber, "defaultGrpcPort", 50051, "Default Python Script Server Port" ); CAF_PDM_InitField( &defaultGrpcPortNumber, "defaultGrpcPort", 50051, "Default Python Script Server Port" );
CAF_PDM_InitFieldNoDefault( &scriptDirectories, "scriptDirectory", "Shared Script Folder(s)" ); CAF_PDM_InitFieldNoDefault( &scriptDirectories, "scriptDirectory", "Shared Script Folder(s)" );
@ -195,10 +189,7 @@ RiaPreferences::RiaPreferences()
"Disable SSL Certificate Verification (HoloLens)" ); "Disable SSL Certificate Verification (HoloLens)" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &holoLensDisableCertificateVerification ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &holoLensDisableCertificateVerification );
CAF_PDM_InitField( &csvTextExportFieldSeparator, CAF_PDM_InitField( &csvTextExportFieldSeparator, "csvTextExportFieldSeparator", QString( "," ), "CSV Text Export Field Separator" );
"csvTextExportFieldSeparator",
QString( "," ),
"CSV Text Export Field Separator" );
CAF_PDM_InitFieldNoDefault( &m_readerSettings, "readerSettings", "Reader Settings" ); CAF_PDM_InitFieldNoDefault( &m_readerSettings, "readerSettings", "Reader Settings" );
m_readerSettings = new RifReaderSettings; m_readerSettings = new RifReaderSettings;
@ -215,10 +206,7 @@ RiaPreferences::RiaPreferences()
CAF_PDM_InitFieldNoDefault( &m_plotTemplateFolders, "plotTemplateFolders", "Plot Template Folder(s)" ); CAF_PDM_InitFieldNoDefault( &m_plotTemplateFolders, "plotTemplateFolders", "Plot Template Folder(s)" );
m_plotTemplateFolders.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() ); m_plotTemplateFolders.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_maxPlotTemplateFoldersDepth, CAF_PDM_InitField( &m_maxPlotTemplateFoldersDepth, "MaxPlotTemplateFoldersDepth", 2, "Maximum Plot Template Folder Search Depth" );
"MaxPlotTemplateFoldersDepth",
2,
"Maximum Plot Template Folder Search Depth" );
CAF_PDM_InitFieldNoDefault( &m_lastUsedPlotTemplate, "defaultPlotTemplate", "Default Plot Template" ); CAF_PDM_InitFieldNoDefault( &m_lastUsedPlotTemplate, "defaultPlotTemplate", "Default Plot Template" );
@ -287,9 +275,7 @@ RiaPreferences* RiaPreferences::current()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field, void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{ {
m_readerSettings->defineEditorAttribute( field, uiConfigName, attribute ); m_readerSettings->defineEditorAttribute( field, uiConfigName, attribute );
m_summaryPreferences->defineEditorAttribute( field, uiConfigName, attribute ); m_summaryPreferences->defineEditorAttribute( field, uiConfigName, attribute );
@ -320,8 +306,7 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field,
caf::PdmUiLineEditorAttribute* myAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute ); caf::PdmUiLineEditorAttribute* myAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
if ( myAttr ) if ( myAttr )
{ {
myAttr->validator = myAttr->validator = new RiaValidRegExpValidator( RiaPreferences::current()->defaultMultiLateralWellNamePattern() );
new RiaValidRegExpValidator( RiaPreferences::current()->defaultMultiLateralWellNamePattern() );
} }
} }
} }
@ -472,8 +457,7 @@ QList<caf::PdmOptionItemInfo> RiaPreferences::calculateValueOptions( const caf::
{ {
QDate exampleDate = QDate( 2019, 8, 16 ); QDate exampleDate = QDate( 2019, 8, 16 );
QString fullDateFormat = QString fullDateFormat =
RiaQDateTimeTools::dateFormatString( dateFormat, RiaQDateTimeTools::dateFormatString( dateFormat, RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY );
RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY );
QString uiText = QString( "%1 (%2)" ).arg( fullDateFormat ).arg( exampleDate.toString( fullDateFormat ) ); QString uiText = QString( "%1 (%2)" ).arg( fullDateFormat ).arg( exampleDate.toString( fullDateFormat ) );
uiText.replace( "AP", "AM/PM" ); uiText.replace( "AP", "AM/PM" );
options.push_back( caf::PdmOptionItemInfo( uiText, QVariant::fromValue( dateFormat ) ) ); options.push_back( caf::PdmOptionItemInfo( uiText, QVariant::fromValue( dateFormat ) ) );
@ -485,8 +469,7 @@ QList<caf::PdmOptionItemInfo> RiaPreferences::calculateValueOptions( const caf::
{ {
QTime exampleTime = QTime( 15, 48, 22 ); QTime exampleTime = QTime( 15, 48, 22 );
QString timeFormatString = QString timeFormatString =
RiaQDateTimeTools::timeFormatString( timeFormat, RiaQDateTimeTools::timeFormatString( timeFormat, RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND );
RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND );
QString uiText = QString( "%1 (%2)" ).arg( timeFormatString ).arg( exampleTime.toString( timeFormatString ) ); QString uiText = QString( "%1 (%2)" ).arg( timeFormatString ).arg( exampleTime.toString( timeFormatString ) );
uiText.replace( "AP", "AM/PM" ); uiText.replace( "AP", "AM/PM" );
options.push_back( caf::PdmOptionItemInfo( uiText, QVariant::fromValue( timeFormat ) ) ); options.push_back( caf::PdmOptionItemInfo( uiText, QVariant::fromValue( timeFormat ) ) );
@ -506,9 +489,7 @@ void RiaPreferences::initAfterRead()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaPreferences::fieldChangedByUi( const caf::PdmFieldHandle* changedField, void RiaPreferences::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
const QVariant& oldValue,
const QVariant& newValue )
{ {
if ( changedField == &m_pageSize ) if ( changedField == &m_pageSize )
{ {
@ -666,8 +647,7 @@ const QString& RiaPreferences::timeFormat() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RiaPreferences::dateTimeFormat( RiaDefines::DateFormatComponents dateComponents, QString RiaPreferences::dateTimeFormat( RiaDefines::DateFormatComponents dateComponents, RiaDefines::TimeFormatComponents timeComponents ) const
RiaDefines::TimeFormatComponents timeComponents ) const
{ {
return QString( "%1 %2" ) return QString( "%1 %2" )
.arg( RiaQDateTimeTools::dateFormatString( m_dateFormat(), dateComponents ) ) .arg( RiaQDateTimeTools::dateFormatString( m_dateFormat(), dateComponents ) )

View File

@ -72,9 +72,9 @@ public:
const QString& dateFormat() const; const QString& dateFormat() const;
const QString& timeFormat() const; const QString& timeFormat() const;
QString dateTimeFormat( QString
RiaDefines::DateFormatComponents dateComponents = RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY, dateTimeFormat( RiaDefines::DateFormatComponents dateComponents = RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY,
RiaDefines::TimeFormatComponents timeComponents = RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND ) const; RiaDefines::TimeFormatComponents timeComponents = RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND ) const;
int maxScriptFoldersDepth() const; int maxScriptFoldersDepth() const;
int maxPlotTemplateFoldersDepth() const; int maxPlotTemplateFoldersDepth() const;
@ -146,13 +146,11 @@ public:
caf::PdmField<QString> csvTextExportFieldSeparator; caf::PdmField<QString> csvTextExportFieldSeparator;
protected: protected:
void defineEditorAttribute( const caf::PdmFieldHandle* field, void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
QString uiConfigName, void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
caf::PdmUiEditorAttribute* attribute ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override; QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void initAfterRead() override; void initAfterRead() override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
private: private:
static QString tabNameGeneral(); static QString tabNameGeneral();

View File

@ -45,10 +45,7 @@ RiaPreferencesGeoMech::RiaPreferencesGeoMech()
CAF_PDM_InitField( &m_keepTemporaryFiles, "keepTemporaryFile", false, "Keep temporary parameter files (for debugging)" ); CAF_PDM_InitField( &m_keepTemporaryFiles, "keepTemporaryFile", false, "Keep temporary parameter files (for debugging)" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_keepTemporaryFiles ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_keepTemporaryFiles );
CAF_PDM_InitField( &m_waitForInputFileEdit, CAF_PDM_InitField( &m_waitForInputFileEdit, "waitForInputFileEdit", true, "Pause to allow modification of input files before running modeling." );
"waitForInputFileEdit",
true,
"Pause to allow modification of input files before running modeling." );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_waitForInputFileEdit ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_waitForInputFileEdit );
} }

View File

@ -50,9 +50,7 @@ void RiaPreferencesSummary::SummaryHistoryCurveStyleModeType::setUp()
{ {
addItem( RiaPreferencesSummary::SummaryHistoryCurveStyleMode::SYMBOLS, "SYMBOLS", "Symbols" ); addItem( RiaPreferencesSummary::SummaryHistoryCurveStyleMode::SYMBOLS, "SYMBOLS", "Symbols" );
addItem( RiaPreferencesSummary::SummaryHistoryCurveStyleMode::LINES, "LINES", "Lines" ); addItem( RiaPreferencesSummary::SummaryHistoryCurveStyleMode::LINES, "LINES", "Lines" );
addItem( RiaPreferencesSummary::SummaryHistoryCurveStyleMode::SYMBOLS_AND_LINES, addItem( RiaPreferencesSummary::SummaryHistoryCurveStyleMode::SYMBOLS_AND_LINES, "SYMBOLS_AND_LINES", "Symbols and Lines" );
"SYMBOLS_AND_LINES",
"Symbols and Lines" );
setDefault( RiaPreferencesSummary::SummaryHistoryCurveStyleMode::SYMBOLS ); setDefault( RiaPreferencesSummary::SummaryHistoryCurveStyleMode::SYMBOLS );
} }
@ -83,9 +81,7 @@ CAF_PDM_SOURCE_INIT( RiaPreferencesSummary, "RiaPreferencesSummary" );
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiaPreferencesSummary::RiaPreferencesSummary() RiaPreferencesSummary::RiaPreferencesSummary()
{ {
CAF_PDM_InitFieldNoDefault( &m_summaryRestartFilesShowImportDialog, CAF_PDM_InitFieldNoDefault( &m_summaryRestartFilesShowImportDialog, "summaryRestartFilesShowImportDialog", "Show Import Dialog" );
"summaryRestartFilesShowImportDialog",
"Show Import Dialog" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_summaryRestartFilesShowImportDialog ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_summaryRestartFilesShowImportDialog );
@ -413,9 +409,7 @@ void RiaPreferencesSummary::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaPreferencesSummary::defineEditorAttribute( const caf::PdmFieldHandle* field, void RiaPreferencesSummary::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{ {
if ( field == &m_defaultRowsPerPage || field == &m_defaultColumnCount ) if ( field == &m_defaultRowsPerPage || field == &m_defaultColumnCount )
{ {
@ -471,10 +465,8 @@ QList<caf::PdmOptionItemInfo> RiaPreferencesSummary::calculateValueOptions( cons
SummaryRestartFilesImportModeType skip( RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT ); SummaryRestartFilesImportModeType skip( RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT );
SummaryRestartFilesImportModeType separate( RiaPreferencesSummary::SummaryRestartFilesImportMode::SEPARATE_CASES ); SummaryRestartFilesImportModeType separate( RiaPreferencesSummary::SummaryRestartFilesImportMode::SEPARATE_CASES );
options.push_back( options.push_back( caf::PdmOptionItemInfo( skip.uiText(), RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT ) );
caf::PdmOptionItemInfo( skip.uiText(), RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT ) ); options.push_back( caf::PdmOptionItemInfo( separate.uiText(), RiaPreferencesSummary::SummaryRestartFilesImportMode::SEPARATE_CASES ) );
options.push_back( caf::PdmOptionItemInfo( separate.uiText(),
RiaPreferencesSummary::SummaryRestartFilesImportMode::SEPARATE_CASES ) );
} }
else if ( fieldNeedingOptions == &m_summaryEnsembleImportMode ) else if ( fieldNeedingOptions == &m_summaryEnsembleImportMode )
{ {
@ -482,24 +474,19 @@ QList<caf::PdmOptionItemInfo> RiaPreferencesSummary::calculateValueOptions( cons
SummaryRestartFilesImportModeType skip( RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT ); SummaryRestartFilesImportModeType skip( RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT );
SummaryRestartFilesImportModeType allowImport( RiaPreferencesSummary::SummaryRestartFilesImportMode::IMPORT ); SummaryRestartFilesImportModeType allowImport( RiaPreferencesSummary::SummaryRestartFilesImportMode::IMPORT );
options.push_back( options.push_back( caf::PdmOptionItemInfo( skip.uiText(), RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT ) );
caf::PdmOptionItemInfo( skip.uiText(), RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT ) ); options.push_back( caf::PdmOptionItemInfo( allowImport.uiText(), RiaPreferencesSummary::SummaryRestartFilesImportMode::IMPORT ) );
options.push_back( caf::PdmOptionItemInfo( allowImport.uiText(),
RiaPreferencesSummary::SummaryRestartFilesImportMode::IMPORT ) );
} }
else if ( fieldNeedingOptions == &m_defaultColumnCount ) else if ( fieldNeedingOptions == &m_defaultColumnCount )
{ {
for ( size_t i = 0; i < ColumnCountEnum::size(); ++i ) for ( size_t i = 0; i < ColumnCountEnum::size(); ++i )
{ {
RiaDefines::ColumnCount enumVal = ColumnCountEnum::fromIndex( i ); RiaDefines::ColumnCount enumVal = ColumnCountEnum::fromIndex( i );
QString columnCountString = ( enumVal == RiaDefines::ColumnCount::COLUMNS_UNLIMITED ) QString columnCountString =
? "Unlimited" ( enumVal == RiaDefines::ColumnCount::COLUMNS_UNLIMITED ) ? "Unlimited" : QString( "%1" ).arg( static_cast<int>( enumVal ) );
: QString( "%1" ).arg( static_cast<int>( enumVal ) );
QString iconPath = QString( ":/Columns%1.png" ).arg( columnCountString ); QString iconPath = QString( ":/Columns%1.png" ).arg( columnCountString );
options.push_back( caf::PdmOptionItemInfo( ColumnCountEnum::uiText( enumVal ), options.push_back(
enumVal, caf::PdmOptionItemInfo( ColumnCountEnum::uiText( enumVal ), enumVal, false, caf::IconProvider( iconPath, QSize( 24, 16 ) ) ) );
false,
caf::IconProvider( iconPath, QSize( 24, 16 ) ) ) );
} }
} }
else if ( fieldNeedingOptions == &m_defaultRowsPerPage ) else if ( fieldNeedingOptions == &m_defaultRowsPerPage )
@ -508,10 +495,8 @@ QList<caf::PdmOptionItemInfo> RiaPreferencesSummary::calculateValueOptions( cons
{ {
RiaDefines::RowCount enumVal = RowCountEnum::fromIndex( i ); RiaDefines::RowCount enumVal = RowCountEnum::fromIndex( i );
QString iconPath = QString( ":/Rows%1.png" ).arg( static_cast<int>( enumVal ) ); QString iconPath = QString( ":/Rows%1.png" ).arg( static_cast<int>( enumVal ) );
options.push_back( caf::PdmOptionItemInfo( RowCountEnum::uiText( enumVal ), options.push_back(
enumVal, caf::PdmOptionItemInfo( RowCountEnum::uiText( enumVal ), enumVal, false, caf::IconProvider( iconPath, QSize( 24, 16 ) ) ) );
false,
caf::IconProvider( iconPath, QSize( 24, 16 ) ) ) );
} }
} }
@ -545,9 +530,7 @@ cvf::Color3f RiaPreferencesSummary::historyCurveContrastColor() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaPreferencesSummary::fieldChangedByUi( const caf::PdmFieldHandle* changedField, void RiaPreferencesSummary::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
const QVariant& oldValue,
const QVariant& newValue )
{ {
if ( changedField == &m_selectDefaultTemplates ) if ( changedField == &m_selectDefaultTemplates )
{ {
@ -580,8 +563,7 @@ std::vector<QString> RiaPreferencesSummary::defaultSummaryPlotTemplates( bool re
if ( singleTemplate && returnEnsembleTemplates ) continue; if ( singleTemplate && returnEnsembleTemplates ) continue;
if ( !singleTemplate && !returnEnsembleTemplates ) continue; if ( !singleTemplate && !returnEnsembleTemplates ) continue;
if ( std::count( templatesToUse.begin(), templatesToUse.end(), fileName ) == 0 ) if ( std::count( templatesToUse.begin(), templatesToUse.end(), fileName ) == 0 ) templatesToUse.push_back( fileName );
templatesToUse.push_back( fileName );
} }
return templatesToUse; return templatesToUse;

View File

@ -114,9 +114,7 @@ public:
cvf::Color3f historyCurveContrastColor() const; cvf::Color3f historyCurveContrastColor() const;
void defineEditorAttribute( const caf::PdmFieldHandle* field, void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
protected: protected:

View File

@ -29,9 +29,7 @@ namespace caf
template <> template <>
void RiaPreferencesSystem::EclipseTextFileReaderModeType::setUp() void RiaPreferencesSystem::EclipseTextFileReaderModeType::setUp()
{ {
addItem( RiaPreferencesSystem::EclipseTextFileReaderMode::MEMORY_MAPPED_FILE, addItem( RiaPreferencesSystem::EclipseTextFileReaderMode::MEMORY_MAPPED_FILE, "MEMORY_MAPPED_FILE", "Memory Mapped File Import" );
"MEMORY_MAPPED_FILE",
"Memory Mapped File Import" );
addItem( RiaPreferencesSystem::EclipseTextFileReaderMode::FILE, "FILE", "Default File Import" ); addItem( RiaPreferencesSystem::EclipseTextFileReaderMode::FILE, "FILE", "Default File Import" );
setDefault( RiaPreferencesSystem::EclipseTextFileReaderMode::FILE ); setDefault( RiaPreferencesSystem::EclipseTextFileReaderMode::FILE );
@ -53,10 +51,7 @@ RiaPreferencesSystem::RiaPreferencesSystem()
CAF_PDM_InitField( &m_appendClassNameToUiText, "appendClassNameToUiText", false, "Show Class Names" ); CAF_PDM_InitField( &m_appendClassNameToUiText, "appendClassNameToUiText", false, "Show Class Names" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_appendClassNameToUiText ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_appendClassNameToUiText );
CAF_PDM_InitField( &m_appendFieldKeywordToToolTipText, CAF_PDM_InitField( &m_appendFieldKeywordToToolTipText, "appendFieldKeywordToToolTipText", false, "Show Field Keyword in ToolTip" );
"appendFieldKeywordToToolTipText",
false,
"Show Field Keyword in ToolTip" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_appendFieldKeywordToToolTipText ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_appendFieldKeywordToToolTipText );
CAF_PDM_InitField( &m_showViewIdInProjectTree, "showViewIdInTree", false, "Show View Id in Project Tree" ); CAF_PDM_InitField( &m_showViewIdInProjectTree, "showViewIdInTree", false, "Show View Id in Project Tree" );
@ -65,10 +60,7 @@ RiaPreferencesSystem::RiaPreferencesSystem()
CAF_PDM_InitField( &m_showTestToolbar, "showTestToolbar", false, "Enable Test Toolbar" ); CAF_PDM_InitField( &m_showTestToolbar, "showTestToolbar", false, "Enable Test Toolbar" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showTestToolbar ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showTestToolbar );
CAF_PDM_InitField( &m_includeFractureDebugInfoFile, CAF_PDM_InitField( &m_includeFractureDebugInfoFile, "includeFractureDebugInfoFile", false, "Include Fracture Debug Info for Completion Export" );
"includeFractureDebugInfoFile",
false,
"Include Fracture Debug Info for Completion Export" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_includeFractureDebugInfoFile ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_includeFractureDebugInfoFile );
CAF_PDM_InitFieldNoDefault( &m_holoLensExportFolder, "holoLensExportFolder", "HoloLens Export Folder" ); CAF_PDM_InitFieldNoDefault( &m_holoLensExportFolder, "holoLensExportFolder", "HoloLens Export Folder" );
@ -273,9 +265,7 @@ QList<caf::PdmOptionItemInfo> RiaPreferencesSystem::calculateValueOptions( const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaPreferencesSystem::defineEditorAttribute( const caf::PdmFieldHandle* field, void RiaPreferencesSystem::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{ {
if ( field == &m_holoLensExportFolder ) if ( field == &m_holoLensExportFolder )
{ {

View File

@ -62,9 +62,7 @@ public:
protected: protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override; QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
private: private:
caf::PdmField<bool> m_appendClassNameToUiText; caf::PdmField<bool> m_appendClassNameToUiText;

View File

@ -21,9 +21,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiaRftPltCurveDefinition::RiaRftPltCurveDefinition( const RifDataSourceForRftPlt& address, RiaRftPltCurveDefinition::RiaRftPltCurveDefinition( const RifDataSourceForRftPlt& address, const QString& wellName, const QDateTime& timeStep )
const QString& wellName,
const QDateTime& timeStep )
: m_curveAddress( address ) : m_curveAddress( address )
, m_wellName( wellName ) , m_wellName( wellName )
, m_timeStep( timeStep ) , m_timeStep( timeStep )

View File

@ -33,9 +33,7 @@ class RimSummaryCase;
class RiaRftPltCurveDefinition class RiaRftPltCurveDefinition
{ {
public: public:
explicit RiaRftPltCurveDefinition( const RifDataSourceForRftPlt& address, explicit RiaRftPltCurveDefinition( const RifDataSourceForRftPlt& address, const QString& wellName, const QDateTime& timeStep );
const QString& wellName,
const QDateTime& timeStep );
const RifDataSourceForRftPlt& address() const; const RifDataSourceForRftPlt& address() const;
const QString& wellName() const; const QString& wellName() const;

View File

@ -45,13 +45,9 @@ void AppEnum<RiaDefines::CurveProperty>::setUp()
addItem( RiaDefines::CurveProperty::FLUID_LOSS_COEFFICIENT, "FLUID_LOSS_COEFFICIENT", "Fluid Loss Coefficient" ); addItem( RiaDefines::CurveProperty::FLUID_LOSS_COEFFICIENT, "FLUID_LOSS_COEFFICIENT", "Fluid Loss Coefficient" );
addItem( RiaDefines::CurveProperty::SPURT_LOSS, "SPURT_LOSS", "Spurt Loss" ); addItem( RiaDefines::CurveProperty::SPURT_LOSS, "SPURT_LOSS", "Spurt Loss" );
addItem( RiaDefines::CurveProperty::TEMPERATURE, "TEMPERATURE", "Temperature" ); addItem( RiaDefines::CurveProperty::TEMPERATURE, "TEMPERATURE", "Temperature" );
addItem( RiaDefines::CurveProperty::RELATIVE_PERMEABILITY_FACTOR, addItem( RiaDefines::CurveProperty::RELATIVE_PERMEABILITY_FACTOR, "RELATIVE_PERMEABILITY_FACTOR", "Relative Permeability Factor" );
"RELATIVE_PERMEABILITY_FACTOR",
"Relative Permeability Factor" );
addItem( RiaDefines::CurveProperty::PORO_ELASTIC_CONSTANT, "PORO_ELASTIC_CONSTANT", "Poro-Elastic Constant" ); addItem( RiaDefines::CurveProperty::PORO_ELASTIC_CONSTANT, "PORO_ELASTIC_CONSTANT", "Poro-Elastic Constant" );
addItem( RiaDefines::CurveProperty::THERMAL_EXPANSION_COEFFICIENT, addItem( RiaDefines::CurveProperty::THERMAL_EXPANSION_COEFFICIENT, "THERMAL_EXPANSION_COEFFICIENT", "Thermal Expansion Coefficient" );
"THERMAL_EXPANSION_COEFFICIENT",
"Thermal Expansion Coefficient" );
addItem( RiaDefines::CurveProperty::IMMOBILE_FLUID_SATURATION, "IMMOBILE_FLUID_SATURATION", "Immobile Fluid Saturation" ); addItem( RiaDefines::CurveProperty::IMMOBILE_FLUID_SATURATION, "IMMOBILE_FLUID_SATURATION", "Immobile Fluid Saturation" );
addItem( RiaDefines::CurveProperty::NET_TO_GROSS, "NET_TO_GROSS", "Net-To-Gross" ); addItem( RiaDefines::CurveProperty::NET_TO_GROSS, "NET_TO_GROSS", "Net-To-Gross" );
addItem( RiaDefines::CurveProperty::POROSITY_UNSCALED, "POROSITY_UNSCALED", "Porosity (Unscaled)" ); addItem( RiaDefines::CurveProperty::POROSITY_UNSCALED, "POROSITY_UNSCALED", "Porosity (Unscaled)" );

View File

@ -50,8 +50,7 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase*
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress )
const RifEclipseSummaryAddress& summaryAddress )
: m_summaryCase( nullptr ) : m_summaryCase( nullptr )
, m_summaryAddress( summaryAddress ) , m_summaryAddress( summaryAddress )
, m_ensemble( ensemble ) , m_ensemble( ensemble )
@ -102,8 +101,7 @@ void RiaSummaryCurveDefinition::setSummaryAddress( const RifEclipseSummaryAddres
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaSummaryCurveDefinition::resultValues( const RiaSummaryCurveDefinition& curveDefinition, void RiaSummaryCurveDefinition::resultValues( const RiaSummaryCurveDefinition& curveDefinition, gsl::not_null<std::vector<double>*> values )
gsl::not_null<std::vector<double>*> values )
{ {
if ( !curveDefinition.summaryAddress().isValid() ) return; if ( !curveDefinition.summaryAddress().isValid() ) return;
if ( !curveDefinition.summaryCase() ) return; if ( !curveDefinition.summaryCase() ) return;
@ -145,8 +143,7 @@ QString RiaSummaryCurveDefinition::curveDefinitionText() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RiaSummaryCurveDefinition::curveDefinitionText( const QString& caseName, QString RiaSummaryCurveDefinition::curveDefinitionText( const QString& caseName, const RifEclipseSummaryAddress& summaryAddress )
const RifEclipseSummaryAddress& summaryAddress )
{ {
QString txt; QString txt;

View File

@ -37,9 +37,7 @@ class RiaSummaryCurveDefinition
{ {
public: public:
RiaSummaryCurveDefinition(); RiaSummaryCurveDefinition();
explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCase, explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& summaryAddress, bool isEnsembleCurve );
const RifEclipseSummaryAddress& summaryAddress,
bool isEnsembleCurve );
explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress ); explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress );
RimSummaryCase* summaryCase() const; RimSummaryCase* summaryCase() const;
@ -51,7 +49,7 @@ public:
bool operator<( const RiaSummaryCurveDefinition& other ) const; bool operator<( const RiaSummaryCurveDefinition& other ) const;
// TODO: Consider moving to a separate tools class // TODO: Consider moving to a separate tools class
static void resultValues( const RiaSummaryCurveDefinition& curveDefinition, gsl::not_null<std::vector<double>*> values ); static void resultValues( const RiaSummaryCurveDefinition& curveDefinition, gsl::not_null<std::vector<double>*> values );
static std::vector<time_t> timeSteps( const RiaSummaryCurveDefinition& curveDefinition ); static std::vector<time_t> timeSteps( const RiaSummaryCurveDefinition& curveDefinition );
QString curveDefinitionText() const; QString curveDefinitionText() const;

View File

@ -78,8 +78,7 @@ QString viscosityResultName()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString getExpectedThermalFractureUnit( const QString& name, RiaDefines::EclipseUnitSystem unitSystem ) QString getExpectedThermalFractureUnit( const QString& name, RiaDefines::EclipseUnitSystem unitSystem )
{ {
CAF_ASSERT( unitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC || CAF_ASSERT( unitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC || unitSystem == RiaDefines::EclipseUnitSystem::UNITS_FIELD );
unitSystem == RiaDefines::EclipseUnitSystem::UNITS_FIELD );
// parameter name --> { metric unit, field unit } // parameter name --> { metric unit, field unit }
std::map<QString, std::pair<QString, QString>> mapping = std::map<QString, std::pair<QString, QString>> mapping =

View File

@ -88,8 +88,7 @@ void RiaViewRedrawScheduler::updateAndRedrawScheduledViews()
independent3DViewsToUpdate.insert( m_resViewsToUpdate[i] ); independent3DViewsToUpdate.insert( m_resViewsToUpdate[i] );
} }
for ( std::set<Rim3dView*>::iterator it = independent3DViewsToUpdate.begin(); it != independent3DViewsToUpdate.end(); for ( std::set<Rim3dView*>::iterator it = independent3DViewsToUpdate.begin(); it != independent3DViewsToUpdate.end(); ++it )
++it )
{ {
if ( *it ) if ( *it )
{ {

View File

@ -67,19 +67,10 @@ bool RiaArgumentParser::parseArguments( cvf::ProgramOptions* progOpt )
"If <filename> has extension .SMSPEC, import the summary file (does not open the " "If <filename> has extension .SMSPEC, import the summary file (does not open the "
"corresponding grid file)", "corresponding grid file)",
cvf::ProgramOptions::MULTI_VALUE ); cvf::ProgramOptions::MULTI_VALUE );
progOpt->registerOption( "size", progOpt->registerOption( "size", "<width> <height>", "Set size of the main application window.", cvf::ProgramOptions::MULTI_VALUE );
"<width> <height>",
"Set size of the main application window.",
cvf::ProgramOptions::MULTI_VALUE );
progOpt->registerOption( "console", "", "Launch as a console application without graphics" ); progOpt->registerOption( "console", "", "Launch as a console application without graphics" );
progOpt->registerOption( "server", progOpt->registerOption( "server", "[<portnumber>]", "Launch as a GRPC server. Default port is 50051", cvf::ProgramOptions::SINGLE_VALUE );
"[<portnumber>]", progOpt->registerOption( "portnumberfile", "[<filename>]", "Write the port number to this file.", cvf::ProgramOptions::SINGLE_VALUE );
"Launch as a GRPC server. Default port is 50051",
cvf::ProgramOptions::SINGLE_VALUE );
progOpt->registerOption( "portnumberfile",
"[<filename>]",
"Write the port number to this file.",
cvf::ProgramOptions::SINGLE_VALUE );
progOpt->registerOption( "startdir", "<folder>", "Set startup directory.\n", cvf::ProgramOptions::SINGLE_VALUE ); progOpt->registerOption( "startdir", "<folder>", "Set startup directory.\n", cvf::ProgramOptions::SINGLE_VALUE );
@ -101,10 +92,7 @@ bool RiaArgumentParser::parseArguments( cvf::ProgramOptions* progOpt )
"'commandFileReplaceCases'.\n", "'commandFileReplaceCases'.\n",
cvf::ProgramOptions::SINGLE_VALUE ); cvf::ProgramOptions::SINGLE_VALUE );
progOpt->registerOption( "snapshotsize", progOpt->registerOption( "snapshotsize", "<width> <height>", "Set size of exported snapshot images.", cvf::ProgramOptions::MULTI_VALUE );
"<width> <height>",
"Set size of exported snapshot images.",
cvf::ProgramOptions::MULTI_VALUE );
progOpt->registerOption( "snapshotfolder", progOpt->registerOption( "snapshotfolder",
"<folder>", "<folder>",
"Set the destination folder for exported snapshot images.\n", "Set the destination folder for exported snapshot images.\n",

View File

@ -53,8 +53,7 @@ std::vector<std::vector<cvf::Vec3d>> calcFacePoints( const std::vector<cvf::Vec3
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3d> std::vector<cvf::Vec3d> RiaCellDividingTools::createHexCornerCoords( std::array<cvf::Vec3d, 8> mainCellCorners, size_t nx, size_t ny, size_t nz )
RiaCellDividingTools::createHexCornerCoords( std::array<cvf::Vec3d, 8> mainCellCorners, size_t nx, size_t ny, size_t nz )
{ {
std::array<std::pair<size_t, size_t>, 12> edgeCorners = { std::array<std::pair<size_t, size_t>, 12> edgeCorners = {
std::make_pair( 0, 1 ), std::make_pair( 0, 1 ),
@ -77,9 +76,7 @@ std::vector<cvf::Vec3d>
for ( int i = 0; i < 12; i++ ) for ( int i = 0; i < 12; i++ )
{ {
int partCountsIndex = i / 4; int partCountsIndex = i / 4;
edgePoints[i] = splitLine( mainCellCorners[edgeCorners[i].first], edgePoints[i] = splitLine( mainCellCorners[edgeCorners[i].first], mainCellCorners[edgeCorners[i].second], nxyz[partCountsIndex] );
mainCellCorners[edgeCorners[i].second],
nxyz[partCountsIndex] );
} }
// lowIJ, highIJ, lowJK, highKJ, // lowIJ, highIJ, lowJK, highKJ,
@ -134,8 +131,7 @@ std::vector<cvf::Vec3d>
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RiaCellDividingTools::computeFlowDistance( const std::array<cvf::Vec3d, 8>& cellVertices, double RiaCellDividingTools::computeFlowDistance( const std::array<cvf::Vec3d, 8>& cellVertices, const cvf::Vec3d& areaCenter )
const cvf::Vec3d& areaCenter )
{ {
auto subCellCorners = createHexCornerCoords( cellVertices, 2, 2, 2 ); auto subCellCorners = createHexCornerCoords( cellVertices, 2, 2, 2 );

View File

@ -29,8 +29,7 @@
class RiaCellDividingTools class RiaCellDividingTools
{ {
public: public:
static std::vector<cvf::Vec3d> static std::vector<cvf::Vec3d> createHexCornerCoords( std::array<cvf::Vec3d, 8> mainCellCorners, size_t nx, size_t ny, size_t nz );
createHexCornerCoords( std::array<cvf::Vec3d, 8> mainCellCorners, size_t nx, size_t ny, size_t nz );
static double computeFlowDistance( const std::array<cvf::Vec3d, 8>& cellVertices, const cvf::Vec3d& areaCenter ); static double computeFlowDistance( const std::array<cvf::Vec3d, 8>& cellVertices, const cvf::Vec3d& areaCenter );
}; };

View File

@ -636,12 +636,9 @@ caf::ColorTable RiaColorTables::createBrightnessBasedColorTable( cvf::Color3ub b
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::map<RiaDefines::PhaseType, caf::ColorTable> RiaColorTables::phaseColors() std::map<RiaDefines::PhaseType, caf::ColorTable> RiaColorTables::phaseColors()
{ {
static std::vector<cvf::Color3ub> waterColors{ cvf::Color3ub( cvf::Color3::DARK_BLUE ), static std::vector<cvf::Color3ub> waterColors{ cvf::Color3ub( cvf::Color3::DARK_BLUE ), cvf::Color3ub( cvf::Color3::SKY_BLUE ) };
cvf::Color3ub( cvf::Color3::SKY_BLUE ) }; static std::vector<cvf::Color3ub> gasColors{ cvf::Color3ub( cvf::Color3::DARK_RED ), cvf::Color3ub( cvf::Color3::PINK ) };
static std::vector<cvf::Color3ub> gasColors{ cvf::Color3ub( cvf::Color3::DARK_RED ), static std::vector<cvf::Color3ub> oilColors{ cvf::Color3ub( cvf::Color3::DARK_GREEN ), cvf::Color3ub( cvf::Color3::YELLOW_GREEN ) };
cvf::Color3ub( cvf::Color3::PINK ) };
static std::vector<cvf::Color3ub> oilColors{ cvf::Color3ub( cvf::Color3::DARK_GREEN ),
cvf::Color3ub( cvf::Color3::YELLOW_GREEN ) };
return { { RiaDefines::PhaseType::WATER_PHASE, caf::ColorTable( waterColors ) }, return { { RiaDefines::PhaseType::WATER_PHASE, caf::ColorTable( waterColors ) },
{ RiaDefines::PhaseType::GAS_PHASE, caf::ColorTable( gasColors ) }, { RiaDefines::PhaseType::GAS_PHASE, caf::ColorTable( gasColors ) },

View File

@ -160,10 +160,7 @@ cvf::Color3f RiaColorTools::textColor3f()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::blendCvfColors( const cvf::Color3f& color1, cvf::Color3f RiaColorTools::blendCvfColors( const cvf::Color3f& color1, const cvf::Color3f& color2, int weight1 /*= 1*/, int weight2 /*= 1*/ )
const cvf::Color3f& color2,
int weight1 /*= 1*/,
int weight2 /*= 1*/ )
{ {
CVF_ASSERT( weight1 > 0 && weight2 > 0 ); CVF_ASSERT( weight1 > 0 && weight2 > 0 );
int weightsum = weight1 + weight2; int weightsum = weight1 + weight2;

View File

@ -45,9 +45,8 @@ public:
static QColor textColor(); static QColor textColor();
static cvf::Color3f textColor3f(); static cvf::Color3f textColor3f();
static cvf::Color3f static cvf::Color3f blendCvfColors( const cvf::Color3f& color1, const cvf::Color3f& color2, int weight1 = 1, int weight2 = 1 );
blendCvfColors( const cvf::Color3f& color1, const cvf::Color3f& color2, int weight1 = 1, int weight2 = 1 ); static QColor blendQColors( const QColor& color1, const QColor& color2, int weight1 = 1, int weight2 = 1 );
static QColor blendQColors( const QColor& color1, const QColor& color2, int weight1 = 1, int weight2 = 1 );
static cvf::Color3f makeLighter( const cvf::Color3f& color1, float normalizedScalingFactor ); static cvf::Color3f makeLighter( const cvf::Color3f& color1, float normalizedScalingFactor );

View File

@ -25,7 +25,7 @@
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiaCurveDataTools::CurveIntervals RiaCurveDataTools::calculateIntervalsOfValidValues( const std::vector<double>& values, RiaCurveDataTools::CurveIntervals RiaCurveDataTools::calculateIntervalsOfValidValues( const std::vector<double>& values,
bool includePositiveValuesOnly ) bool includePositiveValuesOnly )
{ {
CurveIntervals intervals; CurveIntervals intervals;

View File

@ -43,12 +43,10 @@ public:
}; };
public: public:
static CurveIntervals calculateIntervalsOfValidValues( const std::vector<double>& values, static CurveIntervals calculateIntervalsOfValidValues( const std::vector<double>& values, bool includePositiveValuesOnly );
bool includePositiveValuesOnly );
template <typename T> template <typename T>
static void static void getValuesByIntervals( const std::vector<T>& values, const CurveIntervals& intervals, std::vector<T>* filteredValues )
getValuesByIntervals( const std::vector<T>& values, const CurveIntervals& intervals, std::vector<T>* filteredValues )
{ {
CVF_ASSERT( filteredValues ); CVF_ASSERT( filteredValues );

View File

@ -63,9 +63,8 @@ public:
public: public:
// Helper methods, available as public to be able to access from unit tests // Helper methods, available as public to be able to access from unit tests
static double interpolatedYValue( const XValueType& xValue, static double
const std::vector<XValueType>& curveXValues, interpolatedYValue( const XValueType& xValue, const std::vector<XValueType>& curveXValues, const std::vector<double>& curveYValues );
const std::vector<double>& curveYValues );
private: private:
void computeUnionOfXValues( bool includeValuesFromPartialCurves ); void computeUnionOfXValues( bool includeValuesFromPartialCurves );

View File

@ -156,9 +156,8 @@ void RiaCurveMerger<XValueType>::computeInterpolatedValues( bool includeValuesFr
for ( size_t valueIndex = 0; valueIndex < dataValueCount; valueIndex++ ) for ( size_t valueIndex = 0; valueIndex < dataValueCount; valueIndex++ )
{ {
double interpolValue = interpolatedYValue( m_allXValues[valueIndex], double interpolValue =
m_originalValues[curveIdx].first, interpolatedYValue( m_allXValues[valueIndex], m_originalValues[curveIdx].first, m_originalValues[curveIdx].second );
m_originalValues[curveIdx].second );
if ( !RiaCurveDataTools::isValidValue( interpolValue, false ) ) if ( !RiaCurveDataTools::isValidValue( interpolValue, false ) )
{ {
accumulatedValidValues[valueIndex] = HUGE_VAL; accumulatedValidValues[valueIndex] = HUGE_VAL;
@ -203,7 +202,7 @@ void RiaCurveMerger<XValueType>::computeUnionOfXValues( bool includeValuesForPar
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
template <typename XValueType> template <typename XValueType>
void RiaCurveMerger<XValueType>::removeValuesForPartialCurves( std::set<XValueType, XComparator>& unionOfXValues, void RiaCurveMerger<XValueType>::removeValuesForPartialCurves( std::set<XValueType, XComparator>& unionOfXValues,
const std::vector<std::pair<XValueType, XValueType>>& originalXBounds ) const std::vector<std::pair<XValueType, XValueType>>& originalXBounds )
{ {
for ( auto it = unionOfXValues.begin(); it != unionOfXValues.end(); ) for ( auto it = unionOfXValues.begin(); it != unionOfXValues.end(); )

View File

@ -62,11 +62,7 @@ QDateTime RiaDateStringParser::parseDateString( const std::string& dateString, O
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaDateStringParser::parseDateStringWithSeparators( const std::string& dateString, bool RiaDateStringParser::parseDateStringWithSeparators( const std::string& dateString, int& year, int& month, int& day, OrderPreference preference )
int& year,
int& month,
int& day,
OrderPreference preference )
{ {
auto tryParseAllYearFirst = []( const std::string& dateString, int& year, int& month, int& day ) { auto tryParseAllYearFirst = []( const std::string& dateString, int& year, int& month, int& day ) {
return tryParseYearFirst( dateString, year, month, day ) || tryParseDayFirst( dateString, year, month, day ) || return tryParseYearFirst( dateString, year, month, day ) || tryParseDayFirst( dateString, year, month, day ) ||
@ -85,21 +81,15 @@ bool RiaDateStringParser::parseDateStringWithSeparators( const std::string& date
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaDateStringParser::parseDateStringWithoutSeparators( const std::string& dateString, bool RiaDateStringParser::parseDateStringWithoutSeparators( const std::string& dateString, int& year, int& month, int& day, OrderPreference preference )
int& year,
int& month,
int& day,
OrderPreference preference )
{ {
auto tryParseAllYearFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day ) { auto tryParseAllYearFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day ) {
return tryParseYearFirstNoSeparators( dateString, year, month, day ) || return tryParseYearFirstNoSeparators( dateString, year, month, day ) ||
tryParseDayFirstNoSeparators( dateString, year, month, day ) || tryParseDayFirstNoSeparators( dateString, year, month, day ) || tryParseMonthFirstNoSeparators( dateString, year, month, day );
tryParseMonthFirstNoSeparators( dateString, year, month, day );
}; };
auto tryParseAllDayFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day ) { auto tryParseAllDayFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day ) {
return tryParseDayFirstNoSeparators( dateString, year, month, day ) || return tryParseDayFirstNoSeparators( dateString, year, month, day ) || tryParseYearFirstNoSeparators( dateString, year, month, day ) ||
tryParseYearFirstNoSeparators( dateString, year, month, day ) ||
tryParseMonthFirstNoSeparators( dateString, year, month, day ); tryParseMonthFirstNoSeparators( dateString, year, month, day );
}; };
@ -108,9 +98,8 @@ bool RiaDateStringParser::parseDateStringWithoutSeparators( const std::string& d
{ {
std::string subString = dateString.substr( firstNumerical ); std::string subString = dateString.substr( firstNumerical );
return ( preference == OrderPreference::YEAR_FIRST ) return ( preference == OrderPreference::YEAR_FIRST ) ? tryParseAllYearFirstNoSeparators( subString, year, month, day )
? tryParseAllYearFirstNoSeparators( subString, year, month, day ) : tryParseAllDayFirstNoSeparators( subString, year, month, day );
: tryParseAllDayFirstNoSeparators( subString, year, month, day );
} }
return false; return false;
@ -297,9 +286,7 @@ bool RiaDateStringParser::tryParseMonth( const std::string& s, int& month )
{ {
auto sMonth = s; auto sMonth = s;
sMonth = trimString( sMonth ); sMonth = trimString( sMonth );
std::transform( sMonth.begin(), sMonth.end(), sMonth.begin(), []( const char c ) -> char { std::transform( sMonth.begin(), sMonth.end(), sMonth.begin(), []( const char c ) -> char { return (char)::tolower( c ); } );
return (char)::tolower( c );
} );
for ( int i = 0; i < 12; i++ ) for ( int i = 0; i < 12; i++ )
{ {

View File

@ -37,21 +37,12 @@ public:
}; };
static QDateTime parseDateString( const QString& dateString, OrderPreference preference = OrderPreference::YEAR_FIRST ); static QDateTime parseDateString( const QString& dateString, OrderPreference preference = OrderPreference::YEAR_FIRST );
static QDateTime parseDateString( const std::string& dateStringString, static QDateTime parseDateString( const std::string& dateStringString, OrderPreference preference = OrderPreference::YEAR_FIRST );
OrderPreference preference = OrderPreference::YEAR_FIRST );
private: private:
static bool parseDateStringWithSeparators( const std::string& dateString, static bool parseDateStringWithSeparators( const std::string& dateString, int& year, int& month, int& day, OrderPreference preference );
int& year,
int& month,
int& day,
OrderPreference preference );
static bool parseDateStringWithoutSeparators( const std::string& dateString, static bool parseDateStringWithoutSeparators( const std::string& dateString, int& year, int& month, int& day, OrderPreference preference );
int& year,
int& month,
int& day,
OrderPreference preference );
static bool tryParseYearFirst( const std::string& s, int& year, int& month, int& day ); static bool tryParseYearFirst( const std::string& s, int& year, int& month, int& day );
static bool tryParseDayFirst( const std::string& s, int& year, int& month, int& day ); static bool tryParseDayFirst( const std::string& s, int& year, int& month, int& day );

View File

@ -50,8 +50,7 @@ double RiaEclipseUnitTools::darcysConstant( RiaDefines::EclipseUnitSystem unitSy
/// Convert Gas to oil equivalents /// Convert Gas to oil equivalents
/// If field unit, the Gas is in Mega ft^3 while the others are in [stb] (barrel) /// If field unit, the Gas is in Mega ft^3 while the others are in [stb] (barrel)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RiaEclipseUnitTools::convertSurfaceGasFlowRateToOilEquivalents( RiaDefines::EclipseUnitSystem caseUnitSystem, double RiaEclipseUnitTools::convertSurfaceGasFlowRateToOilEquivalents( RiaDefines::EclipseUnitSystem caseUnitSystem, double eclGasFlowRate )
double eclGasFlowRate )
{ {
/// Unused Gas to Barrel conversion : /// Unused Gas to Barrel conversion :
/// we convert gas to stb as well. Based on /// we convert gas to stb as well. Based on
@ -65,10 +64,8 @@ double RiaEclipseUnitTools::convertSurfaceGasFlowRateToOilEquivalents( RiaDefine
double oilEquivalentGasRate = HUGE_VAL; double oilEquivalentGasRate = HUGE_VAL;
if ( caseUnitSystem == RiaDefines::EclipseUnitSystem::UNITS_FIELD ) if ( caseUnitSystem == RiaDefines::EclipseUnitSystem::UNITS_FIELD ) oilEquivalentGasRate = fieldGasToOilEquivalent * eclGasFlowRate;
oilEquivalentGasRate = fieldGasToOilEquivalent * eclGasFlowRate; if ( caseUnitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC ) oilEquivalentGasRate = metricGasToOilEquivalent * eclGasFlowRate;
if ( caseUnitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC )
oilEquivalentGasRate = metricGasToOilEquivalent * eclGasFlowRate;
return oilEquivalentGasRate; return oilEquivalentGasRate;
} }

View File

@ -91,8 +91,7 @@ QString RiaEnsembleNameTools::findSuitableEnsembleName( const QStringList& fileN
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<QStringList> RiaEnsembleNameTools::groupFilesByEnsemble( const QStringList& fileNames, std::vector<QStringList> RiaEnsembleNameTools::groupFilesByEnsemble( const QStringList& fileNames, EnsembleGroupingMode groupingMode )
EnsembleGroupingMode groupingMode )
{ {
std::vector<QStringList> componentsForAllFilePaths; std::vector<QStringList> componentsForAllFilePaths;
@ -282,12 +281,9 @@ QString RiaEnsembleNameTools::findCommonBaseName( const QStringList& fileNames )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RiaEnsembleNameTools::uniqueShortName( const QString& sourceFileName, QString RiaEnsembleNameTools::uniqueShortName( const QString& sourceFileName, const QStringList& allFileNames, const QString& ensembleCaseName )
const QStringList& allFileNames,
const QString& ensembleCaseName )
{ {
std::map<QString, QStringList> keyFileComponentsForAllFiles = std::map<QString, QStringList> keyFileComponentsForAllFiles = RiaFilePathTools::keyPathComponentsForEachFilePath( allFileNames );
RiaFilePathTools::keyPathComponentsForEachFilePath( allFileNames );
return uniqueShortNameFromComponents( sourceFileName, keyFileComponentsForAllFiles, ensembleCaseName ); return uniqueShortNameFromComponents( sourceFileName, keyFileComponentsForAllFiles, ensembleCaseName );
} }

View File

@ -42,9 +42,8 @@ public:
static QString findSuitableEnsembleName( const QStringList& fileNames, EnsembleGroupingMode groupingMode ); static QString findSuitableEnsembleName( const QStringList& fileNames, EnsembleGroupingMode groupingMode );
static QString findCommonBaseName( const QStringList& fileNames ); static QString findCommonBaseName( const QStringList& fileNames );
static QString uniqueShortName( const QString& sourceFileName, static QString
const QStringList& allFileNames, uniqueShortName( const QString& sourceFileName, const QStringList& allFileNames, const QString& ensembleCaseName = QString() );
const QString& ensembleCaseName = QString() );
static QString uniqueShortNameFromComponents( const QString& sourceFileName, static QString uniqueShortNameFromComponents( const QString& sourceFileName,
const std::map<QString, QStringList>& keyFileComponentsForAllFiles, const std::map<QString, QStringList>& keyFileComponentsForAllFiles,

View File

@ -27,8 +27,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RigEclipseWellLogExtractor* RiaExtractionTools::findOrCreateWellLogExtractor( RimWellPath* wellPath, RigEclipseWellLogExtractor* RiaExtractionTools::findOrCreateWellLogExtractor( RimWellPath* wellPath, RimEclipseCase* eclipseCase )
RimEclipseCase* eclipseCase )
{ {
if ( !( wellPath && eclipseCase ) ) return nullptr; if ( !( wellPath && eclipseCase ) ) return nullptr;
@ -41,8 +40,7 @@ RigEclipseWellLogExtractor* RiaExtractionTools::findOrCreateWellLogExtractor( Ri
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RigGeoMechWellLogExtractor* RiaExtractionTools::findOrCreateWellLogExtractor( RimWellPath* wellPath, RigGeoMechWellLogExtractor* RiaExtractionTools::findOrCreateWellLogExtractor( RimWellPath* wellPath, RimGeoMechCase* geomCase )
RimGeoMechCase* geomCase )
{ {
if ( !( wellPath && geomCase ) ) return nullptr; if ( !( wellPath && geomCase ) ) return nullptr;
@ -55,8 +53,7 @@ RigGeoMechWellLogExtractor* RiaExtractionTools::findOrCreateWellLogExtractor( Ri
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RigEclipseWellLogExtractor* RiaExtractionTools::findOrCreateSimWellExtractor( const RimSimWellInView* simWell, RigEclipseWellLogExtractor* RiaExtractionTools::findOrCreateSimWellExtractor( const RimSimWellInView* simWell, const RigWellPath* wellPathGeom )
const RigWellPath* wellPathGeom )
{ {
if ( !( simWell && wellPathGeom ) ) return nullptr; if ( !( simWell && wellPathGeom ) ) return nullptr;
@ -72,10 +69,7 @@ RigEclipseWellLogExtractor* RiaExtractionTools::findOrCreateSimWellExtractor( co
QString caseUserDescription = eclipseCase->caseUserDescription(); QString caseUserDescription = eclipseCase->caseUserDescription();
return wlPlotCollection->findOrCreateSimWellExtractor( simWell->name, return wlPlotCollection->findOrCreateSimWellExtractor( simWell->name, caseUserDescription, wellPathGeom, eclipseCase->eclipseCaseData() );
caseUserDescription,
wellPathGeom,
eclipseCase->eclipseCaseData() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -36,8 +36,7 @@ void RiaFieldHandleTools::disableWriteAndSetFieldHidden( caf::PdmFieldHandle* fi
if ( fieldHandle->uiCapability() ) if ( fieldHandle->uiCapability() )
{ {
if ( dynamic_cast<caf::PdmChildFieldHandle*>( fieldHandle ) || if ( dynamic_cast<caf::PdmChildFieldHandle*>( fieldHandle ) || dynamic_cast<caf::PdmChildArrayFieldHandle*>( fieldHandle ) )
dynamic_cast<caf::PdmChildArrayFieldHandle*>( fieldHandle ) )
fieldHandle->uiCapability()->setUiTreeHidden( true ); fieldHandle->uiCapability()->setUiTreeHidden( true );
else else
fieldHandle->uiCapability()->setUiHidden( true ); fieldHandle->uiCapability()->setUiHidden( true );
@ -52,9 +51,7 @@ void RiaFieldHandleTools::disableWriteAndSetFieldHidden( caf::PdmFieldHandle* fi
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaFieldHandleTools::updateOverrideStateAndLabel( caf::PdmFieldHandle* fieldHandle, void RiaFieldHandleTools::updateOverrideStateAndLabel( caf::PdmFieldHandle* fieldHandle, bool isOverridden, const QString& toolTip )
bool isOverridden,
const QString& toolTip )
{ {
// Get the label text as given by the init_field macro // Get the label text as given by the init_field macro
QString labelText = fieldHandle->uiCapability()->uiName( fieldHandle->uiCapability()->uiConfigNameForStaticData() ); QString labelText = fieldHandle->uiCapability()->uiName( fieldHandle->uiCapability()->uiConfigNameForStaticData() );

View File

@ -109,25 +109,24 @@ void RiaImageCompareReporter::generateHTMLReport( const std::string& fileName, c
html += " <tr>\n"; html += " <tr>\n";
if ( m_showOriginal ) if ( m_showOriginal )
{ {
html += " <td> <img src=\"" + baseImageFolder + "/" + baseImageNames[fIdx] + html += " <td> <img src=\"" + baseImageFolder + "/" + baseImageNames[fIdx] + "\" width=\"100%\" alt=\"" +
"\" width=\"100%\" alt=\"" + baseImageFolder + "/" + baseImageNames[fIdx] + "\" > </td>\n"; baseImageFolder + "/" + baseImageNames[fIdx] + "\" > </td>\n";
} }
if ( m_showGenerated ) if ( m_showGenerated )
{ {
html += " <td> <img src=\"" + genImageFolder + "/" + baseImageNames[fIdx] + html += " <td> <img src=\"" + genImageFolder + "/" + baseImageNames[fIdx] + "\" width=\"100%\" alt=\"" +
"\" width=\"100%\" alt=\"" + genImageFolder + "/" + baseImageNames[fIdx] + "\" > </td>\n"; genImageFolder + "/" + baseImageNames[fIdx] + "\" > </td>\n";
} }
if ( m_showInteractiveDiff ) if ( m_showInteractiveDiff )
{ {
html += " <td> <div class = \"image-slider\"> <div> <img src=\"" + baseImageFolder + "/" + html += " <td> <div class = \"image-slider\"> <div> <img src=\"" + baseImageFolder + "/" + baseImageNames[fIdx] +
baseImageNames[fIdx] + "\" > </div> <img src = \"" + genImageFolder + "/" + "\" > </div> <img src = \"" + genImageFolder + "/" + baseImageNames[fIdx] + "\" > </div> </td>\n";
baseImageNames[fIdx] + "\" > </div> </td>\n";
} }
html += " <td> <img src=\"" + diffImageFolder + "/" + baseImageNames[fIdx] + html += " <td> <img src=\"" + diffImageFolder + "/" + baseImageNames[fIdx] + "\" width=\"100%\" alt=\"" + diffImageFolder +
"\" width=\"100%\" alt=\"" + diffImageFolder + "/" + baseImageNames[fIdx] + "\" > </td>\n"; "/" + baseImageNames[fIdx] + "\" > </td>\n";
html += " </tr>\n"; html += " </tr>\n";
// A little air between images // A little air between images

View File

@ -42,10 +42,7 @@ private:
private: private:
struct DirSet struct DirSet
{ {
DirSet( const std::string& title, DirSet( const std::string& title, const std::string& baseImageDir, const std::string& newImagesDir, const std::string& diffImagesDir )
const std::string& baseImageDir,
const std::string& newImagesDir,
const std::string& diffImagesDir )
: m_title( title ) : m_title( title )
, m_baseImageDir( baseImageDir ) , m_baseImageDir( baseImageDir )
, m_newImagesDir( newImagesDir ) , m_newImagesDir( newImagesDir )

View File

@ -79,13 +79,10 @@ bool RiaImageFileCompare::runComparison( const QString& imgFileName, const QStri
// The ImageMagick compare tool on RedHat 5 does not support the lowlight-color options // The ImageMagick compare tool on RedHat 5 does not support the lowlight-color options
// Use GCC version as a crude mechanism for disabling use of this option on RedHat5 // Use GCC version as a crude mechanism for disabling use of this option on RedHat5
#if ( __GNUC__ == 4 && __GNUC_MINOR__ <= 1 ) #if ( __GNUC__ == 4 && __GNUC_MINOR__ <= 1 )
QString args = QString args = QString( "-fuzz 0.4% -metric ae \"%1\" \"%2\" \"%3\"" ).arg( imgFileName ).arg( refFileName ).arg( ( diffFileName ) );
QString( "-fuzz 0.4% -metric ae \"%1\" \"%2\" \"%3\"" ).arg( imgFileName ).arg( refFileName ).arg( ( diffFileName ) );
#else #else
QString args = QString( "-fuzz 0.4% -lowlight-color white -metric ae \"%1\" \"%2\" \"%3\"" ) QString args =
.arg( imgFileName ) QString( "-fuzz 0.4% -lowlight-color white -metric ae \"%1\" \"%2\" \"%3\"" ).arg( imgFileName ).arg( refFileName ).arg( ( diffFileName ) );
.arg( refFileName )
.arg( ( diffFileName ) );
#endif #endif
QString completeCommand = QString( "\"%1\" %2" ).arg( m_compareExecutable ).arg( args ); QString completeCommand = QString( "\"%1\" %2" ).arg( m_compareExecutable ).arg( args );

View File

@ -112,8 +112,8 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList&
if ( importSummaryCases && !summaryFileInfos.empty() ) if ( importSummaryCases && !summaryFileInfos.empty() )
{ {
RimSummaryCaseMainCollection* sumCaseColl = RimSummaryCaseMainCollection* sumCaseColl = project->activeOilField() ? project->activeOilField()->summaryCaseMainCollection()
project->activeOilField() ? project->activeOilField()->summaryCaseMainCollection() : nullptr; : nullptr;
if ( sumCaseColl ) if ( sumCaseColl )
{ {
std::vector<RimSummaryCase*> candidateCases = sumCaseColl->createSummaryCasesFromFileInfos( summaryFileInfos ); std::vector<RimSummaryCase*> candidateCases = sumCaseColl->createSummaryCasesFromFileInfos( summaryFileInfos );
@ -122,15 +122,13 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList&
for ( RimSummaryCase* newSumCase : candidateCases ) for ( RimSummaryCase* newSumCase : candidateCases )
{ {
RimSummaryCaseCollection* existingCollection = nullptr; RimSummaryCaseCollection* existingCollection = nullptr;
QString gridCaseFile = QString gridCaseFile = RifEclipseSummaryTools::findGridCaseFileFromSummaryHeaderFile( newSumCase->summaryHeaderFilename() );
RifEclipseSummaryTools::findGridCaseFileFromSummaryHeaderFile( newSumCase->summaryHeaderFilename() );
RimEclipseCase* gridCase = project->eclipseCaseFromGridFileName( gridCaseFile ); RimEclipseCase* gridCase = project->eclipseCaseFromGridFileName( gridCaseFile );
if ( gridCase ) if ( gridCase )
{ {
RimSummaryCase* existingSummaryCase = RimSummaryCase* existingSummaryCase = sumCaseColl->findSummaryCaseFromFileName( newSumCase->summaryHeaderFilename() );
sumCaseColl->findSummaryCaseFromFileName( newSumCase->summaryHeaderFilename() ); auto* existingGridSummaryCase = dynamic_cast<RimGridSummaryCase*>( existingSummaryCase );
auto* existingGridSummaryCase = dynamic_cast<RimGridSummaryCase*>( existingSummaryCase ); auto* existingFileSummaryCase = dynamic_cast<RimFileSummaryCase*>( existingSummaryCase );
auto* existingFileSummaryCase = dynamic_cast<RimFileSummaryCase*>( existingSummaryCase );
if ( existingGridSummaryCase ) if ( existingGridSummaryCase )
{ {
duplicatedCases.push_back( newSumCase ); duplicatedCases.push_back( newSumCase );
@ -204,8 +202,7 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList&
// Delete cases that already was present // Delete cases that already was present
for ( auto duplicateCase : duplicatedCases ) for ( auto duplicateCase : duplicatedCases )
{ {
candidateCases.erase( std::remove( candidateCases.begin(), candidateCases.end(), duplicateCase ), candidateCases.erase( std::remove( candidateCases.begin(), candidateCases.end(), duplicateCase ), candidateCases.end() );
candidateCases.end() );
delete duplicateCase; delete duplicateCase;
} }
@ -246,17 +243,12 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList&
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RiaImportEclipseCaseTools::openEclipseCaseFromFile( const QString& fileName, int RiaImportEclipseCaseTools::openEclipseCaseFromFile( const QString& fileName, bool createView, std::shared_ptr<RifReaderSettings> readerSettings )
bool createView,
std::shared_ptr<RifReaderSettings> readerSettings )
{ {
if ( !caf::Utils::fileExists( fileName ) ) return -1; if ( !caf::Utils::fileExists( fileName ) ) return -1;
bool showTimeStepFilter = false; bool showTimeStepFilter = false;
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, showTimeStepFilter, createView, readerSettings );
showTimeStepFilter,
createView,
readerSettings );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -268,10 +260,7 @@ bool RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilter( const QString
bool showTimeStepFilter = true; bool showTimeStepFilter = true;
bool createView = true; bool createView = true;
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, showTimeStepFilter, createView, nullptr ) >= 0;
showTimeStepFilter,
createView,
nullptr ) >= 0;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -293,8 +282,7 @@ int RiaImportEclipseCaseTools::openEclipseInputCaseFromFileNames( const QStringL
return -1; return -1;
} }
RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels() RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels() : nullptr;
: nullptr;
if ( analysisModels == nullptr ) return false; if ( analysisModels == nullptr ) return false;
analysisModels->cases.push_back( rimInputReservoir ); analysisModels->cases.push_back( rimInputReservoir );
@ -337,9 +325,9 @@ bool RiaImportEclipseCaseTools::openMockModel( const QString& name )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QString& fileName, int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QString& fileName,
bool showTimeStepFilter, bool showTimeStepFilter,
bool createView, bool createView,
std::shared_ptr<RifReaderSettings> readerSettings ) std::shared_ptr<RifReaderSettings> readerSettings )
{ {
QFileInfo gridFileName( fileName ); QFileInfo gridFileName( fileName );
@ -352,8 +340,7 @@ int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QStr
RiaApplication* app = RiaApplication::instance(); RiaApplication* app = RiaApplication::instance();
RimProject* project = app->project(); RimProject* project = app->project();
RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels() RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels() : nullptr;
: nullptr;
if ( analysisModels == nullptr ) if ( analysisModels == nullptr )
{ {
delete rimResultReservoir; delete rimResultReservoir;
@ -409,8 +396,7 @@ int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QStr
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaImportEclipseCaseTools::addEclipseCases( const QStringList& fileNames, bool RiaImportEclipseCaseTools::addEclipseCases( const QStringList& fileNames, RimIdenticalGridCaseGroup** resultingCaseGroup /*=nullptr*/ )
RimIdenticalGridCaseGroup** resultingCaseGroup /*=nullptr*/ )
{ {
if ( fileNames.empty() ) return true; if ( fileNames.empty() ) return true;
@ -531,8 +517,7 @@ int RiaImportEclipseCaseTools::openRoffCaseFromFileNames( const QStringList& fil
return -1; return -1;
} }
RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels() RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels() : nullptr;
: nullptr;
if ( !analysisModels ) return -1; if ( !analysisModels ) return -1;
analysisModels->cases.push_back( roffCase ); analysisModels->cases.push_back( roffCase );
@ -546,8 +531,7 @@ int RiaImportEclipseCaseTools::openRoffCaseFromFileNames( const QStringList& fil
if ( RiaGuiApplication::isRunning() ) if ( RiaGuiApplication::isRunning() )
{ {
if ( RiuMainWindow::instance() ) if ( RiuMainWindow::instance() ) RiuMainWindow::instance()->selectAsCurrentItem( eclipseView->cellResult() );
RiuMainWindow::instance()->selectAsCurrentItem( eclipseView->cellResult() );
} }
eclipseView->loadDataAndUpdate(); eclipseView->loadDataAndUpdate();

View File

@ -48,9 +48,7 @@ public:
static bool addEclipseCases( const QStringList& fileNames, RimIdenticalGridCaseGroup** resultingCaseGroup = nullptr ); static bool addEclipseCases( const QStringList& fileNames, RimIdenticalGridCaseGroup** resultingCaseGroup = nullptr );
static int openEclipseCaseFromFile( const QString& fileName, static int openEclipseCaseFromFile( const QString& fileName, bool createView, std::shared_ptr<RifReaderSettings> readerSettings = nullptr );
bool createView,
std::shared_ptr<RifReaderSettings> readerSettings = nullptr );
static int openRoffCaseFromFileNames( const QStringList& fileNames, bool createDefaultView ); static int openRoffCaseFromFileNames( const QStringList& fileNames, bool createDefaultView );

View File

@ -41,10 +41,7 @@ bool almostEqual( double a, double b, double maxRelDiff = std::numeric_limits<do
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RiaInterpolationTools::linear( const std::vector<double>& x, double RiaInterpolationTools::linear( const std::vector<double>& x, const std::vector<double>& y, double value, ExtrapolationMode extrapolationMode )
const std::vector<double>& y,
double value,
ExtrapolationMode extrapolationMode )
{ {
CAF_ASSERT( x.size() == y.size() ); CAF_ASSERT( x.size() == y.size() );
@ -151,12 +148,7 @@ int RiaInterpolationTools::findPreviousDataPoint( const std::vector<double>& val
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RiaInterpolationTools::extrapolateRange( int start, int RiaInterpolationTools::extrapolateRange( int start, int end, int firstPoint, int lastPoint, const std::vector<double>& x, std::vector<double>& y )
int end,
int firstPoint,
int lastPoint,
const std::vector<double>& x,
std::vector<double>& y )
{ {
std::vector<double> xs = { x[firstPoint], x[lastPoint] }; std::vector<double> xs = { x[firstPoint], x[lastPoint] };
std::vector<double> ys = { y[firstPoint], y[lastPoint] }; std::vector<double> ys = { y[firstPoint], y[lastPoint] };
@ -175,12 +167,7 @@ int RiaInterpolationTools::extrapolateRange( int start,
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RiaInterpolationTools::interpolateRange( int start, int RiaInterpolationTools::interpolateRange( int start, int end, int firstPoint, int lastPoint, const std::vector<double>& x, std::vector<double>& y )
int end,
int firstPoint,
int lastPoint,
const std::vector<double>& x,
std::vector<double>& y )
{ {
CAF_ASSERT( start <= end ); CAF_ASSERT( start <= end );

View File

@ -42,20 +42,10 @@ public:
static void interpolateMissingValues( const std::vector<double>& x, std::vector<double>& y ); static void interpolateMissingValues( const std::vector<double>& x, std::vector<double>& y );
private: private:
static int interpolateRange( int start, static int interpolateRange( int start, int end, int firstPoint, int lastPoint, const std::vector<double>& x, std::vector<double>& y );
int end, static int extrapolateRange( int start, int end, int firstPoint, int lastPoint, const std::vector<double>& x, std::vector<double>& y );
int firstPoint, static int findNextDataPoint( const std::vector<double>& values, int index );
int lastPoint, static int findPreviousDataPoint( const std::vector<double>& values, int index );
const std::vector<double>& x,
std::vector<double>& y );
static int extrapolateRange( int start,
int end,
int firstPoint,
int lastPoint,
const std::vector<double>& x,
std::vector<double>& y );
static int findNextDataPoint( const std::vector<double>& values, int index );
static int findPreviousDataPoint( const std::vector<double>& values, int index );
static double extrapolate( const std::vector<double>& x, const std::vector<double>& y, double value ); static double extrapolate( const std::vector<double>& x, const std::vector<double>& y, double value );
static double extrapolateClosestValue( const std::vector<double>& x, const std::vector<double>& y, double value ); static double extrapolateClosestValue( const std::vector<double>& x, const std::vector<double>& y, double value );
}; };

View File

@ -26,8 +26,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaOptionItemFactory::appendOptionItemFromViewNameAndCaseName( Rim3dView* view, void RiaOptionItemFactory::appendOptionItemFromViewNameAndCaseName( Rim3dView* view, QList<caf::PdmOptionItemInfo>* optionItems )
QList<caf::PdmOptionItemInfo>* optionItems )
{ {
if ( !view || !optionItems ) return; if ( !view || !optionItems ) return;
@ -57,8 +56,7 @@ void RiaOptionItemFactory::appendOptionItemsForEnsembleCurveSets( QList<caf::Pdm
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
caf::PdmOptionItemInfo caf::PdmOptionItemInfo RiaOptionItemFactory::optionItemFromSummaryType( RifEclipseSummaryAddress::SummaryVarCategory summaryType )
RiaOptionItemFactory::optionItemFromSummaryType( RifEclipseSummaryAddress::SummaryVarCategory summaryType )
{ {
auto uiText = caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>::uiText( summaryType ); auto uiText = caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>::uiText( summaryType );

View File

@ -29,7 +29,7 @@ class Rim3dView;
class RiaOptionItemFactory class RiaOptionItemFactory
{ {
public: public:
static void appendOptionItemFromViewNameAndCaseName( Rim3dView* view, QList<caf::PdmOptionItemInfo>* optionItems ); static void appendOptionItemFromViewNameAndCaseName( Rim3dView* view, QList<caf::PdmOptionItemInfo>* optionItems );
static void appendOptionItemsForEnsembleCurveSets( QList<caf::PdmOptionItemInfo>* options ); static void appendOptionItemsForEnsembleCurveSets( QList<caf::PdmOptionItemInfo>* options );
static caf::PdmOptionItemInfo optionItemFromSummaryType( RifEclipseSummaryAddress::SummaryVarCategory summaryType ); static caf::PdmOptionItemInfo optionItemFromSummaryType( RifEclipseSummaryAddress::SummaryVarCategory summaryType );
}; };

View File

@ -23,8 +23,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaProjectFileVersionTools::isCandidateVersionNewerThanOther( const QString& candidateProjectFileVersion, bool RiaProjectFileVersionTools::isCandidateVersionNewerThanOther( const QString& candidateProjectFileVersion, const QString& projectFileVersion )
const QString& projectFileVersion )
{ {
int candidateMajorVersion = 0; int candidateMajorVersion = 0;
int candidateMinorVersion = 0; int candidateMinorVersion = 0;
@ -42,11 +41,7 @@ bool RiaProjectFileVersionTools::isCandidateVersionNewerThanOther( const QString
int patchNumber = -1; int patchNumber = -1;
int developmentId = -1; int developmentId = -1;
RiaProjectFileVersionTools::decodeVersionString( projectFileVersion, RiaProjectFileVersionTools::decodeVersionString( projectFileVersion, &majorVersion, &minorVersion, &patchNumber, &developmentId );
&majorVersion,
&minorVersion,
&patchNumber,
&developmentId );
return RiaProjectFileVersionTools::isCandidateNewerThanOther( candidateMajorVersion, return RiaProjectFileVersionTools::isCandidateNewerThanOther( candidateMajorVersion,
candidateMinorVersion, candidateMinorVersion,

View File

@ -26,15 +26,10 @@
class RiaProjectFileVersionTools class RiaProjectFileVersionTools
{ {
public: public:
static bool isCandidateVersionNewerThanOther( const QString& candidateProjectFileVersion, static bool isCandidateVersionNewerThanOther( const QString& candidateProjectFileVersion, const QString& otherProjectFileVersion );
const QString& otherProjectFileVersion );
// Public to be able to unit test function, not intended to be used // Public to be able to unit test function, not intended to be used
static void decodeVersionString( const QString& projectFileVersion, static void decodeVersionString( const QString& projectFileVersion, int* majorVersion, int* minorVersion, int* patch, int* developmentId );
int* majorVersion,
int* minorVersion,
int* patch,
int* developmentId );
private: private:
static bool isCandidateNewerThanOther( int candidateMajorVersion, static bool isCandidateNewerThanOther( int candidateMajorVersion,

View File

@ -84,12 +84,12 @@ public:
static std::vector<QString> supportedDateFormats(); static std::vector<QString> supportedDateFormats();
static std::vector<QString> supportedTimeFormats(); static std::vector<QString> supportedTimeFormats();
static QString dateFormatString( static QString
const QString& fullDateFormat, dateFormatString( const QString& fullDateFormat,
RiaDefines::DateFormatComponents dateComponents = RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY ); RiaDefines::DateFormatComponents dateComponents = RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY );
static QString timeFormatString( const QString& fullTimeFormat, static QString
RiaDefines::TimeFormatComponents timeComponents = timeFormatString( const QString& fullTimeFormat,
RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND ); RiaDefines::TimeFormatComponents timeComponents = RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND );
static QList<caf::PdmOptionItemInfo> createOptionItems( const std::vector<time_t>& timeSteps ); static QList<caf::PdmOptionItemInfo> createOptionItems( const std::vector<time_t>& timeSteps );

View File

@ -114,12 +114,10 @@ void RiaRegressionTest::readSettingsFromApplicationStore()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaRegressionTest::defineEditorAttribute( const caf::PdmFieldHandle* field, void RiaRegressionTest::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{ {
if ( field == &folderContainingDiffTool || field == &folderContainingCompareTool || if ( field == &folderContainingDiffTool || field == &folderContainingCompareTool || field == &regressionTestFolder ||
field == &regressionTestFolder || field == &folderContainingGitTool ) field == &folderContainingGitTool )
{ {
auto* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute ); auto* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
if ( myAttr ) if ( myAttr )

View File

@ -59,7 +59,5 @@ public:
caf::PdmField<caf::AppEnum<PlotEngine>> overridePlotEngine; caf::PdmField<caf::AppEnum<PlotEngine>> overridePlotEngine;
protected: protected:
void defineEditorAttribute( const caf::PdmFieldHandle* field, void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
}; };

View File

@ -181,8 +181,7 @@ void RiaRegressionTestRunner::runRegressionTest()
} }
} }
QString htmlReportFileName = QString htmlReportFileName = generateHtmlReport( folderList, baseFolderName, generatedFolderName, diffFolderName, testDir );
generateHtmlReport( folderList, baseFolderName, generatedFolderName, diffFolderName, testDir );
if ( regressionTestConfig.openReportInBrowser() ) if ( regressionTestConfig.openReportInBrowser() )
{ {
@ -203,8 +202,7 @@ void RiaRegressionTestRunner::runRegressionTest()
{ {
QDir testCaseFolder( folderFileInfo.filePath() ); QDir testCaseFolder( folderFileInfo.filePath() );
bool anyCommandFilesExecuted = bool anyCommandFilesExecuted = findAndExecuteCommandFiles( testCaseFolder, regressionTestConfig, htmlReportFileName );
findAndExecuteCommandFiles( testCaseFolder, regressionTestConfig, htmlReportFileName );
if ( !anyCommandFilesExecuted ) if ( !anyCommandFilesExecuted )
{ {
@ -233,9 +231,7 @@ void RiaRegressionTestRunner::runRegressionTest()
} }
logInfoTextWithTimeInSeconds( timeStamp, "Initializing test :" + testCaseFolder.absolutePath() ); logInfoTextWithTimeInSeconds( timeStamp, "Initializing test :" + testCaseFolder.absolutePath() );
app->loadProject( testCaseFolder.filePath( projectFileName ), app->loadProject( testCaseFolder.filePath( projectFileName ), RiaApplication::ProjectLoadAction::PLA_NONE, projectModifier.p() );
RiaApplication::ProjectLoadAction::PLA_NONE,
projectModifier.p() );
// Wait until all command objects have completed // Wait until all command objects have completed
app->waitUntilCommandObjectsHasBeenProcessed(); app->waitUntilCommandObjectsHasBeenProcessed();
@ -272,8 +268,8 @@ void RiaRegressionTestRunner::runRegressionTest()
} }
else else
{ {
RiaLogging::error( "Could not find a regression test file named : " + testCaseFolder.absolutePath() + RiaLogging::error( "Could not find a regression test file named : " + testCaseFolder.absolutePath() + "/" +
"/" + regTestProjectName + ".rsp" ); regTestProjectName + ".rsp" );
} }
} }
@ -291,9 +287,7 @@ void RiaRegressionTestRunner::runRegressionTest()
{ {
QString fileName = baseImageFileNames[fIdx]; QString fileName = baseImageFileNames[fIdx];
RiaImageFileCompare imgComparator( RegTestNames::imageCompareExeName ); RiaImageFileCompare imgComparator( RegTestNames::imageCompareExeName );
bool ok = imgComparator.runComparison( genDir.filePath( fileName ), bool ok = imgComparator.runComparison( genDir.filePath( fileName ), baseDir.filePath( fileName ), diffDir.filePath( fileName ) );
baseDir.filePath( fileName ),
diffDir.filePath( fileName ) );
if ( !ok ) if ( !ok )
{ {
qDebug() << "Error comparing :" << imgComparator.errorMessage() << "\n" << imgComparator.errorDetails(); qDebug() << "Error comparing :" << imgComparator.errorMessage() << "\n" << imgComparator.errorDetails();
@ -434,9 +428,8 @@ bool RiaRegressionTestRunner::findAndExecuteCommandFiles( const QDir&
html += "<table>\n"; html += "<table>\n";
html += " <tr>\n"; html += " <tr>\n";
html += html += " <td colspan=\"3\" bgcolor=\"darkblue\" height=\"40\"> <b><font color=\"white\" size=\"3\"> " + headerText +
" <td colspan=\"3\" bgcolor=\"darkblue\" height=\"40\"> <b><font color=\"white\" size=\"3\"> " + " </font></b> </td>\n";
headerText + " </font></b> </td>\n";
html += " </tr>\n"; html += " </tr>\n";
textFileCompare.runComparison( baseFilesFolderName, generatedFilesFolderName ); textFileCompare.runComparison( baseFilesFolderName, generatedFilesFolderName );
@ -628,8 +621,7 @@ QFileInfoList RiaRegressionTestRunner::subDirectoriesForTestExecution( const QDi
for ( const auto& s : m_testFilter ) for ( const auto& s : m_testFilter )
{ {
QString trimmed = s.trimmed(); QString trimmed = s.trimmed();
if ( ( m_appendAllTestsAfterLastItemInFilter && anyMatchFound ) || if ( ( m_appendAllTestsAfterLastItemInFilter && anyMatchFound ) || baseName.compare( trimmed, Qt::CaseInsensitive ) == 0 )
baseName.compare( trimmed, Qt::CaseInsensitive ) == 0 )
{ {
foldersMatchingTestFilter.push_back( fi ); foldersMatchingTestFilter.push_back( fi );
anyMatchFound = true; anyMatchFound = true;
@ -669,8 +661,7 @@ void RiaRegressionTestRunner::executeRegressionTests( const QString& regressionT
{ {
mainWnd->statusBar()->close(); mainWnd->statusBar()->close();
QByteArray curState = mainWnd->dockManager()->saveState( 0 ); QByteArray curState = mainWnd->dockManager()->saveState( 0 );
mainWnd->dockManager()->restoreState( mainWnd->dockManager()->restoreState( RiuDockWidgetTools::defaultDockState( RiuDockWidgetTools::dockStateHideAll3DWindowName() ) );
RiuDockWidgetTools::defaultDockState( RiuDockWidgetTools::dockStateHideAll3DWindowName() ) );
mainWnd->setDefaultWindowSize(); mainWnd->setDefaultWindowSize();

View File

@ -29,12 +29,11 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<const RigWellPath*> RiaSimWellBranchTools::simulationWellBranches( const QString& simWellName, std::vector<const RigWellPath*> RiaSimWellBranchTools::simulationWellBranches( const QString& simWellName, bool useAutoDetectionOfBranches )
bool useAutoDetectionOfBranches )
{ {
std::vector<RimEclipseCase*> simCases = RimEclipseCaseTools::eclipseCases(); std::vector<RimEclipseCase*> simCases = RimEclipseCaseTools::eclipseCases();
auto caseItr = std::find_if( simCases.begin(), simCases.end(), [&simWellName]( const RimEclipseCase* eclCase ) { auto caseItr = std::find_if( simCases.begin(), simCases.end(), [&simWellName]( const RimEclipseCase* eclCase ) {
const auto& eclData = eclCase->eclipseCaseData(); const auto& eclData = eclCase->eclipseCaseData();
return eclData != nullptr && eclData->hasSimulationWell( simWellName ); return eclData != nullptr && eclData->hasSimulationWell( simWellName );
} ); } );
@ -47,8 +46,7 @@ std::vector<const RigWellPath*> RiaSimWellBranchTools::simulationWellBranches( c
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> QList<caf::PdmOptionItemInfo> RiaSimWellBranchTools::valueOptionsForBranchIndexField( const std::vector<const RigWellPath*>& simulationWellPaths )
RiaSimWellBranchTools::valueOptionsForBranchIndexField( const std::vector<const RigWellPath*>& simulationWellPaths )
{ {
QList<caf::PdmOptionItemInfo> options; QList<caf::PdmOptionItemInfo> options;
@ -61,8 +59,7 @@ QList<caf::PdmOptionItemInfo>
{ {
for ( int bIdx = 0; bIdx < static_cast<int>( branchCount ); ++bIdx ) for ( int bIdx = 0; bIdx < static_cast<int>( branchCount ); ++bIdx )
{ {
options.push_back( options.push_back( caf::PdmOptionItemInfo( "Branch " + QString::number( bIdx + 1 ), QVariant::fromValue( bIdx ) ) );
caf::PdmOptionItemInfo( "Branch " + QString::number( bIdx + 1 ), QVariant::fromValue( bIdx ) ) );
} }
} }
@ -72,29 +69,26 @@ QList<caf::PdmOptionItemInfo>
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromWellName( caf::PdmUiOrdering* uiOrdering, void RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromWellName( caf::PdmUiOrdering* uiOrdering,
const QString& wellPathOrSimWellName, const QString& wellPathOrSimWellName,
const caf::PdmField<bool>& branchDetectionField, const caf::PdmField<bool>& branchDetectionField,
const caf::PdmField<int>& branchIndexField ) const caf::PdmField<int>& branchIndexField )
{ {
if ( !RimWellPlotTools::hasAssociatedWellPath( wellPathOrSimWellName ) ) if ( !RimWellPlotTools::hasAssociatedWellPath( wellPathOrSimWellName ) )
{ {
const QString simWellName = RimWellPlotTools::simWellName( wellPathOrSimWellName ); const QString simWellName = RimWellPlotTools::simWellName( wellPathOrSimWellName );
RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromSimWellName( uiOrdering, RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromSimWellName( uiOrdering, simWellName, branchDetectionField, branchIndexField );
simWellName,
branchDetectionField,
branchIndexField );
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromSimWellName( caf::PdmUiOrdering* uiOrdering, void RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromSimWellName( caf::PdmUiOrdering* uiOrdering,
const QString& simWellName, const QString& simWellName,
const caf::PdmField<bool>& branchDetectionField, const caf::PdmField<bool>& branchDetectionField,
const caf::PdmField<int>& branchIndexField ) const caf::PdmField<int>& branchIndexField )
{ {
if ( RiaSimWellBranchTools::simulationWellBranches( simWellName, true ).size() > 1 ) if ( RiaSimWellBranchTools::simulationWellBranches( simWellName, true ).size() > 1 )
{ {

View File

@ -39,11 +39,9 @@ class PdmUiOrdering;
class RiaSimWellBranchTools class RiaSimWellBranchTools
{ {
public: public:
static std::vector<const RigWellPath*> simulationWellBranches( const QString& simWellName, static std::vector<const RigWellPath*> simulationWellBranches( const QString& simWellName, bool useAutoDetectionOfBranches );
bool useAutoDetectionOfBranches );
static QList<caf::PdmOptionItemInfo> static QList<caf::PdmOptionItemInfo> valueOptionsForBranchIndexField( const std::vector<const RigWellPath*>& simulationWellPaths );
valueOptionsForBranchIndexField( const std::vector<const RigWellPath*>& simulationWellPaths );
static void appendSimWellBranchFieldsIfRequiredFromWellName( caf::PdmUiOrdering* uiOrdering, static void appendSimWellBranchFieldsIfRequiredFromWellName( caf::PdmUiOrdering* uiOrdering,
const QString& wellPathOrSimWellName, const QString& wellPathOrSimWellName,

View File

@ -163,8 +163,7 @@ std::string RiaStdStringTools::toUpper( const std::string& s )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaStdStringTools::endsWith( const std::string& mainStr, const std::string& toMatch ) bool RiaStdStringTools::endsWith( const std::string& mainStr, const std::string& toMatch )
{ {
if ( mainStr.size() >= toMatch.size() && if ( mainStr.size() >= toMatch.size() && mainStr.compare( mainStr.size() - toMatch.size(), toMatch.size(), toMatch ) == 0 )
mainStr.compare( mainStr.size() - toMatch.size(), toMatch.size(), toMatch ) == 0 )
return true; return true;
else else
return false; return false;

View File

@ -227,7 +227,7 @@ std::vector<std::vector<RifEclipseSummaryAddress>> RiaSummaryAddressAnalyzer::ad
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<QString> RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSummaryAddress::SummaryVarCategory category, std::vector<QString> RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSummaryAddress::SummaryVarCategory category,
const std::string& secondaryIdentifier ) const const std::string& secondaryIdentifier ) const
{ {
std::vector<QString> identifierStrings; std::vector<QString> identifierStrings;
@ -294,9 +294,8 @@ std::vector<QString> RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<RifEclipseSummaryAddress> std::vector<RifEclipseSummaryAddress> RiaSummaryAddressAnalyzer::addressesForCategory( const std::set<RifEclipseSummaryAddress>& addresses,
RiaSummaryAddressAnalyzer::addressesForCategory( const std::set<RifEclipseSummaryAddress>& addresses, RifEclipseSummaryAddress::SummaryVarCategory category )
RifEclipseSummaryAddress::SummaryVarCategory category )
{ {
std::vector<RifEclipseSummaryAddress> filteredAddresses; std::vector<RifEclipseSummaryAddress> filteredAddresses;
@ -330,8 +329,7 @@ std::string RiaSummaryAddressAnalyzer::correspondingHistorySummaryCurveName( con
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::set<std::string> std::set<std::string> RiaSummaryAddressAnalyzer::vectorNamesForCategory( RifEclipseSummaryAddress::SummaryVarCategory category )
RiaSummaryAddressAnalyzer::vectorNamesForCategory( RifEclipseSummaryAddress::SummaryVarCategory category )
{ {
auto it = m_categories.find( category ); auto it = m_categories.find( category );
if ( it != m_categories.end() ) return it->second; if ( it != m_categories.end() ) return it->second;
@ -452,8 +450,7 @@ void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAdd
{ {
m_aquifers.insert( { address.aquiferNumber(), address } ); m_aquifers.insert( { address.aquiferNumber(), address } );
} }
else if ( address.category() == RifEclipseSummaryAddress::SUMMARY_FIELD || else if ( address.category() == RifEclipseSummaryAddress::SUMMARY_FIELD || address.category() == RifEclipseSummaryAddress::SUMMARY_MISC )
address.category() == RifEclipseSummaryAddress::SUMMARY_MISC )
{ {
m_otherCategory.push_back( address ); m_otherCategory.push_back( address );
} }
@ -498,8 +495,8 @@ std::set<int> RiaSummaryAddressAnalyzer::keysInMap( const std::multimap<int, Rif
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::set<RifEclipseSummaryAddress::SummaryVarCategory> RiaSummaryAddressAnalyzer::keysInMap( std::set<RifEclipseSummaryAddress::SummaryVarCategory>
const std::map<RifEclipseSummaryAddress::SummaryVarCategory, std::set<std::string>>& map ) RiaSummaryAddressAnalyzer::keysInMap( const std::map<RifEclipseSummaryAddress::SummaryVarCategory, std::set<std::string>>& map )
{ {
std::set<RifEclipseSummaryAddress::SummaryVarCategory> keys; std::set<RifEclipseSummaryAddress::SummaryVarCategory> keys;
for ( const auto& [key, value] : map ) for ( const auto& [key, value] : map )

View File

@ -62,12 +62,10 @@ public:
std::set<RifEclipseSummaryAddress::SummaryVarCategory> categories() const; std::set<RifEclipseSummaryAddress::SummaryVarCategory> categories() const;
std::vector<std::vector<RifEclipseSummaryAddress>> addressesGroupedByObject() const; std::vector<std::vector<RifEclipseSummaryAddress>> addressesGroupedByObject() const;
std::vector<QString> identifierTexts( RifEclipseSummaryAddress::SummaryVarCategory category, std::vector<QString> identifierTexts( RifEclipseSummaryAddress::SummaryVarCategory category, const std::string& secondaryIdentifier ) const;
const std::string& secondaryIdentifier ) const;
static std::vector<RifEclipseSummaryAddress> static std::vector<RifEclipseSummaryAddress> addressesForCategory( const std::set<RifEclipseSummaryAddress>& addresses,
addressesForCategory( const std::set<RifEclipseSummaryAddress>& addresses, RifEclipseSummaryAddress::SummaryVarCategory category );
RifEclipseSummaryAddress::SummaryVarCategory category );
static std::string correspondingHistorySummaryCurveName( const std::string& curveName ); static std::string correspondingHistorySummaryCurveName( const std::string& curveName );
@ -84,11 +82,9 @@ private:
static std::set<RifEclipseSummaryAddress::SummaryVarCategory> static std::set<RifEclipseSummaryAddress::SummaryVarCategory>
keysInMap( const std::map<RifEclipseSummaryAddress::SummaryVarCategory, std::set<std::string>>& map ); keysInMap( const std::map<RifEclipseSummaryAddress::SummaryVarCategory, std::set<std::string>>& map );
static std::vector<std::vector<RifEclipseSummaryAddress>> static std::vector<std::vector<RifEclipseSummaryAddress>> valuesInMap( const std::multimap<std::string, RifEclipseSummaryAddress>& map );
valuesInMap( const std::multimap<std::string, RifEclipseSummaryAddress>& map );
static std::vector<std::vector<RifEclipseSummaryAddress>> static std::vector<std::vector<RifEclipseSummaryAddress>> valuesInMap( const std::multimap<int, RifEclipseSummaryAddress>& map );
valuesInMap( const std::multimap<int, RifEclipseSummaryAddress>& map );
private: private:
std::set<std::string> m_quantities; std::set<std::string> m_quantities;

View File

@ -95,8 +95,7 @@ std::pair<QStringList, QStringList> RiaSummaryStringTools::splitIntoAddressAndDa
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaSummaryStringTools::hasFilterAnyMatch( const QString& curveFilter, bool RiaSummaryStringTools::hasFilterAnyMatch( const QString& curveFilter, const std::set<RifEclipseSummaryAddress>& summaryAddresses )
const std::set<RifEclipseSummaryAddress>& summaryAddresses )
{ {
for ( const auto& addr : summaryAddresses ) for ( const auto& addr : summaryAddresses )
{ {
@ -143,8 +142,7 @@ void RiaSummaryStringTools::splitUsingDataSourceNames( const QStringList& filter
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryCaseCollection*>> std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryCaseCollection*>> RiaSummaryStringTools::allDataSourcesInProject()
RiaSummaryStringTools::allDataSourcesInProject()
{ {
auto sumCaseMainColl = RiaSummaryTools::summaryCaseMainCollection(); auto sumCaseMainColl = RiaSummaryTools::summaryCaseMainCollection();
if ( !sumCaseMainColl ) return { {}, {} }; if ( !sumCaseMainColl ) return { {}, {} };
@ -245,10 +243,9 @@ QStringList RiaSummaryStringTools::dataSourceNames( const std::vector<RimSummary
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::set<RifEclipseSummaryAddress> std::set<RifEclipseSummaryAddress> RiaSummaryStringTools::computeFilteredAddresses( const QStringList& textFilters,
RiaSummaryStringTools::computeFilteredAddresses( const QStringList& textFilters, const std::set<RifEclipseSummaryAddress>& sourceAddresses,
const std::set<RifEclipseSummaryAddress>& sourceAddresses, bool includeDiffCurves )
bool includeDiffCurves )
{ {
std::set<RifEclipseSummaryAddress> addresses; std::set<RifEclipseSummaryAddress> addresses;

View File

@ -50,10 +50,9 @@ public:
static QStringList dataSourceNames( const std::vector<RimSummaryCase*>& summaryCases, static QStringList dataSourceNames( const std::vector<RimSummaryCase*>& summaryCases,
const std::vector<RimSummaryCaseCollection*>& ensembles ); const std::vector<RimSummaryCaseCollection*>& ensembles );
static std::set<RifEclipseSummaryAddress> static std::set<RifEclipseSummaryAddress> computeFilteredAddresses( const QStringList& textFilters,
computeFilteredAddresses( const QStringList& textFilters, const std::set<RifEclipseSummaryAddress>& sourceAddresses,
const std::set<RifEclipseSummaryAddress>& sourceAddresses, bool includeDiffCurves );
bool includeDiffCurves );
// Consider private, set public to be able to test // Consider private, set public to be able to test
static void splitUsingDataSourceNames( const QStringList& filters, static void splitUsingDataSourceNames( const QStringList& filters,

View File

@ -248,11 +248,10 @@ void RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( int
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::pair<std::vector<time_t>, std::vector<double>> std::pair<std::vector<time_t>, std::vector<double>> RiaSummaryTools::resampledValuesForPeriod( const RifEclipseSummaryAddress& address,
RiaSummaryTools::resampledValuesForPeriod( const RifEclipseSummaryAddress& address, const std::vector<time_t>& timeSteps,
const std::vector<time_t>& timeSteps, std::vector<double>& values,
std::vector<double>& values, RiaDefines::DateTimePeriod period )
RiaDefines::DateTimePeriod period )
{ {
RiaTimeHistoryCurveResampler resampler; RiaTimeHistoryCurveResampler resampler;
resampler.setCurveData( values, timeSteps ); resampler.setCurveData( values, timeSteps );

View File

@ -70,11 +70,10 @@ public:
std::vector<RimSummaryCase*>& cases, std::vector<RimSummaryCase*>& cases,
std::vector<RifEclipseSummaryAddress>& addresses ); std::vector<RifEclipseSummaryAddress>& addresses );
static std::pair<std::vector<time_t>, std::vector<double>> static std::pair<std::vector<time_t>, std::vector<double>> resampledValuesForPeriod( const RifEclipseSummaryAddress& address,
resampledValuesForPeriod( const RifEclipseSummaryAddress& address, const std::vector<time_t>& timeSteps,
const std::vector<time_t>& timeSteps, std::vector<double>& values,
std::vector<double>& values, RiaDefines::DateTimePeriod period );
RiaDefines::DateTimePeriod period );
static RimSummaryCase* summaryCaseById( int caseId ); static RimSummaryCase* summaryCaseById( int caseId );
static RimSummaryCaseCollection* ensembleById( int ensembleId ); static RimSummaryCaseCollection* ensembleById( int ensembleId );

View File

@ -74,8 +74,7 @@ bool RiaTextFileCompare::runComparison( const QString& baseFolder, const QString
// See https://docs.freebsd.org/info/diff/diff.info.diff_Options.html // See https://docs.freebsd.org/info/diff/diff.info.diff_Options.html
QString args = "-r -u --strip-trailing-cr"; QString args = "-r -u --strip-trailing-cr";
QString completeCommand = QString completeCommand = QString( "\"%1\" %2 %3 %4" ).arg( fullFilePath ).arg( baseFolder ).arg( generatedFolder ).arg( args );
QString( "\"%1\" %2 %3 %4" ).arg( fullFilePath ).arg( baseFolder ).arg( generatedFolder ).arg( args );
// Launch process and wait // Launch process and wait
QProcess proc; QProcess proc;

View File

@ -143,8 +143,7 @@ QStringList RiaTextStringTools::splitSkipEmptyParts( const QString& text, const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RiaTextStringTools::replaceTemplateTextWithValues( const QString& templateText, QString RiaTextStringTools::replaceTemplateTextWithValues( const QString& templateText, const std::map<QString, QString>& valueMap )
const std::map<QString, QString>& valueMap )
{ {
QString resolvedText = templateText; QString resolvedText = templateText;

View File

@ -100,9 +100,7 @@ const std::vector<double>& RiaTimeHistoryCurveResampler::resampledValues() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<time_t> RiaTimeHistoryCurveResampler::timeStepsFromTimeRange( RiaDefines::DateTimePeriod period, std::vector<time_t> RiaTimeHistoryCurveResampler::timeStepsFromTimeRange( RiaDefines::DateTimePeriod period, time_t minTime, time_t maxTime )
time_t minTime,
time_t maxTime )
{ {
if ( minTime > maxTime ) return std::vector<time_t>(); if ( minTime > maxTime ) return std::vector<time_t>();
@ -145,8 +143,7 @@ void RiaTimeHistoryCurveResampler::computeWeightedMeanValues( RiaDefines::DateTi
double wMean = 0.0; double wMean = 0.0;
time_t periodStart = time_t periodStart =
i > 0 ? m_timeSteps[i - 1] i > 0 ? m_timeSteps[i - 1]
: RiaQDateTimeTools::subtractPeriod( RiaQDateTimeTools::fromTime_t( m_timeSteps[0] ), period ) : RiaQDateTimeTools::subtractPeriod( RiaQDateTimeTools::fromTime_t( m_timeSteps[0] ), period ).toSecsSinceEpoch();
.toSecsSinceEpoch();
time_t periodEnd = m_timeSteps[i]; time_t periodEnd = m_timeSteps[i];
time_t periodLength = periodEnd - periodStart; time_t periodLength = periodEnd - periodStart;
@ -272,13 +269,11 @@ void RiaTimeHistoryCurveResampler::computeResampledTimeSteps( RiaDefines::DateTi
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QDateTime RiaTimeHistoryCurveResampler::firstResampledTimeStep( const QDateTime& firstTimeStep, QDateTime RiaTimeHistoryCurveResampler::firstResampledTimeStep( const QDateTime& firstTimeStep, RiaDefines::DateTimePeriod period )
RiaDefines::DateTimePeriod period )
{ {
QDateTime truncatedTime = RiaQDateTimeTools::truncateTime( firstTimeStep, period ); QDateTime truncatedTime = RiaQDateTimeTools::truncateTime( firstTimeStep, period );
if ( RiaQDateTimeTools::lessThan( truncatedTime, firstTimeStep ) ) if ( RiaQDateTimeTools::lessThan( truncatedTime, firstTimeStep ) ) return RiaQDateTimeTools::addPeriod( truncatedTime, period );
return RiaQDateTimeTools::addPeriod( truncatedTime, period );
return truncatedTime; return truncatedTime;
} }

View File

@ -111,9 +111,8 @@ void RiaWellLogCurveMerger::computeLookupValues( bool includeValuesFromPartialCu
for ( size_t valueIndex = 0; valueIndex < dataValueCount; valueIndex++ ) for ( size_t valueIndex = 0; valueIndex < dataValueCount; valueIndex++ )
{ {
double interpolValue = lookupYValue( m_allXValues[valueIndex], double interpolValue =
m_originalValues[curveIdx].first, lookupYValue( m_allXValues[valueIndex], m_originalValues[curveIdx].first, m_originalValues[curveIdx].second );
m_originalValues[curveIdx].second );
if ( !RiaCurveDataTools::isValidValue( interpolValue, false ) ) if ( !RiaCurveDataTools::isValidValue( interpolValue, false ) )
{ {
accumulatedValidValues[valueIndex] = HUGE_VAL; accumulatedValidValues[valueIndex] = HUGE_VAL;
@ -158,8 +157,7 @@ void RiaWellLogCurveMerger::computeUnionOfXValues( bool includeValuesForPartialC
originalXBounds.push_back( std::make_pair( *( minmax_it.first ), *( minmax_it.second ) ) ); originalXBounds.push_back( std::make_pair( *( minmax_it.first ), *( minmax_it.second ) ) );
} }
if ( !includeValuesForPartialCurves ) if ( !includeValuesForPartialCurves ) RiaCurveMerger<double>::removeValuesForPartialCurves( unionOfXValues, originalXBounds );
RiaCurveMerger<double>::removeValuesForPartialCurves( unionOfXValues, originalXBounds );
m_allXValues = std::vector<double>( unionOfXValues.begin(), unionOfXValues.end() ); m_allXValues = std::vector<double>( unionOfXValues.begin(), unionOfXValues.end() );
} }

View File

@ -42,9 +42,7 @@ public:
private: private:
void computeUnionOfXValues( bool includeValuesFromPartialCurves ); void computeUnionOfXValues( bool includeValuesFromPartialCurves );
static double lookupYValue( const double& xValue, static double lookupYValue( const double& xValue, const std::vector<double>& curveXValues, const std::vector<double>& curveYValues );
const std::vector<double>& curveXValues,
const std::vector<double>& curveYValues );
std::vector<std::pair<std::vector<double>, std::vector<double>>> m_originalValues; std::vector<std::pair<std::vector<double>, std::vector<double>>> m_originalValues;

View File

@ -44,17 +44,14 @@ public:
static QString pascalUnitStringShort(); static QString pascalUnitStringShort();
public: public:
static std::vector<FloatType> convertDepths( const std::vector<FloatType>& depthsIn, static std::vector<FloatType>
RiaDefines::DepthUnitType unitsIn, convertDepths( const std::vector<FloatType>& depthsIn, RiaDefines::DepthUnitType unitsIn, RiaDefines::DepthUnitType unitsOut );
RiaDefines::DepthUnitType unitsOut );
static std::vector<std::pair<FloatType, FloatType>> static std::vector<std::pair<FloatType, FloatType>> convertDepths( const std::vector<std::pair<FloatType, FloatType>>& depthsIn,
convertDepths( const std::vector<std::pair<FloatType, FloatType>>& depthsIn, RiaDefines::DepthUnitType unitsIn,
RiaDefines::DepthUnitType unitsIn, RiaDefines::DepthUnitType unitsOut );
RiaDefines::DepthUnitType unitsOut );
static FloatType static FloatType convertDepth( FloatType depthIn, RiaDefines::DepthUnitType unitsIn, RiaDefines::DepthUnitType unitsOut );
convertDepth( FloatType depthIn, RiaDefines::DepthUnitType unitsIn, RiaDefines::DepthUnitType unitsOut );
static bool convertValues( const std::vector<FloatType>& tvdRKBs, static bool convertValues( const std::vector<FloatType>& tvdRKBs,
const std::vector<FloatType>& valuesIn, const std::vector<FloatType>& valuesIn,
@ -69,15 +66,11 @@ public:
static std::vector<FloatType> tvdRKBs( const std::vector<FloatType>& measuredDepths, const RigWellPath* wellPath ); static std::vector<FloatType> tvdRKBs( const std::vector<FloatType>& measuredDepths, const RigWellPath* wellPath );
// Supported conversions // Supported conversions
static std::vector<FloatType> convertGpcm3ToBar( const std::vector<FloatType>& tvdRKBs, static std::vector<FloatType> convertGpcm3ToBar( const std::vector<FloatType>& tvdRKBs, const std::vector<FloatType>& valuesInGpcm3 );
const std::vector<FloatType>& valuesInGpcm3 ); static std::vector<FloatType> convertBarToGpcm3( const std::vector<FloatType>& tvdRKBs, const std::vector<FloatType>& valuesInBar );
static std::vector<FloatType> convertBarToGpcm3( const std::vector<FloatType>& tvdRKBs,
const std::vector<FloatType>& valuesInBar );
static std::vector<FloatType> convertNormalizedByPPToBar( const std::vector<FloatType>& tvdRKBs, static std::vector<FloatType> convertNormalizedByPPToBar( const std::vector<FloatType>& tvdRKBs, const std::vector<FloatType>& valuesInBar );
const std::vector<FloatType>& valuesInBar ); static std::vector<FloatType> convertBarToNormalizedByPP( const std::vector<FloatType>& tvdRKBs, const std::vector<FloatType>& valuesInBar );
static std::vector<FloatType> convertBarToNormalizedByPP( const std::vector<FloatType>& tvdRKBs,
const std::vector<FloatType>& valuesInBar );
static std::vector<FloatType> multiply( const std::vector<FloatType>& values, FloatType factor ); static std::vector<FloatType> multiply( const std::vector<FloatType>& values, FloatType factor );
static FloatType pascalPerBar(); static FloatType pascalPerBar();
static FloatType MPaPerBar(); static FloatType MPaPerBar();

View File

@ -153,9 +153,7 @@ std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertDepths( const std:
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
template <typename FloatType> template <typename FloatType>
FloatType RiaWellLogUnitTools<FloatType>::convertDepth( FloatType depthIn, FloatType RiaWellLogUnitTools<FloatType>::convertDepth( FloatType depthIn, RiaDefines::DepthUnitType unitsIn, RiaDefines::DepthUnitType unitsOut )
RiaDefines::DepthUnitType unitsIn,
RiaDefines::DepthUnitType unitsOut )
{ {
FloatType factor = 1.0; FloatType factor = 1.0;
if ( unitsOut == RiaDefines::DepthUnitType::UNIT_METER && unitsIn == RiaDefines::DepthUnitType::UNIT_FEET ) if ( unitsOut == RiaDefines::DepthUnitType::UNIT_METER && unitsIn == RiaDefines::DepthUnitType::UNIT_FEET )
@ -334,8 +332,7 @@ bool RiaWellLogUnitTools<FloatType>::convertValues( std::vector<std::pair<FloatT
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
template <typename FloatType> template <typename FloatType>
std::vector<FloatType> std::vector<FloatType> RiaWellLogUnitTools<FloatType>::tvdRKBs( const std::vector<FloatType>& measuredDepths, const RigWellPath* wellPath )
RiaWellLogUnitTools<FloatType>::tvdRKBs( const std::vector<FloatType>& measuredDepths, const RigWellPath* wellPath )
{ {
if ( measuredDepths.empty() ) return {}; if ( measuredDepths.empty() ) return {};
@ -352,8 +349,8 @@ std::vector<FloatType>
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
template <typename FloatType> template <typename FloatType>
std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertGpcm3ToBar( const std::vector<FloatType>& tvdRKBs, std::vector<FloatType>
const std::vector<FloatType>& valuesInGpcm3 ) RiaWellLogUnitTools<FloatType>::convertGpcm3ToBar( const std::vector<FloatType>& tvdRKBs, const std::vector<FloatType>& valuesInGpcm3 )
{ {
if ( tvdRKBs.empty() ) return {}; if ( tvdRKBs.empty() ) return {};
@ -381,8 +378,8 @@ std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertGpcm3ToBar( const
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
template <typename FloatType> template <typename FloatType>
std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertBarToGpcm3( const std::vector<FloatType>& tvdRKBs, std::vector<FloatType>
const std::vector<FloatType>& valuesInBar ) RiaWellLogUnitTools<FloatType>::convertBarToGpcm3( const std::vector<FloatType>& tvdRKBs, const std::vector<FloatType>& valuesInBar )
{ {
if ( tvdRKBs.empty() ) return {}; if ( tvdRKBs.empty() ) return {};
@ -410,9 +407,8 @@ std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertBarToGpcm3( const
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
template <typename FloatType> template <typename FloatType>
std::vector<FloatType> std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertNormalizedByPPToBar( const std::vector<FloatType>& tvdRKBs,
RiaWellLogUnitTools<FloatType>::convertNormalizedByPPToBar( const std::vector<FloatType>& tvdRKBs, const std::vector<FloatType>& normalizedValues )
const std::vector<FloatType>& normalizedValues )
{ {
if ( tvdRKBs.empty() ) return {}; if ( tvdRKBs.empty() ) return {};
@ -430,9 +426,8 @@ std::vector<FloatType>
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
template <typename FloatType> template <typename FloatType>
std::vector<FloatType> std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertBarToNormalizedByPP( const std::vector<FloatType>& tvdRKBs,
RiaWellLogUnitTools<FloatType>::convertBarToNormalizedByPP( const std::vector<FloatType>& tvdRKBs, const std::vector<FloatType>& valuesInBar )
const std::vector<FloatType>& valuesInBar )
{ {
if ( tvdRKBs.empty() ) return {}; if ( tvdRKBs.empty() ) return {};

View File

@ -41,9 +41,8 @@ public:
static QString removeSpacesFromName( const QString& wellName ); static QString removeSpacesFromName( const QString& wellName );
private: private:
static QString tryMatchName( QString searchName, static QString
const std::vector<QString>& nameList, tryMatchName( QString searchName, const std::vector<QString>& nameList, std::function<QString( QString )> stringFormatter = nullptr );
std::function<QString( QString )> stringFormatter = nullptr );
static QString removeWellNamePrefix( const QString& name ); static QString removeWellNamePrefix( const QString& name );

View File

@ -42,29 +42,17 @@ RiaLineArcWellPathCalculator::RiaLineArcWellPathCalculator( const cvf::Vec3d&
if ( activeWellPathTargets.size() == 1 ) if ( activeWellPathTargets.size() == 1 )
{ {
m_lineArcEndpoints.push_back( activeWellPathTargets[0].targetPointXYZ + referencePointXyz ); m_lineArcEndpoints.push_back( activeWellPathTargets[0].targetPointXYZ + referencePointXyz );
m_targetStatuses.resize( activeWellPathTargets.size(), m_targetStatuses
{ 0.0, .resize( activeWellPathTargets.size(),
0.0, { 0.0, 0.0, false, true, std::numeric_limits<double>::infinity(), false, true, std::numeric_limits<double>::infinity() } );
false,
true,
std::numeric_limits<double>::infinity(),
false,
true,
std::numeric_limits<double>::infinity() } );
} }
return; return;
} }
m_targetStatuses.resize( activeWellPathTargets.size(), m_targetStatuses
{ 0.0, .resize( activeWellPathTargets.size(),
0.0, { 0.0, 0.0, false, false, std::numeric_limits<double>::infinity(), false, false, std::numeric_limits<double>::infinity() } );
false,
false,
std::numeric_limits<double>::infinity(),
false,
false,
std::numeric_limits<double>::infinity() } );
std::vector<WellTarget> adjustedWellPathTargets = activeWellPathTargets; std::vector<WellTarget> adjustedWellPathTargets = activeWellPathTargets;
@ -149,8 +137,8 @@ RiaLineArcWellPathCalculator::RiaLineArcWellPathCalculator( const cvf::Vec3d&
target2Status.resultInclinationRadians = t12Sph.inc(); target2Status.resultInclinationRadians = t12Sph.inc();
} }
m_startTangent = RiaOffshoreSphericalCoords::unitVectorFromAziInc( target1Status.resultAzimuthRadians, m_startTangent =
target1Status.resultInclinationRadians ); RiaOffshoreSphericalCoords::unitVectorFromAziInc( target1Status.resultAzimuthRadians, target1Status.resultInclinationRadians );
} }
else else
{ {

View File

@ -39,8 +39,7 @@ public:
double radius2; double radius2;
}; };
RiaLineArcWellPathCalculator( const cvf::Vec3d& referencePointXyz, RiaLineArcWellPathCalculator( const cvf::Vec3d& referencePointXyz, const std::vector<RiaLineArcWellPathCalculator::WellTarget>& targets );
const std::vector<RiaLineArcWellPathCalculator::WellTarget>& targets );
struct WellTargetStatus struct WellTargetStatus
{ {

View File

@ -25,8 +25,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiaPolyArcLineSampler::RiaPolyArcLineSampler( const cvf::Vec3d& startTangent, RiaPolyArcLineSampler::RiaPolyArcLineSampler( const cvf::Vec3d& startTangent, const std::vector<cvf::Vec3d>& lineArcEndPoints )
const std::vector<cvf::Vec3d>& lineArcEndPoints )
: m_startTangent( startTangent ) : m_startTangent( startTangent )
, m_lineArcEndPoints( lineArcEndPoints ) , m_lineArcEndPoints( lineArcEndPoints )
, m_maxSamplingsInterval( 0.15 ) , m_maxSamplingsInterval( 0.15 )
@ -38,8 +37,8 @@ RiaPolyArcLineSampler::RiaPolyArcLineSampler( const cvf::Vec3d& sta
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::pair<std::vector<cvf::Vec3d>, std::vector<double>> std::pair<std::vector<cvf::Vec3d>, std::vector<double>> RiaPolyArcLineSampler::sampledPointsAndMDs( double sampleInterval,
RiaPolyArcLineSampler::sampledPointsAndMDs( double sampleInterval, bool isResamplingLines ) bool isResamplingLines )
{ {
CVF_ASSERT( sampleInterval > 0.0 ); CVF_ASSERT( sampleInterval > 0.0 );

View File

@ -27,8 +27,7 @@ class RiaPolyArcLineSampler
public: public:
RiaPolyArcLineSampler( const cvf::Vec3d& startTangent, const std::vector<cvf::Vec3d>& lineArcEndPoints ); RiaPolyArcLineSampler( const cvf::Vec3d& startTangent, const std::vector<cvf::Vec3d>& lineArcEndPoints );
std::pair<std::vector<cvf::Vec3d>, std::vector<double>> sampledPointsAndMDs( double maxSampleInterval, std::pair<std::vector<cvf::Vec3d>, std::vector<double>> sampledPointsAndMDs( double maxSampleInterval, bool isResamplingLines );
bool isResamplingLines );
static std::vector<cvf::Vec3d> pointsWithoutDuplicates( const std::vector<cvf::Vec3d>& points ); static std::vector<cvf::Vec3d> pointsWithoutDuplicates( const std::vector<cvf::Vec3d>& points );

View File

@ -28,14 +28,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiaSCurveCalculator::RiaSCurveCalculator( cvf::Vec3d p1, RiaSCurveCalculator::RiaSCurveCalculator( cvf::Vec3d p1, double azi1, double inc1, double rad1, cvf::Vec3d p2, double azi2, double inc2, double rad2 )
double azi1,
double inc1,
double rad1,
cvf::Vec3d p2,
double azi2,
double inc2,
double rad2 )
: m_isCalculationOK( false ) : m_isCalculationOK( false )
, m_p1( p1 ) , m_p1( p1 )
, m_p2( p2 ) , m_p2( p2 )
@ -66,10 +59,10 @@ RiaSCurveCalculator::RiaSCurveCalculator( cvf::Vec3d p1, cvf::Vec3d q1, cvf::Vec
Vec3d tq1q2 = ( q2 - q1 ).getNormalized( &isOk ); // !ok means the control points are in the same place. Could Vec3d tq1q2 = ( q2 - q1 ).getNormalized( &isOk ); // !ok means the control points are in the same place. Could
// fallback to use only one circle segment + one line. // fallback to use only one circle segment + one line.
m_isCalculationOK = m_isCalculationOK && isOk; m_isCalculationOK = m_isCalculationOK && isOk;
Vec3d t1 = ( q1 - p1 ).getNormalized( &isOk ); // !ok means no tangent specified. Could fallback to use only one Vec3d t1 = ( q1 - p1 ).getNormalized( &isOk ); // !ok means no tangent specified. Could fallback to use only one
// circle segment + one line. // circle segment + one line.
m_isCalculationOK = m_isCalculationOK && isOk; m_isCalculationOK = m_isCalculationOK && isOk;
Vec3d t2 = ( p2 - q2 ).getNormalized( &isOk ); // !ok means no tangent specified. Could fallback to use only one Vec3d t2 = ( p2 - q2 ).getNormalized( &isOk ); // !ok means no tangent specified. Could fallback to use only one
// circle segment + one line or only one straight line if both // circle segment + one line or only one straight line if both
// tangents are missing // tangents are missing
m_isCalculationOK = m_isCalculationOK && isOk; m_isCalculationOK = m_isCalculationOK && isOk;
@ -221,14 +214,7 @@ bool isZeroCrossing( double newError, double oldError, double maxError )
/// R1(q1, q2), R2(q1, q2) /// R1(q1, q2), R2(q1, q2)
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaSCurveCalculator::initializeByFinding_q1q2( cvf::Vec3d p1, void RiaSCurveCalculator::initializeByFinding_q1q2( cvf::Vec3d p1, double azi1, double inc1, double r1, cvf::Vec3d p2, double azi2, double inc2, double r2 )
double azi1,
double inc1,
double r1,
cvf::Vec3d p2,
double azi2,
double inc2,
double r2 )
{ {
// Algorithm options // Algorithm options
@ -249,8 +235,7 @@ void RiaSCurveCalculator::initializeByFinding_q1q2( cvf::Vec3d p1,
double initialq1q2 = 0.2 * p1p2Length; double initialq1q2 = 0.2 * p1p2Length;
double deltaPos = initialq1q2 + delta; double deltaPos = initialq1q2 + delta;
RiaSCurveCalculator ev_0 = RiaSCurveCalculator ev_0 = RiaSCurveCalculator::fromTangentsAndLength( p1, azi1, inc1, initialq1q2, p2, azi2, inc2, initialq1q2 );
RiaSCurveCalculator::fromTangentsAndLength( p1, azi1, inc1, initialq1q2, p2, azi2, inc2, initialq1q2 );
if ( ev_0.curveStatus() == RiaSCurveCalculator::OK_INFINITE_RADIUS12 ) if ( ev_0.curveStatus() == RiaSCurveCalculator::OK_INFINITE_RADIUS12 )
{ {
@ -259,10 +244,8 @@ void RiaSCurveCalculator::initializeByFinding_q1q2( cvf::Vec3d p1,
return; return;
} // Todo: Handle infinite radius in one place } // Todo: Handle infinite radius in one place
RiaSCurveCalculator ev_dq1 = RiaSCurveCalculator ev_dq1 = RiaSCurveCalculator::fromTangentsAndLength( p1, azi1, inc1, deltaPos, p2, azi2, inc2, initialq1q2 );
RiaSCurveCalculator::fromTangentsAndLength( p1, azi1, inc1, deltaPos, p2, azi2, inc2, initialq1q2 ); RiaSCurveCalculator ev_dq2 = RiaSCurveCalculator::fromTangentsAndLength( p1, azi1, inc1, initialq1q2, p2, azi2, inc2, deltaPos );
RiaSCurveCalculator ev_dq2 =
RiaSCurveCalculator::fromTangentsAndLength( p1, azi1, inc1, initialq1q2, p2, azi2, inc2, deltaPos );
// Initial Jacobi // Initial Jacobi
double dR1_dq1 = ( ( r1 - ev_dq1.firstRadius() ) - ( r1 - ev_0.firstRadius() ) ) / delta; double dR1_dq1 = ( ( r1 - ev_dq1.firstRadius() ) - ( r1 - ev_0.firstRadius() ) ) / delta;
@ -290,9 +273,8 @@ void RiaSCurveCalculator::initializeByFinding_q1q2( cvf::Vec3d p1,
std::cout << std::endl; std::cout << std::endl;
std::cout << "Targets: R1, R2: " << r1 << " , " << r2 << std::endl; std::cout << "Targets: R1, R2: " << r1 << " , " << r2 << std::endl;
std::cout << 0 << ": " << q1Step << " , " << q2Step << " : " << q1 << " , " << q2 << " | " << ev_0.isOk() << " : " std::cout << 0 << ": " << q1Step << " , " << q2Step << " : " << q1 << " , " << q2 << " | " << ev_0.isOk() << " : " << ev_0.firstRadius()
<< ev_0.firstRadius() << " , " << ev_0.secondRadius() << " : " << R1_error << " , " << R2_error << " , " << ev_0.secondRadius() << " : " << R1_error << " , " << R2_error << std::endl;
<< std::endl;
#endif #endif
SolveStatus solveResultStatus = NOT_SOLVED; SolveStatus solveResultStatus = NOT_SOLVED;
@ -338,9 +320,9 @@ void RiaSCurveCalculator::initializeByFinding_q1q2( cvf::Vec3d p1,
double R2_error_new = r2 - ev_1.secondRadius(); double R2_error_new = r2 - ev_1.secondRadius();
#ifdef DEBUG_OUTPUT_ON #ifdef DEBUG_OUTPUT_ON
std::cout << iteration << ": " << q1Step << q1R1StepCorrMarker << " , " << q2Step << q2R2StepCorrMarker << " : " std::cout << iteration << ": " << q1Step << q1R1StepCorrMarker << " , " << q2Step << q2R2StepCorrMarker << " : " << q1 << " , "
<< q1 << " , " << q2 << " | " << ev_1.isOk() << " : " << ev_1.firstRadius() << " , " << q2 << " | " << ev_1.isOk() << " : " << ev_1.firstRadius() << " , " << ev_1.secondRadius() << " : " << R1_error_new
<< ev_1.secondRadius() << " : " << R1_error_new << " , " << R2_error_new; << " , " << R2_error_new;
#endif #endif
if ( ( fabs( R1_error_new ) < maxError || ev_1.curveStatus() == OK_INFINITE_RADIUS1 ) && if ( ( fabs( R1_error_new ) < maxError || ev_1.curveStatus() == OK_INFINITE_RADIUS1 ) &&

View File

@ -61,24 +61,11 @@ public:
void dump() const; void dump() const;
static RiaSCurveCalculator fromTangentsAndLength( cvf::Vec3d p1, static RiaSCurveCalculator
double azi1, fromTangentsAndLength( cvf::Vec3d p1, double azi1, double inc1, double lengthToQ1, cvf::Vec3d p2, double azi2, double inc2, double lengthToQ2 );
double inc1,
double lengthToQ1,
cvf::Vec3d p2,
double azi2,
double inc2,
double lengthToQ2 );
private: private:
void initializeByFinding_q1q2( cvf::Vec3d p1, void initializeByFinding_q1q2( cvf::Vec3d p1, double azi1, double inc1, double r1, cvf::Vec3d p2, double azi2, double inc2, double r2 );
double azi1,
double inc1,
double r1,
cvf::Vec3d p2,
double azi2,
double inc2,
double r2 );
bool m_isCalculationOK; bool m_isCalculationOK;

View File

@ -26,8 +26,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiaWellPlanCalculator::RiaWellPlanCalculator( const cvf::Vec3d& startTangent, RiaWellPlanCalculator::RiaWellPlanCalculator( const cvf::Vec3d& startTangent, const std::vector<cvf::Vec3d>& lineArcEndPoints )
const std::vector<cvf::Vec3d>& lineArcEndPoints )
: m_startTangent( startTangent ) : m_startTangent( startTangent )
, m_lineArcEndPoints( lineArcEndPoints ) , m_lineArcEndPoints( lineArcEndPoints )
{ {
@ -123,10 +122,10 @@ void RiaWellPlanCalculator::addArcSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Ve
segment.EW = p2.x(); segment.EW = p2.x();
segment.dogleg = cvf::Math::toDegrees( 30.0 / arcCalc.radius() ); segment.dogleg = cvf::Math::toDegrees( 30.0 / arcCalc.radius() );
RiaOffshoreSphericalCoords startAziIncRad( t1 ); RiaOffshoreSphericalCoords startAziIncRad( t1 );
double buildInRadsPrLength = ( arcCalc.endInclination() - startAziIncRad.inc() ) / arcCalc.arcLength(); double buildInRadsPrLength = ( arcCalc.endInclination() - startAziIncRad.inc() ) / arcCalc.arcLength();
double turnInRadsPrLength = ( arcCalc.endAzimuth() - startAziIncRad.azi() ) / arcCalc.arcLength(); double turnInRadsPrLength = ( arcCalc.endAzimuth() - startAziIncRad.azi() ) / arcCalc.arcLength();
segment.build = 30 * cvf::Math::toDegrees( buildInRadsPrLength ); segment.build = 30 * cvf::Math::toDegrees( buildInRadsPrLength );
segment.turn = 30 * cvf::Math::toDegrees( turnInRadsPrLength ); segment.turn = 30 * cvf::Math::toDegrees( turnInRadsPrLength );
m_wpResult.push_back( segment ); m_wpResult.push_back( segment );

View File

@ -37,9 +37,8 @@ class PdmScriptIOMessages;
class RicfCommandFileReader class RicfCommandFileReader
{ {
public: public:
static std::vector<RicfCommandObject*> readCommands( QTextStream& inputStream, static std::vector<RicfCommandObject*>
caf::PdmObjectFactory* objectFactory, readCommands( QTextStream& inputStream, caf::PdmObjectFactory* objectFactory, caf::PdmScriptIOMessages* errorMessageContainer );
caf::PdmScriptIOMessages* errorMessageContainer );
static void writeCommands( QTextStream& outputStream, const std::vector<RicfCommandObject*>& commandsToWrite ); static void writeCommands( QTextStream& outputStream, const std::vector<RicfCommandObject*>& commandsToWrite );
}; };

View File

@ -34,8 +34,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// Empty wellPathNames returns all well paths /// Empty wellPathNames returns all well paths
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<RimWellPath*> RicfApplicationTools::wellPathsFromNames( const QStringList& wellPathNames, std::vector<RimWellPath*> RicfApplicationTools::wellPathsFromNames( const QStringList& wellPathNames, QStringList* wellsNotFound )
QStringList* wellsNotFound )
{ {
std::vector<RimWellPath*> wellPaths; std::vector<RimWellPath*> wellPaths;
auto allWellPaths = RimProject::current()->allWellPaths(); auto allWellPaths = RimProject::current()->allWellPaths();

View File

@ -59,8 +59,7 @@ public:
static RicfCommandFileExecutor* instance(); static RicfCommandFileExecutor* instance();
static std::vector<RicfCommandObject*> static std::vector<RicfCommandObject*> prepareFileCommandsForExecution( const std::vector<RicfCommandObject*>& commandsReadFromFile );
prepareFileCommandsForExecution( const std::vector<RicfCommandObject*>& commandsReadFromFile );
private: private:
void clearCachedData(); void clearCachedData();

View File

@ -94,8 +94,7 @@ caf::PdmScriptResponse RicfComputeCaseGroupStatistics::execute()
if ( !foundCase ) if ( !foundCase )
{ {
QString warning = QString warning = QString( "computeCaseGroupStatistics: Could not find statistics case with ID %1." ).arg( caseId );
QString( "computeCaseGroupStatistics: Could not find statistics case with ID %1." ).arg( caseId );
RiaLogging::warning( warning ); RiaLogging::warning( warning );
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning ); response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );

View File

@ -34,8 +34,7 @@ CAF_PDM_SOURCE_INIT( RicfCreateGridCaseGroupResult, "createGridCaseGroupResult"
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RicfCreateGridCaseGroupResult::RicfCreateGridCaseGroupResult( int caseGroupId /*= -1*/, RicfCreateGridCaseGroupResult::RicfCreateGridCaseGroupResult( int caseGroupId /*= -1*/, const QString& caseGroupName /*= ""*/ )
const QString& caseGroupName /*= ""*/ )
{ {
CAF_PDM_InitObject( "case_group_result" ); CAF_PDM_InitObject( "case_group_result" );
CAF_PDM_InitField( &this->caseGroupId, "groupId", caseGroupId, "" ); CAF_PDM_InitField( &this->caseGroupId, "groupId", caseGroupId, "" );

View File

@ -72,8 +72,7 @@ caf::PdmScriptResponse RicfCreateLgrForCompletions::execute()
wellPaths = TOOLS::wellPathsFromNames( TOOLS::toQStringList( m_wellPathNames ), &wellsNotFound ); wellPaths = TOOLS::wellPathsFromNames( TOOLS::toQStringList( m_wellPathNames ), &wellsNotFound );
if ( !wellsNotFound.empty() ) if ( !wellsNotFound.empty() )
{ {
QString error = QString( "createLgrForCompletions: These well paths were not found: " ) + QString error = QString( "createLgrForCompletions: These well paths were not found: " ) + wellsNotFound.join( ", " );
wellsNotFound.join( ", " );
RiaLogging::error( error ); RiaLogging::error( error );
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error ); return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
} }
@ -87,8 +86,7 @@ caf::PdmScriptResponse RicfCreateLgrForCompletions::execute()
} }
caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance(); caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance();
auto feature = dynamic_cast<RicCreateTemporaryLgrFeature*>( auto feature = dynamic_cast<RicCreateTemporaryLgrFeature*>( commandManager->getCommandFeature( "RicCreateTemporaryLgrFeature" ) );
commandManager->getCommandFeature( "RicCreateTemporaryLgrFeature" ) );
RimEclipseCase* eclipseCase = nullptr; RimEclipseCase* eclipseCase = nullptr;
{ {

View File

@ -93,8 +93,7 @@ caf::PdmScriptResponse RicfCreateMultipleFractures::execute()
wellPaths = TOOLS::wellPathsFromNames( TOOLS::toQStringList( m_wellPathNames ), &wellsNotFound ); wellPaths = TOOLS::wellPathsFromNames( TOOLS::toQStringList( m_wellPathNames ), &wellsNotFound );
if ( !wellsNotFound.empty() ) if ( !wellsNotFound.empty() )
{ {
QString error = QString error = QString( "createMultipleFractures: These well paths were not found: %1" ).arg( wellsNotFound.join( ", " ) );
QString( "createMultipleFractures: These well paths were not found: %1" ).arg( wellsNotFound.join( ", " ) );
RiaLogging::error( error ); RiaLogging::error( error );
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error ); return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
} }
@ -109,8 +108,7 @@ caf::PdmScriptResponse RicfCreateMultipleFractures::execute()
if ( !fractureTemplate ) if ( !fractureTemplate )
{ {
QString error = QString error = QString( "createMultipleFractures: Could not find fracture template with ID %1" ).arg( m_templateId );
QString( "createMultipleFractures: Could not find fracture template with ID %1" ).arg( m_templateId );
RiaLogging::error( error ); RiaLogging::error( error );
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error ); return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
} }
@ -131,8 +129,8 @@ caf::PdmScriptResponse RicfCreateMultipleFractures::execute()
RicCreateMultipleFracturesOptionItemUi* options = new RicCreateMultipleFracturesOptionItemUi(); RicCreateMultipleFracturesOptionItemUi* options = new RicCreateMultipleFracturesOptionItemUi();
caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance(); caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance();
auto feature = dynamic_cast<RicCreateMultipleFracturesFeature*>( auto feature =
commandManager->getCommandFeature( "RicCreateMultipleFracturesFeature" ) ); dynamic_cast<RicCreateMultipleFracturesFeature*>( commandManager->getCommandFeature( "RicCreateMultipleFracturesFeature" ) );
// Default layers // Default layers
int topLayer = m_topLayer; int topLayer = m_topLayer;

View File

@ -91,8 +91,8 @@ caf::PdmScriptResponse RicfCreateWellBoreStabilityPlotFeature::execute()
{ {
if ( !chosenWellPath->wellPathGeometry() ) if ( !chosenWellPath->wellPathGeometry() )
{ {
QString error = QString( "The well path %1 has no geometry. Cannot create a Well Bore Stability Plot" ) QString error =
.arg( chosenWellPath->name() ); QString( "The well path %1 has no geometry. Cannot create a Well Bore Stability Plot" ).arg( chosenWellPath->name() );
RiaLogging::error( error ); RiaLogging::error( error );
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error ); return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
} }

View File

@ -71,8 +71,7 @@ caf::PdmScriptResponse RicfExportLgrForCompletions::execute()
wellPaths = TOOLS::wellPathsFromNames( TOOLS::toQStringList( m_wellPathNames ), &wellsNotFound ); wellPaths = TOOLS::wellPathsFromNames( TOOLS::toQStringList( m_wellPathNames ), &wellsNotFound );
if ( !wellsNotFound.empty() ) if ( !wellsNotFound.empty() )
{ {
QString error( QString( "exportLgrForCompletions: These well paths were not found: " ) + QString error( QString( "exportLgrForCompletions: These well paths were not found: " ) + wellsNotFound.join( ", " ) );
wellsNotFound.join( ", " ) );
RiaLogging::error( error ); RiaLogging::error( error );
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error ); return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
} }
@ -92,7 +91,7 @@ caf::PdmScriptResponse RicfExportLgrForCompletions::execute()
} }
caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance(); caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance();
auto feature = dynamic_cast<RicExportLgrFeature*>( commandManager->getCommandFeature( "RicExportLgrFeature" ) ); auto feature = dynamic_cast<RicExportLgrFeature*>( commandManager->getCommandFeature( "RicExportLgrFeature" ) );
RimEclipseCase* eclipseCase = TOOLS::caseFromId( m_caseId() ); RimEclipseCase* eclipseCase = TOOLS::caseFromId( m_caseId() );
if ( !eclipseCase ) if ( !eclipseCase )
@ -119,10 +118,8 @@ caf::PdmScriptResponse RicfExportLgrForCompletions::execute()
caf::PdmScriptResponse response; caf::PdmScriptResponse response;
if ( !wellsIntersectingOtherLgrs.empty() ) if ( !wellsIntersectingOtherLgrs.empty() )
{ {
auto wellsList = wellsIntersectingOtherLgrs.join( ", " ); auto wellsList = wellsIntersectingOtherLgrs.join( ", " );
QString warning( QString warning( "exportLgrForCompletions: No export for some wells due to existing intersecting LGR(s).Affected wells : " + wellsList );
"exportLgrForCompletions: No export for some wells due to existing intersecting LGR(s).Affected wells : " +
wellsList );
RiaLogging::warning( warning ); RiaLogging::warning( warning );
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning ); response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
} }

View File

@ -70,8 +70,7 @@ caf::PdmScriptResponse RicfExportMsw::execute()
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error ); return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
} }
QString exportFolder = QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::COMPLETIONS );
RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::COMPLETIONS );
if ( exportFolder.isNull() ) if ( exportFolder.isNull() )
{ {
exportFolder = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath( "completions" ); exportFolder = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath( "completions" );

View File

@ -67,8 +67,7 @@ caf::PdmScriptResponse RicfExportMultiCaseSnapshots::execute()
std::vector<QString> listFileNames = RiaApplication::readFileListFromTextFile( m_gridListFile() ); std::vector<QString> listFileNames = RiaApplication::readFileListFromTextFile( m_gridListFile() );
app->runMultiCaseSnapshots( lastProjectPath, app->runMultiCaseSnapshots( lastProjectPath,
listFileNames, listFileNames,
RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::SNAPSHOTS ) );
RicfCommandFileExecutor::ExportType::SNAPSHOTS ) );
return caf::PdmScriptResponse(); return caf::PdmScriptResponse();
} }

View File

@ -97,8 +97,7 @@ caf::PdmScriptResponse RicfExportProperty::execute()
QString filePath = m_exportFileName; QString filePath = m_exportFileName;
if ( filePath.isNull() ) if ( filePath.isNull() )
{ {
QDir propertiesDir( QDir propertiesDir( RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::PROPERTIES ) );
RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::PROPERTIES ) );
QString fileName = QString( "%1-%2" ).arg( eclipseCase->caseUserDescription() ).arg( m_propertyName ); QString fileName = QString( "%1-%2" ).arg( eclipseCase->caseUserDescription() ).arg( m_propertyName );
fileName = caf::Utils::makeValidFileBasename( fileName ); fileName = caf::Utils::makeValidFileBasename( fileName );
filePath = propertiesDir.filePath( fileName ); filePath = propertiesDir.filePath( fileName );

View File

@ -128,24 +128,19 @@ caf::PdmScriptResponse RicfExportPropertyInViews::execute()
if ( resultAccessor.isNull() ) if ( resultAccessor.isNull() )
{ {
QString warning = QString warning = QString( "exportProperty: Could not find property. Case ID %1, time step %2, property '%3'" )
QString( "exportProperty: Could not find property. Case ID %1, time step %2, property '%3'" ) .arg( m_caseId )
.arg( m_caseId ) .arg( view->currentTimeStep() )
.arg( view->currentTimeStep() ) .arg( propertyName );
.arg( propertyName );
RiaLogging::warning( warning ); RiaLogging::warning( warning );
response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning ); response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning );
continue; continue;
} }
QDir propertiesDir( QDir propertiesDir( RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::PROPERTIES ) );
RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::PROPERTIES ) );
QString fileName = QString( "%1-%2-T%3-%4" ) QString fileName =
.arg( eclipseCase->caseUserDescription() ) QString( "%1-%2-T%3-%4" ).arg( eclipseCase->caseUserDescription() ).arg( view->name() ).arg( view->currentTimeStep() ).arg( propertyName );
.arg( view->name() )
.arg( view->currentTimeStep() )
.arg( propertyName );
fileName = caf::Utils::makeValidFileBasename( fileName ); fileName = caf::Utils::makeValidFileBasename( fileName );
const QString filePath = propertiesDir.filePath( fileName ); const QString filePath = propertiesDir.filePath( fileName );

View File

@ -52,10 +52,7 @@ RicfExportSimWellFractureCompletions::RicfExportSimWellFractureCompletions()
CAF_PDM_InitScriptableField( &m_timeStep, "timeStep", -1, "Time Step Index" ); CAF_PDM_InitScriptableField( &m_timeStep, "timeStep", -1, "Time Step Index" );
CAF_PDM_InitScriptableField( &m_simWellNames, "simulationWellNames", std::vector<QString>(), "Simulation Well Names" ); CAF_PDM_InitScriptableField( &m_simWellNames, "simulationWellNames", std::vector<QString>(), "Simulation Well Names" );
CAF_PDM_InitScriptableField( &m_fileSplit, "fileSplit", RicExportCompletionDataSettingsUi::ExportSplitType(), "File Split" ); CAF_PDM_InitScriptableField( &m_fileSplit, "fileSplit", RicExportCompletionDataSettingsUi::ExportSplitType(), "File Split" );
CAF_PDM_InitScriptableField( &m_compdatExport, CAF_PDM_InitScriptableField( &m_compdatExport, "compdatExport", RicExportCompletionDataSettingsUi::CompdatExportType(), "Compdat Export" );
"compdatExport",
RicExportCompletionDataSettingsUi::CompdatExportType(),
"Compdat Export" );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -83,8 +80,7 @@ caf::PdmScriptResponse RicfExportSimWellFractureCompletions::execute()
exportSettings.caseToApply = eclipseCase; exportSettings.caseToApply = eclipseCase;
} }
QString exportFolder = QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::COMPLETIONS );
RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::COMPLETIONS );
if ( exportFolder.isNull() ) if ( exportFolder.isNull() )
{ {
exportFolder = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath( "completions" ); exportFolder = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath( "completions" );

View File

@ -87,13 +87,11 @@ caf::PdmScriptResponse RicfExportSnapshots::execute()
CVF_ASSERT( mainWnd ); CVF_ASSERT( mainWnd );
QByteArray curState = mainWnd->dockManager()->saveState( 0 ); QByteArray curState = mainWnd->dockManager()->saveState( 0 );
mainWnd->dockManager()->restoreState( mainWnd->dockManager()->restoreState( RiuDockWidgetTools::defaultDockState( RiuDockWidgetTools::dockStateHideAll3DWindowName() ) );
RiuDockWidgetTools::defaultDockState( RiuDockWidgetTools::dockStateHideAll3DWindowName() ) );
RiaGuiApplication::instance()->processEvents(); RiaGuiApplication::instance()->processEvents();
QString absolutePathToSnapshotDir = QString absolutePathToSnapshotDir = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::SNAPSHOTS );
RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::SNAPSHOTS );
if ( !m_exportFolder().isEmpty() ) if ( !m_exportFolder().isEmpty() )
{ {
@ -101,8 +99,7 @@ caf::PdmScriptResponse RicfExportSnapshots::execute()
} }
if ( absolutePathToSnapshotDir.isNull() ) if ( absolutePathToSnapshotDir.isNull() )
{ {
absolutePathToSnapshotDir = absolutePathToSnapshotDir = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath( "snapshots" );
RiaApplication::instance()->createAbsolutePathFromProjectRelativePath( "snapshots" );
} }
if ( m_type == RicfExportSnapshots::SnapshotsType::VIEWS || m_type == RicfExportSnapshots::SnapshotsType::ALL ) if ( m_type == RicfExportSnapshots::SnapshotsType::VIEWS || m_type == RicfExportSnapshots::SnapshotsType::ALL )
{ {
@ -113,10 +110,7 @@ caf::PdmScriptResponse RicfExportSnapshots::execute()
QApplication::processEvents(); QApplication::processEvents();
} }
RicSnapshotAllViewsToFileFeature::exportSnapshotOfViewsIntoFolder( absolutePathToSnapshotDir, RicSnapshotAllViewsToFileFeature::exportSnapshotOfViewsIntoFolder( absolutePathToSnapshotDir, m_prefix, m_caseId(), m_viewId() );
m_prefix,
m_caseId(),
m_viewId() );
} }
if ( m_type == RicfExportSnapshots::SnapshotsType::PLOTS || m_type == RicfExportSnapshots::SnapshotsType::ALL ) if ( m_type == RicfExportSnapshots::SnapshotsType::PLOTS || m_type == RicfExportSnapshots::SnapshotsType::ALL )
{ {
@ -134,11 +128,7 @@ caf::PdmScriptResponse RicfExportSnapshots::execute()
QString fileSuffix = ".png"; QString fileSuffix = ".png";
if ( m_plotOutputFormat == PlotOutputFormat::PDF ) fileSuffix = ".pdf"; if ( m_plotOutputFormat == PlotOutputFormat::PDF ) fileSuffix = ".pdf";
RicSnapshotAllPlotsToFileFeature::exportSnapshotOfPlotsIntoFolder( absolutePathToSnapshotDir, RicSnapshotAllPlotsToFileFeature::exportSnapshotOfPlotsIntoFolder( absolutePathToSnapshotDir, activateWidget, m_prefix, m_viewId(), fileSuffix );
activateWidget,
m_prefix,
m_viewId(),
fileSuffix );
} }
RiaGuiApplication::instance()->processEvents(); RiaGuiApplication::instance()->processEvents();

View File

@ -66,10 +66,7 @@ RicfExportVisibleCells::RicfExportVisibleCells()
CAF_PDM_InitScriptableField( &m_caseId, "caseId", -1, "Case ID" ); CAF_PDM_InitScriptableField( &m_caseId, "caseId", -1, "Case ID" );
CAF_PDM_InitScriptableField( &m_viewId, "viewId", -1, "View ID" ); CAF_PDM_InitScriptableField( &m_viewId, "viewId", -1, "View ID" );
CAF_PDM_InitScriptableField( &m_viewName, "viewName", QString(), "View Name" ); CAF_PDM_InitScriptableField( &m_viewName, "viewName", QString(), "View Name" );
CAF_PDM_InitScriptableField( &m_exportKeyword, CAF_PDM_InitScriptableField( &m_exportKeyword, "exportKeyword", caf::AppEnum<RicfExportVisibleCells::ExportKeyword>(), "Export Keyword" );
"exportKeyword",
caf::AppEnum<RicfExportVisibleCells::ExportKeyword>(),
"Export Keyword" );
CAF_PDM_InitScriptableField( &m_visibleActiveCellsValue, "visibleActiveCellsValue", 1, "Visible Active Cells Value" ); CAF_PDM_InitScriptableField( &m_visibleActiveCellsValue, "visibleActiveCellsValue", 1, "Visible Active Cells Value" );
CAF_PDM_InitScriptableField( &m_hiddenActiveCellsValue, "hiddenActiveCellsValue", 0, "Hidden Active Cells Value" ); CAF_PDM_InitScriptableField( &m_hiddenActiveCellsValue, "hiddenActiveCellsValue", 0, "Hidden Active Cells Value" );
CAF_PDM_InitScriptableField( &m_inactiveCellsValue, "inactiveCellsValue", 0, "Inactive Cells Value" ); CAF_PDM_InitScriptableField( &m_inactiveCellsValue, "inactiveCellsValue", 0, "Inactive Cells Value" );
@ -97,10 +94,8 @@ caf::PdmScriptResponse RicfExportVisibleCells::execute()
} }
if ( !eclipseView ) if ( !eclipseView )
{ {
QString error( QString( "exportVisibleCells: Could not find view of id %1 or named '%2' in case ID %3" ) QString error(
.arg( m_viewId ) QString( "exportVisibleCells: Could not find view of id %1 or named '%2' in case ID %3" ).arg( m_viewId ).arg( m_viewName ).arg( m_caseId ) );
.arg( m_viewName )
.arg( m_caseId ) );
RiaLogging::error( error ); RiaLogging::error( error );
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error ); return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error );
} }
@ -123,8 +118,7 @@ caf::PdmScriptResponse RicfExportVisibleCells::execute()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicfExportVisibleCells::buildExportSettings( const QString& exportFolder, void RicfExportVisibleCells::buildExportSettings( const QString& exportFolder, RicSaveEclipseInputVisibleCellsUi* exportSettings )
RicSaveEclipseInputVisibleCellsUi* exportSettings )
{ {
QDir baseDir( exportFolder ); QDir baseDir( exportFolder );
exportSettings->exportFilename = baseDir.absoluteFilePath( QString( "%1.grdecl" ).arg( m_exportKeyword().text() ) ); exportSettings->exportFilename = baseDir.absoluteFilePath( QString( "%1.grdecl" ).arg( m_exportKeyword().text() ) );

View File

@ -92,10 +92,7 @@ caf::PdmScriptResponse RicfExportWellLogPlotData::execute()
if ( m_format() == ExportFormat::ASCII ) if ( m_format() == ExportFormat::ASCII )
{ {
QString validFileName = QString validFileName =
RicAsciiExportWellLogPlotFeature::makeValidExportFileName( plot, RicAsciiExportWellLogPlotFeature::makeValidExportFileName( plot, m_folder(), m_filePrefix(), m_capitalizeFileNames() );
m_folder(),
m_filePrefix(),
m_capitalizeFileNames() );
if ( RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot( validFileName, plot ) ) if ( RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot( validFileName, plot ) )
{ {
result->exportedFiles.v().push_back( validFileName ); result->exportedFiles.v().push_back( validFileName );
@ -103,24 +100,21 @@ caf::PdmScriptResponse RicfExportWellLogPlotData::execute()
} }
else else
{ {
std::vector<QString> exportedFiles = std::vector<QString> exportedFiles = RicExportToLasFileFeature::exportToLasFiles( m_folder(),
RicExportToLasFileFeature::exportToLasFiles( m_folder(), m_filePrefix(),
m_filePrefix(), plot,
plot, m_exportTvdRkb(),
m_exportTvdRkb(), m_capitalizeFileNames(),
m_capitalizeFileNames(), true,
true, m_resampleInterval(),
m_resampleInterval(), m_convertCurveUnits() );
m_convertCurveUnits() );
if ( exportedFiles.empty() ) if ( exportedFiles.empty() )
{ {
errorMessages << QString( "No files exported for '%1'" ).arg( plot->description() ); errorMessages << QString( "No files exported for '%1'" ).arg( plot->description() );
} }
else else
{ {
result->exportedFiles.v().insert( result->exportedFiles.v().end(), result->exportedFiles.v().insert( result->exportedFiles.v().end(), exportedFiles.begin(), exportedFiles.end() );
exportedFiles.begin(),
exportedFiles.end() );
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show More