mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge remote-tracking branch 'origin/2020.10-patch-01' into dev
This commit is contained in:
commit
1a3a155d36
@ -125,9 +125,9 @@ RiaPreferences::RiaPreferences( void )
|
||||
CAF_PDM_InitField( &scriptEditorExecutable, "scriptEditorExecutable", defaultTextEditor, "Script Editor", "", "", "" );
|
||||
scriptEditorExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &octaveExecutable, "octaveExecutable", QString( "octave" ), "Octave Executable Location", "", "", "" );
|
||||
octaveExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
octaveExecutable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
CAF_PDM_InitField( &m_octaveExecutable, "octaveExecutable", QString( "octave" ), "Octave Executable Location", "", "", "" );
|
||||
m_octaveExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_octaveExecutable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
CAF_PDM_InitField( &octaveShowHeaderInfoWhenExecutingScripts,
|
||||
"octaveShowHeaderInfoWhenExecutingScripts",
|
||||
@ -138,9 +138,9 @@ RiaPreferences::RiaPreferences( void )
|
||||
"" );
|
||||
octaveShowHeaderInfoWhenExecutingScripts.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
|
||||
CAF_PDM_InitField( &pythonExecutable, "pythonExecutable", QString( "python" ), "Python Executable Location", "", "", "" );
|
||||
pythonExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
pythonExecutable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
CAF_PDM_InitField( &m_pythonExecutable, "pythonExecutable", QString( "python" ), "Python Executable Location", "", "", "" );
|
||||
m_pythonExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_pythonExecutable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
CAF_PDM_InitField( &showPythonDebugInfo, "pythonDebugInfo", false, "Show Python Debug Info", "", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &ssihubAddress, "ssihubAddress", QString( "http://" ), "SSIHUB Address", "", "", "" );
|
||||
@ -555,7 +555,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
else if ( uiConfigName == RiaPreferences::tabNameScripting() )
|
||||
{
|
||||
caf::PdmUiGroup* octaveGroup = uiOrdering.addNewGroup( "Octave" );
|
||||
octaveGroup->add( &octaveExecutable );
|
||||
octaveGroup->add( &m_octaveExecutable );
|
||||
octaveGroup->add( &octaveShowHeaderInfoWhenExecutingScripts );
|
||||
|
||||
#ifdef ENABLE_GRPC
|
||||
@ -563,7 +563,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
pythonGroup->add( &enableGrpcServer );
|
||||
pythonGroup->add( &showPythonDebugInfo );
|
||||
pythonGroup->add( &defaultGrpcPortNumber );
|
||||
pythonGroup->add( &pythonExecutable );
|
||||
pythonGroup->add( &m_pythonExecutable );
|
||||
#endif
|
||||
caf::PdmUiGroup* scriptGroup = uiOrdering.addNewGroup( "Script files" );
|
||||
scriptGroup->add( &scriptDirectories );
|
||||
@ -1104,6 +1104,22 @@ bool RiaPreferences::showGridBox() const
|
||||
return m_showGridBox();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::pythonExecutable() const
|
||||
{
|
||||
return m_pythonExecutable().trimmed();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::octaveExecutable() const
|
||||
{
|
||||
return m_octaveExecutable().trimmed();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -130,17 +130,17 @@ public:
|
||||
bool showInfoBox() const;
|
||||
bool showGridBox() const;
|
||||
|
||||
// Script paths
|
||||
QString pythonExecutable() const;
|
||||
QString octaveExecutable() const;
|
||||
|
||||
public: // Pdm Fields
|
||||
caf::PdmField<bool> enableGrpcServer;
|
||||
caf::PdmField<int> defaultGrpcPortNumber;
|
||||
|
||||
caf::PdmField<QString> scriptDirectories;
|
||||
caf::PdmField<QString> scriptEditorExecutable;
|
||||
|
||||
caf::PdmField<QString> octaveExecutable;
|
||||
caf::PdmField<bool> octaveShowHeaderInfoWhenExecutingScripts;
|
||||
|
||||
caf::PdmField<QString> pythonExecutable;
|
||||
caf::PdmField<bool> showPythonDebugInfo;
|
||||
|
||||
caf::PdmField<QString> ssihubAddress;
|
||||
@ -228,6 +228,10 @@ private:
|
||||
caf::PdmField<bool> m_searchPlotTemplateFoldersRecursively;
|
||||
caf::PdmField<caf::FilePath> m_defaultPlotTemplate;
|
||||
|
||||
// Script paths
|
||||
caf::PdmField<QString> m_octaveExecutable;
|
||||
caf::PdmField<QString> m_pythonExecutable;
|
||||
|
||||
// Surface Import
|
||||
caf::PdmField<double> m_surfaceImportResamplingDistance;
|
||||
|
||||
|
@ -279,14 +279,9 @@ QString RiaProjectModifier::makeFilePathAbsolute( const QString& relOrAbsolutePa
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaProjectModifier::caseNameFromGridFileName( const QString& fullGridFilePathName )
|
||||
{
|
||||
QString fn = QDir::fromNativeSeparators( fullGridFilePathName );
|
||||
QFileInfo fi( fullGridFilePathName );
|
||||
|
||||
// Extract file name plus the 'deepest' directory
|
||||
QString deepestDirPlusFileName = fn.section( '/', -2, -1 );
|
||||
|
||||
deepestDirPlusFileName.replace( "/", "--" );
|
||||
|
||||
return deepestDirPlusFileName;
|
||||
return fi.baseName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -169,6 +169,14 @@ std::set<std::string> RiaSummaryCurveAnalyzer::blocks() const
|
||||
return m_blocks;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<int> RiaSummaryCurveAnalyzer::aquifers() const
|
||||
{
|
||||
return m_aquifers;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -229,6 +237,13 @@ std::vector<QString> RiaSummaryCurveAnalyzer::identifierTexts( RifEclipseSummary
|
||||
identifierStrings.push_back( QString::fromStdString( conn ) );
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_AQUIFER )
|
||||
{
|
||||
for ( const auto& aquifer : m_aquifers )
|
||||
{
|
||||
identifierStrings.push_back( QString::number( aquifer ) );
|
||||
}
|
||||
}
|
||||
|
||||
return identifierStrings;
|
||||
}
|
||||
@ -284,6 +299,7 @@ void RiaSummaryCurveAnalyzer::clear()
|
||||
m_wellCompletions.clear();
|
||||
m_wellSegmentNumbers.clear();
|
||||
m_blocks.clear();
|
||||
m_aquifers.clear();
|
||||
|
||||
m_quantitiesNoMatchingHistory.clear();
|
||||
m_quantitiesWithMatchingHistory.clear();
|
||||
@ -378,6 +394,10 @@ void RiaSummaryCurveAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAddre
|
||||
auto text = address.blockAsString();
|
||||
m_blocks.insert( text );
|
||||
}
|
||||
else if ( address.category() == RifEclipseSummaryAddress::SUMMARY_AQUIFER )
|
||||
{
|
||||
m_aquifers.insert( address.aquiferNumber() );
|
||||
}
|
||||
|
||||
if ( address.category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
||||
{
|
||||
|
@ -55,6 +55,7 @@ public:
|
||||
std::set<std::string> wellCompletions( const std::string& wellName ) const;
|
||||
std::set<int> wellSegmentNumbers( const std::string& wellName ) const;
|
||||
std::set<std::string> blocks() const;
|
||||
std::set<int> aquifers() const;
|
||||
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> categories() const;
|
||||
|
||||
@ -84,6 +85,7 @@ private:
|
||||
std::set<std::pair<std::string, std::string>> m_wellCompletions;
|
||||
std::set<std::pair<std::string, int>> m_wellSegmentNumbers;
|
||||
std::set<std::string> m_blocks;
|
||||
std::set<int> m_aquifers;
|
||||
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> m_categories;
|
||||
};
|
||||
|
@ -198,6 +198,7 @@ void RicCloseCaseFeature::deleteEclipseCase( RimEclipseCase* eclipseCase )
|
||||
{
|
||||
RimGridSummaryCase* gridSummaryCase = dynamic_cast<RimGridSummaryCase*>( summaryCase );
|
||||
sumCaseColl->convertGridSummaryCasesToFileSummaryCases( gridSummaryCase );
|
||||
sumCaseColl->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,13 +20,16 @@
|
||||
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaStringListSerializer.h"
|
||||
|
||||
#include "RiuFileDialogTools.h"
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include <QAbstractItemView>
|
||||
#include <QAction>
|
||||
#include <QCheckBox>
|
||||
#include <QClipboard>
|
||||
#include <QComboBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QDir>
|
||||
#include <QGroupBox>
|
||||
@ -35,12 +38,14 @@
|
||||
#include <QListWidget>
|
||||
#include <QMenu>
|
||||
#include <QPushButton>
|
||||
#include <QSettings>
|
||||
#include <QTextEdit>
|
||||
#include <QTime>
|
||||
#include <QToolBar>
|
||||
#include <QToolTip>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#define RECURSIVE_FILESEARCH_DEFAULT_DIALOG_HEIGHT 350
|
||||
@ -70,7 +75,31 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea
|
||||
QString pathFilterText = dir;
|
||||
RiaFilePathTools::appendSeparatorIfNo( pathFilterText );
|
||||
pathFilterText += pathFilter;
|
||||
dialog.m_pathFilterField->setText( QDir::toNativeSeparators( pathFilterText ) );
|
||||
|
||||
const QString searchHistoryStringsRegistryKey =
|
||||
QString( "RicRecursiveFileSearchDialog %1" ).arg( caption ).replace( " ", "_" );
|
||||
const int maxItemsInRegistry = 10;
|
||||
{
|
||||
RiaStringListSerializer stringListSerializer( searchHistoryStringsRegistryKey );
|
||||
QStringList files = stringListSerializer.textStrings();
|
||||
|
||||
int numRecentFiles = std::min( files.size(), maxItemsInRegistry );
|
||||
for ( int i = 0; i < numRecentFiles; i++ )
|
||||
{
|
||||
dialog.m_pathFilterField->addItem( files[i] );
|
||||
}
|
||||
}
|
||||
|
||||
QSettings settings;
|
||||
const QString useRealizationStarRegistryKey = "RecursiveFileSearchDialog_use_realization";
|
||||
|
||||
bool isChecked = settings.value( useRealizationStarRegistryKey, true ).toBool();
|
||||
dialog.m_useRealizationStarCheckBox->setChecked( isChecked );
|
||||
|
||||
dialog.m_pathFilterField->addItem( QDir::toNativeSeparators( pathFilterText ) );
|
||||
dialog.m_pathFilterField->setCurrentText( QDir::toNativeSeparators( pathFilterText ) );
|
||||
|
||||
dialog.m_pathFilterField->setEditable( true );
|
||||
dialog.m_fileFilterField->setText( fileNameFilter );
|
||||
dialog.m_fileExtensions = trimLeftStrings( fileExtensions, "." );
|
||||
|
||||
@ -81,6 +110,14 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea
|
||||
dialog.resize( 800, 150 );
|
||||
dialog.exec();
|
||||
|
||||
if ( dialog.result() == QDialog::Accepted )
|
||||
{
|
||||
RiaStringListSerializer stringListSerializer( searchHistoryStringsRegistryKey );
|
||||
stringListSerializer.addString( dialog.m_pathFilterField->currentText(), maxItemsInRegistry );
|
||||
|
||||
settings.setValue( useRealizationStarRegistryKey, dialog.m_useRealizationStarCheckBox->isChecked() );
|
||||
}
|
||||
|
||||
return RicRecursiveFileSearchDialogResult( dialog.result() == QDialog::Accepted,
|
||||
dialog.m_foundFiles,
|
||||
dialog.rootDirWithEndSeparator(),
|
||||
@ -95,9 +132,13 @@ RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent )
|
||||
: QDialog( parent, RiuTools::defaultDialogFlags() )
|
||||
{
|
||||
// Create widgets
|
||||
m_browseButton = new QPushButton();
|
||||
m_browseButton = new QPushButton();
|
||||
|
||||
m_useRealizationStarCheckBox = new QCheckBox( "Use 'realization-*' in filter" );
|
||||
connect( m_useRealizationStarCheckBox, SIGNAL( clicked() ), this, SLOT( slotUseRealizationStarClicked() ) );
|
||||
|
||||
m_pathFilterLabel = new QLabel();
|
||||
m_pathFilterField = new QLineEdit();
|
||||
m_pathFilterField = new QComboBox();
|
||||
m_fileFilterLabel = new QLabel();
|
||||
m_fileFilterField = new QLineEdit();
|
||||
m_effectiveFilterLabel = new QLabel();
|
||||
@ -110,7 +151,15 @@ RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent )
|
||||
m_buttons = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
|
||||
|
||||
// Connect to signals
|
||||
connect( m_pathFilterField, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotFilterChanged( const QString& ) ) );
|
||||
connect( m_pathFilterField,
|
||||
SIGNAL( currentTextChanged( const QString& ) ),
|
||||
this,
|
||||
SLOT( slotFilterChanged( const QString& ) ) );
|
||||
connect( m_pathFilterField,
|
||||
SIGNAL( editTextChanged( const QString& ) ),
|
||||
this,
|
||||
SLOT( slotFilterChanged( const QString& ) ) );
|
||||
|
||||
connect( m_fileFilterField, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotFilterChanged( const QString& ) ) );
|
||||
|
||||
connect( m_fileListWidget,
|
||||
@ -159,9 +208,10 @@ RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent )
|
||||
inputGridLayout->addWidget( m_browseButton, 0, 3 );
|
||||
inputGridLayout->addWidget( m_fileFilterLabel, 1, 0 );
|
||||
inputGridLayout->addWidget( m_fileFilterField, 1, 1, 1, 2 );
|
||||
inputGridLayout->addWidget( m_effectiveFilterLabel, 2, 0 );
|
||||
inputGridLayout->addWidget( m_effectiveFilterContentLabel, 2, 1 );
|
||||
inputGridLayout->addWidget( m_findOrCancelButton, 2, 2, 1, 2 );
|
||||
inputGridLayout->addWidget( m_useRealizationStarCheckBox, 2, 1 );
|
||||
inputGridLayout->addWidget( m_effectiveFilterLabel, 3, 0 );
|
||||
inputGridLayout->addWidget( m_effectiveFilterContentLabel, 3, 1 );
|
||||
inputGridLayout->addWidget( m_findOrCancelButton, 3, 2, 1, 2 );
|
||||
|
||||
inputGroup->setLayout( inputGridLayout );
|
||||
|
||||
@ -221,10 +271,16 @@ RicRecursiveFileSearchDialog::~RicRecursiveFileSearchDialog()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicRecursiveFileSearchDialog::cleanTextFromPathFilterField() const
|
||||
{
|
||||
QString pathFilterText = m_pathFilterField->text().trimmed();
|
||||
QString pathFilterText = m_pathFilterField->currentText().trimmed();
|
||||
pathFilterText = RiaFilePathTools::toInternalSeparator( pathFilterText );
|
||||
pathFilterText = RiaFilePathTools::removeDuplicatePathSeparators( pathFilterText );
|
||||
pathFilterText.replace( QString( "**" ), QString( "*" ) );
|
||||
|
||||
if ( m_useRealizationStarCheckBox->isChecked() )
|
||||
{
|
||||
pathFilterText = replaceWithRealizationStar( pathFilterText );
|
||||
}
|
||||
|
||||
return pathFilterText;
|
||||
}
|
||||
|
||||
@ -489,6 +545,20 @@ QStringList RicRecursiveFileSearchDialog::createFileNameFilterList()
|
||||
return nameFilter;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicRecursiveFileSearchDialog::replaceWithRealizationStar( const QString& text )
|
||||
{
|
||||
const QString pattern = "realization-\\d+";
|
||||
QRegExp regexp( pattern, Qt::CaseInsensitive );
|
||||
|
||||
QString textWithStar = text;
|
||||
textWithStar.replace( regexp, "realization-*" );
|
||||
|
||||
return textWithStar;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -715,7 +785,19 @@ void RicRecursiveFileSearchDialog::slotBrowseButtonClicked()
|
||||
QString folder = RiuFileDialogTools::getExistingDirectory( this, "Select folder", rootDirWithEndSeparator() );
|
||||
RiaFilePathTools::appendSeparatorIfNo( folder );
|
||||
folder += "*";
|
||||
if ( !folder.isEmpty() ) m_pathFilterField->setText( QDir::toNativeSeparators( folder ) );
|
||||
if ( !folder.isEmpty() )
|
||||
{
|
||||
m_pathFilterField->addItem( QDir::toNativeSeparators( folder ) );
|
||||
m_pathFilterField->setCurrentText( QDir::toNativeSeparators( folder ) );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRecursiveFileSearchDialog::slotUseRealizationStarClicked()
|
||||
{
|
||||
updateEffectiveFilter();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -32,6 +32,8 @@ class QPushButton;
|
||||
class QMainWindow;
|
||||
class QListWidget;
|
||||
class QGroupBox;
|
||||
class QComboBox;
|
||||
class QCheckBox;
|
||||
|
||||
class RicRecursiveFileSearchDialogResult;
|
||||
|
||||
@ -79,16 +81,18 @@ private:
|
||||
|
||||
// File search methods
|
||||
|
||||
QStringList findMatchingFiles();
|
||||
void buildDirectoryListRecursiveSimple( const QString& currentDir,
|
||||
const QString& currentPathFilter,
|
||||
QStringList* accumulatedDirs );
|
||||
QStringList findFilesInDirs( const QStringList& dirs );
|
||||
QStringList createFileNameFilterList();
|
||||
QStringList findMatchingFiles();
|
||||
void buildDirectoryListRecursiveSimple( const QString& currentDir,
|
||||
const QString& currentPathFilter,
|
||||
QStringList* accumulatedDirs );
|
||||
QStringList findFilesInDirs( const QStringList& dirs );
|
||||
QStringList createFileNameFilterList();
|
||||
static QString replaceWithRealizationStar( const QString& text );
|
||||
|
||||
private slots:
|
||||
void slotFilterChanged( const QString& text );
|
||||
void slotBrowseButtonClicked();
|
||||
void slotUseRealizationStarClicked();
|
||||
void slotFindOrCancelButtonClicked();
|
||||
|
||||
void slotFileListCustomMenuRequested( const QPoint& point );
|
||||
@ -102,8 +106,9 @@ private slots:
|
||||
|
||||
private:
|
||||
QLabel* m_pathFilterLabel;
|
||||
QLineEdit* m_pathFilterField;
|
||||
QComboBox* m_pathFilterField;
|
||||
QPushButton* m_browseButton;
|
||||
QCheckBox* m_useRealizationStarCheckBox;
|
||||
|
||||
QLabel* m_fileFilterLabel;
|
||||
QLineEdit* m_fileFilterField;
|
||||
@ -153,4 +158,4 @@ public:
|
||||
QString rootDir;
|
||||
QString pathFilter;
|
||||
QString fileNameFilter;
|
||||
};
|
||||
};
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RicReplaceSummaryCaseFeature.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimObservedDataCollection.h"
|
||||
@ -61,6 +62,8 @@ void RicReloadSummaryCaseFeature::onActionTriggered( bool isChecked )
|
||||
summaryCase->createSummaryReaderInterface();
|
||||
summaryCase->createRftReaderInterface();
|
||||
|
||||
RicReplaceSummaryCaseFeature::updateRequredCalculatedCurves( summaryCase );
|
||||
|
||||
RiaLogging::info( QString( "Reloaded data for %1" ).arg( summaryCase->summaryHeaderFilename() ) );
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,26 @@
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicReplaceSummaryCaseFeature, "RicReplaceSummaryCaseFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicReplaceSummaryCaseFeature::updateRequredCalculatedCurves( RimSummaryCase* sourceSummaryCase )
|
||||
{
|
||||
RimSummaryCalculationCollection* calcColl = RimProject::current()->calculationCollection();
|
||||
|
||||
for ( RimSummaryCalculation* summaryCalculation : calcColl->calculations() )
|
||||
{
|
||||
bool needsUpdate =
|
||||
RicReplaceSummaryCaseFeature::checkIfCalculationNeedsUpdate( summaryCalculation, sourceSummaryCase );
|
||||
if ( needsUpdate )
|
||||
{
|
||||
summaryCalculation->parseExpression();
|
||||
summaryCalculation->calculate();
|
||||
summaryCalculation->updateDependentCurvesAndPlots();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -74,19 +94,17 @@ void RicReplaceSummaryCaseFeature::onActionTriggered( bool isChecked )
|
||||
summaryCase->createRftReaderInterface();
|
||||
RiaLogging::info( QString( "Replaced summary data for %1" ).arg( oldSummaryHeaderFilename ) );
|
||||
|
||||
RimSummaryCalculationCollection* calcColl = RimProject::current()->calculationCollection();
|
||||
RicReplaceSummaryCaseFeature::updateRequredCalculatedCurves( summaryCase );
|
||||
|
||||
// Find and update all changed calculations
|
||||
std::set<int> ids;
|
||||
std::set<int> ids;
|
||||
RimSummaryCalculationCollection* calcColl = RimProject::current()->calculationCollection();
|
||||
for ( RimSummaryCalculation* summaryCalculation : calcColl->calculations() )
|
||||
{
|
||||
bool needsUpdate = checkIfCalculationNeedsUpdate( summaryCalculation, summaryCase );
|
||||
if ( needsUpdate )
|
||||
{
|
||||
ids.insert( summaryCalculation->id() );
|
||||
summaryCalculation->parseExpression();
|
||||
summaryCalculation->calculate();
|
||||
summaryCalculation->updateDependentCurvesAndPlots();
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,7 +192,7 @@ void RicReplaceSummaryCaseFeature::setupActionLook( QAction* actionToSetup )
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicReplaceSummaryCaseFeature::checkIfCalculationNeedsUpdate( const RimSummaryCalculation* summaryCalculation,
|
||||
const RimFileSummaryCase* summaryCase )
|
||||
const RimSummaryCase* summaryCase )
|
||||
{
|
||||
std::vector<RimSummaryCalculationVariable*> variables = summaryCalculation->allVariables();
|
||||
for ( RimSummaryCalculationVariable* variable : variables )
|
||||
|
@ -21,17 +21,20 @@
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryCalculation;
|
||||
class RimFileSummaryCase;
|
||||
class RimSummaryCase;
|
||||
|
||||
class RicReplaceSummaryCaseFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
static void updateRequredCalculatedCurves( RimSummaryCase* sourceSummaryCase );
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
bool checkIfCalculationNeedsUpdate( const RimSummaryCalculation* summaryCalculation,
|
||||
const RimFileSummaryCase* summaryCase );
|
||||
static bool checkIfCalculationNeedsUpdate( const RimSummaryCalculation* summaryCalculation,
|
||||
const RimSummaryCase* summaryCase );
|
||||
};
|
||||
|
@ -18,7 +18,9 @@
|
||||
|
||||
#include "RifEnsembleStatisticsReader.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleStatisticsCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
|
||||
static const std::vector<time_t> EMPTY_TIME_STEPS_VECTOR;
|
||||
|
||||
@ -80,7 +82,23 @@ bool RifEnsembleStatisticsReader::values( const RifEclipseSummaryAddress& result
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RifEnsembleStatisticsReader::unitName( const RifEclipseSummaryAddress& resultAddress ) const
|
||||
{
|
||||
return "";
|
||||
std::string retval;
|
||||
|
||||
// The stat case does not have a unit set, so pick up the unit from one of the input cases, if possible
|
||||
auto cases = m_ensembleStatCase->curveSet()->summaryCaseCollection()->allSummaryCases();
|
||||
if ( cases.size() > 0 )
|
||||
{
|
||||
// get rid of the stats part of the quantity name
|
||||
QString qName = QString::fromStdString( resultAddress.quantityName() );
|
||||
std::string orgQName = qName.split( ":" )[1].toStdString();
|
||||
|
||||
RifEclipseSummaryAddress address = RifEclipseSummaryAddress( resultAddress );
|
||||
address.setQuantityName( orgQName );
|
||||
|
||||
retval = cases[0]->summaryReader()->unitName( address );
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -163,14 +163,14 @@ def test_replaceCase(rips_instance, initialize_test):
|
||||
|
||||
case.replace(new_grid_file=case_path)
|
||||
# Check that the case object has been changed
|
||||
assert(case.name == "Real0--BRUGGE_0000.EGRID")
|
||||
assert(case.name == "BRUGGE_0000")
|
||||
assert(case.id == 0)
|
||||
|
||||
cases = rips_instance.project.cases()
|
||||
assert(len(cases) is 1)
|
||||
# Check that retrieving the case object again will yield the changed object
|
||||
case = project.case(case_id=0)
|
||||
assert(case.name == "Real0--BRUGGE_0000.EGRID")
|
||||
assert(case.name == "BRUGGE_0000")
|
||||
assert(case.id == 0)
|
||||
|
||||
|
||||
|
@ -127,8 +127,12 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
||||
cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper();
|
||||
|
||||
std::vector<std::vector<cvf::BoundingBox>> labelBBoxes;
|
||||
std::vector<cvf::ref<cvf::Drawable>> labelDrawables =
|
||||
createContourLabels( camera, displayCoordTransform, &labelBBoxes );
|
||||
std::vector<cvf::ref<cvf::Drawable>> labelDrawables;
|
||||
|
||||
if ( m_contourMapProjection->showContourLabels() )
|
||||
{
|
||||
labelDrawables = createContourLabels( camera, displayCoordTransform, &labelBBoxes );
|
||||
}
|
||||
|
||||
std::vector<std::vector<cvf::ref<cvf::Drawable>>> contourDrawablesForAllLevels =
|
||||
createContourPolygons( displayCoordTransform, labelBBoxes );
|
||||
@ -163,14 +167,18 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
||||
}
|
||||
}
|
||||
}
|
||||
for ( auto labelDrawableRef : labelDrawables )
|
||||
|
||||
if ( m_contourMapProjection->showContourLabels() )
|
||||
{
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
part->setDrawable( labelDrawableRef.p() );
|
||||
part->setEffect( m_labelEffect.p() );
|
||||
part->setPriority( RivPartPriority::Text );
|
||||
part->setSourceInfo( new RivMeshLinesSourceInfo( m_contourMapProjection.p() ) );
|
||||
model->addPart( part.p() );
|
||||
for ( auto labelDrawableRef : labelDrawables )
|
||||
{
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
part->setDrawable( labelDrawableRef.p() );
|
||||
part->setEffect( m_labelEffect.p() );
|
||||
part->setPriority( RivPartPriority::Text );
|
||||
part->setSourceInfo( new RivMeshLinesSourceInfo( m_contourMapProjection.p() ) );
|
||||
model->addPart( part.p() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -295,46 +303,49 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
||||
lineBBox.add( displayVertex2 );
|
||||
|
||||
bool addOriginalSegment = true;
|
||||
for ( const cvf::BoundingBox& existingBBox : labelBBoxes[i] )
|
||||
if ( labelBBoxes.size() > 0 )
|
||||
{
|
||||
if ( lineBBox.intersects( existingBBox ) )
|
||||
for ( const cvf::BoundingBox& existingBBox : labelBBoxes[i] )
|
||||
{
|
||||
if ( existingBBox.contains( displayVertex1 ) && existingBBox.contains( displayVertex2 ) )
|
||||
if ( lineBBox.intersects( existingBBox ) )
|
||||
{
|
||||
addOriginalSegment = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
cvf::Vec3d dir = displayVertex2 - displayVertex1;
|
||||
|
||||
cvf::Ray ray;
|
||||
ray.setOrigin( displayVertex1 );
|
||||
ray.setDirection( dir.getNormalized() );
|
||||
ray.setMaximumDistance( dir.length() );
|
||||
|
||||
if ( !existingBBox.contains( displayVertex1 ) )
|
||||
if ( existingBBox.contains( displayVertex1 ) && existingBBox.contains( displayVertex2 ) )
|
||||
{
|
||||
cvf::Vec3d intersection;
|
||||
bool hit = ray.boxIntersect( existingBBox, &intersection );
|
||||
if ( hit )
|
||||
{
|
||||
displayLines.push_back( cvf::Vec3f( displayVertex1 ) );
|
||||
displayLines.push_back( cvf::Vec3f( intersection ) );
|
||||
addOriginalSegment = false;
|
||||
}
|
||||
addOriginalSegment = false;
|
||||
}
|
||||
|
||||
if ( !existingBBox.contains( displayVertex2 ) )
|
||||
else
|
||||
{
|
||||
ray.setOrigin( displayVertex2 );
|
||||
ray.setDirection( -ray.direction() );
|
||||
cvf::Vec3d intersection;
|
||||
bool hit = ray.boxIntersect( existingBBox, &intersection );
|
||||
if ( hit )
|
||||
cvf::Vec3d dir = displayVertex2 - displayVertex1;
|
||||
|
||||
cvf::Ray ray;
|
||||
ray.setOrigin( displayVertex1 );
|
||||
ray.setDirection( dir.getNormalized() );
|
||||
ray.setMaximumDistance( dir.length() );
|
||||
|
||||
if ( !existingBBox.contains( displayVertex1 ) )
|
||||
{
|
||||
displayLines.push_back( cvf::Vec3f( intersection ) );
|
||||
displayLines.push_back( cvf::Vec3f( displayVertex2 ) );
|
||||
addOriginalSegment = false;
|
||||
cvf::Vec3d intersection;
|
||||
bool hit = ray.boxIntersect( existingBBox, &intersection );
|
||||
if ( hit )
|
||||
{
|
||||
displayLines.push_back( cvf::Vec3f( displayVertex1 ) );
|
||||
displayLines.push_back( cvf::Vec3f( intersection ) );
|
||||
addOriginalSegment = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !existingBBox.contains( displayVertex2 ) )
|
||||
{
|
||||
ray.setOrigin( displayVertex2 );
|
||||
ray.setDirection( -ray.direction() );
|
||||
cvf::Vec3d intersection;
|
||||
bool hit = ray.boxIntersect( existingBBox, &intersection );
|
||||
if ( hit )
|
||||
{
|
||||
displayLines.push_back( cvf::Vec3f( intersection ) );
|
||||
displayLines.push_back( cvf::Vec3f( displayVertex2 ) );
|
||||
addOriginalSegment = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -467,6 +467,13 @@ void RimGridCrossPlotDataSet::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( legendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS ||
|
||||
legendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::LOG10_CONTINUOUS )
|
||||
{
|
||||
// Avoid continuous modes
|
||||
legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::LINEAR_DISCRETE );
|
||||
}
|
||||
|
||||
RigEclipseResultAddress xAddress( m_xAxisProperty->resultType(), m_xAxisProperty->resultVariable() );
|
||||
RigEclipseResultAddress yAddress( m_yAxisProperty->resultType(), m_yAxisProperty->resultVariable() );
|
||||
RigEclipseResultAddress groupAddress( m_groupingProperty->resultType(), m_groupingProperty->resultVariable() );
|
||||
@ -531,8 +538,6 @@ void RimGridCrossPlotDataSet::assignCurveDataGroups( const RigEclipseCrossPlotRe
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<double> tickValues;
|
||||
|
||||
if ( groupingByCategoryResult() )
|
||||
{
|
||||
for ( size_t i = 0; i < result.xValues.size(); ++i )
|
||||
@ -550,20 +555,24 @@ void RimGridCrossPlotDataSet::assignCurveDataGroups( const RigEclipseCrossPlotRe
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<double> tickValues;
|
||||
legendConfig()->scalarMapper()->majorTickValues( &tickValues );
|
||||
|
||||
for ( size_t i = 0; i < result.xValues.size(); ++i )
|
||||
if ( !tickValues.empty() )
|
||||
{
|
||||
auto upperBoundIt =
|
||||
std::lower_bound( tickValues.begin(), tickValues.end(), result.groupValuesContinuous[i] );
|
||||
int upperBoundIndex = static_cast<int>( upperBoundIt - tickValues.begin() );
|
||||
int categoryNum = std::min( (int)tickValues.size() - 2, std::max( 0, upperBoundIndex - 1 ) );
|
||||
m_groupedResults[categoryNum].xValues.push_back( result.xValues[i] );
|
||||
m_groupedResults[categoryNum].yValues.push_back( result.yValues[i] );
|
||||
if ( !result.groupValuesContinuous.empty() )
|
||||
m_groupedResults[categoryNum].groupValuesContinuous.push_back( result.groupValuesContinuous[i] );
|
||||
if ( !result.groupValuesDiscrete.empty() )
|
||||
m_groupedResults[categoryNum].groupValuesDiscrete.push_back( result.groupValuesDiscrete[i] );
|
||||
for ( size_t i = 0; i < result.xValues.size(); ++i )
|
||||
{
|
||||
auto upperBoundIt =
|
||||
std::lower_bound( tickValues.begin(), tickValues.end(), result.groupValuesContinuous[i] );
|
||||
int upperBoundIndex = static_cast<int>( upperBoundIt - tickValues.begin() );
|
||||
int categoryNum = std::min( (int)tickValues.size() - 2, std::max( 0, upperBoundIndex - 1 ) );
|
||||
m_groupedResults[categoryNum].xValues.push_back( result.xValues[i] );
|
||||
m_groupedResults[categoryNum].yValues.push_back( result.yValues[i] );
|
||||
if ( !result.groupValuesContinuous.empty() )
|
||||
m_groupedResults[categoryNum].groupValuesContinuous.push_back( result.groupValuesContinuous[i] );
|
||||
if ( !result.groupValuesDiscrete.empty() )
|
||||
m_groupedResults[categoryNum].groupValuesDiscrete.push_back( result.groupValuesDiscrete[i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -614,7 +623,14 @@ void RimGridCrossPlotDataSet::createCurves( const RigEclipseCrossPlotResult& res
|
||||
}
|
||||
else
|
||||
{
|
||||
curve->setColor( cvf::Color3f( legendConfig()->scalarMapper()->mapToColor( tickValues[it->first] ) ) );
|
||||
if ( it->first < static_cast<int>( tickValues.size() ) )
|
||||
{
|
||||
curve->setColor( cvf::Color3f( legendConfig()->scalarMapper()->mapToColor( tickValues[it->first] ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
curve->setColor( cvf::Color3f( legendConfig()->scalarMapper()->mapToColor( it->first ) ) );
|
||||
}
|
||||
}
|
||||
curve->setSymbolEdgeColor( curve->color() );
|
||||
curve->setSamples( it->second.xValues, it->second.yValues );
|
||||
@ -705,9 +721,13 @@ QString RimGridCrossPlotDataSet::createGroupName( size_t groupIndex ) const
|
||||
{
|
||||
std::vector<double> tickValues;
|
||||
legendConfig()->scalarMapper()->majorTickValues( &tickValues );
|
||||
double lowerLimit = tickValues[groupIndex];
|
||||
double upperLimit = groupIndex + 1u < tickValues.size() ? tickValues[groupIndex + 1u]
|
||||
: std::numeric_limits<double>::infinity();
|
||||
|
||||
double lowerLimit = std::numeric_limits<double>::infinity();
|
||||
if ( groupIndex < tickValues.size() ) lowerLimit = tickValues[groupIndex];
|
||||
|
||||
double upperLimit = std::numeric_limits<double>::infinity();
|
||||
if ( groupIndex + 1u < tickValues.size() ) upperLimit = tickValues[groupIndex + 1u];
|
||||
|
||||
return QString( "%1 [%2, %3]" ).arg( groupParameter() ).arg( lowerLimit ).arg( upperLimit );
|
||||
}
|
||||
}
|
||||
|
@ -714,6 +714,8 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicImportEnsembleFeature";
|
||||
menuBuilder << "RicNewDerivedEnsembleFeature";
|
||||
menuBuilder << "RicNewDerivedSummaryFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicShowSummaryCurveCalculatorFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimSummaryCaseCollection*>( firstUiItem ) )
|
||||
{
|
||||
|
@ -239,6 +239,14 @@ bool RimContourMapProjection::showContourLines() const
|
||||
return m_showContourLines();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimContourMapProjection::showContourLabels() const
|
||||
{
|
||||
return m_showContourLabels();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -89,6 +89,7 @@ public:
|
||||
double sampleSpacingFactor() const;
|
||||
void setSampleSpacingFactor( double spacingFactor );
|
||||
bool showContourLines() const;
|
||||
bool showContourLabels() const;
|
||||
|
||||
QString resultAggregationText() const;
|
||||
|
||||
|
@ -1890,6 +1890,7 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen
|
||||
if ( !eclipseCaseData ) return;
|
||||
|
||||
RigCaseCellResultsData* cellResultsData = eclipseCaseData->results( this->porosityModel() );
|
||||
cellResultsData->ensureKnownResultLoaded( this->eclipseResultAddress() );
|
||||
|
||||
double globalMin, globalMax;
|
||||
double globalPosClosestToZero, globalNegClosestToZero;
|
||||
|
@ -58,6 +58,7 @@ RimModeledWellPath::RimModeledWellPath()
|
||||
|
||||
// Required, as these settings are set in RimWellPath()
|
||||
m_name.uiCapability()->setUiReadOnly( false );
|
||||
m_name.uiCapability()->setUiHidden( false );
|
||||
m_name.xmlCapability()->setIOReadable( true );
|
||||
m_name.xmlCapability()->setIOWritable( true );
|
||||
}
|
||||
@ -182,3 +183,12 @@ void RimModeledWellPath::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrd
|
||||
uiTreeOrdering.add( m_geometryDefinition() );
|
||||
RimWellPath::defineUiTreeOrdering( uiTreeOrdering, uiConfigName );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimModeledWellPath::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_name );
|
||||
RimWellPath::defineUiOrdering( uiConfigName, uiOrdering );
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
|
||||
private:
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
caf::PdmChildField<RimWellPathGeometryDef*> m_geometryDefinition;
|
||||
};
|
||||
|
@ -184,8 +184,12 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const
|
||||
auto addToUnitToQuantityMap =[&]( const std::string& unitText,
|
||||
const RifEclipseSummaryAddress& sumAddress )
|
||||
{
|
||||
// remove any stats prefix from the quantity name
|
||||
size_t cutPos = sumAddress.quantityName().find(':');
|
||||
if (cutPos == std::string::npos) cutPos = -1;
|
||||
|
||||
std::string quantityNameForDisplay;
|
||||
const std::string& quantityName = sumAddress.quantityName();
|
||||
const std::string& quantityName = sumAddress.quantityName().substr(cutPos+1);
|
||||
|
||||
if ( sumAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
{
|
||||
@ -225,11 +229,7 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const
|
||||
RifEclipseSummaryAddress sumAddress;
|
||||
std::string unitText;
|
||||
|
||||
if ( rimCurve->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if ( m_axisProperties->plotAxisType() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
||||
if ( m_axisProperties->plotAxisType() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
||||
{
|
||||
sumAddress = rimCurve->summaryAddressX();
|
||||
unitText = rimCurve->unitNameX();
|
||||
|
@ -71,6 +71,7 @@ RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
|
||||
CAF_PDM_InitFieldNoDefault( &m_cellBlock, "CellBlock", "Block", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_segment, "Segment", "Segment", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_completion, "Completion", "Completion", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_aquifer, "Aquifer", "Aquifer", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_ensemble, "Ensemble", "Ensemble", "", "", "" );
|
||||
|
||||
@ -312,6 +313,10 @@ QList<caf::PdmOptionItemInfo>
|
||||
secondaryIdentifier = m_wellName().toStdString();
|
||||
category = RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION;
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_aquifer )
|
||||
{
|
||||
category = RifEclipseSummaryAddress::SUMMARY_AQUIFER;
|
||||
}
|
||||
|
||||
std::vector<QString> identifierTexts;
|
||||
|
||||
@ -496,6 +501,10 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
{
|
||||
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION;
|
||||
}
|
||||
else if ( changedField == &m_aquifer )
|
||||
{
|
||||
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_AQUIFER;
|
||||
}
|
||||
|
||||
if ( summaryCategoryToModify != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
||||
{
|
||||
@ -737,6 +746,7 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFi
|
||||
m_cellBlock.uiCapability()->setUiHidden( true );
|
||||
m_segment.uiCapability()->setUiHidden( true );
|
||||
m_completion.uiCapability()->setUiHidden( true );
|
||||
m_aquifer.uiCapability()->setUiHidden( true );
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> fields;
|
||||
|
||||
@ -858,6 +868,14 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFi
|
||||
fieldsCommonForAllCurves.push_back( &m_completion );
|
||||
}
|
||||
|
||||
if ( analyzer.aquifers().size() == 1 )
|
||||
{
|
||||
m_aquifer = *( analyzer.aquifers().begin() );
|
||||
m_aquifer.uiCapability()->setUiHidden( false );
|
||||
|
||||
fieldsCommonForAllCurves.push_back( &m_aquifer );
|
||||
}
|
||||
|
||||
if ( !analyzer.quantityNameForTitle().empty() )
|
||||
{
|
||||
QString txt = QString::fromStdString( analyzer.quantityNameForTitle() );
|
||||
@ -972,6 +990,18 @@ bool RimSummaryPlotSourceStepping::updateAddressIfMatching( const QVariant&
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_AQUIFER )
|
||||
{
|
||||
int oldInt = oldValue.toInt();
|
||||
int newInt = newValue.toInt();
|
||||
|
||||
if ( adr->aquiferNumber() == oldInt )
|
||||
{
|
||||
adr->setAquiferNumber( newInt );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP )
|
||||
{
|
||||
std::string oldString = oldValue.toString().toStdString();
|
||||
|
@ -120,6 +120,8 @@ private:
|
||||
caf::PdmField<QString> m_segment;
|
||||
caf::PdmField<QString> m_completion;
|
||||
|
||||
caf::PdmField<int> m_aquifer;
|
||||
|
||||
caf::PdmField<bool> m_includeEnsembleCasesForCaseStepping;
|
||||
|
||||
SourceSteppingType m_sourceSteppingType;
|
||||
|
@ -17,6 +17,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RiuScalarMapperLegendFrame.h"
|
||||
|
||||
#include "cvfScalarMapperDiscreteLinear.h"
|
||||
#include "cvfScalarMapperDiscreteLog.h"
|
||||
#include "cvfString.h"
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
@ -162,8 +164,16 @@ void RiuScalarMapperLegendFrame::renderRect( QPainter* painter, const LayoutInfo
|
||||
int rectIndexFromBottom = rectCount() - rectIndex - 1;
|
||||
cvf::Color3ub startColor = m_scalarMapper->mapToColor( m_tickValues[rectIndexFromBottom] );
|
||||
cvf::Color3ub endColor = m_scalarMapper->mapToColor( m_tickValues[rectIndexFromBottom + 1] );
|
||||
QColor startQColor( startColor.r(), startColor.g(), startColor.b() );
|
||||
QColor endQColor( endColor.r(), endColor.g(), endColor.b() );
|
||||
|
||||
if ( dynamic_cast<const cvf::ScalarMapperDiscreteLog*>( m_scalarMapper.p() ) ||
|
||||
dynamic_cast<const cvf::ScalarMapperDiscreteLinear*>( m_scalarMapper.p() ) )
|
||||
{
|
||||
// Do not draw gradient for discrete legends
|
||||
endColor = startColor;
|
||||
}
|
||||
|
||||
QColor startQColor( startColor.r(), startColor.g(), startColor.b() );
|
||||
QColor endQColor( endColor.r(), endColor.g(), endColor.b() );
|
||||
|
||||
QRectF gradientRect( QPointF( layout.tickStartX,
|
||||
layout.colorBarRect.bottom() - layout.tickYPixelPos[rectIndexFromBottom] + 1 ),
|
||||
|
@ -55,15 +55,12 @@ RiuSummaryQuantityNameInfoProvider::RiuSummaryQuantityInfo
|
||||
else if ( quantity.size() > 1 && quantity[1] == 'U' )
|
||||
{
|
||||
// User defined vector name
|
||||
// The summary type is given by the first letter, and U defines user-defined
|
||||
// FU : field user defined name
|
||||
// WU : well user defined name
|
||||
// .....
|
||||
|
||||
std::string key = quantity.substr( 0, 2 );
|
||||
|
||||
it = m_summaryToDescMap.find( key );
|
||||
|
||||
if ( it != m_summaryToDescMap.end() )
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
return RiuSummaryQuantityInfo();
|
||||
}
|
||||
else if ( quantity.size() > 5 )
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ set(RESINSIGHT_VERSION_TEXT "-dev")
|
||||
# Must be unique and increasing within one combination of major/minor/patch version
|
||||
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
|
||||
# Format of text must be ".xx"
|
||||
set(RESINSIGHT_DEV_VERSION ".01")
|
||||
set(RESINSIGHT_DEV_VERSION ".02")
|
||||
|
||||
# https://github.com/CRAVA/crava/tree/master/libs/nrlib
|
||||
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")
|
||||
|
Loading…
Reference in New Issue
Block a user