mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor : Several fixes by clang-tidy and use of clang compiler
This commit is contained in:
parent
b01569869a
commit
d754ef4705
@ -87,13 +87,14 @@ void RicNewAnalysisPlotFeature::onActionTriggered( bool isChecked )
|
||||
newPlot = analysisPlotColl->createAnalysisPlot( ensemble, quantityName, timeStep );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if ( !newPlot && analysisPlotColl )
|
||||
{
|
||||
newPlot = analysisPlotColl->createAnalysisPlot();
|
||||
}
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
analysisPlotColl->updateConnectedEditors();
|
||||
if ( analysisPlotColl ) analysisPlotColl->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindowTools::setExpanded( newPlot );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( newPlot );
|
||||
|
@ -46,7 +46,6 @@ bool RicNewPolygonFilter3dviewFeature::isCommandEnabled()
|
||||
void RicNewPolygonFilter3dviewFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
// Get the selected Cell Filter Collection
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
RimGridView* viewOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
|
||||
RimCellFilterCollection* filtColl = viewOrComparisonView->cellFilterCollection();
|
||||
|
||||
|
@ -90,14 +90,15 @@ void RicNewCorrelationMatrixPlotFeature::onActionTriggered( bool isChecked )
|
||||
newPlot = correlationPlotColl->createCorrelationMatrixPlot( ensemble, includedQuantityNames, timeStep );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if ( !newPlot && correlationPlotColl )
|
||||
{
|
||||
newPlot = correlationPlotColl->createCorrelationMatrixPlot();
|
||||
}
|
||||
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
correlationPlotColl->updateConnectedEditors();
|
||||
if ( correlationPlotColl ) correlationPlotColl->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindowTools::setExpanded( newPlot );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( newPlot );
|
||||
|
@ -85,14 +85,15 @@ void RicNewCorrelationPlotFeature::onActionTriggered( bool isChecked )
|
||||
newPlot = correlationPlotColl->createCorrelationPlot( ensemble, quantityName, timeStep );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if ( !newPlot && correlationPlotColl )
|
||||
{
|
||||
newPlot = correlationPlotColl->createCorrelationPlot();
|
||||
}
|
||||
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
correlationPlotColl->updateConnectedEditors();
|
||||
if ( correlationPlotColl ) correlationPlotColl->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindowTools::setExpanded( newPlot );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( newPlot );
|
||||
|
@ -92,13 +92,14 @@ void RicNewCorrelationReportPlotFeature::onActionTriggered( bool isChecked )
|
||||
timeStep );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if ( !newPlot && correlationPlotColl )
|
||||
{
|
||||
newPlot = correlationPlotColl->createCorrelationReportPlot();
|
||||
}
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
correlationPlotColl->updateConnectedEditors();
|
||||
if ( correlationPlotColl ) correlationPlotColl->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindowTools::setExpanded( newPlot );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( newPlot );
|
||||
|
@ -95,14 +95,15 @@ void RicNewParameterResultCrossPlotFeature::onActionTriggered( bool isChecked )
|
||||
correlationPlotColl->createParameterResultCrossPlot( ensemble, ensembleParameter, quantityName, timeStep );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if ( !newPlot && correlationPlotColl )
|
||||
{
|
||||
newPlot = correlationPlotColl->createParameterResultCrossPlot();
|
||||
}
|
||||
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
correlationPlotColl->updateConnectedEditors();
|
||||
if ( correlationPlotColl ) correlationPlotColl->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindowTools::setExpanded( newPlot );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( newPlot );
|
||||
|
@ -73,7 +73,7 @@ void RicImportEclipseCasesFeature::onActionTriggered( bool isChecked )
|
||||
RiaImportEclipseCaseTools::FileCaseIdMap newCaseFiles;
|
||||
RiaImportEclipseCaseTools::openEclipseCasesFromFile( result.files, &newCaseFiles );
|
||||
|
||||
for ( const auto newCaseFileAndId : newCaseFiles )
|
||||
for ( const auto& newCaseFileAndId : newCaseFiles )
|
||||
{
|
||||
RiaApplication::instance()->addToRecentFiles( newCaseFileAndId.first );
|
||||
}
|
||||
|
@ -114,10 +114,11 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre
|
||||
if ( writeProjectInfo )
|
||||
{
|
||||
formatter.comment( "Project: " + RimProject::current()->fileName );
|
||||
stream << endl;
|
||||
stream << "\n";
|
||||
}
|
||||
|
||||
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename( exportName ) << "'" << endl;
|
||||
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename( exportName ) << "'"
|
||||
<< "\n";
|
||||
|
||||
auto numberFormat = RifTextDataTableDoubleFormatting( RIF_FLOAT, 2 );
|
||||
formatter.header( { { "X", numberFormat, RIGHT },
|
||||
@ -136,7 +137,8 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre
|
||||
}
|
||||
formatter.tableCompleted( "", false );
|
||||
|
||||
stream << -999 << endl << endl;
|
||||
stream << -999 << "\n"
|
||||
<< "\n";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -33,6 +33,8 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSnapshotFilenameGenerator::generateSnapshotFileName( RimViewWindow* viewWindow )
|
||||
{
|
||||
if ( !viewWindow ) return {};
|
||||
|
||||
{
|
||||
Rim3dView* view = dynamic_cast<Rim3dView*>( viewWindow );
|
||||
if ( view != nullptr )
|
||||
|
@ -85,6 +85,7 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells( Rim
|
||||
}
|
||||
|
||||
CVF_ASSERT( selectedWell );
|
||||
if ( !selectedWell ) return;
|
||||
|
||||
RimEclipseResultCase* eclipseResultCase = nullptr;
|
||||
selectedWell->firstAncestorOrThisOfTypeAsserted( eclipseResultCase );
|
||||
@ -101,7 +102,8 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells( Rim
|
||||
|
||||
RimFlowDiagSolution::TracerStatusType tracerStatus =
|
||||
flowDiagSolution->tracerStatusInTimeStep( selectedWell->name(), timeStep );
|
||||
if ( !( tracerStatus == RimFlowDiagSolution::INJECTOR || tracerStatus == RimFlowDiagSolution::PRODUCER ) )
|
||||
if ( !( tracerStatus == RimFlowDiagSolution::TracerStatusType::INJECTOR ||
|
||||
tracerStatus == RimFlowDiagSolution::TracerStatusType::PRODUCER ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -113,10 +115,10 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells( Rim
|
||||
|
||||
switch ( tracerStatus )
|
||||
{
|
||||
case RimFlowDiagSolution::PRODUCER:
|
||||
case RimFlowDiagSolution::TracerStatusType::PRODUCER:
|
||||
viewToModify->cellResult()->setFlowDiagTracerSelectionType( RimEclipseResultDefinition::FLOW_TR_INJECTORS );
|
||||
break;
|
||||
case RimFlowDiagSolution::INJECTOR:
|
||||
case RimFlowDiagSolution::TracerStatusType::INJECTOR:
|
||||
viewToModify->cellResult()->setFlowDiagTracerSelectionType( RimEclipseResultDefinition::FLOW_TR_PRODUCERS );
|
||||
break;
|
||||
|
||||
@ -184,16 +186,16 @@ std::vector<QString>
|
||||
|
||||
if ( flowDiagSolution && simWellData->hasWellResult( timeStep ) )
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType requestedTracerType = RimFlowDiagSolution::UNDEFINED;
|
||||
RimFlowDiagSolution::TracerStatusType requestedTracerType = RimFlowDiagSolution::TracerStatusType::UNDEFINED;
|
||||
|
||||
const RigWellResultFrame::WellProductionType prodType = simWellData->wellProductionType( timeStep );
|
||||
if ( prodType == RigWellResultFrame::PRODUCER || prodType == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE )
|
||||
{
|
||||
requestedTracerType = RimFlowDiagSolution::INJECTOR;
|
||||
requestedTracerType = RimFlowDiagSolution::TracerStatusType::INJECTOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
requestedTracerType = RimFlowDiagSolution::PRODUCER;
|
||||
requestedTracerType = RimFlowDiagSolution::TracerStatusType::PRODUCER;
|
||||
}
|
||||
|
||||
std::vector<QString> tracerNames = flowDiagSolution->tracerNames();
|
||||
|
@ -60,8 +60,8 @@ void RicNewStimPlanModelTemplateFeature::onActionTriggered( bool isChecked )
|
||||
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>( RiaApplication::instance()->activeGridView() );
|
||||
if ( activeView )
|
||||
{
|
||||
RimEclipseCase* eclipseCase = eclipseCase = activeView->eclipseCase();
|
||||
int timeStep = activeView->currentTimeStep();
|
||||
RimEclipseCase* eclipseCase = activeView->eclipseCase();
|
||||
int timeStep = activeView->currentTimeStep();
|
||||
stimPlanModelTemplate->setDynamicEclipseCase( eclipseCase );
|
||||
stimPlanModelTemplate->setTimeStep( timeStep );
|
||||
stimPlanModelTemplate->setStaticEclipseCase( eclipseCase );
|
||||
|
@ -60,6 +60,7 @@ bool RicContourMapPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
||||
|
||||
RimGridView* view = nullptr;
|
||||
contourMap->firstAncestorOrThisOfTypeAsserted( view );
|
||||
if ( !view ) return false;
|
||||
|
||||
cvf::Vec2d pickedPoint;
|
||||
double valueAtPoint = 0.0;
|
||||
@ -82,7 +83,7 @@ bool RicContourMapPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
||||
{
|
||||
geoMechContourView->updatePickPointAndRedraw();
|
||||
}
|
||||
else
|
||||
else if ( eclipseContourView )
|
||||
{
|
||||
eclipseContourView->updatePickPointAndRedraw();
|
||||
}
|
||||
@ -90,6 +91,7 @@ bool RicContourMapPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
||||
}
|
||||
contourMap->setPickPoint( cvf::Vec2d::UNDEFINED );
|
||||
view->updateDisplayModelForCurrentTimeStepAndRedraw();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimColorLegend;
|
||||
class RimFormationNames;
|
||||
class Rim3dView;
|
||||
|
||||
@ -34,7 +33,6 @@ class RicImportFormationNamesFeature : public caf::CmdFeature
|
||||
static RimFormationNames* importFormationFiles( const QStringList& fileNames );
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
@ -43,7 +41,4 @@ private:
|
||||
static void addCustomColorLegend( QString& name, RimFormationNames* formationNames );
|
||||
|
||||
void setFormationCellResultAndLegend( Rim3dView* activeView, QString& legendName );
|
||||
|
||||
private:
|
||||
RimColorLegend* m_lastCustomColorLegendCreated;
|
||||
};
|
||||
|
@ -233,7 +233,7 @@ bool RicImportGeneralDataFeature::openEclipseCaseFromFileNames( const QStringLis
|
||||
RiaImportEclipseCaseTools::FileCaseIdMap newCaseFiles;
|
||||
if ( RiaImportEclipseCaseTools::openEclipseCasesFromFile( fileNames, &newCaseFiles ) )
|
||||
{
|
||||
for ( const auto newCaseFileAndId : newCaseFiles )
|
||||
for ( const auto& newCaseFileAndId : newCaseFiles )
|
||||
{
|
||||
RiaApplication::instance()->addToRecentFiles( newCaseFileAndId.first );
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ void RicNewContourMapViewFeature::onActionTriggered( bool isChecked )
|
||||
if ( geoMechCase )
|
||||
{
|
||||
geoMechCase->updateConnectedEditors();
|
||||
eclipseContourMap->cellFilterCollection()->setCase( geoMechCase );
|
||||
geoMechContourMap->cellFilterCollection()->setCase( geoMechCase );
|
||||
caf::SelectionManager::instance()->setSelectedItem( geoMechContourMap );
|
||||
geoMechContourMap->createDisplayModelAndRedraw();
|
||||
geoMechContourMap->zoomAll();
|
||||
|
@ -101,7 +101,7 @@ Rim3dView* RicNewViewFeature::createReservoirView( RimEclipseCase* eclipseCase,
|
||||
}
|
||||
|
||||
// Must be run before buildViewItems, as wells are created in this function
|
||||
insertedView->loadDataAndUpdate();
|
||||
if ( insertedView ) insertedView->loadDataAndUpdate();
|
||||
|
||||
if ( eclipseCase )
|
||||
{
|
||||
|
@ -846,7 +846,7 @@ void sortStringsByLength( QStringList& strings, bool ascending /*= true*/ )
|
||||
{
|
||||
int s0 = strings[i].size();
|
||||
int s1 = strings[i + 1].size();
|
||||
if ( ascending && s0 > s1 || !ascending && s0 < s1 )
|
||||
if ( ( ascending && s0 > s1 ) || ( !ascending && s0 < s1 ) )
|
||||
{
|
||||
const QString temp = strings[i];
|
||||
strings[i] = strings[i + 1];
|
||||
|
@ -219,7 +219,7 @@ RicSummaryCaseRestartDialogResult RicSummaryCaseRestartDialog::openDialog( const
|
||||
QWidget* parent )
|
||||
{
|
||||
RicSummaryCaseRestartDialogResult dialogResult;
|
||||
if ( lastResult && lastResult->applyToAll && lastResult->summaryImportOption != SEPARATE_CASES )
|
||||
if ( lastResult && lastResult->applyToAll && lastResult->summaryImportOption != ImportOptions::SEPARATE_CASES )
|
||||
{
|
||||
dialogResult = *lastResult;
|
||||
dialogResult.summaryFiles.clear();
|
||||
@ -279,11 +279,12 @@ RicSummaryCaseRestartDialogResult RicSummaryCaseRestartDialog::openDialog( const
|
||||
if ( originFileInfos.empty() && !hasWarnings )
|
||||
{
|
||||
return RicSummaryCaseRestartDialogResult( RicSummaryCaseRestartDialogResult::SUMMARY_OK,
|
||||
NOT_IMPORT,
|
||||
NOT_IMPORT,
|
||||
ImportOptions::NOT_IMPORT,
|
||||
ImportOptions::NOT_IMPORT,
|
||||
QStringList( { initialSummaryFile } ),
|
||||
QStringList( { initialGridFile } ),
|
||||
useFirstSummaryCaseAsTemplate || lastResult->applyToAll );
|
||||
useFirstSummaryCaseAsTemplate ||
|
||||
( lastResult && lastResult->applyToAll ) );
|
||||
}
|
||||
|
||||
if ( lastResult && lastResult->applyToAll )
|
||||
@ -398,15 +399,15 @@ RicSummaryCaseRestartDialogResult RicSummaryCaseRestartDialog::openDialog( const
|
||||
if ( dialogResult.status != RicSummaryCaseRestartDialogResult::SUMMARY_OK )
|
||||
{
|
||||
return RicSummaryCaseRestartDialogResult( dialogResult.status,
|
||||
NOT_IMPORT,
|
||||
NOT_IMPORT,
|
||||
ImportOptions::NOT_IMPORT,
|
||||
ImportOptions::NOT_IMPORT,
|
||||
QStringList(),
|
||||
QStringList(),
|
||||
false );
|
||||
}
|
||||
|
||||
dialogResult.summaryFiles.push_back( RiaFilePathTools::toInternalSeparator( initialSummaryFile ) );
|
||||
if ( dialogResult.summaryImportOption == SEPARATE_CASES )
|
||||
if ( dialogResult.summaryImportOption == ImportOptions::SEPARATE_CASES )
|
||||
{
|
||||
for ( const auto& ofi : originFileInfos )
|
||||
{
|
||||
@ -418,7 +419,7 @@ RicSummaryCaseRestartDialogResult RicSummaryCaseRestartDialog::openDialog( const
|
||||
{
|
||||
dialogResult.gridFiles.push_back( initialGridFile );
|
||||
|
||||
if ( dialogResult.gridImportOption == SEPARATE_CASES )
|
||||
if ( dialogResult.gridImportOption == ImportOptions::SEPARATE_CASES )
|
||||
{
|
||||
for ( const auto& ofi : originFileInfos )
|
||||
{
|
||||
@ -435,8 +436,9 @@ RicSummaryCaseRestartDialogResult RicSummaryCaseRestartDialog::openDialog( const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCaseRestartDialog::ImportOptions RicSummaryCaseRestartDialog::selectedSummaryImportOption() const
|
||||
{
|
||||
return m_summaryReadAllBtn->isChecked() ? IMPORT_ALL
|
||||
: m_summarySeparateCasesBtn->isChecked() ? SEPARATE_CASES : NOT_IMPORT;
|
||||
return m_summaryReadAllBtn->isChecked()
|
||||
? ImportOptions::IMPORT_ALL
|
||||
: m_summarySeparateCasesBtn->isChecked() ? ImportOptions::SEPARATE_CASES : ImportOptions::NOT_IMPORT;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -444,7 +446,7 @@ RicSummaryCaseRestartDialog::ImportOptions RicSummaryCaseRestartDialog::selected
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCaseRestartDialog::ImportOptions RicSummaryCaseRestartDialog::selectedGridImportOption() const
|
||||
{
|
||||
return m_gridSeparateCasesBtn->isChecked() ? SEPARATE_CASES : NOT_IMPORT;
|
||||
return m_gridSeparateCasesBtn->isChecked() ? ImportOptions::SEPARATE_CASES : ImportOptions::NOT_IMPORT;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -462,7 +464,7 @@ void RicSummaryCaseRestartDialog::updateFileListWidget( QGridLayout* gridLayout,
|
||||
{
|
||||
// Remove current items
|
||||
QLayoutItem* item;
|
||||
while ( item = gridLayout->takeAt( 0 ) )
|
||||
while ( ( item = gridLayout->takeAt( 0 ) ) )
|
||||
{
|
||||
gridLayout->removeItem( item );
|
||||
delete item->widget();
|
||||
|
@ -56,7 +56,7 @@ class RicSummaryCaseRestartDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum ImportOptions
|
||||
enum class ImportOptions
|
||||
{
|
||||
IMPORT_ALL,
|
||||
SEPARATE_CASES,
|
||||
@ -136,8 +136,8 @@ public:
|
||||
};
|
||||
RicSummaryCaseRestartDialogResult( Status _status = SUMMARY_ERROR )
|
||||
: status( _status )
|
||||
, summaryImportOption( RicSummaryCaseRestartDialog::IMPORT_ALL )
|
||||
, gridImportOption( RicSummaryCaseRestartDialog::NOT_IMPORT )
|
||||
, summaryImportOption( RicSummaryCaseRestartDialog::ImportOptions::IMPORT_ALL )
|
||||
, gridImportOption( RicSummaryCaseRestartDialog::ImportOptions::NOT_IMPORT )
|
||||
, applyToAll( false )
|
||||
{
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
|
||||
RiaDefines::ThemeEnum theme = RiaGuiApplication::instance()->preferences()->guiTheme();
|
||||
|
||||
QDialog* dialog = new QDialog( RiuMainWindow::instance() );
|
||||
connect( dialog, &QDialog::close, [this, theme]() { RiuGuiTheme::updateGuiTheme( theme ); } );
|
||||
connect( dialog, &QDialog::close, [theme]() { RiuGuiTheme::updateGuiTheme( theme ); } );
|
||||
dialog->setModal( false );
|
||||
dialog->setWindowTitle( "Theme Color Editor Dialog" );
|
||||
|
||||
@ -89,13 +89,12 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
|
||||
completer->setCaseSensitivity( Qt::CaseInsensitive );
|
||||
completer->setWrapAround( false );
|
||||
editor->setCompleter( completer );
|
||||
QssSyntaxHighligter* highlighter = new QssSyntaxHighligter( editor->document() );
|
||||
|
||||
auto generateColorFields = [themeSelector, widget, editor, completer, this]() -> void {
|
||||
auto generateColorFields = [themeSelector, widget, editor]() -> void {
|
||||
QLayoutItem* item;
|
||||
if ( widget->layout() )
|
||||
{
|
||||
while ( ( item = widget->layout()->takeAt( 0 ) ) != NULL )
|
||||
while ( ( item = widget->layout()->takeAt( 0 ) ) != nullptr )
|
||||
{
|
||||
delete item->widget();
|
||||
delete item;
|
||||
@ -108,7 +107,7 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
|
||||
RiaDefines::ThemeEnum theme = static_cast<RiaDefines::ThemeEnum>( themeSelector->currentData().toInt() );
|
||||
QMap<QString, QString> variableValueMap = RiuGuiTheme::getVariableValueMap( theme );
|
||||
QMap<QString, QString> variableGuiTextMap = RiuGuiTheme::getVariableGuiTextMap( theme );
|
||||
for ( const QString variableName : variableValueMap.keys() )
|
||||
for ( const QString& variableName : variableValueMap.keys() )
|
||||
{
|
||||
innerLayout->addWidget( new QLabel( !variableGuiTextMap[variableName].isEmpty() ? variableGuiTextMap[variableName]
|
||||
: variableName ),
|
||||
@ -118,7 +117,7 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
|
||||
colorBox->setStyleSheet( QString( "background-color: %0;" ).arg( variableValueMap.value( variableName ) ) );
|
||||
connect( colorBox,
|
||||
&QPushButton::clicked,
|
||||
[this, variableValueMap, variableName, theme, editor, widget, colorBox]() -> void {
|
||||
[variableValueMap, variableName, theme, editor, widget, colorBox]() -> void {
|
||||
QColor color = QColorDialog::getColor( colorBox->palette().color( QPalette::Button ), widget );
|
||||
if ( color.isValid() )
|
||||
{
|
||||
@ -160,7 +159,7 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
QPushButton* button = new QPushButton( "Apply style sheet changes" );
|
||||
layout->addWidget( button, 6, 1 );
|
||||
connect( button, &QPushButton::clicked, [this, themeSelector, editor, generateColorFields]() {
|
||||
connect( button, &QPushButton::clicked, [themeSelector, editor, generateColorFields]() {
|
||||
RiaDefines::ThemeEnum theme = static_cast<RiaDefines::ThemeEnum>( themeSelector->currentData().toInt() );
|
||||
RiuGuiTheme::writeStyleSheetToFile( theme, editor->toPlainText() );
|
||||
generateColorFields();
|
||||
|
@ -79,7 +79,7 @@ bool RicWellLogTools::wellHasRftData( const QString& wellName )
|
||||
|
||||
for ( RimCase* rimCase : cases )
|
||||
{
|
||||
if ( resultCase = dynamic_cast<RimEclipseResultCase*>( rimCase ) )
|
||||
if ( ( resultCase = dynamic_cast<RimEclipseResultCase*>( rimCase ) ) )
|
||||
{
|
||||
if ( resultCase->rftReader() )
|
||||
{
|
||||
@ -316,7 +316,7 @@ RimWellLogRftCurve*
|
||||
|
||||
for ( RimCase* rimCase : cases )
|
||||
{
|
||||
if ( resultCase = dynamic_cast<RimEclipseResultCase*>( rimCase ) )
|
||||
if ( ( resultCase = dynamic_cast<RimEclipseResultCase*>( rimCase ) ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -52,12 +52,14 @@ void RicEditSummaryPlotFeature::closeDialogAndResetTargetPlot()
|
||||
{
|
||||
auto dialog = RicEditSummaryPlotFeature::curveCreatorDialog();
|
||||
|
||||
if ( dialog && dialog->isVisible() )
|
||||
if ( dialog )
|
||||
{
|
||||
dialog->hide();
|
||||
if ( dialog->isVisible() )
|
||||
{
|
||||
dialog->hide();
|
||||
}
|
||||
dialog->updateFromSummaryPlot( nullptr );
|
||||
}
|
||||
|
||||
dialog->updateFromSummaryPlot( nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -191,6 +191,16 @@ QString RicNewGridTimeHistoryCurveFeature::suggestedNewPlotName()
|
||||
case RIG_ELEMENT:
|
||||
posName = "E";
|
||||
break;
|
||||
case RIG_ELEMENT_NODAL_FACE:
|
||||
break;
|
||||
case RIG_FORMATION_NAMES:
|
||||
break;
|
||||
case RIG_WELLPATH_DERIVED:
|
||||
break;
|
||||
case RIG_DIFFERENTIALS:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
QString fieldUiName = resultDefinition->resultFieldUiName();
|
||||
|
@ -190,13 +190,11 @@ void RicNewSummaryEnsembleCurveSetFeature::setupActionLook( QAction* actionToSet
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RicNewSummaryEnsembleCurveSetFeature::selectedSummaryPlot() const
|
||||
{
|
||||
RimSummaryPlot* sumPlot = nullptr;
|
||||
|
||||
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( selObj )
|
||||
{
|
||||
sumPlot = RiaSummaryTools::parentSummaryPlot( selObj );
|
||||
return RiaSummaryTools::parentSummaryPlot( selObj );
|
||||
}
|
||||
|
||||
return sumPlot;
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -72,6 +72,8 @@ public:
|
||||
bool hasAnyUnlinkableViews = false;
|
||||
for ( auto gridView : selectedGridViews )
|
||||
{
|
||||
if ( !gridView ) continue;
|
||||
|
||||
if ( dynamic_cast<RimEclipseContourMapView*>( gridView ) )
|
||||
{
|
||||
hasAnyUnlinkableViews = true;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "RicLinkVisibleViewsFeatureUi.h"
|
||||
|
||||
#include "RimEclipseContourMapView.h"
|
||||
#include "RimGeoMechContourMapView.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimViewController.h"
|
||||
@ -32,7 +33,6 @@
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
|
||||
#include "RimGeoMechContourMapView.h"
|
||||
#include <QAction>
|
||||
#include <QTreeView>
|
||||
|
||||
@ -83,7 +83,6 @@ void RicLinkVisibleViewsFeature::onActionTriggered( bool isChecked )
|
||||
findLinkableVisibleViews( linkableViews );
|
||||
|
||||
linkViews( linkableViews );
|
||||
return;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -122,6 +121,7 @@ void RicLinkVisibleViewsFeature::findLinkableVisibleViews( std::vector<RimGridVi
|
||||
|
||||
for ( auto gridView : visibleGridViews )
|
||||
{
|
||||
if ( !gridView ) continue;
|
||||
if ( dynamic_cast<RimEclipseContourMapView*>( gridView ) ) continue;
|
||||
if ( dynamic_cast<RimGeoMechContourMapView*>( gridView ) ) continue;
|
||||
if ( gridView->assosiatedViewLinker() ) continue;
|
||||
@ -152,9 +152,8 @@ void RicLinkVisibleViewsFeature::linkViews( std::vector<RimGridView*>& linkableV
|
||||
viewLinker->setMasterView( masterView );
|
||||
}
|
||||
|
||||
for ( size_t i = 0; i < linkableViews.size(); i++ )
|
||||
for ( RimGridView* rimView : linkableViews )
|
||||
{
|
||||
RimGridView* rimView = linkableViews[i];
|
||||
if ( rimView == viewLinker->masterView() ) continue;
|
||||
|
||||
viewLinker->addDependentView( rimView );
|
||||
|
@ -220,7 +220,7 @@ void RifSummaryCaseRestartSelector::determineFilesToImportByAskingUser( const st
|
||||
{
|
||||
RifSummaryCaseFileResultInfo resultFileInfo( file,
|
||||
result.summaryImportOption ==
|
||||
RicSummaryCaseRestartDialog::IMPORT_ALL );
|
||||
RicSummaryCaseRestartDialog::ImportOptions::IMPORT_ALL );
|
||||
if ( !vectorContains( m_summaryFileInfos, resultFileInfo ) )
|
||||
{
|
||||
m_summaryFileInfos.push_back( resultFileInfo );
|
||||
@ -275,15 +275,15 @@ void RifSummaryCaseRestartSelector::determineFilesToImportUsingPrefs( const std:
|
||||
|
||||
if ( handleSummaryFile )
|
||||
{
|
||||
if ( defaultSummaryImportMode == RicSummaryCaseRestartDialog::IMPORT_ALL )
|
||||
if ( defaultSummaryImportMode == RicSummaryCaseRestartDialog::ImportOptions::IMPORT_ALL )
|
||||
{
|
||||
m_summaryFileInfos.push_back( RifSummaryCaseFileResultInfo( initialSummaryFile, true ) );
|
||||
}
|
||||
else if ( defaultSummaryImportMode == RicSummaryCaseRestartDialog::NOT_IMPORT )
|
||||
else if ( defaultSummaryImportMode == RicSummaryCaseRestartDialog::ImportOptions::NOT_IMPORT )
|
||||
{
|
||||
m_summaryFileInfos.push_back( RifSummaryCaseFileResultInfo( initialSummaryFile, false ) );
|
||||
}
|
||||
else if ( defaultSummaryImportMode == RicSummaryCaseRestartDialog::SEPARATE_CASES )
|
||||
else if ( defaultSummaryImportMode == RicSummaryCaseRestartDialog::ImportOptions::SEPARATE_CASES )
|
||||
{
|
||||
m_summaryFileInfos.push_back( RifSummaryCaseFileResultInfo( initialSummaryFile, false ) );
|
||||
bool hasWarnings = false;
|
||||
@ -307,7 +307,7 @@ void RifSummaryCaseRestartSelector::determineFilesToImportUsingPrefs( const std:
|
||||
m_gridFiles.push_back( initialGridFile );
|
||||
|
||||
RicSummaryCaseRestartDialog::ImportOptions defaultGridImportMode = mapReadOption( prefs->gridImportMode() );
|
||||
if ( defaultGridImportMode == RicSummaryCaseRestartDialog::SEPARATE_CASES )
|
||||
if ( defaultGridImportMode == RicSummaryCaseRestartDialog::ImportOptions::SEPARATE_CASES )
|
||||
{
|
||||
RifReaderEclipseSummary reader;
|
||||
bool hasWarnings = false;
|
||||
|
@ -1 +0,0 @@
|
||||
Checks: 'google-readability-braces-around-statements,google-readability-casting,google-readability-function-size,google-readability-namespace-comments,google-readability-todo,modernize-avoid-bind,modernize-avoid-c-arrays,modernize-concat-nested-namespaces,modernize-deprecated-headers,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-make-shared,modernize-make-unique,modernize-pass-by-value,modernize-raw-string-literal,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-replace-random-shuffle,modernize-return-braced-init-list,modernize-shrink-to-fit,modernize-unary-static-assert,modernize-use-auto,modernize-use-bool-literals,modernize-use-default-member-init,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-override,modernize-use-transparent-functors,modernize-use-uncaught-exceptions,modernize-use-using,readability-avoid-const-params-in-decls,readability-braces-around-statements,readability-const-return-type,readability-container-size-empty,readability-deleted-default,readability-delete-null-pointer,readability-else-after-return,readability-function-size,readability-identifier-naming,readability-implicit-bool-conversion,readability-inconsistent-declaration-parameter-name,readability-isolate-declaration,readability-magic-numbers,readability-misleading-indentation,readability-misplaced-array-index,readability-named-parameter,readability-non-const-parameter,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-boolean-expr,readability-simplify-subscript-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-string-compare,readability-uniqueptr-delete-release,readability-uppercase-literal-suffix'
|
@ -1 +0,0 @@
|
||||
Checks: 'google-readability-braces-around-statements,google-readability-casting,google-readability-function-size,google-readability-namespace-comments,google-readability-todo,modernize-avoid-bind,modernize-avoid-c-arrays,modernize-concat-nested-namespaces,modernize-deprecated-headers,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-make-shared,modernize-make-unique,modernize-pass-by-value,modernize-raw-string-literal,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-replace-random-shuffle,modernize-return-braced-init-list,modernize-shrink-to-fit,modernize-unary-static-assert,modernize-use-auto,modernize-use-bool-literals,modernize-use-default-member-init,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-override,modernize-use-transparent-functors,modernize-use-uncaught-exceptions,modernize-use-using,readability-avoid-const-params-in-decls,readability-braces-around-statements,readability-const-return-type,readability-container-size-empty,readability-deleted-default,readability-delete-null-pointer,readability-else-after-return,readability-function-size,readability-identifier-naming,readability-implicit-bool-conversion,readability-inconsistent-declaration-parameter-name,readability-isolate-declaration,readability-magic-numbers,readability-misleading-indentation,readability-misplaced-array-index,readability-named-parameter,readability-non-const-parameter,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-boolean-expr,readability-simplify-subscript-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-string-compare,readability-uniqueptr-delete-release,readability-uppercase-literal-suffix'
|
@ -337,18 +337,20 @@ QList<caf::PdmOptionItemInfo>
|
||||
if ( !caf::Utils::isStringMatch( m_tracerFilter, tracerName ) ) continue;
|
||||
|
||||
RimFlowDiagSolution::TracerStatusType tracerStatus = m_flowDiagSolution->tracerStatusOverall( tracerName );
|
||||
if ( tracerStatus == RimFlowDiagSolution::CLOSED ) continue;
|
||||
if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::CLOSED ) continue;
|
||||
|
||||
if ( m_cellFilter() == RigFlowDiagResults::CELLS_FLOODED )
|
||||
{
|
||||
if ( tracerStatus == RimFlowDiagSolution::INJECTOR || tracerStatus == RimFlowDiagSolution::VARYING )
|
||||
if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::INJECTOR ||
|
||||
tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING )
|
||||
{
|
||||
sortedTracerNames.push_back( std::make_pair( tracerName, tracerName ) );
|
||||
}
|
||||
}
|
||||
else if ( m_cellFilter() == RigFlowDiagResults::CELLS_DRAINED )
|
||||
{
|
||||
if ( tracerStatus == RimFlowDiagSolution::PRODUCER || tracerStatus == RimFlowDiagSolution::VARYING )
|
||||
if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::PRODUCER ||
|
||||
tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING )
|
||||
{
|
||||
sortedTracerNames.push_back( std::make_pair( tracerName, tracerName ) );
|
||||
}
|
||||
@ -358,16 +360,16 @@ QList<caf::PdmOptionItemInfo>
|
||||
QString prefix;
|
||||
switch ( tracerStatus )
|
||||
{
|
||||
case RimFlowDiagSolution::INJECTOR:
|
||||
case RimFlowDiagSolution::TracerStatusType::INJECTOR:
|
||||
prefix = "I : ";
|
||||
break;
|
||||
case RimFlowDiagSolution::PRODUCER:
|
||||
case RimFlowDiagSolution::TracerStatusType::PRODUCER:
|
||||
prefix = "P : ";
|
||||
break;
|
||||
case RimFlowDiagSolution::VARYING:
|
||||
case RimFlowDiagSolution::TracerStatusType::VARYING:
|
||||
prefix = "I/P: ";
|
||||
break;
|
||||
case RimFlowDiagSolution::UNDEFINED:
|
||||
case RimFlowDiagSolution::TracerStatusType::UNDEFINED:
|
||||
prefix = "U : ";
|
||||
break;
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(
|
||||
RimEclipseResultCase* eclCase;
|
||||
this->firstAncestorOrThisOfTypeAsserted( eclCase );
|
||||
|
||||
TracerStatusType tracerStatus = UNDEFINED;
|
||||
TracerStatusType tracerStatus = TracerStatusType::UNDEFINED;
|
||||
if ( eclCase && eclCase->eclipseCaseData() )
|
||||
{
|
||||
const cvf::Collection<RigSimWellData>& simWellData = eclCase->eclipseCaseData()->wellResults();
|
||||
@ -239,26 +239,26 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(
|
||||
|
||||
if ( simWellData[wIdx]->m_wellName != wellName ) continue;
|
||||
|
||||
tracerStatus = CLOSED;
|
||||
tracerStatus = TracerStatusType::CLOSED;
|
||||
for ( const RigWellResultFrame& wellResFrame : simWellData[wIdx]->m_wellCellsTimeSteps )
|
||||
{
|
||||
if ( wellResFrame.m_productionType == RigWellResultFrame::GAS_INJECTOR ||
|
||||
wellResFrame.m_productionType == RigWellResultFrame::OIL_INJECTOR ||
|
||||
wellResFrame.m_productionType == RigWellResultFrame::WATER_INJECTOR )
|
||||
{
|
||||
if ( tracerStatus == PRODUCER )
|
||||
tracerStatus = VARYING;
|
||||
if ( tracerStatus == TracerStatusType::PRODUCER )
|
||||
tracerStatus = TracerStatusType::VARYING;
|
||||
else
|
||||
tracerStatus = INJECTOR;
|
||||
tracerStatus = TracerStatusType::INJECTOR;
|
||||
}
|
||||
else if ( wellResFrame.m_productionType == RigWellResultFrame::PRODUCER )
|
||||
{
|
||||
if ( tracerStatus == INJECTOR )
|
||||
tracerStatus = VARYING;
|
||||
if ( tracerStatus == TracerStatusType::INJECTOR )
|
||||
tracerStatus = TracerStatusType::VARYING;
|
||||
else
|
||||
tracerStatus = PRODUCER;
|
||||
tracerStatus = TracerStatusType::PRODUCER;
|
||||
}
|
||||
if ( tracerStatus == VARYING ) break;
|
||||
if ( tracerStatus == TracerStatusType::VARYING ) break;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -266,10 +266,10 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(
|
||||
|
||||
if ( hasCrossFlowEnding( tracerName ) )
|
||||
{
|
||||
if ( tracerStatus == PRODUCER )
|
||||
tracerStatus = INJECTOR;
|
||||
else if ( tracerStatus == INJECTOR )
|
||||
tracerStatus = PRODUCER;
|
||||
if ( tracerStatus == TracerStatusType::PRODUCER )
|
||||
tracerStatus = TracerStatusType::INJECTOR;
|
||||
else if ( tracerStatus == TracerStatusType::INJECTOR )
|
||||
tracerStatus = TracerStatusType::PRODUCER;
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,7 +294,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
|
||||
QString wellName = removeCrossFlowEnding( tracerName );
|
||||
|
||||
if ( simWellData[wIdx]->m_wellName != wellName ) continue;
|
||||
if ( !simWellData[wIdx]->hasWellResult( timeStepIndex ) ) return CLOSED;
|
||||
if ( !simWellData[wIdx]->hasWellResult( timeStepIndex ) ) return TracerStatusType::CLOSED;
|
||||
|
||||
const RigWellResultFrame& wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex );
|
||||
|
||||
@ -302,16 +302,16 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
|
||||
wellResFrame.m_productionType == RigWellResultFrame::OIL_INJECTOR ||
|
||||
wellResFrame.m_productionType == RigWellResultFrame::WATER_INJECTOR )
|
||||
{
|
||||
if ( hasCrossFlowEnding( tracerName ) ) return PRODUCER;
|
||||
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::PRODUCER;
|
||||
|
||||
return INJECTOR;
|
||||
return TracerStatusType::INJECTOR;
|
||||
}
|
||||
else if ( wellResFrame.m_productionType == RigWellResultFrame::PRODUCER ||
|
||||
wellResFrame.m_productionType == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE )
|
||||
{
|
||||
if ( hasCrossFlowEnding( tracerName ) ) return INJECTOR;
|
||||
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::INJECTOR;
|
||||
|
||||
return PRODUCER;
|
||||
return TracerStatusType::PRODUCER;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -320,7 +320,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
|
||||
}
|
||||
}
|
||||
|
||||
return UNDEFINED;
|
||||
return TracerStatusType::UNDEFINED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
std::map<std::string, std::vector<int>> allInjectorTracerActiveCellIndices( size_t timeStepIndex ) const;
|
||||
std::map<std::string, std::vector<int>> allProducerTracerActiveCellIndices( size_t timeStepIndex ) const;
|
||||
|
||||
enum TracerStatusType
|
||||
enum class TracerStatusType
|
||||
{
|
||||
CLOSED, ///< Tracer has no active cells, and does not contribute
|
||||
PRODUCER, ///< Tracer with producing cells
|
||||
|
@ -441,16 +441,16 @@ std::map<QString, const std::vector<double>*>
|
||||
|
||||
if ( m_flowDiagSolution && simWellData->hasWellResult( m_timeStep ) )
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType requestedTracerType = RimFlowDiagSolution::UNDEFINED;
|
||||
RimFlowDiagSolution::TracerStatusType requestedTracerType = RimFlowDiagSolution::TracerStatusType::UNDEFINED;
|
||||
|
||||
const RigWellResultFrame::WellProductionType prodType = simWellData->wellProductionType( m_timeStep );
|
||||
if ( prodType == RigWellResultFrame::PRODUCER || prodType == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE )
|
||||
{
|
||||
requestedTracerType = RimFlowDiagSolution::INJECTOR;
|
||||
requestedTracerType = RimFlowDiagSolution::TracerStatusType::INJECTOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
requestedTracerType = RimFlowDiagSolution::PRODUCER;
|
||||
requestedTracerType = RimFlowDiagSolution::TracerStatusType::PRODUCER;
|
||||
}
|
||||
|
||||
std::vector<QString> tracerNames = m_flowDiagSolution->tracerNames();
|
||||
|
@ -542,12 +542,14 @@ void RimEclipseResultDefinition::setTofAndSelectTracer( const QString& tracerNam
|
||||
|
||||
std::vector<QString> tracers;
|
||||
tracers.push_back( tracerName );
|
||||
if ( ( tracerStatus == RimFlowDiagSolution::INJECTOR ) || ( tracerStatus == RimFlowDiagSolution::VARYING ) )
|
||||
if ( ( tracerStatus == RimFlowDiagSolution::TracerStatusType::INJECTOR ) ||
|
||||
( tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING ) )
|
||||
{
|
||||
setSelectedInjectorTracers( tracers );
|
||||
}
|
||||
|
||||
if ( ( tracerStatus == RimFlowDiagSolution::PRODUCER ) || ( tracerStatus == RimFlowDiagSolution::VARYING ) )
|
||||
if ( ( tracerStatus == RimFlowDiagSolution::TracerStatusType::PRODUCER ) ||
|
||||
( tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING ) )
|
||||
{
|
||||
setSelectedProducerTracers( tracers );
|
||||
}
|
||||
@ -989,7 +991,7 @@ RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType status =
|
||||
flowSol->tracerStatusInTimeStep( tracerName, timeStep );
|
||||
if ( status == RimFlowDiagSolution::INJECTOR )
|
||||
if ( status == RimFlowDiagSolution::TracerStatusType::INJECTOR )
|
||||
{
|
||||
selTracerNames.insert( tracerName.toStdString() );
|
||||
}
|
||||
@ -1002,7 +1004,7 @@ RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType status =
|
||||
flowSol->tracerStatusInTimeStep( tracerName, timeStep );
|
||||
if ( status == RimFlowDiagSolution::PRODUCER )
|
||||
if ( status == RimFlowDiagSolution::TracerStatusType::PRODUCER )
|
||||
{
|
||||
selTracerNames.insert( tracerName.toStdString() );
|
||||
}
|
||||
@ -1381,15 +1383,16 @@ void RimEclipseResultDefinition::setSelectedTracers( const std::vector<QString>&
|
||||
for ( const QString& tracerName : selectedTracers )
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType tracerStatus = m_flowSolution()->tracerStatusOverall( tracerName );
|
||||
if ( tracerStatus == RimFlowDiagSolution::INJECTOR )
|
||||
if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::INJECTOR )
|
||||
{
|
||||
injectorTracers.push_back( tracerName );
|
||||
}
|
||||
else if ( tracerStatus == RimFlowDiagSolution::PRODUCER )
|
||||
else if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::PRODUCER )
|
||||
{
|
||||
producerTracers.push_back( tracerName );
|
||||
}
|
||||
else if ( tracerStatus == RimFlowDiagSolution::VARYING || tracerStatus == RimFlowDiagSolution::UNDEFINED )
|
||||
else if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING ||
|
||||
tracerStatus == RimFlowDiagSolution::TracerStatusType::UNDEFINED )
|
||||
{
|
||||
injectorTracers.push_back( tracerName );
|
||||
producerTracers.push_back( tracerName );
|
||||
@ -2216,11 +2219,11 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForSelected
|
||||
{
|
||||
QString postfix;
|
||||
RimFlowDiagSolution::TracerStatusType status = flowSol->tracerStatusOverall( tracerName );
|
||||
if ( status == RimFlowDiagSolution::VARYING )
|
||||
if ( status == RimFlowDiagSolution::TracerStatusType::VARYING )
|
||||
{
|
||||
postfix = " [I/P]";
|
||||
}
|
||||
else if ( status == RimFlowDiagSolution::UNDEFINED )
|
||||
else if ( status == RimFlowDiagSolution::TracerStatusType::UNDEFINED )
|
||||
{
|
||||
postfix = " [U]";
|
||||
}
|
||||
@ -2406,9 +2409,10 @@ std::set<QString, RimEclipseResultDefinition::TracerComp> RimEclipseResultDefini
|
||||
for ( const QString& tracerName : tracerNames )
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType status = flowSol->tracerStatusOverall( tracerName );
|
||||
bool includeTracer = status == RimFlowDiagSolution::VARYING || status == RimFlowDiagSolution::UNDEFINED;
|
||||
includeTracer |= injector && status == RimFlowDiagSolution::INJECTOR;
|
||||
includeTracer |= !injector && status == RimFlowDiagSolution::PRODUCER;
|
||||
bool includeTracer = status == RimFlowDiagSolution::TracerStatusType::VARYING ||
|
||||
status == RimFlowDiagSolution::TracerStatusType::UNDEFINED;
|
||||
includeTracer |= injector && status == RimFlowDiagSolution::TracerStatusType::INJECTOR;
|
||||
includeTracer |= !injector && status == RimFlowDiagSolution::TracerStatusType::PRODUCER;
|
||||
|
||||
if ( includeTracer )
|
||||
{
|
||||
|
@ -235,14 +235,26 @@ std::vector<double>* RigFlowDiagResults::calculateAverageTOFResult( const RigFlo
|
||||
size_t timeStepIndex )
|
||||
{
|
||||
std::vector<const std::vector<double>*> injectorTOFs =
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_TOF_RESNAME, RimFlowDiagSolution::INJECTOR );
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_TOF_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::INJECTOR );
|
||||
std::vector<const std::vector<double>*> injectorFractions =
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::INJECTOR );
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::INJECTOR );
|
||||
|
||||
std::vector<const std::vector<double>*> producerTOFs =
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_TOF_RESNAME, RimFlowDiagSolution::PRODUCER );
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_TOF_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::PRODUCER );
|
||||
std::vector<const std::vector<double>*> producerFractions =
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::PRODUCER );
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::PRODUCER );
|
||||
size_t activeCellCount = this->activeCellInfo( resVarAddr )->reservoirActiveCellCount();
|
||||
|
||||
std::vector<double> injectorTotalFractions;
|
||||
@ -323,10 +335,11 @@ void RigFlowDiagResults::calculateSumOfFractionAndFractionMultTOF( size_t active
|
||||
std::vector<double>* RigFlowDiagResults::calculateSumOfFractionsResult( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex )
|
||||
{
|
||||
std::vector<const std::vector<double>*> fractions = findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::UNDEFINED );
|
||||
std::vector<const std::vector<double>*> fractions =
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::UNDEFINED );
|
||||
|
||||
RigFlowDiagResultFrames* sumOfFractionsFrames = this->createScalarResult( resVarAddr );
|
||||
std::vector<double>& sumOfFractions = sumOfFractionsFrames->frameData( timeStepIndex );
|
||||
@ -348,7 +361,7 @@ std::vector<double>* RigFlowDiagResults::calculateTracerWithMaxFractionResult( c
|
||||
findNamedResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::UNDEFINED );
|
||||
RimFlowDiagSolution::TracerStatusType::UNDEFINED );
|
||||
|
||||
std::vector<int> resultTracerIdxToGlobalTracerIdx;
|
||||
{
|
||||
@ -410,9 +423,15 @@ std::vector<double>* RigFlowDiagResults::calculateCommunicationResult( const Rig
|
||||
size_t timeStepIndex )
|
||||
{
|
||||
std::vector<const std::vector<double>*> injectorFractions =
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::INJECTOR );
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::INJECTOR );
|
||||
std::vector<const std::vector<double>*> producerFractions =
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::PRODUCER );
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::PRODUCER );
|
||||
size_t activeCellCount = this->activeCellInfo( resVarAddr )->reservoirActiveCellCount();
|
||||
|
||||
std::vector<double> sumOfInjectorFractions;
|
||||
@ -475,8 +494,8 @@ std::vector<const std::vector<double>*>
|
||||
RimFlowDiagSolution::TracerStatusType tracerType =
|
||||
m_flowDiagSolution->tracerStatusInTimeStep( QString::fromStdString( tracerName ), timeStepIndex );
|
||||
|
||||
if ( tracerType != RimFlowDiagSolution::CLOSED &&
|
||||
( tracerType == wantedTracerType || wantedTracerType == RimFlowDiagSolution::UNDEFINED ) )
|
||||
if ( tracerType != RimFlowDiagSolution::TracerStatusType::CLOSED &&
|
||||
( tracerType == wantedTracerType || wantedTracerType == RimFlowDiagSolution::TracerStatusType::UNDEFINED ) )
|
||||
{
|
||||
selectedTracersResults.push_back(
|
||||
findOrCalculateResult( RigFlowDiagResultAddress( nativeResultName, resVarAddr.phaseSelection, tracerName ),
|
||||
@ -503,8 +522,8 @@ std::vector<std::pair<std::string, const std::vector<double>*>>
|
||||
RimFlowDiagSolution::TracerStatusType tracerType =
|
||||
m_flowDiagSolution->tracerStatusInTimeStep( QString::fromStdString( tracerName ), timeStepIndex );
|
||||
|
||||
if ( tracerType != RimFlowDiagSolution::CLOSED &&
|
||||
( tracerType == wantedTracerType || wantedTracerType == RimFlowDiagSolution::UNDEFINED ) )
|
||||
if ( tracerType != RimFlowDiagSolution::TracerStatusType::CLOSED &&
|
||||
( tracerType == wantedTracerType || wantedTracerType == RimFlowDiagSolution::TracerStatusType::UNDEFINED ) )
|
||||
{
|
||||
selectedTracersResults.push_back(
|
||||
std::make_pair( tracerName,
|
||||
@ -777,11 +796,11 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType status =
|
||||
m_flowDiagSolution->tracerStatusInTimeStep( tracerName, timeStepIndex );
|
||||
if ( status == RimFlowDiagSolution::INJECTOR )
|
||||
if ( status == RimFlowDiagSolution::TracerStatusType::INJECTOR )
|
||||
{
|
||||
injectorNames.insert( tracerName.toStdString() );
|
||||
}
|
||||
else if ( status == RimFlowDiagSolution::PRODUCER )
|
||||
else if ( status == RimFlowDiagSolution::TracerStatusType::PRODUCER )
|
||||
{
|
||||
producerNames.insert( tracerName.toStdString() );
|
||||
}
|
||||
@ -896,11 +915,11 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType status =
|
||||
m_flowDiagSolution->tracerStatusInTimeStep( tracerName, timeStepIndex );
|
||||
if ( status == RimFlowDiagSolution::INJECTOR )
|
||||
if ( status == RimFlowDiagSolution::TracerStatusType::INJECTOR )
|
||||
{
|
||||
injectorNames.insert( tracerName.toStdString() );
|
||||
}
|
||||
else if ( status == RimFlowDiagSolution::PRODUCER )
|
||||
else if ( status == RimFlowDiagSolution::TracerStatusType::PRODUCER )
|
||||
{
|
||||
producerNames.insert( tracerName.toStdString() );
|
||||
}
|
||||
|
@ -250,15 +250,17 @@ std::vector<QString>
|
||||
|
||||
const RimFlowDiagSolution::TracerStatusType targetWellStatus =
|
||||
flowDiagSolution.tracerStatusInTimeStep( targetWellname, timeStepIndex );
|
||||
if ( targetWellStatus != RimFlowDiagSolution::INJECTOR && targetWellStatus != RimFlowDiagSolution::PRODUCER )
|
||||
if ( targetWellStatus != RimFlowDiagSolution::TracerStatusType::INJECTOR &&
|
||||
targetWellStatus != RimFlowDiagSolution::TracerStatusType::PRODUCER )
|
||||
{
|
||||
RiaLogging::warning( "Status of target well is neither INJECTOR nor PRODUCER" );
|
||||
return candidateWellNames;
|
||||
}
|
||||
|
||||
const RimFlowDiagSolution::TracerStatusType oppositeStatus = ( targetWellStatus == RimFlowDiagSolution::INJECTOR )
|
||||
? RimFlowDiagSolution::PRODUCER
|
||||
: RimFlowDiagSolution::INJECTOR;
|
||||
const RimFlowDiagSolution::TracerStatusType oppositeStatus =
|
||||
( targetWellStatus == RimFlowDiagSolution::TracerStatusType::INJECTOR )
|
||||
? RimFlowDiagSolution::TracerStatusType::PRODUCER
|
||||
: RimFlowDiagSolution::TracerStatusType::INJECTOR;
|
||||
|
||||
const std::vector<QString> allWellNames = flowDiagSolution.tracerNames();
|
||||
for ( const QString& name : allWellNames )
|
||||
|
Loading…
Reference in New Issue
Block a user