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", "", "", "" );
|
CAF_PDM_InitField( &scriptEditorExecutable, "scriptEditorExecutable", defaultTextEditor, "Script Editor", "", "", "" );
|
||||||
scriptEditorExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
scriptEditorExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||||
|
|
||||||
CAF_PDM_InitField( &octaveExecutable, "octaveExecutable", QString( "octave" ), "Octave Executable Location", "", "", "" );
|
CAF_PDM_InitField( &m_octaveExecutable, "octaveExecutable", QString( "octave" ), "Octave Executable Location", "", "", "" );
|
||||||
octaveExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
m_octaveExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||||
octaveExecutable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
m_octaveExecutable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||||
|
|
||||||
CAF_PDM_InitField( &octaveShowHeaderInfoWhenExecutingScripts,
|
CAF_PDM_InitField( &octaveShowHeaderInfoWhenExecutingScripts,
|
||||||
"octaveShowHeaderInfoWhenExecutingScripts",
|
"octaveShowHeaderInfoWhenExecutingScripts",
|
||||||
@ -138,9 +138,9 @@ RiaPreferences::RiaPreferences( void )
|
|||||||
"" );
|
"" );
|
||||||
octaveShowHeaderInfoWhenExecutingScripts.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
octaveShowHeaderInfoWhenExecutingScripts.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||||
|
|
||||||
CAF_PDM_InitField( &pythonExecutable, "pythonExecutable", QString( "python" ), "Python Executable Location", "", "", "" );
|
CAF_PDM_InitField( &m_pythonExecutable, "pythonExecutable", QString( "python" ), "Python Executable Location", "", "", "" );
|
||||||
pythonExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
m_pythonExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||||
pythonExecutable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
m_pythonExecutable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||||
CAF_PDM_InitField( &showPythonDebugInfo, "pythonDebugInfo", false, "Show Python Debug Info", "", "", "" );
|
CAF_PDM_InitField( &showPythonDebugInfo, "pythonDebugInfo", false, "Show Python Debug Info", "", "", "" );
|
||||||
|
|
||||||
CAF_PDM_InitField( &ssihubAddress, "ssihubAddress", QString( "http://" ), "SSIHUB Address", "", "", "" );
|
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() )
|
else if ( uiConfigName == RiaPreferences::tabNameScripting() )
|
||||||
{
|
{
|
||||||
caf::PdmUiGroup* octaveGroup = uiOrdering.addNewGroup( "Octave" );
|
caf::PdmUiGroup* octaveGroup = uiOrdering.addNewGroup( "Octave" );
|
||||||
octaveGroup->add( &octaveExecutable );
|
octaveGroup->add( &m_octaveExecutable );
|
||||||
octaveGroup->add( &octaveShowHeaderInfoWhenExecutingScripts );
|
octaveGroup->add( &octaveShowHeaderInfoWhenExecutingScripts );
|
||||||
|
|
||||||
#ifdef ENABLE_GRPC
|
#ifdef ENABLE_GRPC
|
||||||
@ -563,7 +563,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
|||||||
pythonGroup->add( &enableGrpcServer );
|
pythonGroup->add( &enableGrpcServer );
|
||||||
pythonGroup->add( &showPythonDebugInfo );
|
pythonGroup->add( &showPythonDebugInfo );
|
||||||
pythonGroup->add( &defaultGrpcPortNumber );
|
pythonGroup->add( &defaultGrpcPortNumber );
|
||||||
pythonGroup->add( &pythonExecutable );
|
pythonGroup->add( &m_pythonExecutable );
|
||||||
#endif
|
#endif
|
||||||
caf::PdmUiGroup* scriptGroup = uiOrdering.addNewGroup( "Script files" );
|
caf::PdmUiGroup* scriptGroup = uiOrdering.addNewGroup( "Script files" );
|
||||||
scriptGroup->add( &scriptDirectories );
|
scriptGroup->add( &scriptDirectories );
|
||||||
@ -1104,6 +1104,22 @@ bool RiaPreferences::showGridBox() const
|
|||||||
return m_showGridBox();
|
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 showInfoBox() const;
|
||||||
bool showGridBox() const;
|
bool showGridBox() const;
|
||||||
|
|
||||||
|
// Script paths
|
||||||
|
QString pythonExecutable() const;
|
||||||
|
QString octaveExecutable() const;
|
||||||
|
|
||||||
public: // Pdm Fields
|
public: // Pdm Fields
|
||||||
caf::PdmField<bool> enableGrpcServer;
|
caf::PdmField<bool> enableGrpcServer;
|
||||||
caf::PdmField<int> defaultGrpcPortNumber;
|
caf::PdmField<int> defaultGrpcPortNumber;
|
||||||
|
|
||||||
caf::PdmField<QString> scriptDirectories;
|
caf::PdmField<QString> scriptDirectories;
|
||||||
caf::PdmField<QString> scriptEditorExecutable;
|
caf::PdmField<QString> scriptEditorExecutable;
|
||||||
|
|
||||||
caf::PdmField<QString> octaveExecutable;
|
|
||||||
caf::PdmField<bool> octaveShowHeaderInfoWhenExecutingScripts;
|
caf::PdmField<bool> octaveShowHeaderInfoWhenExecutingScripts;
|
||||||
|
|
||||||
caf::PdmField<QString> pythonExecutable;
|
|
||||||
caf::PdmField<bool> showPythonDebugInfo;
|
caf::PdmField<bool> showPythonDebugInfo;
|
||||||
|
|
||||||
caf::PdmField<QString> ssihubAddress;
|
caf::PdmField<QString> ssihubAddress;
|
||||||
@ -228,6 +228,10 @@ private:
|
|||||||
caf::PdmField<bool> m_searchPlotTemplateFoldersRecursively;
|
caf::PdmField<bool> m_searchPlotTemplateFoldersRecursively;
|
||||||
caf::PdmField<caf::FilePath> m_defaultPlotTemplate;
|
caf::PdmField<caf::FilePath> m_defaultPlotTemplate;
|
||||||
|
|
||||||
|
// Script paths
|
||||||
|
caf::PdmField<QString> m_octaveExecutable;
|
||||||
|
caf::PdmField<QString> m_pythonExecutable;
|
||||||
|
|
||||||
// Surface Import
|
// Surface Import
|
||||||
caf::PdmField<double> m_surfaceImportResamplingDistance;
|
caf::PdmField<double> m_surfaceImportResamplingDistance;
|
||||||
|
|
||||||
|
@ -279,14 +279,9 @@ QString RiaProjectModifier::makeFilePathAbsolute( const QString& relOrAbsolutePa
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RiaProjectModifier::caseNameFromGridFileName( const QString& fullGridFilePathName )
|
QString RiaProjectModifier::caseNameFromGridFileName( const QString& fullGridFilePathName )
|
||||||
{
|
{
|
||||||
QString fn = QDir::fromNativeSeparators( fullGridFilePathName );
|
QFileInfo fi( fullGridFilePathName );
|
||||||
|
|
||||||
// Extract file name plus the 'deepest' directory
|
return fi.baseName();
|
||||||
QString deepestDirPlusFileName = fn.section( '/', -2, -1 );
|
|
||||||
|
|
||||||
deepestDirPlusFileName.replace( "/", "--" );
|
|
||||||
|
|
||||||
return deepestDirPlusFileName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -169,6 +169,14 @@ std::set<std::string> RiaSummaryCurveAnalyzer::blocks() const
|
|||||||
return m_blocks;
|
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 ) );
|
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;
|
return identifierStrings;
|
||||||
}
|
}
|
||||||
@ -284,6 +299,7 @@ void RiaSummaryCurveAnalyzer::clear()
|
|||||||
m_wellCompletions.clear();
|
m_wellCompletions.clear();
|
||||||
m_wellSegmentNumbers.clear();
|
m_wellSegmentNumbers.clear();
|
||||||
m_blocks.clear();
|
m_blocks.clear();
|
||||||
|
m_aquifers.clear();
|
||||||
|
|
||||||
m_quantitiesNoMatchingHistory.clear();
|
m_quantitiesNoMatchingHistory.clear();
|
||||||
m_quantitiesWithMatchingHistory.clear();
|
m_quantitiesWithMatchingHistory.clear();
|
||||||
@ -378,6 +394,10 @@ void RiaSummaryCurveAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAddre
|
|||||||
auto text = address.blockAsString();
|
auto text = address.blockAsString();
|
||||||
m_blocks.insert( text );
|
m_blocks.insert( text );
|
||||||
}
|
}
|
||||||
|
else if ( address.category() == RifEclipseSummaryAddress::SUMMARY_AQUIFER )
|
||||||
|
{
|
||||||
|
m_aquifers.insert( address.aquiferNumber() );
|
||||||
|
}
|
||||||
|
|
||||||
if ( address.category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
if ( address.category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
||||||
{
|
{
|
||||||
|
@ -55,6 +55,7 @@ public:
|
|||||||
std::set<std::string> wellCompletions( const std::string& wellName ) const;
|
std::set<std::string> wellCompletions( const std::string& wellName ) const;
|
||||||
std::set<int> wellSegmentNumbers( const std::string& wellName ) const;
|
std::set<int> wellSegmentNumbers( const std::string& wellName ) const;
|
||||||
std::set<std::string> blocks() const;
|
std::set<std::string> blocks() const;
|
||||||
|
std::set<int> aquifers() const;
|
||||||
|
|
||||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> categories() 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, std::string>> m_wellCompletions;
|
||||||
std::set<std::pair<std::string, int>> m_wellSegmentNumbers;
|
std::set<std::pair<std::string, int>> m_wellSegmentNumbers;
|
||||||
std::set<std::string> m_blocks;
|
std::set<std::string> m_blocks;
|
||||||
|
std::set<int> m_aquifers;
|
||||||
|
|
||||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> m_categories;
|
std::set<RifEclipseSummaryAddress::SummaryVarCategory> m_categories;
|
||||||
};
|
};
|
||||||
|
@ -198,6 +198,7 @@ void RicCloseCaseFeature::deleteEclipseCase( RimEclipseCase* eclipseCase )
|
|||||||
{
|
{
|
||||||
RimGridSummaryCase* gridSummaryCase = dynamic_cast<RimGridSummaryCase*>( summaryCase );
|
RimGridSummaryCase* gridSummaryCase = dynamic_cast<RimGridSummaryCase*>( summaryCase );
|
||||||
sumCaseColl->convertGridSummaryCasesToFileSummaryCases( gridSummaryCase );
|
sumCaseColl->convertGridSummaryCasesToFileSummaryCases( gridSummaryCase );
|
||||||
|
sumCaseColl->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,13 +20,16 @@
|
|||||||
|
|
||||||
#include "RiaFilePathTools.h"
|
#include "RiaFilePathTools.h"
|
||||||
#include "RiaGuiApplication.h"
|
#include "RiaGuiApplication.h"
|
||||||
|
#include "RiaStringListSerializer.h"
|
||||||
|
|
||||||
#include "RiuFileDialogTools.h"
|
#include "RiuFileDialogTools.h"
|
||||||
#include "RiuTools.h"
|
#include "RiuTools.h"
|
||||||
|
|
||||||
#include <QAbstractItemView>
|
#include <QAbstractItemView>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
|
#include <QComboBox>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
@ -35,12 +38,14 @@
|
|||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QSettings>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define RECURSIVE_FILESEARCH_DEFAULT_DIALOG_HEIGHT 350
|
#define RECURSIVE_FILESEARCH_DEFAULT_DIALOG_HEIGHT 350
|
||||||
@ -70,7 +75,31 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea
|
|||||||
QString pathFilterText = dir;
|
QString pathFilterText = dir;
|
||||||
RiaFilePathTools::appendSeparatorIfNo( pathFilterText );
|
RiaFilePathTools::appendSeparatorIfNo( pathFilterText );
|
||||||
pathFilterText += pathFilter;
|
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_fileFilterField->setText( fileNameFilter );
|
||||||
dialog.m_fileExtensions = trimLeftStrings( fileExtensions, "." );
|
dialog.m_fileExtensions = trimLeftStrings( fileExtensions, "." );
|
||||||
|
|
||||||
@ -81,6 +110,14 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea
|
|||||||
dialog.resize( 800, 150 );
|
dialog.resize( 800, 150 );
|
||||||
dialog.exec();
|
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,
|
return RicRecursiveFileSearchDialogResult( dialog.result() == QDialog::Accepted,
|
||||||
dialog.m_foundFiles,
|
dialog.m_foundFiles,
|
||||||
dialog.rootDirWithEndSeparator(),
|
dialog.rootDirWithEndSeparator(),
|
||||||
@ -96,8 +133,12 @@ RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent )
|
|||||||
{
|
{
|
||||||
// Create widgets
|
// 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_pathFilterLabel = new QLabel();
|
||||||
m_pathFilterField = new QLineEdit();
|
m_pathFilterField = new QComboBox();
|
||||||
m_fileFilterLabel = new QLabel();
|
m_fileFilterLabel = new QLabel();
|
||||||
m_fileFilterField = new QLineEdit();
|
m_fileFilterField = new QLineEdit();
|
||||||
m_effectiveFilterLabel = new QLabel();
|
m_effectiveFilterLabel = new QLabel();
|
||||||
@ -110,7 +151,15 @@ RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent )
|
|||||||
m_buttons = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
|
m_buttons = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
|
||||||
|
|
||||||
// Connect to signals
|
// 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_fileFilterField, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotFilterChanged( const QString& ) ) );
|
||||||
|
|
||||||
connect( m_fileListWidget,
|
connect( m_fileListWidget,
|
||||||
@ -159,9 +208,10 @@ RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent )
|
|||||||
inputGridLayout->addWidget( m_browseButton, 0, 3 );
|
inputGridLayout->addWidget( m_browseButton, 0, 3 );
|
||||||
inputGridLayout->addWidget( m_fileFilterLabel, 1, 0 );
|
inputGridLayout->addWidget( m_fileFilterLabel, 1, 0 );
|
||||||
inputGridLayout->addWidget( m_fileFilterField, 1, 1, 1, 2 );
|
inputGridLayout->addWidget( m_fileFilterField, 1, 1, 1, 2 );
|
||||||
inputGridLayout->addWidget( m_effectiveFilterLabel, 2, 0 );
|
inputGridLayout->addWidget( m_useRealizationStarCheckBox, 2, 1 );
|
||||||
inputGridLayout->addWidget( m_effectiveFilterContentLabel, 2, 1 );
|
inputGridLayout->addWidget( m_effectiveFilterLabel, 3, 0 );
|
||||||
inputGridLayout->addWidget( m_findOrCancelButton, 2, 2, 1, 2 );
|
inputGridLayout->addWidget( m_effectiveFilterContentLabel, 3, 1 );
|
||||||
|
inputGridLayout->addWidget( m_findOrCancelButton, 3, 2, 1, 2 );
|
||||||
|
|
||||||
inputGroup->setLayout( inputGridLayout );
|
inputGroup->setLayout( inputGridLayout );
|
||||||
|
|
||||||
@ -221,10 +271,16 @@ RicRecursiveFileSearchDialog::~RicRecursiveFileSearchDialog()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RicRecursiveFileSearchDialog::cleanTextFromPathFilterField() const
|
QString RicRecursiveFileSearchDialog::cleanTextFromPathFilterField() const
|
||||||
{
|
{
|
||||||
QString pathFilterText = m_pathFilterField->text().trimmed();
|
QString pathFilterText = m_pathFilterField->currentText().trimmed();
|
||||||
pathFilterText = RiaFilePathTools::toInternalSeparator( pathFilterText );
|
pathFilterText = RiaFilePathTools::toInternalSeparator( pathFilterText );
|
||||||
pathFilterText = RiaFilePathTools::removeDuplicatePathSeparators( pathFilterText );
|
pathFilterText = RiaFilePathTools::removeDuplicatePathSeparators( pathFilterText );
|
||||||
pathFilterText.replace( QString( "**" ), QString( "*" ) );
|
pathFilterText.replace( QString( "**" ), QString( "*" ) );
|
||||||
|
|
||||||
|
if ( m_useRealizationStarCheckBox->isChecked() )
|
||||||
|
{
|
||||||
|
pathFilterText = replaceWithRealizationStar( pathFilterText );
|
||||||
|
}
|
||||||
|
|
||||||
return pathFilterText;
|
return pathFilterText;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -489,6 +545,20 @@ QStringList RicRecursiveFileSearchDialog::createFileNameFilterList()
|
|||||||
return nameFilter;
|
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() );
|
QString folder = RiuFileDialogTools::getExistingDirectory( this, "Select folder", rootDirWithEndSeparator() );
|
||||||
RiaFilePathTools::appendSeparatorIfNo( folder );
|
RiaFilePathTools::appendSeparatorIfNo( folder );
|
||||||
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 QMainWindow;
|
||||||
class QListWidget;
|
class QListWidget;
|
||||||
class QGroupBox;
|
class QGroupBox;
|
||||||
|
class QComboBox;
|
||||||
|
class QCheckBox;
|
||||||
|
|
||||||
class RicRecursiveFileSearchDialogResult;
|
class RicRecursiveFileSearchDialogResult;
|
||||||
|
|
||||||
@ -85,10 +87,12 @@ private:
|
|||||||
QStringList* accumulatedDirs );
|
QStringList* accumulatedDirs );
|
||||||
QStringList findFilesInDirs( const QStringList& dirs );
|
QStringList findFilesInDirs( const QStringList& dirs );
|
||||||
QStringList createFileNameFilterList();
|
QStringList createFileNameFilterList();
|
||||||
|
static QString replaceWithRealizationStar( const QString& text );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotFilterChanged( const QString& text );
|
void slotFilterChanged( const QString& text );
|
||||||
void slotBrowseButtonClicked();
|
void slotBrowseButtonClicked();
|
||||||
|
void slotUseRealizationStarClicked();
|
||||||
void slotFindOrCancelButtonClicked();
|
void slotFindOrCancelButtonClicked();
|
||||||
|
|
||||||
void slotFileListCustomMenuRequested( const QPoint& point );
|
void slotFileListCustomMenuRequested( const QPoint& point );
|
||||||
@ -102,8 +106,9 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QLabel* m_pathFilterLabel;
|
QLabel* m_pathFilterLabel;
|
||||||
QLineEdit* m_pathFilterField;
|
QComboBox* m_pathFilterField;
|
||||||
QPushButton* m_browseButton;
|
QPushButton* m_browseButton;
|
||||||
|
QCheckBox* m_useRealizationStarCheckBox;
|
||||||
|
|
||||||
QLabel* m_fileFilterLabel;
|
QLabel* m_fileFilterLabel;
|
||||||
QLineEdit* m_fileFilterField;
|
QLineEdit* m_fileFilterField;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
#include "RiaSummaryTools.h"
|
#include "RiaSummaryTools.h"
|
||||||
|
#include "RicReplaceSummaryCaseFeature.h"
|
||||||
|
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimObservedDataCollection.h"
|
#include "RimObservedDataCollection.h"
|
||||||
@ -61,6 +62,8 @@ void RicReloadSummaryCaseFeature::onActionTriggered( bool isChecked )
|
|||||||
summaryCase->createSummaryReaderInterface();
|
summaryCase->createSummaryReaderInterface();
|
||||||
summaryCase->createRftReaderInterface();
|
summaryCase->createRftReaderInterface();
|
||||||
|
|
||||||
|
RicReplaceSummaryCaseFeature::updateRequredCalculatedCurves( summaryCase );
|
||||||
|
|
||||||
RiaLogging::info( QString( "Reloaded data for %1" ).arg( summaryCase->summaryHeaderFilename() ) );
|
RiaLogging::info( QString( "Reloaded data for %1" ).arg( summaryCase->summaryHeaderFilename() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,6 +46,26 @@
|
|||||||
|
|
||||||
CAF_CMD_SOURCE_INIT( RicReplaceSummaryCaseFeature, "RicReplaceSummaryCaseFeature" );
|
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();
|
summaryCase->createRftReaderInterface();
|
||||||
RiaLogging::info( QString( "Replaced summary data for %1" ).arg( oldSummaryHeaderFilename ) );
|
RiaLogging::info( QString( "Replaced summary data for %1" ).arg( oldSummaryHeaderFilename ) );
|
||||||
|
|
||||||
RimSummaryCalculationCollection* calcColl = RimProject::current()->calculationCollection();
|
RicReplaceSummaryCaseFeature::updateRequredCalculatedCurves( summaryCase );
|
||||||
|
|
||||||
// Find and update all changed calculations
|
// Find and update all changed calculations
|
||||||
std::set<int> ids;
|
std::set<int> ids;
|
||||||
|
RimSummaryCalculationCollection* calcColl = RimProject::current()->calculationCollection();
|
||||||
for ( RimSummaryCalculation* summaryCalculation : calcColl->calculations() )
|
for ( RimSummaryCalculation* summaryCalculation : calcColl->calculations() )
|
||||||
{
|
{
|
||||||
bool needsUpdate = checkIfCalculationNeedsUpdate( summaryCalculation, summaryCase );
|
bool needsUpdate = checkIfCalculationNeedsUpdate( summaryCalculation, summaryCase );
|
||||||
if ( needsUpdate )
|
if ( needsUpdate )
|
||||||
{
|
{
|
||||||
ids.insert( summaryCalculation->id() );
|
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,
|
bool RicReplaceSummaryCaseFeature::checkIfCalculationNeedsUpdate( const RimSummaryCalculation* summaryCalculation,
|
||||||
const RimFileSummaryCase* summaryCase )
|
const RimSummaryCase* summaryCase )
|
||||||
{
|
{
|
||||||
std::vector<RimSummaryCalculationVariable*> variables = summaryCalculation->allVariables();
|
std::vector<RimSummaryCalculationVariable*> variables = summaryCalculation->allVariables();
|
||||||
for ( RimSummaryCalculationVariable* variable : variables )
|
for ( RimSummaryCalculationVariable* variable : variables )
|
||||||
|
@ -21,17 +21,20 @@
|
|||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
class RimSummaryCalculation;
|
class RimSummaryCalculation;
|
||||||
class RimFileSummaryCase;
|
class RimSummaryCase;
|
||||||
|
|
||||||
class RicReplaceSummaryCaseFeature : public caf::CmdFeature
|
class RicReplaceSummaryCaseFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static void updateRequredCalculatedCurves( RimSummaryCase* sourceSummaryCase );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool isCommandEnabled() override;
|
bool isCommandEnabled() override;
|
||||||
void onActionTriggered( bool isChecked ) override;
|
void onActionTriggered( bool isChecked ) override;
|
||||||
void setupActionLook( QAction* actionToSetup ) override;
|
void setupActionLook( QAction* actionToSetup ) override;
|
||||||
|
|
||||||
bool checkIfCalculationNeedsUpdate( const RimSummaryCalculation* summaryCalculation,
|
static bool checkIfCalculationNeedsUpdate( const RimSummaryCalculation* summaryCalculation,
|
||||||
const RimFileSummaryCase* summaryCase );
|
const RimSummaryCase* summaryCase );
|
||||||
};
|
};
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
|
|
||||||
#include "RifEnsembleStatisticsReader.h"
|
#include "RifEnsembleStatisticsReader.h"
|
||||||
|
|
||||||
|
#include "RimEnsembleCurveSet.h"
|
||||||
#include "RimEnsembleStatisticsCase.h"
|
#include "RimEnsembleStatisticsCase.h"
|
||||||
|
#include "RimSummaryCaseCollection.h"
|
||||||
|
|
||||||
static const std::vector<time_t> EMPTY_TIME_STEPS_VECTOR;
|
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
|
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)
|
case.replace(new_grid_file=case_path)
|
||||||
# Check that the case object has been changed
|
# Check that the case object has been changed
|
||||||
assert(case.name == "Real0--BRUGGE_0000.EGRID")
|
assert(case.name == "BRUGGE_0000")
|
||||||
assert(case.id == 0)
|
assert(case.id == 0)
|
||||||
|
|
||||||
cases = rips_instance.project.cases()
|
cases = rips_instance.project.cases()
|
||||||
assert(len(cases) is 1)
|
assert(len(cases) is 1)
|
||||||
# Check that retrieving the case object again will yield the changed object
|
# Check that retrieving the case object again will yield the changed object
|
||||||
case = project.case(case_id=0)
|
case = project.case(case_id=0)
|
||||||
assert(case.name == "Real0--BRUGGE_0000.EGRID")
|
assert(case.name == "BRUGGE_0000")
|
||||||
assert(case.id == 0)
|
assert(case.id == 0)
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,8 +127,12 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
|||||||
cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper();
|
cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper();
|
||||||
|
|
||||||
std::vector<std::vector<cvf::BoundingBox>> labelBBoxes;
|
std::vector<std::vector<cvf::BoundingBox>> labelBBoxes;
|
||||||
std::vector<cvf::ref<cvf::Drawable>> labelDrawables =
|
std::vector<cvf::ref<cvf::Drawable>> labelDrawables;
|
||||||
createContourLabels( camera, displayCoordTransform, &labelBBoxes );
|
|
||||||
|
if ( m_contourMapProjection->showContourLabels() )
|
||||||
|
{
|
||||||
|
labelDrawables = createContourLabels( camera, displayCoordTransform, &labelBBoxes );
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::vector<cvf::ref<cvf::Drawable>>> contourDrawablesForAllLevels =
|
std::vector<std::vector<cvf::ref<cvf::Drawable>>> contourDrawablesForAllLevels =
|
||||||
createContourPolygons( displayCoordTransform, labelBBoxes );
|
createContourPolygons( displayCoordTransform, labelBBoxes );
|
||||||
@ -163,6 +167,9 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_contourMapProjection->showContourLabels() )
|
||||||
|
{
|
||||||
for ( auto labelDrawableRef : labelDrawables )
|
for ( auto labelDrawableRef : labelDrawables )
|
||||||
{
|
{
|
||||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||||
@ -174,6 +181,7 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -295,6 +303,8 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
|||||||
lineBBox.add( displayVertex2 );
|
lineBBox.add( displayVertex2 );
|
||||||
|
|
||||||
bool addOriginalSegment = true;
|
bool addOriginalSegment = true;
|
||||||
|
if ( labelBBoxes.size() > 0 )
|
||||||
|
{
|
||||||
for ( const cvf::BoundingBox& existingBBox : labelBBoxes[i] )
|
for ( const cvf::BoundingBox& existingBBox : labelBBoxes[i] )
|
||||||
{
|
{
|
||||||
if ( lineBBox.intersects( existingBBox ) )
|
if ( lineBBox.intersects( existingBBox ) )
|
||||||
@ -340,6 +350,7 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ( addOriginalSegment )
|
if ( addOriginalSegment )
|
||||||
{
|
{
|
||||||
displayLines.push_back( cvf::Vec3f( displayVertex1 ) );
|
displayLines.push_back( cvf::Vec3f( displayVertex1 ) );
|
||||||
|
@ -467,6 +467,13 @@ void RimGridCrossPlotDataSet::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
return;
|
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 xAddress( m_xAxisProperty->resultType(), m_xAxisProperty->resultVariable() );
|
||||||
RigEclipseResultAddress yAddress( m_yAxisProperty->resultType(), m_yAxisProperty->resultVariable() );
|
RigEclipseResultAddress yAddress( m_yAxisProperty->resultType(), m_yAxisProperty->resultVariable() );
|
||||||
RigEclipseResultAddress groupAddress( m_groupingProperty->resultType(), m_groupingProperty->resultVariable() );
|
RigEclipseResultAddress groupAddress( m_groupingProperty->resultType(), m_groupingProperty->resultVariable() );
|
||||||
@ -531,8 +538,6 @@ void RimGridCrossPlotDataSet::assignCurveDataGroups( const RigEclipseCrossPlotRe
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::vector<double> tickValues;
|
|
||||||
|
|
||||||
if ( groupingByCategoryResult() )
|
if ( groupingByCategoryResult() )
|
||||||
{
|
{
|
||||||
for ( size_t i = 0; i < result.xValues.size(); ++i )
|
for ( size_t i = 0; i < result.xValues.size(); ++i )
|
||||||
@ -550,8 +555,11 @@ void RimGridCrossPlotDataSet::assignCurveDataGroups( const RigEclipseCrossPlotRe
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
std::vector<double> tickValues;
|
||||||
legendConfig()->scalarMapper()->majorTickValues( &tickValues );
|
legendConfig()->scalarMapper()->majorTickValues( &tickValues );
|
||||||
|
|
||||||
|
if ( !tickValues.empty() )
|
||||||
|
{
|
||||||
for ( size_t i = 0; i < result.xValues.size(); ++i )
|
for ( size_t i = 0; i < result.xValues.size(); ++i )
|
||||||
{
|
{
|
||||||
auto upperBoundIt =
|
auto upperBoundIt =
|
||||||
@ -568,6 +576,7 @@ void RimGridCrossPlotDataSet::assignCurveDataGroups( const RigEclipseCrossPlotRe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -613,9 +622,16 @@ void RimGridCrossPlotDataSet::createCurves( const RigEclipseCrossPlotResult& res
|
|||||||
curve->setColor( cvf::Color3f( legendConfig()->scalarMapper()->mapToColor( it->first ) ) );
|
curve->setColor( cvf::Color3f( legendConfig()->scalarMapper()->mapToColor( it->first ) ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if ( it->first < static_cast<int>( tickValues.size() ) )
|
||||||
{
|
{
|
||||||
curve->setColor( cvf::Color3f( legendConfig()->scalarMapper()->mapToColor( tickValues[it->first] ) ) );
|
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->setSymbolEdgeColor( curve->color() );
|
||||||
curve->setSamples( it->second.xValues, it->second.yValues );
|
curve->setSamples( it->second.xValues, it->second.yValues );
|
||||||
curve->setShowInLegend( m_crossPlotCurves.empty() );
|
curve->setShowInLegend( m_crossPlotCurves.empty() );
|
||||||
@ -705,9 +721,13 @@ QString RimGridCrossPlotDataSet::createGroupName( size_t groupIndex ) const
|
|||||||
{
|
{
|
||||||
std::vector<double> tickValues;
|
std::vector<double> tickValues;
|
||||||
legendConfig()->scalarMapper()->majorTickValues( &tickValues );
|
legendConfig()->scalarMapper()->majorTickValues( &tickValues );
|
||||||
double lowerLimit = tickValues[groupIndex];
|
|
||||||
double upperLimit = groupIndex + 1u < tickValues.size() ? tickValues[groupIndex + 1u]
|
double lowerLimit = std::numeric_limits<double>::infinity();
|
||||||
: 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 );
|
return QString( "%1 [%2, %3]" ).arg( groupParameter() ).arg( lowerLimit ).arg( upperLimit );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -714,6 +714,8 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
|||||||
menuBuilder << "RicImportEnsembleFeature";
|
menuBuilder << "RicImportEnsembleFeature";
|
||||||
menuBuilder << "RicNewDerivedEnsembleFeature";
|
menuBuilder << "RicNewDerivedEnsembleFeature";
|
||||||
menuBuilder << "RicNewDerivedSummaryFeature";
|
menuBuilder << "RicNewDerivedSummaryFeature";
|
||||||
|
menuBuilder << "Separator";
|
||||||
|
menuBuilder << "RicShowSummaryCurveCalculatorFeature";
|
||||||
}
|
}
|
||||||
else if ( dynamic_cast<RimSummaryCaseCollection*>( firstUiItem ) )
|
else if ( dynamic_cast<RimSummaryCaseCollection*>( firstUiItem ) )
|
||||||
{
|
{
|
||||||
|
@ -239,6 +239,14 @@ bool RimContourMapProjection::showContourLines() const
|
|||||||
return m_showContourLines();
|
return m_showContourLines();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimContourMapProjection::showContourLabels() const
|
||||||
|
{
|
||||||
|
return m_showContourLabels();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -89,6 +89,7 @@ public:
|
|||||||
double sampleSpacingFactor() const;
|
double sampleSpacingFactor() const;
|
||||||
void setSampleSpacingFactor( double spacingFactor );
|
void setSampleSpacingFactor( double spacingFactor );
|
||||||
bool showContourLines() const;
|
bool showContourLines() const;
|
||||||
|
bool showContourLabels() const;
|
||||||
|
|
||||||
QString resultAggregationText() const;
|
QString resultAggregationText() const;
|
||||||
|
|
||||||
|
@ -1890,6 +1890,7 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen
|
|||||||
if ( !eclipseCaseData ) return;
|
if ( !eclipseCaseData ) return;
|
||||||
|
|
||||||
RigCaseCellResultsData* cellResultsData = eclipseCaseData->results( this->porosityModel() );
|
RigCaseCellResultsData* cellResultsData = eclipseCaseData->results( this->porosityModel() );
|
||||||
|
cellResultsData->ensureKnownResultLoaded( this->eclipseResultAddress() );
|
||||||
|
|
||||||
double globalMin, globalMax;
|
double globalMin, globalMax;
|
||||||
double globalPosClosestToZero, globalNegClosestToZero;
|
double globalPosClosestToZero, globalNegClosestToZero;
|
||||||
|
@ -58,6 +58,7 @@ RimModeledWellPath::RimModeledWellPath()
|
|||||||
|
|
||||||
// Required, as these settings are set in RimWellPath()
|
// Required, as these settings are set in RimWellPath()
|
||||||
m_name.uiCapability()->setUiReadOnly( false );
|
m_name.uiCapability()->setUiReadOnly( false );
|
||||||
|
m_name.uiCapability()->setUiHidden( false );
|
||||||
m_name.xmlCapability()->setIOReadable( true );
|
m_name.xmlCapability()->setIOReadable( true );
|
||||||
m_name.xmlCapability()->setIOWritable( true );
|
m_name.xmlCapability()->setIOWritable( true );
|
||||||
}
|
}
|
||||||
@ -182,3 +183,12 @@ void RimModeledWellPath::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrd
|
|||||||
uiTreeOrdering.add( m_geometryDefinition() );
|
uiTreeOrdering.add( m_geometryDefinition() );
|
||||||
RimWellPath::defineUiTreeOrdering( uiTreeOrdering, uiConfigName );
|
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:
|
private:
|
||||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
|
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
|
||||||
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||||
|
|
||||||
caf::PdmChildField<RimWellPathGeometryDef*> m_geometryDefinition;
|
caf::PdmChildField<RimWellPathGeometryDef*> m_geometryDefinition;
|
||||||
};
|
};
|
||||||
|
@ -184,8 +184,12 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const
|
|||||||
auto addToUnitToQuantityMap =[&]( const std::string& unitText,
|
auto addToUnitToQuantityMap =[&]( const std::string& unitText,
|
||||||
const RifEclipseSummaryAddress& sumAddress )
|
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;
|
std::string quantityNameForDisplay;
|
||||||
const std::string& quantityName = sumAddress.quantityName();
|
const std::string& quantityName = sumAddress.quantityName().substr(cutPos+1);
|
||||||
|
|
||||||
if ( sumAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
if ( sumAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||||
{
|
{
|
||||||
@ -225,11 +229,7 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const
|
|||||||
RifEclipseSummaryAddress sumAddress;
|
RifEclipseSummaryAddress sumAddress;
|
||||||
std::string unitText;
|
std::string unitText;
|
||||||
|
|
||||||
if ( rimCurve->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS )
|
if ( m_axisProperties->plotAxisType() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if ( m_axisProperties->plotAxisType() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
|
|
||||||
{
|
{
|
||||||
sumAddress = rimCurve->summaryAddressX();
|
sumAddress = rimCurve->summaryAddressX();
|
||||||
unitText = rimCurve->unitNameX();
|
unitText = rimCurve->unitNameX();
|
||||||
|
@ -71,6 +71,7 @@ RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
|
|||||||
CAF_PDM_InitFieldNoDefault( &m_cellBlock, "CellBlock", "Block", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_cellBlock, "CellBlock", "Block", "", "", "" );
|
||||||
CAF_PDM_InitFieldNoDefault( &m_segment, "Segment", "Segment", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_segment, "Segment", "Segment", "", "", "" );
|
||||||
CAF_PDM_InitFieldNoDefault( &m_completion, "Completion", "Completion", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_completion, "Completion", "Completion", "", "", "" );
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_aquifer, "Aquifer", "Aquifer", "", "", "" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_ensemble, "Ensemble", "Ensemble", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_ensemble, "Ensemble", "Ensemble", "", "", "" );
|
||||||
|
|
||||||
@ -312,6 +313,10 @@ QList<caf::PdmOptionItemInfo>
|
|||||||
secondaryIdentifier = m_wellName().toStdString();
|
secondaryIdentifier = m_wellName().toStdString();
|
||||||
category = RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION;
|
category = RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION;
|
||||||
}
|
}
|
||||||
|
else if ( fieldNeedingOptions == &m_aquifer )
|
||||||
|
{
|
||||||
|
category = RifEclipseSummaryAddress::SUMMARY_AQUIFER;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<QString> identifierTexts;
|
std::vector<QString> identifierTexts;
|
||||||
|
|
||||||
@ -496,6 +501,10 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
|||||||
{
|
{
|
||||||
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION;
|
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION;
|
||||||
}
|
}
|
||||||
|
else if ( changedField == &m_aquifer )
|
||||||
|
{
|
||||||
|
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_AQUIFER;
|
||||||
|
}
|
||||||
|
|
||||||
if ( summaryCategoryToModify != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
if ( summaryCategoryToModify != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
||||||
{
|
{
|
||||||
@ -737,6 +746,7 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFi
|
|||||||
m_cellBlock.uiCapability()->setUiHidden( true );
|
m_cellBlock.uiCapability()->setUiHidden( true );
|
||||||
m_segment.uiCapability()->setUiHidden( true );
|
m_segment.uiCapability()->setUiHidden( true );
|
||||||
m_completion.uiCapability()->setUiHidden( true );
|
m_completion.uiCapability()->setUiHidden( true );
|
||||||
|
m_aquifer.uiCapability()->setUiHidden( true );
|
||||||
|
|
||||||
std::vector<caf::PdmFieldHandle*> fields;
|
std::vector<caf::PdmFieldHandle*> fields;
|
||||||
|
|
||||||
@ -858,6 +868,14 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFi
|
|||||||
fieldsCommonForAllCurves.push_back( &m_completion );
|
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() )
|
if ( !analyzer.quantityNameForTitle().empty() )
|
||||||
{
|
{
|
||||||
QString txt = QString::fromStdString( analyzer.quantityNameForTitle() );
|
QString txt = QString::fromStdString( analyzer.quantityNameForTitle() );
|
||||||
@ -972,6 +990,18 @@ bool RimSummaryPlotSourceStepping::updateAddressIfMatching( const QVariant&
|
|||||||
return true;
|
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 )
|
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP )
|
||||||
{
|
{
|
||||||
std::string oldString = oldValue.toString().toStdString();
|
std::string oldString = oldValue.toString().toStdString();
|
||||||
|
@ -120,6 +120,8 @@ private:
|
|||||||
caf::PdmField<QString> m_segment;
|
caf::PdmField<QString> m_segment;
|
||||||
caf::PdmField<QString> m_completion;
|
caf::PdmField<QString> m_completion;
|
||||||
|
|
||||||
|
caf::PdmField<int> m_aquifer;
|
||||||
|
|
||||||
caf::PdmField<bool> m_includeEnsembleCasesForCaseStepping;
|
caf::PdmField<bool> m_includeEnsembleCasesForCaseStepping;
|
||||||
|
|
||||||
SourceSteppingType m_sourceSteppingType;
|
SourceSteppingType m_sourceSteppingType;
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
#include "RiuScalarMapperLegendFrame.h"
|
#include "RiuScalarMapperLegendFrame.h"
|
||||||
|
|
||||||
|
#include "cvfScalarMapperDiscreteLinear.h"
|
||||||
|
#include "cvfScalarMapperDiscreteLog.h"
|
||||||
#include "cvfString.h"
|
#include "cvfString.h"
|
||||||
#include "cvfqtUtils.h"
|
#include "cvfqtUtils.h"
|
||||||
|
|
||||||
@ -162,6 +164,14 @@ void RiuScalarMapperLegendFrame::renderRect( QPainter* painter, const LayoutInfo
|
|||||||
int rectIndexFromBottom = rectCount() - rectIndex - 1;
|
int rectIndexFromBottom = rectCount() - rectIndex - 1;
|
||||||
cvf::Color3ub startColor = m_scalarMapper->mapToColor( m_tickValues[rectIndexFromBottom] );
|
cvf::Color3ub startColor = m_scalarMapper->mapToColor( m_tickValues[rectIndexFromBottom] );
|
||||||
cvf::Color3ub endColor = m_scalarMapper->mapToColor( m_tickValues[rectIndexFromBottom + 1] );
|
cvf::Color3ub endColor = m_scalarMapper->mapToColor( m_tickValues[rectIndexFromBottom + 1] );
|
||||||
|
|
||||||
|
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 startQColor( startColor.r(), startColor.g(), startColor.b() );
|
||||||
QColor endQColor( endColor.r(), endColor.g(), endColor.b() );
|
QColor endQColor( endColor.r(), endColor.g(), endColor.b() );
|
||||||
|
|
||||||
|
@ -55,15 +55,12 @@ RiuSummaryQuantityNameInfoProvider::RiuSummaryQuantityInfo
|
|||||||
else if ( quantity.size() > 1 && quantity[1] == 'U' )
|
else if ( quantity.size() > 1 && quantity[1] == 'U' )
|
||||||
{
|
{
|
||||||
// User defined vector name
|
// 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 );
|
return RiuSummaryQuantityInfo();
|
||||||
|
|
||||||
it = m_summaryToDescMap.find( key );
|
|
||||||
|
|
||||||
if ( it != m_summaryToDescMap.end() )
|
|
||||||
{
|
|
||||||
return it->second;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if ( quantity.size() > 5 )
|
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
|
# Must be unique and increasing within one combination of major/minor/patch version
|
||||||
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
|
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
|
||||||
# Format of text must be ".xx"
|
# 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
|
# https://github.com/CRAVA/crava/tree/master/libs/nrlib
|
||||||
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")
|
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")
|
||||||
|
Loading…
Reference in New Issue
Block a user