Adjustments to UI

* #9551: Guard nullpointer if no RFT data is present
* Hide RFT in tree view if no RFT file is found
* Avoid display of 3d main window when importing a summary case
* Use specific grid import feature instead of general file import feature
This commit is contained in:
Magne Sjaastad 2022-12-09 08:47:40 +01:00 committed by GitHub
parent 5ec32f8613
commit 7cb6c587c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 64 additions and 48 deletions

View File

@ -75,6 +75,6 @@ void RicImportEclipseCaseFeature::onActionTriggered( bool isChecked )
//--------------------------------------------------------------------------------------------------
void RicImportEclipseCaseFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/Case48x48.png" ) );
actionToSetup->setIcon( QIcon( ":/Case.svg" ) );
actionToSetup->setText( "Import Eclipse Case" );
}

View File

@ -201,10 +201,9 @@ QStringList RicImportGeneralDataFeature::getEclipseFileNamesWithDialog( RiaDefin
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectory( defaultDirectoryLabel( fileType ) );
QStringList fileNames = RiuFileDialogTools::getOpenFileNames( Riu3DMainWindowTools::mainWindowWidget(),
"Import Data File",
defaultDir,
fullPattern );
// Use nullptr as parent to this dialog, as this function is called from both plot window and main window
QStringList fileNames = RiuFileDialogTools::getOpenFileNames( nullptr, "Import Data File", defaultDir, fullPattern );
return fileNames;
}

View File

@ -475,7 +475,8 @@ RimWellLogCurve* RicWellLogTools::addSummaryRftCurve( RimWellLogTrack* plotTrack
curve->setSummaryCase( rimCase );
auto rftReader = rimCase->rftReader();
if ( rftReader )
{
QString wellName;
auto wellNames = rftReader->wellNames();
if ( !wellNames.empty() ) wellName = *wellNames.begin();
@ -488,6 +489,7 @@ RimWellLogCurve* RicWellLogTools::addSummaryRftCurve( RimWellLogTrack* plotTrack
RifEclipseRftAddress adr =
RifEclipseRftAddress::createAddress( wellName, dateTime, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE );
curve->setRftAddress( adr );
}
plotTrack->addCurve( curve );
@ -506,8 +508,10 @@ RimWellLogRftCurve* RicWellLogTools::addSummaryRftSegmentCurve( RimWellLogTrack*
auto curve = new RimWellLogRftCurve();
curve->setSummaryCase( rimCase );
auto rftReader = rimCase->rftReader();
auto rftReader = rimCase->rftReader();
if ( rftReader )
{
QDateTime dateTime;
auto timeSteps = rftReader->availableTimeSteps( wellName );
@ -520,6 +524,7 @@ RimWellLogRftCurve* RicWellLogTools::addSummaryRftSegmentCurve( RimWellLogTrack*
curve->setLineThickness( 4 );
curve->setInterpolation( RiuQwtPlotCurveDefines::CurveInterpolationEnum::INTERPOLATION_STEP_LEFT );
}
plotTrack->addCurve( curve );
@ -535,6 +540,7 @@ bool RicWellLogTools::hasData( const QString& resultName,
RimSummaryCase* rimCase )
{
auto rftReader = rimCase->rftReader();
if ( rftReader ) return false;
QDateTime dateTime;

View File

@ -24,6 +24,7 @@
#include "RicWellLogTools.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiaPlotWindowRedrawScheduler.h"
#include "RiaRftDefines.h"
@ -64,16 +65,19 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked )
rftCase->firstAncestorOfType( summaryCase );
if ( !summaryCase ) return;
auto rftReader = summaryCase->rftReader();
if ( !rftReader )
{
RiaLogging::error( "Could not open RFT file or no RFT file present. " );
return;
}
auto plot = RicNewWellLogPlotFeatureImpl::createHorizontalWellLogPlot();
QString wellName = "Unknown";
auto rftReader = summaryCase->rftReader();
if ( rftReader )
{
auto wellNames = rftReader->wellNames();
if ( !wellNames.empty() ) wellName = *wellNames.begin();
}
appendTrackAndCurveForBranchType( plot,
"Connection Rates",

View File

@ -24,6 +24,7 @@
#include "RiaApplication.h"
#include "RiaColorTools.h"
#include "RiaLogging.h"
#include "RiaPlotWindowRedrawScheduler.h"
#include "RiaRftDefines.h"
@ -64,16 +65,18 @@ void RicNewRftSegmentWellLogPlotFeature::onActionTriggered( bool isChecked )
rftCase->firstAncestorOfType( summaryCase );
if ( !summaryCase ) return;
auto rftReader = summaryCase->rftReader();
if ( !rftReader )
{
RiaLogging::error( "Could not open RFT file or no RFT file present. " );
return;
}
auto plot = RicNewWellLogPlotFeatureImpl::createHorizontalWellLogPlot();
QString wellName = "Unknown";
auto rftReader = summaryCase->rftReader();
if ( rftReader )
{
auto wellNames = rftReader->wellNames();
if ( !wellNames.empty() ) wellName = *wellNames.begin();
}
{
RimWellLogTrack* plotTrack = new RimWellLogTrack();
@ -197,15 +200,14 @@ void RicNewRftSegmentWellLogPlotFeature::appendTopologyTrack( RimWellLogPlot* pl
const QString& wellName,
RimSummaryCase* summaryCase )
{
auto rftReader = dynamic_cast<RifReaderOpmRft*>( summaryCase->rftReader() );
if ( !rftReader ) return;
QDateTime dateTime;
int branchIndex = 1;
auto rftReader = dynamic_cast<RifReaderOpmRft*>( summaryCase->rftReader() );
if ( rftReader )
{
auto timeSteps = rftReader->availableTimeSteps( wellName );
if ( !timeSteps.empty() ) dateTime = *timeSteps.rbegin();
}
auto track = new RimWellLogTrack();
track->setDescription( "Topology" );

View File

@ -269,8 +269,13 @@ void RimFileSummaryCase::defineEditorAttribute( const caf::PdmFieldHandle* field
void RimFileSummaryCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= "" */ )
{
RimSummaryCase::defineUiTreeOrdering( uiTreeOrdering, uiConfigName );
if ( rftReader() )
{
uiTreeOrdering.add( m_rftCase() );
}
uiTreeOrdering.skipRemainingChildren();
}
//--------------------------------------------------------------------------------------------------
///

View File

@ -594,7 +594,7 @@ void RiuMainWindow::createToolBars()
{
QToolBar* toolbar = addToolBar( tr( "Standard" ) );
toolbar->setObjectName( toolbar->windowTitle() );
toolbar->addAction( cmdFeatureMgr->action( "RicImportGeneralDataFeature" ) );
toolbar->addAction( cmdFeatureMgr->action( "RicImportEclipseCaseFeature" ) );
toolbar->addAction( cmdFeatureMgr->action( "RicOpenProjectFeature" ) );
toolbar->addAction( cmdFeatureMgr->action( "RicSaveProjectFeature" ) );
}

View File

@ -405,7 +405,7 @@ QStringList RiuPlotMainWindow::toolbarCommandIds( const QString& toolbarName )
if ( toolbarName.isEmpty() || toolbarName == "Standard" )
{
commandIds << "RicImportGeneralDataFeature";
commandIds << "RicImportEclipseCaseFeature";
commandIds << "RicImportSummaryCaseFeature";
commandIds << "RicImportEnsembleFeature";
commandIds << "RicOpenProjectFeature";