Merge remote-tracking branch 'origin/dev' into summary-text-edit-in-toolbar

This commit is contained in:
Magne Sjaastad 2019-10-28 20:45:00 +01:00
commit 23e8db65c2
244 changed files with 8089 additions and 4802 deletions

3
.gitignore vendored
View File

@ -69,3 +69,6 @@ Ankh.NoLoad
/Resinsight_Host.creator
/Resinsight_Host.config
*.RESINSIGHT_IDX
#Python
*.pyc

View File

@ -12,6 +12,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveDefinition.h
${CMAKE_CURRENT_LIST_DIR}/RiaCurveSetDefinition.h
${CMAKE_CURRENT_LIST_DIR}/RiaRftPltCurveDefinition.h
${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.h
${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.h
${CMAKE_CURRENT_LIST_DIR}/RiaMemoryCleanup.h
${CMAKE_CURRENT_LIST_DIR}/RiaFontCache.h
${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.h
@ -32,6 +33,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveDefinition.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaCurveSetDefinition.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaRftPltCurveDefinition.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaMemoryCleanup.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaFontCache.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.cpp
@ -52,6 +54,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaConsoleApplication.h
${CMAKE_CURRENT_LIST_DIR}/RiaGuiApplication.h
${CMAKE_CURRENT_LIST_DIR}/RiaCompletionTypeCalculationScheduler.h
${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.h
${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.h
)

View File

@ -84,6 +84,9 @@
#include "RimWellPltPlot.h"
#include "RimWellRftPlot.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
#include "cafPdmSettings.h"
#include "cafPdmUiModelChangeDetector.h"
#include "cafProgressInfo.h"
@ -258,6 +261,25 @@ RimGridView* RiaApplication::activeGridView()
return dynamic_cast<RimGridView*>( m_activeReservoirView.p() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridView* RiaApplication::activeMainOrComparisonGridView()
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimGridView* viewOrComparisonView = activeView;
if ( activeView->viewer()->viewerCommands()->isCurrentPickInComparisonView() )
{
if ( RimGridView* compView = dynamic_cast<RimGridView*>( activeView->activeComparisonView() ) )
{
viewOrComparisonView = compView;
}
}
return viewOrComparisonView;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -290,7 +312,7 @@ bool RiaApplication::openFile( const QString& fileName )
}
else if ( fileType & RiaDefines::ANY_ECLIPSE_FILE )
{
loadingSucceded = RicImportGeneralDataFeature::openEclipseFilesFromFileNames( QStringList{fileName}, true );
loadingSucceded = RicImportGeneralDataFeature::openEclipseFilesFromFileNames( QStringList{ fileName }, true );
lastUsedDialogTag = RiaDefines::defaultDirectoryLabel( fileType );
}
@ -428,7 +450,7 @@ bool RiaApplication::loadProject( const QString& projectFileName,
// VL check regarding specific order mentioned in comment above...
m_preferences->lastUsedProjectFileName = fullPathProjectFileName;
caf::PdmSettings::writeFieldsToApplicationStore( m_preferences );
m_preferences->writePreferencesToApplicationStore();
for ( size_t oilFieldIdx = 0; oilFieldIdx < m_project->oilFields().size(); oilFieldIdx++ )
{
@ -685,7 +707,7 @@ bool RiaApplication::saveProjectAs( const QString& fileName, QString* errorMessa
}
m_preferences->lastUsedProjectFileName = fileName;
caf::PdmSettings::writeFieldsToApplicationStore( m_preferences );
m_preferences->writePreferencesToApplicationStore();
onProjectSaved();
@ -1164,7 +1186,8 @@ void RiaApplication::applyPreferences()
this->project()->setPlotTemplateFolders( m_preferences->plotTemplateFolders() );
this->project()->updateConnectedEditors();
}
caf::PdmSettings::writeFieldsToApplicationStore( m_preferences );
m_preferences->writePreferencesToApplicationStore();
}
//--------------------------------------------------------------------------------------------------

View File

@ -112,6 +112,7 @@ public:
Rim3dView* activeReservoirView();
const Rim3dView* activeReservoirView() const;
RimGridView* activeGridView();
RimGridView* activeMainOrComparisonGridView();
RimProject* project();

View File

@ -102,7 +102,6 @@
#include "cafAppEnum.h"
#include "cafEffectGenerator.h"
#include "cafFixedAtlasFont.h"
#include "cafPdmSettings.h"
#include "cafPdmUiModelChangeDetector.h"
#include "cafPdmUiTreeView.h"
#include "cafProgressInfo.h"

View File

@ -0,0 +1,140 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RiaPlotWindowRedrawScheduler.h"
#include "RiuGridPlotWindow.h"
#include "RiuQwtPlotWidget.h"
#include <QCoreApplication>
#include <QDebug>
#include <set>
#include "cafProgressState.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaPlotWindowRedrawScheduler* RiaPlotWindowRedrawScheduler::instance()
{
static RiaPlotWindowRedrawScheduler theInstance;
return &theInstance;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::schedulePlotWindowUpdate( RiuGridPlotWindow* plotWindow )
{
m_plotWindowsToUpdate.push_back( plotWindow );
startTimer( 0 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::schedulePlotWidgetReplot( RiuQwtPlotWidget* plotWidget )
{
m_plotWidgetsToReplot.push_back( plotWidget );
startTimer( 0 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::clearAllScheduledUpdates()
{
if ( m_plotWindowUpdateTimer )
{
while ( m_plotWindowUpdateTimer->isActive() )
{
QCoreApplication::processEvents();
}
}
m_plotWidgetsToReplot.clear();
m_plotWindowsToUpdate.clear();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::performScheduledUpdatesAndReplots()
{
std::set<RiuQwtPlotWidget*> updatedPlots;
std::set<RiuGridPlotWindow*> updatedPlotWindows;
for ( RiuGridPlotWindow* plotWindow : m_plotWindowsToUpdate )
{
if ( plotWindow && !updatedPlotWindows.count( plotWindow ) )
{
plotWindow->performUpdate();
updatedPlotWindows.insert( plotWindow );
}
}
// Perform update and replot. Make sure we handle legend update
for ( RiuQwtPlotWidget* plot : m_plotWidgetsToReplot )
{
if ( plot && !updatedPlots.count( plot ) )
{
plot->replot();
updatedPlots.insert( plot );
}
}
m_plotWidgetsToReplot.clear();
m_plotWindowsToUpdate.clear();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::slotUpdateAndReplotScheduledItemsWhenReady()
{
if ( caf::ProgressState::isActive() )
{
startTimer( 10 );
return;
}
performScheduledUpdatesAndReplots();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::startTimer( int msecs )
{
if ( !m_plotWindowUpdateTimer )
{
m_plotWindowUpdateTimer.reset( new QTimer( this ) );
connect( m_plotWindowUpdateTimer.data(),
SIGNAL( timeout() ),
this,
SLOT( slotUpdateAndReplotScheduledItemsWhenReady() ) );
}
if ( !m_plotWindowUpdateTimer->isActive() )
{
m_plotWindowUpdateTimer->setSingleShot( true );
m_plotWindowUpdateTimer->start( msecs );
}
}

View File

@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmPointer.h"
#include <QObject>
#include <QPointer>
#include <QScopedPointer>
#include <QTimer>
#include <vector>
class RiuGridPlotWindow;
class RiuQwtPlotWidget;
class RiaPlotWindowRedrawScheduler : public QObject
{
Q_OBJECT
public:
static RiaPlotWindowRedrawScheduler* instance();
void schedulePlotWindowUpdate( RiuGridPlotWindow* plotWindow );
void schedulePlotWidgetReplot( RiuQwtPlotWidget* plotWidget );
void clearAllScheduledUpdates();
void performScheduledUpdatesAndReplots();
private slots:
void slotUpdateAndReplotScheduledItemsWhenReady();
private:
void startTimer( int msecs );
private:
std::vector<QPointer<RiuQwtPlotWidget>> m_plotWidgetsToReplot;
std::vector<QPointer<RiuGridPlotWindow>> m_plotWindowsToUpdate;
QScopedPointer<QTimer> m_plotWindowUpdateTimer;
};

View File

@ -26,6 +26,7 @@
#include "RifReaderSettings.h"
#include "cafPdmFieldCvfColor.h"
#include "cafPdmSettings.h"
#include "cafPdmUiCheckBoxEditor.h"
#include "cafPdmUiComboBoxEditor.h"
#include "cafPdmUiFieldHandle.h"
@ -793,3 +794,11 @@ std::map<RiaDefines::FontSettingType, RiaFontCache::FontSize> RiaPreferences::de
fontSizes[RiaDefines::PLOT_FONT] = defaultPlotFontSize();
return fontSizes;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPreferences::writePreferencesToApplicationStore()
{
caf::PdmSettings::writeFieldsToApplicationStore( this );
}

View File

@ -88,6 +88,8 @@ public:
std::map<RiaDefines::FontSettingType, RiaFontCache::FontSize> defaultFontSizes() const;
void writePreferencesToApplicationStore();
public: // Pdm Fields
caf::PdmField<caf::AppEnum<RiaGuiApplication::RINavigationPolicy>> navigationPolicy;

View File

@ -35,21 +35,6 @@ RiaViewRedrawScheduler* RiaViewRedrawScheduler::instance()
return &theInstance;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaViewRedrawScheduler::clearViewsScheduledForUpdate()
{
if ( m_resViewUpdateTimer )
{
while ( m_resViewUpdateTimer->isActive() )
{
QCoreApplication::processEvents();
}
}
m_resViewsToUpdate.clear();
}
//--------------------------------------------------------------------------------------------------
/// Schedule a creation of the Display model and redraw of the reservoir view
/// The redraw will happen as soon as the event loop is entered
@ -64,19 +49,16 @@ void RiaViewRedrawScheduler::scheduleDisplayModelUpdateAndRedraw( Rim3dView* res
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaViewRedrawScheduler::startTimer( int msecs )
void RiaViewRedrawScheduler::clearViewsScheduledForUpdate()
{
if ( !m_resViewUpdateTimer )
if ( m_resViewUpdateTimer )
{
m_resViewUpdateTimer = new QTimer( this );
connect( m_resViewUpdateTimer, SIGNAL( timeout() ), this, SLOT( slotUpdateAndRedrawScheduledViewsWhenReady() ) );
}
if ( !m_resViewUpdateTimer->isActive() )
{
m_resViewUpdateTimer->setSingleShot( true );
m_resViewUpdateTimer->start( msecs );
while ( m_resViewUpdateTimer->isActive() )
{
QCoreApplication::processEvents();
}
}
m_resViewsToUpdate.clear();
}
//--------------------------------------------------------------------------------------------------
@ -135,6 +117,24 @@ void RiaViewRedrawScheduler::slotUpdateAndRedrawScheduledViewsWhenReady()
updateAndRedrawScheduledViews();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaViewRedrawScheduler::startTimer( int msecs )
{
if ( !m_resViewUpdateTimer )
{
m_resViewUpdateTimer = new QTimer( this );
connect( m_resViewUpdateTimer, SIGNAL( timeout() ), this, SLOT( slotUpdateAndRedrawScheduledViewsWhenReady() ) );
}
if ( !m_resViewUpdateTimer->isActive() )
{
m_resViewUpdateTimer->setSingleShot( true );
m_resViewUpdateTimer->start( msecs );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -34,15 +34,18 @@ std::string RiaStdStringTools::trimString( const std::string& s )
//--------------------------------------------------------------------------------------------------
bool RiaStdStringTools::isNumber( const std::string& s, char decimalPoint )
{
if ( s.size() == 0 ) return false;
if ( s.empty() ) return false;
if ( findCharMatchCount( s, decimalPoint ) > 1 ) return false;
if ( findCharMatchCount( s, '-' ) > 1 ) return false;
if ( findCharMatchCount( s, 'e' ) > 1 ) return false;
if ( findCharMatchCount( s, 'E' ) > 1 ) return false;
std::string matchChars( "0123456789eE-" );
std::string matchChars( "0123456789eE-+" );
matchChars.append( 1, decimalPoint );
return ( s.find_first_not_of( matchChars ) == std::string::npos );
auto it = s.find_first_not_of( matchChars );
return ( it == std::string::npos );
}
//--------------------------------------------------------------------------------------------------

View File

@ -28,6 +28,7 @@
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
#include "cvfBoundingBox.h"
#include "cvfCamera.h"
@ -57,12 +58,14 @@ void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered( bool isChecked )
if ( activeView )
{
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
cvf::BoundingBox bbox = activeView->ownerCase()->activeCellsBoundingBox();
RimGridView* viewOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
cvf::BoundingBox bbox = viewOrComparisonView->ownerCase()->activeCellsBoundingBox();
if ( contMapView ) domainCoord[2] = bbox.max().z() - bbox.extent().z() * 0.2;
auto coll = activeView->annotationCollection();
auto coll = viewOrComparisonView->annotationCollection();
if ( coll )
{
@ -70,7 +73,9 @@ void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered( bool isChecked )
newAnnotation->setAnchorPoint( domainCoord );
cvf::Vec3d labelPos = domainCoord;
if ( activeView->viewer()->mainCamera()->direction().z() <= 0 )
cvf::Camera* viewCamera = activeView->viewer()->mainCamera();
if ( viewCamera->direction().z() <= 0 )
{
labelPos.z() = bbox.max().z();
}
@ -79,10 +84,10 @@ void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered( bool isChecked )
labelPos.z() = bbox.min().z();
}
cvf::Vec3d horizontalRight = activeView->viewer()->mainCamera()->direction() ^ cvf::Vec3d::Z_AXIS;
cvf::Vec3d horizontalUp = activeView->viewer()->mainCamera()->up() -
( cvf::Vec3d::Z_AXIS *
( activeView->viewer()->mainCamera()->up() * cvf::Vec3d::Z_AXIS ) );
cvf::Vec3d horizontalRight = viewCamera->direction() ^ cvf::Vec3d::Z_AXIS;
cvf::Vec3d horizontalUp = viewCamera->up() -
( cvf::Vec3d::Z_AXIS * ( viewCamera->up() * cvf::Vec3d::Z_AXIS ) );
bool isOk = horizontalRight.normalize();
if ( !isOk ) horizontalRight = {1.0, 0.0, 0.0};
@ -93,7 +98,7 @@ void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered( bool isChecked )
coll->scheduleRedrawOfRelevantViews();
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( newAnnotation );
RiuMainWindow::instance()->selectAsCurrentItem( newAnnotation, false );
}
}
}

View File

@ -70,5 +70,6 @@ void RicExitApplicationFeature::onActionTriggered( bool isChecked )
void RicExitApplicationFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "E&xit" );
actionToSetup->setShortcut( QKeySequence::Quit );
applyShortcutWithHintToAction( actionToSetup, QKeySequence::Quit );
}

View File

@ -266,5 +266,6 @@ void RicHelpOpenUsersGuideFeature::onActionTriggered( bool isChecked )
void RicHelpOpenUsersGuideFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "&Users Guide" );
actionToSetup->setShortcut( QKeySequence::HelpContents );
applyShortcutWithHintToAction( actionToSetup, QKeySequence::HelpContents );
}

View File

@ -20,8 +20,6 @@
#include "RiaRegressionTestRunner.h"
#include "cafPdmSettings.h"
#include <QAction>
#include <QDir>

View File

@ -69,5 +69,6 @@ void RicOpenProjectFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Open Project" );
actionToSetup->setIcon( QIcon( ":/openFolder24x24.png" ) );
actionToSetup->setShortcuts( QKeySequence::Open );
applyShortcutWithHintToAction( actionToSetup, QKeySequence::Open );
}

View File

@ -92,5 +92,6 @@ void RicSaveProjectAsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Save Project &As" );
actionToSetup->setIcon( QIcon( ":/Save.png" ) );
actionToSetup->setShortcuts( QKeySequence::SaveAs );
applyShortcutWithHintToAction( actionToSetup, QKeySequence::SaveAs );
}

View File

@ -101,7 +101,8 @@ void RicSaveProjectFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "&Save Project" );
actionToSetup->setIcon( QIcon( ":/Save.png" ) );
actionToSetup->setShortcuts( QKeySequence::Save );
applyShortcutWithHintToAction( actionToSetup, QKeySequence::Save );
}
//--------------------------------------------------------------------------------------------------

View File

@ -87,11 +87,11 @@ public:
{
RiaPreferences* prefs = RiaApplication::instance()->preferences();
return m_summaryPlot->asciiDataForPlotExport( timePeriod, prefs->showSummaryTimeAsLongString() );
return m_summaryPlot->asciiDataForSummaryPlotExport( timePeriod, prefs->showSummaryTimeAsLongString() );
}
else
{
return m_summaryPlot->asciiDataForPlotExport( DateTimePeriod::NONE, true );
return m_summaryPlot->asciiDataForSummaryPlotExport( DateTimePeriod::NONE, true );
}
}
@ -152,7 +152,7 @@ public:
virtual QString tabText( int tabIndex ) const override
{
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
return m_crossPlot->asciiDataForPlotExport( tabIndex );
return m_crossPlot->asciiDataForGridCrossPlotExport( tabIndex );
}
virtual int tabCount() const override

View File

@ -81,6 +81,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.h
)
@ -160,6 +162,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.cpp
)

View File

@ -21,7 +21,7 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
#include "RicExportFeatureImpl.h"
#include "RicMswExportInfo.h"

View File

@ -34,7 +34,7 @@
#include "RicWellPathFractureReportItem.h"
#include "RicWellPathFractureTextReportFeatureImpl.h"
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"
@ -719,22 +719,22 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspecsToFile( RimEclips
{
QTextStream stream( exportFile.get() );
RifEclipseDataTableFormatter formatter( stream );
RifTextDataTableFormatter formatter( stream );
formatter.setColumnSpacing( 2 );
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "Well" ),
RifEclipseOutputTableColumn( "Grp" ),
RifEclipseOutputTableColumn( "I" ),
RifEclipseOutputTableColumn( "J" ),
RifEclipseOutputTableColumn( "RefDepth" ),
RifEclipseOutputTableColumn( "Type" ),
RifEclipseOutputTableColumn( "DrainRad" ),
RifEclipseOutputTableColumn( "GasInEq" ),
RifEclipseOutputTableColumn( "AutoShut" ),
RifEclipseOutputTableColumn( "XFlow" ),
RifEclipseOutputTableColumn( "FluidPVT" ),
RifEclipseOutputTableColumn( "HydSDens" ),
RifEclipseOutputTableColumn( "FluidInPlReg" )};
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Well" ),
RifTextDataTableColumn( "Grp" ),
RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "RefDepth" ),
RifTextDataTableColumn( "Type" ),
RifTextDataTableColumn( "DrainRad" ),
RifTextDataTableColumn( "GasInEq" ),
RifTextDataTableColumn( "AutoShut" ),
RifTextDataTableColumn( "XFlow" ),
RifTextDataTableColumn( "FluidPVT" ),
RifTextDataTableColumn( "HydSDens" ),
RifTextDataTableColumn( "FluidInPlReg" )};
formatter.keyword( "WELSPECS" );
formatter.header( header );
@ -784,23 +784,23 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile(
{
QTextStream stream( exportFile.get() );
RifEclipseDataTableFormatter formatter( stream );
RifTextDataTableFormatter formatter( stream );
formatter.setColumnSpacing( 2 );
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "Well" ),
RifEclipseOutputTableColumn( "Grp" ),
RifEclipseOutputTableColumn( "LGR" ),
RifEclipseOutputTableColumn( "I" ),
RifEclipseOutputTableColumn( "J" ),
RifEclipseOutputTableColumn( "RefDepth" ),
RifEclipseOutputTableColumn( "Type" ),
RifEclipseOutputTableColumn( "DrainRad" ),
RifEclipseOutputTableColumn( "GasInEq" ),
RifEclipseOutputTableColumn( "AutoShut" ),
RifEclipseOutputTableColumn( "XFlow" ),
RifEclipseOutputTableColumn( "FluidPVT" ),
RifEclipseOutputTableColumn( "HydSDens" ),
RifEclipseOutputTableColumn( "FluidInPlReg" )};
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Well" ),
RifTextDataTableColumn( "Grp" ),
RifTextDataTableColumn( "LGR" ),
RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "RefDepth" ),
RifTextDataTableColumn( "Type" ),
RifTextDataTableColumn( "DrainRad" ),
RifTextDataTableColumn( "GasInEq" ),
RifTextDataTableColumn( "AutoShut" ),
RifTextDataTableColumn( "XFlow" ),
RifTextDataTableColumn( "FluidPVT" ),
RifTextDataTableColumn( "HydSDens" ),
RifTextDataTableColumn( "FluidInPlReg" )};
formatter.keyword( "WELSPECL" );
formatter.header( header );
@ -931,7 +931,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatAndWpimultTables(
QTextStream stream( exportFile.get() );
RifEclipseDataTableFormatter formatter( stream );
RifTextDataTableFormatter formatter( stream );
formatter.setColumnSpacing( 3 );
for ( const auto& gridCompletions : completionsPerGrid )
@ -958,56 +958,52 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatAndWpimultTables(
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatter(
RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData )
RifTextDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData )
{
std::vector<RifEclipseOutputTableColumn> header;
std::vector<RifTextDataTableColumn> header;
if ( gridName.isEmpty() )
{
header = {RifEclipseOutputTableColumn( "Well" ),
RifEclipseOutputTableColumn( "I" ),
RifEclipseOutputTableColumn( "J" ),
RifEclipseOutputTableColumn( "K1" ),
RifEclipseOutputTableColumn( "K2" ),
RifEclipseOutputTableColumn( "Status" ),
RifEclipseOutputTableColumn( "SAT" ),
RifEclipseOutputTableColumn( "TR",
RifEclipseOutputTableDoubleFormatting(
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifEclipseOutputTableColumn( "DIAM" ),
RifEclipseOutputTableColumn( "KH",
RifEclipseOutputTableDoubleFormatting(
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifEclipseOutputTableColumn( "S" ),
RifEclipseOutputTableColumn( "Df",
RifEclipseOutputTableDoubleFormatting(
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifEclipseOutputTableColumn( "DIR" )};
header =
{RifTextDataTableColumn( "Well" ),
RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "K1" ),
RifTextDataTableColumn( "K2" ),
RifTextDataTableColumn( "Status" ),
RifTextDataTableColumn( "SAT" ),
RifTextDataTableColumn( "TR",
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifTextDataTableColumn( "DIAM" ),
RifTextDataTableColumn( "KH",
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifTextDataTableColumn( "S" ),
RifTextDataTableColumn( "Df",
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifTextDataTableColumn( "DIR" )};
formatter.keyword( "COMPDAT" );
}
else
{
header = {RifEclipseOutputTableColumn( "Well" ),
RifEclipseOutputTableColumn( "LgrName" ),
RifEclipseOutputTableColumn( "I" ),
RifEclipseOutputTableColumn( "J" ),
RifEclipseOutputTableColumn( "K1" ),
RifEclipseOutputTableColumn( "K2" ),
RifEclipseOutputTableColumn( "Status" ),
RifEclipseOutputTableColumn( "SAT" ),
RifEclipseOutputTableColumn( "TR",
RifEclipseOutputTableDoubleFormatting(
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifEclipseOutputTableColumn( "DIAM" ),
RifEclipseOutputTableColumn( "KH",
RifEclipseOutputTableDoubleFormatting(
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifEclipseOutputTableColumn( "S" ),
RifEclipseOutputTableColumn( "Df",
RifEclipseOutputTableDoubleFormatting(
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifEclipseOutputTableColumn( "DIR" )};
header =
{RifTextDataTableColumn( "Well" ),
RifTextDataTableColumn( "LgrName" ),
RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "K1" ),
RifTextDataTableColumn( "K2" ),
RifTextDataTableColumn( "Status" ),
RifTextDataTableColumn( "SAT" ),
RifTextDataTableColumn( "TR",
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifTextDataTableColumn( "DIAM" ),
RifTextDataTableColumn( "KH",
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifTextDataTableColumn( "S" ),
RifTextDataTableColumn( "Df",
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
RifTextDataTableColumn( "DIR" )};
formatter.keyword( "COMPDATL" );
}
@ -1098,30 +1094,30 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeatureImpl::exportWpimultTableUsingFormatter(
RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData )
RifTextDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData )
{
std::vector<RifEclipseOutputTableColumn> header;
std::vector<RifTextDataTableColumn> header;
if ( gridName.isEmpty() )
{
header = {
RifEclipseOutputTableColumn( "Well" ),
RifEclipseOutputTableColumn( "Mult" ),
RifEclipseOutputTableColumn( "I" ),
RifEclipseOutputTableColumn( "J" ),
RifEclipseOutputTableColumn( "K" ),
RifTextDataTableColumn( "Well" ),
RifTextDataTableColumn( "Mult" ),
RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "K" ),
};
formatter.keyword( "WPIMULT" );
}
else
{
header = {
RifEclipseOutputTableColumn( "Well" ),
RifEclipseOutputTableColumn( "LgrName" ),
RifEclipseOutputTableColumn( "Mult" ),
RifEclipseOutputTableColumn( "I" ),
RifEclipseOutputTableColumn( "J" ),
RifEclipseOutputTableColumn( "K" ),
RifTextDataTableColumn( "Well" ),
RifTextDataTableColumn( "LgrName" ),
RifTextDataTableColumn( "Mult" ),
RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "K" ),
};
formatter.keyword( "WPIMULTL" );
}
@ -1727,4 +1723,4 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCarfinForTemporaryLgrs( c
{
RicExportLgrFeature::exportLgrs( folder, lgrInfoForWell.first, lgrInfoForWell.second );
}
}
}

View File

@ -43,7 +43,7 @@ class RimWellPath;
class RimWellPathValve;
class RimWellPathFracture;
class RimNonDarcyPerforationParameters;
class RifEclipseDataTableFormatter;
class RifTextDataTableFormatter;
class RigVirtualPerforationTransmissibilities;
class SubSegmentIntersectionInfo;
@ -189,11 +189,11 @@ private:
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
RicExportCompletionDataSettingsUi::CompdatExportType exportType );
static void exportCompdatTableUsingFormatter( RifEclipseDataTableFormatter& formatter,
static void exportCompdatTableUsingFormatter( RifTextDataTableFormatter& formatter,
const QString& gridName,
const std::vector<RigCompletionData>& completionData );
static void exportWpimultTableUsingFormatter( RifEclipseDataTableFormatter& formatter,
static void exportWpimultTableUsingFormatter( RifTextDataTableFormatter& formatter,
const QString& gridName,
const std::vector<RigCompletionData>& completionData );

View File

@ -27,7 +27,7 @@
#include "RicMswValveAccumulators.h"
#include "RicWellPathExportCompletionsFileTools.h"
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
#include "RigActiveCellInfo.h"
#include "RigEclipseCaseData.h"
@ -190,8 +190,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFractures( RimEcl
RicMswExportInfo exportInfo = generateFracturesMswExportInfo( eclipseCase, wellPath, fractures );
QTextStream stream( exportFile.get() );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( exportFile.get() );
RifTextDataTableFormatter formatter( stream );
generateWelsegsTable( formatter, exportInfo );
generateCompsegTables( formatter, exportInfo );
}
@ -213,8 +213,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFishbones(
RicMswExportInfo exportInfo = generateFishbonesMswExportInfo( eclipseCase, wellPath, fishbonesSubs, true );
QTextStream stream( exportFile.get() );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( exportFile.get() );
RifTextDataTableFormatter formatter( stream );
generateWelsegsTable( formatter, exportInfo );
generateCompsegTables( formatter, exportInfo );
@ -239,8 +239,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForPerforations(
RicMswExportInfo exportInfo = generatePerforationsMswExportInfo( eclipseCase, wellPath, timeStep, perforationIntervals );
QTextStream stream( exportFile.get() );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( exportFile.get() );
RifTextDataTableFormatter formatter( stream );
generateWelsegsTable( formatter, exportInfo );
generateCompsegTables( formatter, exportInfo );
@ -251,8 +251,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForPerforations(
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifEclipseDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo )
void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifTextDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo )
{
formatter.keyword( "WELSEGS" );
@ -260,13 +260,13 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifEclipseDataTa
double startTVD = exportInfo.initialTVD();
{
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn( "Name" ),
RifEclipseOutputTableColumn( "Dep 1" ),
RifEclipseOutputTableColumn( "Tlen 1" ),
RifEclipseOutputTableColumn( "Vol 1" ),
RifEclipseOutputTableColumn( "Len&Dep" ),
RifEclipseOutputTableColumn( "PresDrop" ),
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( "Name" ),
RifTextDataTableColumn( "Dep 1" ),
RifTextDataTableColumn( "Tlen 1" ),
RifTextDataTableColumn( "Vol 1" ),
RifTextDataTableColumn( "Len&Dep" ),
RifTextDataTableColumn( "PresDrop" ),
};
formatter.header( header );
@ -281,15 +281,15 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifEclipseDataTa
}
{
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn( "First Seg" ),
RifEclipseOutputTableColumn( "Last Seg" ),
RifEclipseOutputTableColumn( "Branch Num" ),
RifEclipseOutputTableColumn( "Outlet Seg" ),
RifEclipseOutputTableColumn( "Length" ),
RifEclipseOutputTableColumn( "Depth Change" ),
RifEclipseOutputTableColumn( "Diam" ),
RifEclipseOutputTableColumn( "Rough" ),
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( "First Seg" ),
RifTextDataTableColumn( "Last Seg" ),
RifTextDataTableColumn( "Branch Num" ),
RifTextDataTableColumn( "Outlet Seg" ),
RifTextDataTableColumn( "Length" ),
RifTextDataTableColumn( "Depth Change" ),
RifTextDataTableColumn( "Diam" ),
RifTextDataTableColumn( "Rough" ),
};
formatter.header( header );
}
@ -351,7 +351,7 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifEclipseDataTa
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateWelsegsSegments(
RifEclipseDataTableFormatter& formatter,
RifTextDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo,
const std::set<RigCompletionData::CompletionType>& exportCompletionTypes )
{
@ -436,7 +436,7 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsSegments(
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateWelsegsCompletionCommentHeader(
RifEclipseDataTableFormatter& formatter, RigCompletionData::CompletionType completionType )
RifTextDataTableFormatter& formatter, RigCompletionData::CompletionType completionType )
{
if ( completionType == RigCompletionData::CT_UNDEFINED )
{
@ -465,8 +465,8 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsCompletionCommentHeader
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifEclipseDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo )
void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifTextDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo )
{
/*
* TODO: Creating the regular perforation COMPSEGS table should come in here, before the others
@ -509,7 +509,7 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifEclipseDataT
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateCompsegTable(
RifEclipseDataTableFormatter& formatter,
RifTextDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo,
bool exportSubGridIntersections,
const std::set<RigCompletionData::CompletionType>& exportCompletionTypes )
@ -576,7 +576,7 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegTable(
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifEclipseDataTableFormatter& formatter,
void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifTextDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo,
RigCompletionData::CompletionType completionType,
bool exportSubGridIntersections )
@ -600,28 +600,28 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifEclipseDataT
}
{
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "Name" )};
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Name" )};
formatter.header( header );
formatter.add( exportInfo.wellPath()->completions()->wellNameForExport() );
formatter.rowCompleted();
}
{
std::vector<RifEclipseOutputTableColumn> allHeaders;
std::vector<RifTextDataTableColumn> allHeaders;
if ( exportSubGridIntersections )
{
allHeaders.push_back( RifEclipseOutputTableColumn( "Grid" ) );
allHeaders.push_back( RifTextDataTableColumn( "Grid" ) );
}
std::vector<RifEclipseOutputTableColumn> commonHeaders = {RifEclipseOutputTableColumn( "I" ),
RifEclipseOutputTableColumn( "J" ),
RifEclipseOutputTableColumn( "K" ),
RifEclipseOutputTableColumn( "Branch no" ),
RifEclipseOutputTableColumn( "Start Length" ),
RifEclipseOutputTableColumn( "End Length" ),
RifEclipseOutputTableColumn( "Dir Pen" ),
RifEclipseOutputTableColumn( "End Range" ),
RifEclipseOutputTableColumn( "Connection Depth" )};
std::vector<RifTextDataTableColumn> commonHeaders = {RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "K" ),
RifTextDataTableColumn( "Branch no" ),
RifTextDataTableColumn( "Start Length" ),
RifTextDataTableColumn( "End Length" ),
RifTextDataTableColumn( "Dir Pen" ),
RifTextDataTableColumn( "End Range" ),
RifTextDataTableColumn( "Connection Depth" )};
allHeaders.insert( allHeaders.end(), commonHeaders.begin(), commonHeaders.end() );
formatter.header( allHeaders );
}
@ -630,8 +630,8 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifEclipseDataT
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateWsegvalvTable( RifEclipseDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo )
void RicWellPathExportMswCompletionsImpl::generateWsegvalvTable( RifTextDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo )
{
bool foundValve = false;
@ -644,11 +644,11 @@ void RicWellPathExportMswCompletionsImpl::generateWsegvalvTable( RifEclipseDataT
if ( !foundValve )
{
formatter.keyword( "WSEGVALV" );
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn( "Well Name" ),
RifEclipseOutputTableColumn( "Seg No" ),
RifEclipseOutputTableColumn( "Cv" ),
RifEclipseOutputTableColumn( "Ac" ),
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( "Well Name" ),
RifTextDataTableColumn( "Seg No" ),
RifTextDataTableColumn( "Cv" ),
RifTextDataTableColumn( "Ac" ),
};
formatter.header( header );
@ -682,10 +682,10 @@ void RicWellPathExportMswCompletionsImpl::generateWsegvalvTable( RifEclipseDataT
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateWsegAicdTable( RifEclipseDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo )
void RicWellPathExportMswCompletionsImpl::generateWsegAicdTable( RifTextDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo )
{
RifEclipseDataTableFormatter tighterFormatter( formatter );
RifTextDataTableFormatter tighterFormatter( formatter );
tighterFormatter.setColumnSpacing( 1 );
tighterFormatter.setTableRowPrependText( " " );
@ -739,14 +739,14 @@ void RicWellPathExportMswCompletionsImpl::generateWsegAicdTable( RifEclipseDataT
QString( "%1: %2" ).arg( i + 1, 2, 10, QChar( '0' ) ).arg( columnDescriptions[i] ) );
}
std::vector<RifEclipseOutputTableColumn> header;
std::vector<RifTextDataTableColumn> header;
for ( size_t i = 1; i <= 21; ++i )
{
QString cName = QString( "%1" ).arg( i, 2, 10, QChar( '0' ) );
RifEclipseOutputTableColumn col( cName,
RifEclipseOutputTableDoubleFormatting(
RifEclipseOutputTableDoubleFormat::RIF_CONSISE ),
RIGHT );
QString cName = QString( "%1" ).arg( i, 2, 10, QChar( '0' ) );
RifTextDataTableColumn col( cName,
RifTextDataTableDoubleFormatting(
RifTextDataTableDoubleFormat::RIF_CONSISE ),
RIGHT );
header.push_back( col );
}
tighterFormatter.header( header );

View File

@ -21,7 +21,7 @@
#include "RigCompletionData.h"
class RicExportCompletionDataSettingsUi;
class RifEclipseDataTableFormatter;
class RifTextDataTableFormatter;
class RimEclipseCase;
class RimFishbonesMultipleSubs;
class RimPerforationInterval;
@ -76,24 +76,24 @@ private:
int timeStep,
const std::vector<const RimPerforationInterval*>& perforationIntervals );
static void generateWelsegsTable( RifEclipseDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
static void generateWelsegsTable( RifTextDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
static void generateWelsegsSegments( RifEclipseDataTableFormatter& formatter,
static void generateWelsegsSegments( RifTextDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo,
const std::set<RigCompletionData::CompletionType>& exportCompletionTypes );
static void generateWelsegsCompletionCommentHeader( RifEclipseDataTableFormatter& formatter,
static void generateWelsegsCompletionCommentHeader( RifTextDataTableFormatter& formatter,
RigCompletionData::CompletionType completionType );
static void generateCompsegTables( RifEclipseDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
static void generateCompsegTable( RifEclipseDataTableFormatter& formatter,
static void generateCompsegTables( RifTextDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
static void generateCompsegTable( RifTextDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo,
bool exportSubGridIntersections,
const std::set<RigCompletionData::CompletionType>& exportCompletionTypes );
static void generateCompsegHeader( RifEclipseDataTableFormatter& formatter,
static void generateCompsegHeader( RifTextDataTableFormatter& formatter,
const RicMswExportInfo& exportInfo,
RigCompletionData::CompletionType completionType,
bool exportSubGridIntersections );
static void generateWsegvalvTable( RifEclipseDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
static void generateWsegAicdTable( RifEclipseDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
static void generateWsegvalvTable( RifTextDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
static void generateWsegAicdTable( RifTextDataTableFormatter& formatter, const RicMswExportInfo& exportInfo );
private:
typedef std::vector<std::shared_ptr<RicMswSegment>> MainBoreSegments;
@ -152,4 +152,4 @@ private:
int* branchNum,
int* segmentNum );
static void assignBranchAndSegmentNumbers( const RimEclipseCase* caseToApply, RicMswExportInfo* exportInfo );
};
};

View File

@ -24,7 +24,7 @@
#include "RicExportFractureCompletionsImpl.h"
#include "RicWellPathFractureReportItem.h"
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
#include "RigCompletionData.h"
#include "RigTransmissibilityEquations.h"
@ -55,9 +55,9 @@ QString orientationText( RimFractureTemplate::FracOrientationEnum orientation )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseOutputTableColumn floatNumberColumn( const QString& text )
RifTextDataTableColumn floatNumberColumn( const QString& text )
{
return RifEclipseOutputTableColumn( text, RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 3 ), RIGHT );
return RifTextDataTableColumn( text, RifTextDataTableDoubleFormatting( RIF_FLOAT, 3 ), RIGHT );
}
//--------------------------------------------------------------------------------------------------
@ -233,13 +233,13 @@ QString RicWellPathFractureTextReportFeatureImpl::createWellFileLocationText( co
QString tableText;
QTextStream stream( &tableText );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &tableText );
RifTextDataTableFormatter formatter( stream );
configureFormatter( &formatter );
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn( "Well" ),
RifEclipseOutputTableColumn( "Location" ),
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( "Well" ),
RifTextDataTableColumn( "Location" ),
};
formatter.header( header );
@ -275,13 +275,13 @@ QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFileLocationText
QString tableText;
QTextStream stream( &tableText );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &tableText );
RifTextDataTableFormatter formatter( stream );
configureFormatter( &formatter );
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn( "StimPlan Name" ),
RifEclipseOutputTableColumn( "Location" ),
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( "StimPlan Name" ),
RifTextDataTableColumn( "Location" ),
};
formatter.header( header );
@ -316,13 +316,13 @@ QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFractureText(
RiaEclipseUnitTools::UnitSystem unitSystem = stimPlanTemplates.front()->fractureTemplateUnit();
bool isFieldUnits = unitSystem == RiaEclipseUnitTools::UNITS_FIELD;
QTextStream stream( &tableText );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &tableText );
RifTextDataTableFormatter formatter( stream );
configureFormatter( &formatter );
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn( "StimPlan" ),
RifEclipseOutputTableColumn( " " ),
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( "StimPlan" ),
RifTextDataTableColumn( " " ),
floatNumberColumn( "WDiam" ),
floatNumberColumn( "Skin" ),
};
@ -368,13 +368,13 @@ QString RicWellPathFractureTextReportFeatureImpl::createEllipseFractureText(
RiaEclipseUnitTools::UnitSystem unitSystem = ellipseTemplates.front()->fractureTemplateUnit();
bool isFieldUnits = unitSystem == RiaEclipseUnitTools::UNITS_FIELD;
QTextStream stream( &tableText );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &tableText );
RifTextDataTableFormatter formatter( stream );
configureFormatter( &formatter );
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn( "Ellipse" ),
RifEclipseOutputTableColumn( " " ),
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( "Ellipse" ),
RifTextDataTableColumn( " " ),
floatNumberColumn( "Xf" ),
floatNumberColumn( "Height" ),
floatNumberColumn( "Kf" ),
@ -433,12 +433,12 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureText(
QString tableText;
QTextStream stream( &tableText );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &tableText );
RifTextDataTableFormatter formatter( stream );
configureFormatter( &formatter );
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn( " " ),
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( " " ),
floatNumberColumn( "Top" ),
floatNumberColumn( "Bot" ),
floatNumberColumn( "Fault" ),
@ -517,24 +517,23 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureInstancesText(
QString tableText;
QTextStream stream( &tableText );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &tableText );
RifTextDataTableFormatter formatter( stream );
configureFormatter( &formatter );
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn( "" ),
RifEclipseOutputTableColumn( "" ),
RifEclipseOutputTableColumn( "" ),
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( "" ),
RifTextDataTableColumn( "" ),
RifTextDataTableColumn( "" ),
floatNumberColumn( "MD" ),
floatNumberColumn( "Dip" ),
floatNumberColumn( "Tilt" ),
floatNumberColumn( "LPerf" ),
floatNumberColumn( "PerfEff" ),
floatNumberColumn( "Wdia" ),
RifEclipseOutputTableColumn( "Dfac",
RifEclipseOutputTableDoubleFormatting(
RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC ),
RIGHT ),
RifTextDataTableColumn( "Dfac",
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ),
RIGHT ),
};
formatter.header( header );
@ -627,25 +626,25 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar
RiaEclipseUnitTools::UnitSystem unitSystem = wellPathFractureReportItems.front().unitSystem();
bool isFieldUnits = unitSystem == RiaEclipseUnitTools::UNITS_FIELD;
QTextStream stream( &tableText );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &tableText );
RifTextDataTableFormatter formatter( stream );
configureFormatter( &formatter );
const QString meanText = "Mean";
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn( "" ), // Well
RifEclipseOutputTableColumn( "" ), // Fracture
RifEclipseOutputTableColumn( "" ), // Template
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( "" ), // Well
RifTextDataTableColumn( "" ), // Fracture
RifTextDataTableColumn( "" ), // Template
floatNumberColumn( "" ), // Tr
floatNumberColumn( "" ), //#con
floatNumberColumn( "" ), // Fcd
RifEclipseOutputTableColumn( "", RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // Area
RifEclipseOutputTableColumn( meanText, RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // KfWf
RifEclipseOutputTableColumn( meanText, RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // Kf
RifTextDataTableColumn( "", RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // Area
RifTextDataTableColumn( meanText, RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // KfWf
RifTextDataTableColumn( meanText, RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // Kf
floatNumberColumn( meanText ), // wf
RifEclipseOutputTableColumn( meanText, RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // xf
RifEclipseOutputTableColumn( meanText, RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // H
RifTextDataTableColumn( meanText, RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // xf
RifTextDataTableColumn( meanText, RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // H
floatNumberColumn( meanText ), // Km
};
@ -724,15 +723,15 @@ QString RicWellPathFractureTextReportFeatureImpl::createFracturePressureDepletio
{
QString tableText;
QTextStream stream( &tableText );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &tableText );
RifTextDataTableFormatter formatter( stream );
configureFormatter( &formatter );
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "Well" ),
RifEclipseOutputTableColumn( "Fracture" ),
RifEclipseOutputTableColumn( "Actual WBHP" ),
RifEclipseOutputTableColumn( "Min Pressure Drop" ),
RifEclipseOutputTableColumn( "Max Pressure Drop" )};
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Well" ),
RifTextDataTableColumn( "Fracture" ),
RifTextDataTableColumn( "Actual WBHP" ),
RifTextDataTableColumn( "Min Pressure Drop" ),
RifTextDataTableColumn( "Max Pressure Drop" )};
bool createdTable = false;
@ -775,12 +774,11 @@ QString RicWellPathFractureTextReportFeatureImpl::createConnectionsPerWellText(
{
QString tableText;
QTextStream stream( &tableText );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &tableText );
RifTextDataTableFormatter formatter( stream );
configureFormatter( &formatter );
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "Well" ),
floatNumberColumn( "ConnCount" )};
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Well" ), floatNumberColumn( "ConnCount" )};
formatter.header( header );
formatter.addHorizontalLine( '-' );
@ -813,7 +811,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createConnectionsPerWellText(
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathFractureTextReportFeatureImpl::configureFormatter( RifEclipseDataTableFormatter* formatter ) const
void RicWellPathFractureTextReportFeatureImpl::configureFormatter( RifTextDataTableFormatter* formatter ) const
{
if ( !formatter ) return;

View File

@ -26,7 +26,7 @@ class RimEclipseCase;
class RimFractureTemplate;
class RimEllipseFractureTemplate;
class RimStimPlanFractureTemplate;
class RifEclipseDataTableFormatter;
class RifTextDataTableFormatter;
class RicWellPathFractureReportItem;
//==================================================================================================
@ -57,5 +57,5 @@ private:
QString createConnectionsPerWellText(
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems ) const;
void configureFormatter( RifEclipseDataTableFormatter* formatter ) const;
void configureFormatter( RifTextDataTableFormatter* formatter ) const;
};

View File

@ -58,7 +58,7 @@ bool RicNewAzimuthDipIntersectionFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewAzimuthDipIntersectionFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !activeView ) return;
RicNewAzimuthDipIntersectionFeatureCmd* cmd = new RicNewAzimuthDipIntersectionFeatureCmd(
@ -122,7 +122,7 @@ void RicNewAzimuthDipIntersectionFeatureCmd::redo()
m_intersectionCollection->appendIntersectionAndUpdate( intersection );
Riu3dSelectionManager::instance()->deleteAllItems();
Riu3DMainWindowTools::selectAsCurrentItem( intersection );
Riu3DMainWindowTools::selectAsCurrentItem( intersection, false );
}
//--------------------------------------------------------------------------------------------------

View File

@ -57,7 +57,7 @@ bool RicNewPolylineIntersectionFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewPolylineIntersectionFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !activeView ) return;
RicNewPolylineIntersectionFeatureCmd* cmd = new RicNewPolylineIntersectionFeatureCmd(
@ -112,7 +112,7 @@ void RicNewPolylineIntersectionFeatureCmd::redo()
Riu3dSelectionManager::instance()->deleteAllItems();
Riu3DMainWindowTools::selectAsCurrentItem( intersection );
Riu3DMainWindowTools::selectAsCurrentItem( intersection, false );
}
//--------------------------------------------------------------------------------------------------

View File

@ -66,7 +66,7 @@ void RicEclipsePropertyFilterFeatureImpl::addPropertyFilter( RimEclipsePropertyF
propertyFilterCollection->reservoirView()->scheduleCreateDisplayModelAndRedraw();
propertyFilterCollection->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter );
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter, false );
}
//--------------------------------------------------------------------------------------------------
@ -83,7 +83,7 @@ void RicEclipsePropertyFilterFeatureImpl::insertPropertyFilter( RimEclipseProper
propertyFilterCollection->reservoirView()->scheduleCreateDisplayModelAndRedraw();
propertyFilterCollection->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter );
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter, false );
}
//--------------------------------------------------------------------------------------------------

View File

@ -39,7 +39,7 @@ CAF_CMD_SOURCE_INIT( RicEclipsePropertyFilterNewInViewFeature, "RicEclipseProper
//--------------------------------------------------------------------------------------------------
bool RicEclipsePropertyFilterNewInViewFeature::isCommandEnabled()
{
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
Rim3dView* view = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !view ) return false;
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( view );
@ -64,7 +64,7 @@ bool RicEclipsePropertyFilterNewInViewFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicEclipsePropertyFilterNewInViewFeature::onActionTriggered( bool isChecked )
{
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
Rim3dView* view = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !view ) return;
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( view );
if ( !eclView ) return;

View File

@ -25,7 +25,7 @@
#include "RicExportCarfinUi.h"
#include "RicExportFeatureImpl.h"
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
#include "RimDialogData.h"
#include "RimEclipseCase.h"
@ -79,20 +79,20 @@ void RicExportCarfin::onActionTriggered( bool isChecked )
return;
}
QTextStream stream( &exportFile );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &exportFile );
RifTextDataTableFormatter formatter( stream );
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn( "I1" ),
RifEclipseOutputTableColumn( "I2" ),
RifEclipseOutputTableColumn( "J1" ),
RifEclipseOutputTableColumn( "J2" ),
RifEclipseOutputTableColumn( "K1" ),
RifEclipseOutputTableColumn( "K2" ),
RifEclipseOutputTableColumn( "NX" ),
RifEclipseOutputTableColumn( "NY" ),
RifEclipseOutputTableColumn( "NZ" ),
RifEclipseOutputTableColumn( "NWMAX" ),
RifEclipseOutputTableColumn( "Parent LGR" )};
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "I1" ),
RifTextDataTableColumn( "I2" ),
RifTextDataTableColumn( "J1" ),
RifTextDataTableColumn( "J2" ),
RifTextDataTableColumn( "K1" ),
RifTextDataTableColumn( "K2" ),
RifTextDataTableColumn( "NX" ),
RifTextDataTableColumn( "NY" ),
RifTextDataTableColumn( "NZ" ),
RifTextDataTableColumn( "NWMAX" ),
RifTextDataTableColumn( "Parent LGR" )};
formatter.keyword( "CARFIN" );
formatter.header( header );

View File

@ -42,7 +42,6 @@
#include "Riu3DMainWindowTools.h"
#include "RiuPropertyViewTabWidget.h"
#include "cafPdmSettings.h"
#include "cafPdmUiPropertyViewDialog.h"
#include "cafProgressInfo.h"
#include "cafSelectionManager.h"
@ -162,7 +161,7 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
QString fileName = dirPath.absoluteFilePath( keyword + ".GRDECL" );
bool worked = RifEclipseInputFileTools::exportKeywords( fileName,
view->eclipseCase()->eclipseCaseData(),
{keyword},
{ keyword },
fileWriteMode,
min,
max,

View File

@ -24,7 +24,7 @@
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeature.h"
#include "RicExportLgrUi.h"
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
#include "RigCaseCellResultsData.h"
#include "RigMainGrid.h"
@ -367,19 +367,19 @@ void RicExportLgrFeature::writeLgrs( QTextStream& stream, const std::vector<LgrI
for ( auto lgrInfo : lgrInfos )
{
{
RifEclipseDataTableFormatter formatter( stream );
RifTextDataTableFormatter formatter( stream );
formatter.comment( QString( "LGR: " ) + lgrInfo.name );
formatter.keyword( "CARFIN" );
formatter.header( {RifEclipseOutputTableColumn( "Name" ),
RifEclipseOutputTableColumn( "I1" ),
RifEclipseOutputTableColumn( "I2" ),
RifEclipseOutputTableColumn( "J1" ),
RifEclipseOutputTableColumn( "J2" ),
RifEclipseOutputTableColumn( "K1" ),
RifEclipseOutputTableColumn( "K2" ),
RifEclipseOutputTableColumn( "NX" ),
RifEclipseOutputTableColumn( "NY" ),
RifEclipseOutputTableColumn( "NZ" )} );
formatter.header( {RifTextDataTableColumn( "Name" ),
RifTextDataTableColumn( "I1" ),
RifTextDataTableColumn( "I2" ),
RifTextDataTableColumn( "J1" ),
RifTextDataTableColumn( "J2" ),
RifTextDataTableColumn( "K1" ),
RifTextDataTableColumn( "K2" ),
RifTextDataTableColumn( "NX" ),
RifTextDataTableColumn( "NY" ),
RifTextDataTableColumn( "NZ" )} );
formatter.add( lgrInfo.name );
formatter.addOneBasedCellIndex( lgrInfo.mainGridStartCell.i() );
@ -396,7 +396,7 @@ void RicExportLgrFeature::writeLgrs( QTextStream& stream, const std::vector<LgrI
}
{
RifEclipseDataTableFormatter formatter( stream );
RifTextDataTableFormatter formatter( stream );
formatter.keyword( "ENDFIN" );
formatter.tableCompleted( "", true );
}

View File

@ -23,7 +23,7 @@
#include "RicExportWellPathsUi.h"
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
#include "RigWellPath.h"
@ -103,7 +103,8 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre
double currMd = wellPathGeom->measureDepths().front() - mdStepSize;
double endMd = wellPathGeom->measureDepths().back();
RifEclipseDataTableFormatter formatter( stream );
RifTextDataTableFormatter formatter( stream );
formatter.setHeaderPrefix( "# " );
formatter.setCommentPrefix( "# " );
formatter.setTableRowPrependText( " " );
@ -115,7 +116,7 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename( exportName ) << "'" << endl;
auto numberFormat = RifEclipseOutputTableDoubleFormatting( RIF_FLOAT, 2 );
auto numberFormat = RifTextDataTableDoubleFormatting( RIF_FLOAT, 2 );
formatter.header( {{"X", numberFormat, RIGHT},
{"Y", numberFormat, RIGHT},
{"TVDMSL", numberFormat, RIGHT},

View File

@ -45,18 +45,22 @@ CAF_CMD_SOURCE_INIT( RicExportToLasFileFeature, "RicExportToLasFileFeature" );
//--------------------------------------------------------------------------------------------------
std::vector<QString> RicExportToLasFileFeature::exportToLasFiles( const QString& exportFolder,
const QString& exportPrefix,
const RimWellLogPlot* plot,
const RimWellLogPlot* plotWindow,
bool exportTvdRkb,
bool capitalizeFileNames,
double resampleInterval )
{
std::vector<RimWellLogCurve*> allCurves;
std::vector<RimWellLogTrack*> tracks = plot->visibleTracks();
std::vector<RimWellLogCurve*> allCurves;
std::vector<RimPlotInterface*> plots = plotWindow->visiblePlots();
for ( RimWellLogTrack* track : tracks )
for ( RimPlotInterface* plot : plots )
{
std::vector<RimWellLogCurve*> curves = track->visibleCurvesVector();
allCurves.insert( allCurves.end(), curves.begin(), curves.end() );
RimWellLogTrack* track = dynamic_cast<RimWellLogTrack*>( plot );
if ( track )
{
std::vector<RimWellLogCurve*> curves = track->visibleCurves();
allCurves.insert( allCurves.end(), curves.begin(), curves.end() );
}
}
std::vector<QString> wellNames;

View File

@ -38,7 +38,7 @@ class RicExportToLasFileFeature : public caf::CmdFeature
public:
static std::vector<QString> exportToLasFiles( const QString& exportFolder,
const QString& filePrefix,
const RimWellLogPlot* plot,
const RimWellLogPlot* plotWindow,
bool exportTvdRkb = false,
bool capitalizeFileNames = false,
double resampleInterval = 0.0 );

View File

@ -75,8 +75,6 @@ void RicAddStoredFlowCharacteristicsPlotFeature::onActionTriggered( bool isCheck
sourceObject->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
CVF_ASSERT( flowCharacteristicsPlot );
RiaApplication::instance()->project()->assignViewIdToView( flowCharacteristicsPlot );
flowPlotColl->addFlowCharacteristicsPlotToStoredPlots( flowCharacteristicsPlot );
flowCharacteristicsPlot->resolveReferencesRecursively();

View File

@ -74,7 +74,6 @@ void RicAddStoredWellAllocationPlotFeature::onActionTriggered( bool isChecked )
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>(
sourceObject->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
RiaApplication::instance()->project()->assignViewIdToView( wellAllocationPlot );
CVF_ASSERT( wellAllocationPlot );
flowPlotColl->addWellAllocPlotToStoredPlots( wellAllocationPlot );

View File

@ -18,7 +18,7 @@
#include "RicCreateMultipleFracturesUi.h"
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
@ -239,19 +239,19 @@ QString RiuCreateMultipleFractionsUi::summaryText() const
QString tableText;
{
QTextStream stream( &tableText );
RifEclipseDataTableFormatter formatter( stream );
QTextStream stream( &tableText );
RifTextDataTableFormatter formatter( stream );
formatter.setTableRowLineAppendText( "" );
formatter.setTableRowPrependText( " " );
std::vector<RifEclipseOutputTableColumn> header;
header.push_back( RifEclipseOutputTableColumn( "Selected Wells" ) );
std::vector<RifTextDataTableColumn> header;
header.push_back( RifTextDataTableColumn( "Selected Wells" ) );
for ( auto fracTemplate : fracTemplateSet )
{
header.push_back( RifEclipseOutputTableColumn( fracTemplate->name(),
RifEclipseOutputTableDoubleFormatting(),
RifEclipseOutputTableAlignment::RIGHT ) );
header.push_back( RifTextDataTableColumn( fracTemplate->name(),
RifTextDataTableDoubleFormatting(),
RifTextDataTableAlignment::RIGHT ) );
}
formatter.header( header );

View File

@ -24,7 +24,6 @@
#include "RiuMainWindow.h"
#include "cafPdmSettings.h"
#include "cafPdmUiPropertyViewDialog.h"
#include <QAction>

View File

@ -1,5 +1,6 @@
set (SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.h
${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.h
${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionBoxFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.h
@ -9,6 +10,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.h
)
set (SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.cpp
${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.cpp
${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionBoxFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.cpp

View File

@ -27,6 +27,7 @@
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
#include "cafCmdExecCommandManager.h"
#include "cafSelectionManager.h"
@ -51,9 +52,10 @@ bool RicIntersectionBoxAtPosFeature::isCommandEnabled()
void RicIntersectionBoxAtPosFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
if ( activeView )
RimGridView* activeMainOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( activeMainOrComparisonView )
{
RimIntersectionCollection* coll = activeView->crossSectionCollection();
RimIntersectionCollection* coll = activeMainOrComparisonView->crossSectionCollection();
CVF_ASSERT( coll );
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
@ -61,21 +63,17 @@ void RicIntersectionBoxAtPosFeature::onActionTriggered( bool isChecked )
coll->appendIntersectionBoxAndUpdate( intersectionBox );
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_NONE, domainCoord );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox, false );
RimGridView* rimView = nullptr;
coll->firstAncestorOrThisOfType( rimView );
if ( rimView )
{
rimView->showGridCells( false );
RiuMainWindow::instance()->refreshDrawStyleActions();
activeMainOrComparisonView->showGridCells(false);
RiuMainWindow::instance()->refreshDrawStyleActions();
rimView->scheduleCreateDisplayModelAndRedraw();
}
activeView->scheduleCreateDisplayModelAndRedraw();
}
}

View File

@ -18,12 +18,15 @@
#include "RicIntersectionBoxXSliceFeature.h"
#include "RicIntersectionFeatureImpl.h"
#include "RiaApplication.h"
#include "RimCase.h"
#include "RimGridView.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionCollection.h"
#include "RiuViewerCommands.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
@ -50,33 +53,7 @@ bool RicIntersectionBoxXSliceFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicIntersectionBoxXSliceFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
if ( activeView )
{
RimIntersectionCollection* coll = activeView->crossSectionCollection();
CVF_ASSERT( coll );
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString( "X-slice (Intersection box)" );
coll->appendIntersectionBoxAndUpdate( intersectionBox );
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_X, domainCoord );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
RimGridView* rimView = nullptr;
coll->firstAncestorOrThisOfType( rimView );
if ( rimView )
{
rimView->showGridCells( false );
RiuMainWindow::instance()->refreshDrawStyleActions();
rimView->scheduleCreateDisplayModelAndRedraw();
}
}
RicIntersectionFeatureImpl::createIntersectionBoxSlize("X-slice (Intersection box)", RimIntersectionBox::PLANE_STATE_X);
}
//--------------------------------------------------------------------------------------------------

View File

@ -18,6 +18,8 @@
#include "RicIntersectionBoxYSliceFeature.h"
#include "RicIntersectionFeatureImpl.h"
#include "RiaApplication.h"
#include "RimCase.h"
@ -27,6 +29,7 @@
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
#include "cafCmdExecCommandManager.h"
#include "cafSelectionManager.h"
@ -50,33 +53,7 @@ bool RicIntersectionBoxYSliceFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicIntersectionBoxYSliceFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
if ( activeView )
{
RimIntersectionCollection* coll = activeView->crossSectionCollection();
CVF_ASSERT( coll );
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString( "Y-slice (Intersection box)" );
coll->appendIntersectionBoxAndUpdate( intersectionBox );
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_Y, domainCoord );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
RimGridView* rimView = nullptr;
coll->firstAncestorOrThisOfType( rimView );
if ( rimView )
{
rimView->showGridCells( false );
RiuMainWindow::instance()->refreshDrawStyleActions();
rimView->scheduleCreateDisplayModelAndRedraw();
}
}
RicIntersectionFeatureImpl::createIntersectionBoxSlize("Y-slice (Intersection box)", RimIntersectionBox::PLANE_STATE_Y);
}
//--------------------------------------------------------------------------------------------------

View File

@ -18,12 +18,15 @@
#include "RicIntersectionBoxZSliceFeature.h"
#include "RicIntersectionFeatureImpl.h"
#include "RiaApplication.h"
#include "RimCase.h"
#include "RimGridView.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionCollection.h"
#include "RiuViewerCommands.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
@ -50,32 +53,7 @@ bool RicIntersectionBoxZSliceFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicIntersectionBoxZSliceFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
if ( activeView )
{
RimIntersectionCollection* coll = activeView->crossSectionCollection();
CVF_ASSERT( coll );
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString( "Z-slice (Intersection box)" );
coll->appendIntersectionBoxAndUpdate( intersectionBox );
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_Z, domainCoord );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
RimGridView* rimView = nullptr;
coll->firstAncestorOrThisOfType( rimView );
if ( rimView )
{
rimView->showGridCells( false );
RiuMainWindow::instance()->refreshDrawStyleActions();
rimView->scheduleCreateDisplayModelAndRedraw();
}
}
RicIntersectionFeatureImpl::createIntersectionBoxSlize("Z-slice (Intersection box)", RimIntersectionBox::PLANE_STATE_Z);
}
//--------------------------------------------------------------------------------------------------

View File

@ -0,0 +1,59 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicIntersectionFeatureImpl.h"
#include "RiaApplication.h"
#include "RimGridView.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionCollection.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicIntersectionFeatureImpl::createIntersectionBoxSlize(const QString& name, RimIntersectionBox::SinglePlaneState plane)
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimGridView* activeMainOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( activeMainOrComparisonView )
{
RimIntersectionCollection* coll = activeMainOrComparisonView->crossSectionCollection();
CVF_ASSERT( coll );
cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = name;
coll->appendIntersectionBoxNoUpdate( intersectionBox );
intersectionBox->setToDefaultSizeSlice( plane, domainCoord );
coll->updateConnectedEditors();
activeMainOrComparisonView->showGridCells(false);
activeMainOrComparisonView->scheduleCreateDisplayModelAndRedraw();
activeView->scheduleCreateDisplayModelAndRedraw();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox, false );
RiuMainWindow::instance()->refreshDrawStyleActions();
}
}

View File

@ -15,17 +15,15 @@
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimNameConfig.h"
#include "RimViewWindow.h"
#include "RimIntersectionBox.h"
class RimPlot : public RimViewWindow
class QString;
class RicIntersectionFeatureImpl
{
CAF_PDM_HEADER_INIT;
public:
RimPlot();
QWidget* createPlotWidget();
public :
static void createIntersectionBoxSlize(const QString& name, RimIntersectionBox::SinglePlaneState plane );
};

View File

@ -69,6 +69,7 @@ void RicCreatePlotFromTemplateByShortcutFeature::onActionTriggered( bool isCheck
fileName = fileNameSelectedInUi;
RiaApplication::instance()->preferences()->setDefaultPlotTemplatePath( fileName );
RiaApplication::instance()->preferences()->writePreferencesToApplicationStore();
}
auto sumCases = RicSummaryPlotTemplateTools::selectedSummaryCases();
@ -87,5 +88,6 @@ void RicCreatePlotFromTemplateByShortcutFeature::setupActionLook( QAction* actio
actionToSetup->setIcon( QIcon( ":/SummaryTemplate16x16.png" ) );
QKeySequence keySeq( Qt::CTRL + Qt::Key_T );
actionToSetup->setShortcut( keySeq );
applyShortcutWithHintToAction( actionToSetup, keySeq );
}

View File

@ -119,6 +119,7 @@ void RicSavePlotTemplateFeature::onActionTriggered( bool isChecked )
if ( ret == QMessageBox::Yes )
{
app->preferences()->appendPlotTemplateFolders( absPath );
app->preferences()->writePreferencesToApplicationStore();
}
}

View File

@ -138,7 +138,7 @@ void RicSummaryPlotTemplateTools::appendSummaryPlotToPlotCollection(
}
}
if ( selectedSummaryCases.size() > static_cast<size_t>( maximumIndexValue ) )
if ( selectedSummaryCases.size() > static_cast<size_t>( maximumIndexValue + 1 ) )
{
// Use the curve style of the last curve in template, and duplicate this for remaining data sources
@ -192,7 +192,7 @@ void RicSummaryPlotTemplateTools::appendSummaryPlotToPlotCollection(
}
}
if ( selectedEnsembles.size() > static_cast<size_t>( maximumIndexValue ) )
if ( selectedEnsembles.size() > static_cast<size_t>( maximumIndexValue + 1 ) )
{
// Use the curve style of the last curve in template, and duplicate this for remaining data sources

View File

@ -28,7 +28,7 @@
#include "ExportCommands/RicExportLgrUi.h"
#include "RicDeleteTemporaryLgrsFeature.h"
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"

View File

@ -200,7 +200,7 @@ void RicDeleteItemExec::redo()
if ( wellLogPlot )
{
wellLogPlot->calculateAvailableDepthRange();
wellLogPlot->updateDepthZoom();
wellLogPlot->updateZoom();
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
mainPlotWindow->updateWellLogPlotToolBar();
}
@ -209,7 +209,8 @@ void RicDeleteItemExec::redo()
parentObj->firstAncestorOrThisOfType( wellLogPlotTrack );
if ( wellLogPlotTrack )
{
wellLogPlotTrack->calculateXZoomRangeAndUpdateQwt();
wellLogPlotTrack->setAutoScaleXEnabled( true );
wellLogPlotTrack->updateZoomInQwt();
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
mainPlotWindow->updateWellLogPlotToolBar();
}

View File

@ -0,0 +1,346 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicExportContourMapToTextFeature.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RicExportContourMapToTextUi.h"
#include "RifTextDataTableFormatter.h"
#include "RimContourMapProjection.h"
#include "RimEclipseContourMapProjection.h"
#include "RimEclipseContourMapView.h"
#include "RimGeoMechContourMapProjection.h"
#include "RimGeoMechContourMapView.h"
#include "RimProject.h"
#include "RimViewWindow.h"
#include "Riu3DMainWindowTools.h"
#include "RiuViewer.h"
#include "cafCmdFeatureManager.h"
#include "cafPdmUiPropertyViewDialog.h"
#include "cafSelectionManager.h"
#include "cafUtils.h"
#include <QAction>
#include <QFileDialog>
#include <cmath>
RICF_SOURCE_INIT( RicExportContourMapToTextFeature, "RicExportContourMapToTextFeature", "exportContourMapToText" );
RicExportContourMapToTextFeature::RicExportContourMapToTextFeature()
{
RICF_InitFieldNoDefault( &m_exportFileName, "exportFileName", "", "", "", "" );
RICF_InitFieldNoDefault( &m_exportLocalCoordinates, "exportLocalCoordinates", "", "", "", "" );
RICF_InitFieldNoDefault( &m_undefinedValueLabel, "undefinedValueLabel", "", "", "", "" );
RICF_InitFieldNoDefault( &m_excludeUndefinedValues, "excludeUndefinedValues", "", "", "", "" );
RICF_InitField( &m_viewId, "viewId", -1, "View Id", "", "", "" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicExportContourMapToTextFeature::isCommandEnabled()
{
RimEclipseContourMapView* existingEclipseContourMap = nullptr;
RimGeoMechContourMapView* existingGeoMechContourMap = nullptr;
auto sourceViews = findContourMapView();
existingEclipseContourMap = sourceViews.first;
existingGeoMechContourMap = sourceViews.second;
return existingEclipseContourMap || existingGeoMechContourMap;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportContourMapToTextFeature::onActionTriggered( bool isChecked )
{
RimEclipseContourMapView* existingEclipseContourMap = nullptr;
RimGeoMechContourMapView* existingGeoMechContourMap = nullptr;
auto sourceViews = findContourMapView();
existingEclipseContourMap = sourceViews.first;
existingGeoMechContourMap = sourceViews.second;
CAF_ASSERT( existingEclipseContourMap || existingGeoMechContourMap );
RimContourMapProjection* contourMapProjection = nullptr;
QString contourMapName;
if ( existingEclipseContourMap )
{
m_viewId = existingEclipseContourMap->id();
contourMapProjection = existingEclipseContourMap->contourMapProjection();
contourMapName = existingEclipseContourMap->createAutoName();
}
else if ( existingGeoMechContourMap )
{
m_viewId = existingGeoMechContourMap->id();
contourMapProjection = existingGeoMechContourMap->contourMapProjection();
contourMapName = existingGeoMechContourMap->createAutoName();
}
CAF_ASSERT( contourMapProjection );
RiaGuiApplication* app = RiaGuiApplication::instance();
CAF_ASSERT( app && "Must be gui mode" );
QString startPath = app->lastUsedDialogDirectoryWithFallbackToProjectFolder( "CONTOUR_EXPORT" );
QString fileBaseName = caf::Utils::makeValidFileBasename( contourMapName );
startPath = startPath + "/" + fileBaseName + ".txt";
RicExportContourMapToTextUi featureUi;
featureUi.setExportFileName( startPath );
caf::PdmUiPropertyViewDialog propertyDialog( Riu3DMainWindowTools::mainWindowWidget(),
&featureUi,
"Export Contour Map to Text",
"",
QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
if ( propertyDialog.exec() == QDialog::Accepted )
{
QString fileName = featureUi.exportFileName();
app->setLastUsedDialogDirectory( "CONTOUR_EXPORT", QFileInfo( fileName ).absolutePath() );
m_exportFileName = fileName;
m_exportLocalCoordinates = featureUi.exportLocalCoordinates();
m_undefinedValueLabel = featureUi.undefinedValueLabel();
m_excludeUndefinedValues = featureUi.excludeUndefinedValues();
RicfCommandResponse response = execute();
QStringList messages = response.messages();
if ( !messages.empty() )
{
QString displayMessage = QString( "Problem exporting contour map:\n%2" ).arg( messages.join( "\n" ) );
if ( response.status() == RicfCommandResponse::COMMAND_ERROR )
{
RiaLogging::error( displayMessage );
}
else
{
RiaLogging::warning( displayMessage );
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportContourMapToTextFeature::writeMetaDataToStream( QTextStream& stream,
const RimContourMapProjection* contourMapProjection,
const QString& caseName,
bool exportLocalCoordinates )
{
cvf::Vec2ui numVerticesIJ = contourMapProjection->numberOfVerticesIJ();
stream << "# case name : " << contourMapProjection->caseName() << "\n";
stream << "# sampling points : nx=" << numVerticesIJ.x() << " ny=" << numVerticesIJ.y() << "\n";
stream << "# time and date : " << contourMapProjection->currentTimeStepName() << "\n";
stream << "# property name : " << contourMapProjection->resultDescriptionText() << "\n";
if ( exportLocalCoordinates )
{
stream << "# UTM offset : x=" << contourMapProjection->origin3d().x()
<< " y=" << contourMapProjection->origin3d().y() << "\n";
}
stream << "\n\n";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportContourMapToTextFeature::writeContourMapToStream( QTextStream& stream,
const RimContourMapProjection* contourMapProjection,
bool exportLocalCoordinates,
const QString& undefinedValueLabel,
bool excludeUndefinedValues )
{
RifTextDataTableFormatter formatter( stream );
formatter.setTableRowLineAppendText( "" );
formatter.setTableRowPrependText( "" );
formatter.setCommentPrefix( "#" );
formatter.setHeaderPrefix( "" );
formatter.setDefaultMarker( undefinedValueLabel );
std::vector<RifTextDataTableColumn> header = {
RifTextDataTableColumn( "x" ),
RifTextDataTableColumn( "y" ),
RifTextDataTableColumn( "value" ),
};
formatter.header( header );
cvf::Vec2ui numVerticesIJ = contourMapProjection->numberOfVerticesIJ();
std::vector<double> xVertexPositions = contourMapProjection->xVertexPositions();
std::vector<double> yVertexPositions = contourMapProjection->yVertexPositions();
// Undefined values are positive inf in contour map projection.
double undefined = std::numeric_limits<double>::infinity();
for ( unsigned int j = 0; j < numVerticesIJ.y(); j++ )
{
for ( unsigned int i = 0; i < numVerticesIJ.x(); i++ )
{
double value = contourMapProjection->valueAtVertex( i, j );
if ( !( std::isinf( value ) && excludeUndefinedValues ) )
{
double x = xVertexPositions.at( i );
double y = yVertexPositions.at( j );
if ( !exportLocalCoordinates )
{
x += contourMapProjection->origin3d().x();
y += contourMapProjection->origin3d().y();
}
formatter.add( x );
formatter.add( y );
formatter.addValueOrDefaultMarker( value, undefined );
formatter.rowCompleted();
}
}
}
formatter.tableCompleted();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<RimEclipseContourMapView*, RimGeoMechContourMapView*> RicExportContourMapToTextFeature::findContourMapView()
{
RimEclipseContourMapView* existingEclipseContourMap = nullptr;
RimGeoMechContourMapView* existingGeoMechContourMap = nullptr;
auto contextMenuWidget = dynamic_cast<RiuViewer*>(
caf::CmdFeatureManager::instance()->currentContextMenuTargetWidget() );
if ( contextMenuWidget )
{
{
auto candidate = dynamic_cast<RimEclipseContourMapView*>( contextMenuWidget->ownerReservoirView() );
if ( candidate )
{
existingEclipseContourMap = candidate;
}
}
{
auto candidate = dynamic_cast<RimGeoMechContourMapView*>( contextMenuWidget->ownerReservoirView() );
if ( candidate )
{
existingGeoMechContourMap = candidate;
}
}
}
if ( !existingEclipseContourMap && !existingGeoMechContourMap )
{
existingEclipseContourMap = caf::SelectionManager::instance()->selectedItemOfType<RimEclipseContourMapView>();
existingGeoMechContourMap = caf::SelectionManager::instance()->selectedItemOfType<RimGeoMechContourMapView>();
}
auto pair = std::make_pair( existingEclipseContourMap, existingGeoMechContourMap );
return pair;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportContourMapToTextFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Export Contour Map to Text" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicfCommandResponse RicExportContourMapToTextFeature::execute()
{
RicfCommandResponse response;
QStringList errorMessages, warningMessages;
RiaApplication* app = RiaApplication::instance();
RimProject* proj = app->project();
CAF_ASSERT( proj );
std::vector<Rim3dView*> allViews;
proj->allViews( allViews );
Rim3dView* myView = nullptr;
for ( auto view : allViews )
{
if ( m_viewId == view->id() )
{
myView = view;
}
}
if ( !myView )
{
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, "No contour map view found" );
return response;
}
RimContourMapProjection* contourMapProjection = nullptr;
RimEclipseContourMapView* existingEclipseContourMap = dynamic_cast<RimEclipseContourMapView*>( myView );
RimGeoMechContourMapView* existingGeoMechContourMap = dynamic_cast<RimGeoMechContourMapView*>( myView );
CAF_ASSERT( existingEclipseContourMap || existingGeoMechContourMap );
QString contourMapName;
if ( existingEclipseContourMap )
{
contourMapProjection = existingEclipseContourMap->contourMapProjection();
contourMapName = existingEclipseContourMap->createAutoName();
}
else if ( existingGeoMechContourMap )
{
contourMapProjection = existingGeoMechContourMap->contourMapProjection();
contourMapName = existingGeoMechContourMap->createAutoName();
}
CAF_ASSERT( contourMapProjection );
QFile exportFile( m_exportFileName );
if ( !exportFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
errorMessages << QString( "Export Contour Map to Text : Could not open the file: %1" ).arg( m_exportFileName );
}
else
{
QString tableText;
QTextStream stream( &exportFile );
writeMetaDataToStream( stream, contourMapProjection, contourMapName, m_exportLocalCoordinates.value() );
writeContourMapToStream( stream,
contourMapProjection,
m_exportLocalCoordinates.value(),
m_undefinedValueLabel.value(),
m_excludeUndefinedValues.value() );
}
for ( QString errorMessage : errorMessages )
{
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, errorMessage );
}
return response;
}

View File

@ -0,0 +1,69 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "CommandFileInterface/Core/RicfCommandObject.h"
#include "cafCmdFeature.h"
#include "cafPdmField.h"
#include <utility>
class RimContourMapProjection;
class RimEclipseContourMapView;
class RimGeoMechContourMapView;
class QTextStream;
//==================================================================================================
///
//==================================================================================================
class RicExportContourMapToTextFeature : public caf::CmdFeature, public RicfCommandObject
{
RICF_HEADER_INIT;
public:
RicExportContourMapToTextFeature();
RicfCommandResponse execute() override;
protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
static void writeMetaDataToStream( QTextStream& stream,
const RimContourMapProjection* contourMapProjection,
const QString& caseName,
bool exportLocalCoordinates );
static void writeContourMapToStream( QTextStream& stream,
const RimContourMapProjection* contourMapProjection,
bool exportLocalCoordinates,
const QString& undefinedValueLabel,
bool excludeUndefinedValues );
private:
static std::pair<RimEclipseContourMapView*, RimGeoMechContourMapView*> findContourMapView();
private:
caf::PdmField<QString> m_exportFileName;
caf::PdmField<bool> m_exportLocalCoordinates;
caf::PdmField<QString> m_undefinedValueLabel;
caf::PdmField<bool> m_excludeUndefinedValues;
caf::PdmField<int> m_viewId;
};

View File

@ -0,0 +1,79 @@
#include "RicExportContourMapToTextUi.h"
#include "RiaApplication.h"
#include "cafPdmUiFilePathEditor.h"
CAF_PDM_SOURCE_INIT( RicExportContourMapToTextUi, "RicExportContourMapToTextUi" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicExportContourMapToTextUi::RicExportContourMapToTextUi()
{
CAF_PDM_InitObject( "Export Contour Map to Text", "", "", "" );
CAF_PDM_InitField( &m_exportFileName, "ExportFileName", QString(), "Export File Name", "", "", "" );
m_exportFileName.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_exportLocalCoordinates, "ExportLocalCoordinates", false, "Export Local Coordinates", "", "", "" );
CAF_PDM_InitField( &m_undefinedValueLabel, "UndefinedValueLabel", QString( "NaN" ), "Undefined Value Label", "", "", "" );
CAF_PDM_InitField( &m_excludeUndefinedValues, "ExcludeUndefinedValues", false, "Exclude Undefined Values", "", "", "" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RicExportContourMapToTextUi::exportFileName() const
{
return m_exportFileName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportContourMapToTextUi::setExportFileName( const QString& exportFileName )
{
m_exportFileName = exportFileName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicExportContourMapToTextUi::exportLocalCoordinates() const
{
return m_exportLocalCoordinates;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RicExportContourMapToTextUi::undefinedValueLabel() const
{
return m_undefinedValueLabel;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicExportContourMapToTextUi::excludeUndefinedValues() const
{
return m_excludeUndefinedValues;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportContourMapToTextUi::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{
if ( field == &m_exportFileName )
{
caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
if ( myAttr )
{
myAttr->m_selectSaveFileName = true;
}
}
}

View File

@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmField.h"
#include "cafPdmObject.h"
//==================================================================================================
///
//==================================================================================================
class RicExportContourMapToTextUi : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RicExportContourMapToTextUi();
QString exportFileName() const;
void setExportFileName( const QString& exportFileName );
bool exportLocalCoordinates() const;
QString undefinedValueLabel() const;
bool excludeUndefinedValues() const;
protected:
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
private:
caf::PdmField<QString> m_exportFileName;
caf::PdmField<bool> m_exportLocalCoordinates;
caf::PdmField<QString> m_undefinedValueLabel;
caf::PdmField<bool> m_excludeUndefinedValues;
};

View File

@ -68,7 +68,7 @@ void RicGeoMechPropertyFilterFeatureImpl::addPropertyFilter( RimGeoMechPropertyF
propertyFilterCollection->reservoirView()->scheduleCreateDisplayModelAndRedraw();
propertyFilterCollection->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter );
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter , false);
}
//--------------------------------------------------------------------------------------------------
@ -85,7 +85,7 @@ void RicGeoMechPropertyFilterFeatureImpl::insertPropertyFilter( RimGeoMechProper
propertyFilterCollection->reservoirView()->scheduleCreateDisplayModelAndRedraw();
propertyFilterCollection->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter );
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter , false);
}
//--------------------------------------------------------------------------------------------------

View File

@ -39,7 +39,7 @@ CAF_CMD_SOURCE_INIT( RicGeoMechPropertyFilterNewInViewFeature, "RicGeoMechProper
//--------------------------------------------------------------------------------------------------
bool RicGeoMechPropertyFilterNewInViewFeature::isCommandEnabled()
{
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
Rim3dView* view = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !view ) return false;
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>( view );
@ -62,7 +62,7 @@ bool RicGeoMechPropertyFilterNewInViewFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicGeoMechPropertyFilterNewInViewFeature::onActionTriggered( bool isChecked )
{
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
Rim3dView* view = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !view ) return;
RimGeoMechView* eclView = dynamic_cast<RimGeoMechView*>( view );
if ( !eclView ) return;

View File

@ -41,6 +41,7 @@
#include "RiuMainWindow.h"
#include "RiuPlotMainWindow.h"
#include "RiuPlotMainWindowTools.h"
#include "SummaryPlotCommands/RicNewSummaryEnsembleCurveSetFeature.h"
#include "SummaryPlotCommands/RicNewSummaryPlotFeature.h"
@ -84,7 +85,12 @@ void RicImportSummaryCasesFeature::onActionTriggered( bool isChecked )
addSummaryCases( cases );
if ( !cases.empty() )
{
RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( cases.front() );
auto objectToSelect = RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( cases.front() );
if ( objectToSelect )
{
RiuPlotMainWindowTools::setExpanded( objectToSelect );
RiuPlotMainWindowTools::selectAsCurrentItem( objectToSelect );
}
}
addCasesToGroupIfRelevant( cases );
@ -95,8 +101,6 @@ void RicImportSummaryCasesFeature::onActionTriggered( bool isChecked )
RiuPlotMainWindow* mainPlotWindow = app->getOrCreateAndShowMainPlotWindow();
if ( mainPlotWindow && !cases.empty() )
{
mainPlotWindow->selectAsCurrentItem( cases.back() );
mainPlotWindow->updateSummaryPlotToolBar();
}
@ -134,13 +138,17 @@ bool RicImportSummaryCasesFeature::createAndAddSummaryCasesFromFiles( const QStr
addSummaryCases( *cases );
if ( !cases->empty() && doCreateDefaultPlot )
{
RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( cases->back() );
auto objectToSelect = RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( cases->back() );
if ( objectToSelect )
{
RiuPlotMainWindowTools::setExpanded( objectToSelect );
RiuPlotMainWindowTools::selectAsCurrentItem( objectToSelect );
}
}
RiuPlotMainWindow* mainPlotWindow = app->getOrCreateAndShowMainPlotWindow();
if ( mainPlotWindow && !cases->empty() )
{
mainPlotWindow->selectAsCurrentItem( cases->back() );
mainPlotWindow->updateSummaryPlotToolBar();
// Close main window if there are no eclipse cases imported

View File

@ -26,23 +26,28 @@
#include "RimGridView.h"
#include "RimViewController.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
#include "cafCmdExecCommandManager.h"
#include <QAction>
#include <QList>
#include <QVariant>
CAF_CMD_SOURCE_INIT( RicNewSliceRangeFilterFeature, "RicNewSliceRangeFilterFeature" );
CAF_CMD_SOURCE_INIT( RicNewSliceRangeFilter3dViewFeature, "RicNewSliceRangeFilter3dViewFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewSliceRangeFilterFeature::isCommandEnabled()
bool RicNewSliceRangeFilter3dViewFeature::isCommandEnabled()
{
RimGridView* view = RiaApplication::instance()->activeGridView();
if ( !view ) return false;
RimViewController* vc = view->viewController();
RimGridView* viewOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
RimViewController* vc = viewOrComparisonView->viewController();
if ( !vc ) return true;
return ( !vc->isRangeFiltersControlled() );
@ -51,14 +56,16 @@ bool RicNewSliceRangeFilterFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewSliceRangeFilterFeature::onActionTriggered( bool isChecked )
void RicNewSliceRangeFilter3dViewFeature::onActionTriggered( bool isChecked )
{
QVariant userData = this->userData();
if ( !userData.isNull() && userData.type() == QVariant::List )
{
RimGridView* view = RiaApplication::instance()->activeGridView();
RimCellRangeFilterCollection* rangeFilterCollection = view->rangeFilterCollection();
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimGridView* viewOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
RimCellRangeFilterCollection* rangeFilterCollection = viewOrComparisonView->rangeFilterCollection();
RicRangeFilterNewExec* filterExec = new RicRangeFilterNewExec( rangeFilterCollection );
@ -87,14 +94,14 @@ void RicNewSliceRangeFilterFeature::onActionTriggered( bool isChecked )
}
caf::CmdExecCommandManager::instance()->processExecuteCommand( filterExec );
view->setSurfaceDrawstyle();
activeView->setSurfaceDrawstyle();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewSliceRangeFilterFeature::setupActionLook( QAction* actionToSetup )
void RicNewSliceRangeFilter3dViewFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/CellFilter_Range.png" ) );
}

View File

@ -23,7 +23,7 @@
//==================================================================================================
///
//==================================================================================================
class RicNewSliceRangeFilterFeature : public caf::CmdFeature
class RicNewSliceRangeFilter3dViewFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;

View File

@ -73,7 +73,7 @@ void RicRangeFilterNewExec::redo()
m_cellRangeFilterCollection->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( rangeFilter );
Riu3DMainWindowTools::selectAsCurrentItem( rangeFilter, false );
// Trigger update of view following the range filter update
RimGridView* view = nullptr;

View File

@ -68,7 +68,9 @@ bool RicSelectColorResult::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSelectColorResult::onActionTriggered( bool isChecked )
{
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
Rim3dView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
bool isComparisonView = (activeView != RiaApplication::instance()->activeGridView());
Rim2dIntersectionView* int2dView = dynamic_cast<Rim2dIntersectionView*>( activeView );
RimGridView* gridView = nullptr;
@ -80,13 +82,13 @@ void RicSelectColorResult::onActionTriggered( bool isChecked )
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( gridView );
if ( eclView )
{
Riu3DMainWindowTools::selectAsCurrentItem( eclView->cellResult(), int2dView == nullptr );
Riu3DMainWindowTools::selectAsCurrentItem( eclView->cellResult(), int2dView == nullptr && !isComparisonView );
return;
}
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>( gridView );
if ( geoMechView )
{
Riu3DMainWindowTools::selectAsCurrentItem( geoMechView->cellResult(), int2dView == nullptr );
Riu3DMainWindowTools::selectAsCurrentItem( geoMechView->cellResult(), int2dView == nullptr && !isComparisonView );
}
}

View File

@ -54,5 +54,6 @@ void RicActivateCurveFilterInToolbarFeature::onActionTriggered( bool isChecked )
void RicActivateCurveFilterInToolbarFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Activate Summary Curve Filter Editor" );
actionToSetup->setShortcut( QKeySequence( tr( "Ctrl+F" ) ) );
applyShortcutWithHintToAction( actionToSetup, QKeySequence( tr( "Ctrl+F" ) ) );
}

View File

@ -176,7 +176,7 @@ bool RicAsciiExportSummaryPlotFeature::exportAsciiForSummaryPlot( const QString&
bool showTimeAsLongString )
{
QString text = summaryPlot->description();
text.append( summaryPlot->asciiDataForPlotExport( resamplingPeriod, showTimeAsLongString ) );
text.append( summaryPlot->asciiDataForSummaryPlotExport( resamplingPeriod, showTimeAsLongString ) );
text.append( "\n\n" );
return exportTextToFile( fileName, text );

View File

@ -68,17 +68,7 @@ RicSummaryCurveCreatorDialog* RicEditSummaryPlotFeature::curveCreatorDialog()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicEditSummaryPlotFeature::isCommandEnabled()
{
if ( selectedSummaryPlot() ) return true;
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicEditSummaryPlotFeature::onActionTriggered( bool isChecked )
void RicEditSummaryPlotFeature::editSummaryPlot( RimSummaryPlot* plot )
{
auto dialog = RicEditSummaryPlotFeature::curveCreatorDialog();
@ -91,13 +81,30 @@ void RicEditSummaryPlotFeature::onActionTriggered( bool isChecked )
dialog->raise();
}
// Set target plot
if ( selectedSummaryPlot() )
if ( plot )
{
dialog->updateFromSummaryPlot( selectedSummaryPlot() );
dialog->updateFromSummaryPlot( plot );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicEditSummaryPlotFeature::isCommandEnabled()
{
if ( selectedSummaryPlot() ) return true;
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicEditSummaryPlotFeature::onActionTriggered( bool isChecked )
{
editSummaryPlot( selectedSummaryPlot() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -110,7 +117,7 @@ void RicEditSummaryPlotFeature::setupActionLook( QAction* actionToSetup )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryPlot* RicEditSummaryPlotFeature::selectedSummaryPlot() const
RimSummaryPlot* RicEditSummaryPlotFeature::selectedSummaryPlot()
{
RimSummaryPlot* sumPlot = nullptr;

View File

@ -35,13 +35,13 @@ public:
void closeDialogAndResetTargetPlot();
static RicSummaryCurveCreatorDialog* curveCreatorDialog();
static void editSummaryPlot( RimSummaryPlot* plot );
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
private:
RimSummaryPlot* selectedSummaryPlot() const;
static RimSummaryPlot* selectedSummaryPlot();
};

View File

@ -658,7 +658,7 @@ void RicSummaryCurveCreator::updateTargetPlot()
copyEnsembleCurveAndAddToCurveSet( editedCurve, editedCurveSet );
}
newCurveSet->setParentQwtPlotNoReplot( m_targetPlot->qwtPlot() );
newCurveSet->setParentQwtPlotNoReplot( m_targetPlot->viewer() );
}
m_targetPlot->enableAutoPlotTitle( m_useAutoPlotTitleProxy() );
@ -874,7 +874,7 @@ void RicSummaryCurveCreator::updateCurveNames()
curve->updateCurveNameNoLegendUpdate();
}
if ( m_previewPlot && m_previewPlot->qwtPlot() ) m_previewPlot->qwtPlot()->updateLegend();
if ( m_previewPlot && m_previewPlot->viewer() ) m_previewPlot->viewer()->updateLegend();
}
//--------------------------------------------------------------------------------------------------

View File

@ -107,7 +107,7 @@ void RicSummaryCurveCreatorSplitterUi::recursivelyConfigureAndUpdateTopLevelUiOr
QMinimizePanel* curveGroup = getOrCreateCurveTreeGroup();
m_lowerLeftLayout->insertWidget( 2, curveGroup, 1 );
m_lowerLeftLayout->addStretch( 0 );
m_secondRowLayout->insertWidget( 1, getOrCreatePlotWidget() );
m_lowerRightLayout->insertWidget( 1, getOrCreatePlotWidget() );
// Fields at bottom of dialog
configureAndUpdateFields( 1, m_bottomFieldLayout, topLevelUiItems, uiConfigName );
@ -138,6 +138,20 @@ QWidget* RicSummaryCurveCreatorSplitterUi::createWidget( QWidget* parent )
m_lowerLeftLayout->setContentsMargins( 0, 0, 0, 0 );
m_secondRowLayout->addLayout( m_lowerLeftLayout );
m_lowerRightLayout = new QVBoxLayout;
m_lowerRightLayout->setContentsMargins( 0, 0, 0, 0 );
m_secondRowLayout->addLayout( m_lowerRightLayout );
{
auto label = new QLabel( "Plot Preview" );
label->setAlignment( Qt::AlignCenter );
auto font = label->font();
font.setPixelSize( 20 );
label->setFont( font );
m_lowerRightLayout->insertWidget( 0, label );
}
m_firstColumnSplitter = new QSplitter( Qt::Vertical );
m_firstColumnSplitter->setContentsMargins( 0, 0, 0, 0 );

View File

@ -87,6 +87,7 @@ private:
QPointer<QHBoxLayout> m_firstRowLayout;
QPointer<QHBoxLayout> m_secondRowLayout;
QPointer<QVBoxLayout> m_lowerLeftLayout;
QPointer<QVBoxLayout> m_lowerRightLayout;
QPointer<QHBoxLayout> m_bottomFieldLayout;

View File

@ -131,7 +131,12 @@ void RicSummaryPlotFeatureImpl::ensureAtLeastOnePlot( RimSummaryPlotCollection*
{
if ( summaryPlotCollection->summaryPlots.empty() )
{
createDefaultSummaryPlot( summaryCase );
auto objectToSelect = createDefaultSummaryPlot( summaryCase );
if ( objectToSelect )
{
RiuPlotMainWindowTools::setExpanded( objectToSelect );
RiuPlotMainWindowTools::selectAsCurrentItem( objectToSelect );
}
}
}
}
@ -139,11 +144,13 @@ void RicSummaryPlotFeatureImpl::ensureAtLeastOnePlot( RimSummaryPlotCollection*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( RimSummaryCase* summaryCase )
caf::PdmObject* RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( RimSummaryCase* summaryCase )
{
RimSummaryPlotCollection* summaryPlotCollection =
RiaApplication::instance()->project()->mainPlotCollection->summaryPlotCollection();
caf::PdmObject* itemToSelect = nullptr;
if ( summaryPlotCollection && summaryCase &&
!RiaApplication::instance()->preferences()->defaultSummaryCurvesTextFilter().isEmpty() )
{
@ -156,12 +163,17 @@ void RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( RimSummaryCase* summar
summaryPlotCollection->updateConnectedEditors();
caf::PdmObject* itemToSelect = plot;
if ( curves.size() ) itemToSelect = curves[0];
RiuPlotMainWindowTools::setExpanded( itemToSelect );
RiuPlotMainWindowTools::selectAsCurrentItem( itemToSelect );
if ( curves.size() )
{
itemToSelect = curves[0];
}
else
{
itemToSelect = plot;
}
}
return itemToSelect;
}
RimSummaryCurve* createHistoryCurve( const RifEclipseSummaryAddress& addr, RimSummaryCase* summaryCasesToUse )
@ -275,7 +287,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
QStringList gridFileNames;
QString ensembleColoringParameter;
std::set<QString> validOptions = {"-help", "-h", "-nl", "-s", "-n", "-e", "-c", "-cl"};
std::set<QString> validOptions = { "-help", "-h", "-nl", "-s", "-n", "-e", "-c", "-cl" };
for ( int optionIdx = 0; optionIdx < arguments.size(); ++optionIdx )
{

View File

@ -22,6 +22,11 @@
#include <set>
#include <vector>
namespace caf
{
class PdmObject;
}
class RimSummaryCurve;
class RimSummaryPlot;
class RimSummaryCase;
@ -35,7 +40,7 @@ public:
static RimSummaryCurve* addDefaultCurveToPlot( RimSummaryPlot* plot, RimSummaryCase* summaryCase );
static std::vector<RimSummaryCurve*> addDefaultCurvesToPlot( RimSummaryPlot* plot, RimSummaryCase* summaryCase );
static void ensureAtLeastOnePlot( RimSummaryPlotCollection* summaryPlotCollection, RimSummaryCase* summaryCase );
static void createDefaultSummaryPlot( RimSummaryCase* summaryCase );
static caf::PdmObject* createDefaultSummaryPlot( RimSummaryCase* summaryCase );
static void createSummaryPlotsFromArgumentLine( const QStringList& arguments );

View File

@ -13,7 +13,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotFeatureImpl.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotTrackFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotCurveFeatureImpl.h
${CMAKE_CURRENT_LIST_DIR}/RicWellLogsImportFileFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellLogPlotTrackFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubPlotFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotTrackFeatureImpl.h
${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogCurveFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogTrackFeature.h
@ -44,7 +44,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotFeatureImpl.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotTrackFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotCurveFeatureImpl.cpp
${CMAKE_CURRENT_LIST_DIR}/RicWellLogsImportFileFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellLogPlotTrackFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubPlotFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotTrackFeatureImpl.cpp
${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogCurveFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogTrackFeature.cpp

View File

@ -37,7 +37,7 @@
#include "RigWellLogFile.h"
#include "RiaApplication.h"
#include "RiuWellLogTrack.h"
#include "RiuQwtPlotWidget.h"
#include "cafSelectionManager.h"
@ -65,8 +65,8 @@ void RicAddWellLogToPlotFeature::onActionTriggered( bool isChecked )
RimWellLogPlot* plot = RicNewWellLogPlotFeatureImpl::createWellLogPlot();
RimWellLogTrack* plotTrack = new RimWellLogTrack();
plot->addTrack( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( plot->trackCount() ) );
plot->addPlot( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( plot->plotCount() ) );
plot->loadDataAndUpdate();
@ -103,9 +103,7 @@ void RicAddWellLogToPlotFeature::onActionTriggered( bool isChecked )
curve->loadDataAndUpdate( true );
}
}
plot->calculateAvailableDepthRange();
plot->updateDepthZoom();
plotTrack->viewer()->replot();
plot->updateLayout();
RiaApplication::instance()->project()->updateConnectedEditors();

View File

@ -17,38 +17,38 @@
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicDeleteWellLogPlotTrackFeature.h"
#include "RicDeleteSubPlotFeature.h"
#include "RicWellLogPlotCurveFeatureImpl.h"
#include "RiaGuiApplication.h"
#include "RiuGridPlotWindow.h"
#include "RiuPlotMainWindow.h"
#include "RiuWellLogPlot.h"
#include "RiuWellLogTrack.h"
#include "RiuQwtPlotWidget.h"
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "RimGridPlotWindow.h"
#include "RimPlotInterface.h"
#include "cafSelectionManager.h"
#include <QAction>
CAF_CMD_SOURCE_INIT( RicDeleteWellLogPlotTrackFeature, "RicDeleteWellLogPlotTrackFeature" );
CAF_CMD_SOURCE_INIT( RicDeleteSubPlotFeature, "RicDeleteWellLogPlotTrackFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicDeleteWellLogPlotTrackFeature::isCommandEnabled()
bool RicDeleteSubPlotFeature::isCommandEnabled()
{
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return false;
std::vector<RimWellLogTrack*> selection;
std::vector<caf::PdmObject*> selection;
caf::SelectionManager::instance()->objectsByType( &selection );
if ( selection.size() > 0 )
{
RimWellLogPlot* wellLogPlot = nullptr;
RimGridPlotWindow* wellLogPlot = nullptr;
selection[0]->firstAncestorOrThisOfType( wellLogPlot );
if ( wellLogPlot && wellLogPlot->trackCount() > 1 )
if ( dynamic_cast<RimPlotInterface*>( selection[0] ) && wellLogPlot && wellLogPlot->plotCount() > 1 )
{
return true;
}
@ -60,38 +60,39 @@ bool RicDeleteWellLogPlotTrackFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDeleteWellLogPlotTrackFeature::onActionTriggered( bool isChecked )
void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
{
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return;
std::vector<RimWellLogTrack*> selection;
std::vector<caf::PdmObject*> selection;
caf::SelectionManager::instance()->objectsByType( &selection );
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
std::set<RimWellLogPlot*> alteredWellLogPlots;
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
std::set<RimGridPlotWindow*> alteredWellLogPlots;
for ( size_t i = 0; i < selection.size(); i++ )
{
RimWellLogTrack* track = selection[i];
RimPlotInterface* plot = dynamic_cast<RimPlotInterface*>( selection[i] );
RimWellLogPlot* wellLogPlot = nullptr;
track->firstAncestorOrThisOfType( wellLogPlot );
if ( wellLogPlot && wellLogPlot->trackCount() > 1 )
RimGridPlotWindow* wellLogPlot = nullptr;
selection[i]->firstAncestorOrThisOfType( wellLogPlot );
if ( plot && wellLogPlot && wellLogPlot->plotCount() > 1 )
{
alteredWellLogPlots.insert( wellLogPlot );
wellLogPlot->removeTrack( track );
caf::SelectionManager::instance()->removeObjectFromAllSelections( track );
wellLogPlot->removePlot( plot );
caf::SelectionManager::instance()->removeObjectFromAllSelections( selection[i] );
wellLogPlot->updateConnectedEditors();
delete track;
delete plot;
}
}
for ( RimWellLogPlot* wellLogPlot : alteredWellLogPlots )
for ( RimGridPlotWindow* wellLogPlot : alteredWellLogPlots )
{
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>( wellLogPlot->viewWidget() );
RiuGridPlotWindow* viewWidget = dynamic_cast<RiuGridPlotWindow*>( wellLogPlot->viewWidget() );
plotWindow->setWidthOfMdiWindow( viewWidget, viewWidget->preferredWidth() );
wellLogPlot->calculateAvailableDepthRange();
wellLogPlot->updateDepthZoom();
// TODO: add back with virtual methods
// wellLogPlot->calculateAvailableDepthRange();
// wellLogPlot->updateDepthZoom();
wellLogPlot->uiCapability()->updateConnectedEditors();
}
}
@ -99,7 +100,7 @@ void RicDeleteWellLogPlotTrackFeature::onActionTriggered( bool isChecked )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDeleteWellLogPlotTrackFeature::setupActionLook( QAction* actionToSetup )
void RicDeleteSubPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Delete Track" );
actionToSetup->setIcon( QIcon( ":/Erase.png" ) );

View File

@ -24,7 +24,7 @@
//==================================================================================================
///
//==================================================================================================
class RicDeleteWellLogPlotTrackFeature : public caf::CmdFeature
class RicDeleteSubPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;

View File

@ -112,8 +112,8 @@ void RicNewPltPlotFeature::onActionTriggered( bool isChecked )
pltPlot->setCurrentWellName( wellPathName );
RimWellLogTrack* plotTrack = new RimWellLogTrack();
pltPlot->addTrack( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( pltPlot->trackCount() ) );
pltPlot->addPlot( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( pltPlot->plotCount() ) );
pltPlotColl->addPlot( pltPlot );
pltPlot->setDescription( plotName );

View File

@ -68,13 +68,12 @@ void RicNewRftPlotFeature::onActionTriggered( bool isChecked )
QString wellName = selectedWellName();
RimWellRftPlot* rftPlot = new RimWellRftPlot();
RiaApplication::instance()->project()->assignViewIdToView( rftPlot );
rftPlot->setSimWellOrWellPathName( wellName );
RimWellLogTrack* plotTrack = new RimWellLogTrack();
rftPlot->addTrack( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( rftPlot->trackCount() ) );
rftPlot->addPlot( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( rftPlot->plotCount() ) );
rftPlotColl->addPlot( rftPlot );
rftPlot->applyInitialSelections();

View File

@ -99,10 +99,10 @@ RimWellBoreStabilityPlot*
plot->enableAllAutoNameTags( true );
plot->setPlotTitleVisible( true );
plot->setTrackLegendsVisible( true );
plot->setTrackLegendsHorizontal( true );
plot->setLegendsVisible( true );
plot->setLegendsHorizontal( true );
plot->setDepthType( RimWellLogPlot::TRUE_VERTICAL_DEPTH );
plot->setDepthAutoZoom( true );
plot->setAutoScaleYEnabled( true );
RicNewWellLogPlotFeatureImpl::updateAfterCreation( plot );
}
@ -191,7 +191,7 @@ void RicNewWellBoreStabilityPlotFeature::createFormationTrack( RimWellBoreStabil
formationTrack->setFormationCase( geoMechCase );
formationTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
formationTrack->setVisibleXRange( 0.0, 0.0 );
formationTrack->setWidthScaleFactor( RimWellLogTrack::NARROW_TRACK );
formationTrack->setWidthScaleFactor( RimPlotInterface::NARROW );
}
//--------------------------------------------------------------------------------------------------
@ -202,7 +202,7 @@ void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack( RimWellBoreStabi
RimGeoMechCase* geoMechCase )
{
RimWellLogTrack* casingShoeTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Well Design", plot );
casingShoeTrack->setWidthScaleFactor( RimWellLogTrack::NARROW_TRACK );
casingShoeTrack->setWidthScaleFactor( RimPlotInterface::NARROW );
casingShoeTrack->setFormationWellPath( wellPath );
casingShoeTrack->setFormationCase( geoMechCase );
casingShoeTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
@ -226,7 +226,7 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi
RimWellLogTrack* paramCurvesTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false,
"WBS Parameters",
plot );
paramCurvesTrack->setWidthScaleFactor( RimWellLogTrack::WIDE_TRACK );
paramCurvesTrack->setWidthScaleFactor( RimPlotInterface::WIDE );
paramCurvesTrack->setAutoScaleXEnabled( true );
paramCurvesTrack->setTickIntervals( 0.5, 0.05 );
paramCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
@ -234,10 +234,10 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi
paramCurvesTrack->setFormationCase( geoMechCase );
paramCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::CURVE_ANNOTATIONS );
paramCurvesTrack->setShowRegionLabels( true );
paramCurvesTrack->setVisible( false );
paramCurvesTrack->setChecked( false );
std::vector<QString> resultNames = RiaDefines::wellPathStabilityParameterNames();
std::vector<cvf::Color3f> colors = {cvf::Color3f::CRIMSON, cvf::Color3f::DARK_YELLOW};
std::vector<cvf::Color3f> colors = { cvf::Color3f::CRIMSON, cvf::Color3f::DARK_YELLOW };
for ( size_t i = 0; i < resultNames.size(); ++i )
{
@ -258,7 +258,7 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi
curve->loadDataAndUpdate( false );
curve->setAutoNameComponents( false, true, false, false, false );
}
paramCurvesTrack->calculateXZoomRangeAndUpdateQwt();
paramCurvesTrack->setAutoScaleXEnabled( true );
}
//--------------------------------------------------------------------------------------------------
@ -272,7 +272,7 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
RimWellLogTrack* stabilityCurvesTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false,
"Stability Curves",
plot );
stabilityCurvesTrack->setWidthScaleFactor( RimWellLogTrack::EXTRA_WIDE_TRACK );
stabilityCurvesTrack->setWidthScaleFactor( RimPlotInterface::EXTRA_WIDE );
stabilityCurvesTrack->setAutoScaleXEnabled( true );
stabilityCurvesTrack->setTickIntervals( 0.5, 0.05 );
stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
@ -283,11 +283,11 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
std::vector<QString> resultNames = RiaDefines::wellPathStabilityResultNames();
std::vector<cvf::Color3f> colors = {cvf::Color3f::BLUE,
cvf::Color3f::BROWN,
cvf::Color3f::RED,
cvf::Color3f::PURPLE,
cvf::Color3f::DARK_GREEN};
std::vector<cvf::Color3f> colors = { cvf::Color3f::BLUE,
cvf::Color3f::BROWN,
cvf::Color3f::RED,
cvf::Color3f::PURPLE,
cvf::Color3f::DARK_GREEN };
for ( size_t i = 0; i < resultNames.size(); ++i )
{
@ -309,7 +309,7 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
curve->setSmoothCurve( true );
curve->setSmoothingThreshold( 0.002 );
}
stabilityCurvesTrack->calculateXZoomRangeAndUpdateQwt();
stabilityCurvesTrack->setAutoScaleXEnabled( true );
}
//--------------------------------------------------------------------------------------------------
@ -327,9 +327,9 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability
const double angleIncrement = 90.0;
std::vector<QString> resultNames = RiaDefines::wellPathAngleResultNames();
std::vector<cvf::Color3f> colors = {cvf::Color3f::GREEN, cvf::Color3f::ORANGE};
std::vector<cvf::Color3f> colors = { cvf::Color3f::GREEN, cvf::Color3f::ORANGE };
std::vector<RiuQwtPlotCurve::LineStyleEnum> lineStyles = {RiuQwtPlotCurve::STYLE_SOLID, RiuQwtPlotCurve::STYLE_DASH};
std::vector<RiuQwtPlotCurve::LineStyleEnum> lineStyles = { RiuQwtPlotCurve::STYLE_SOLID, RiuQwtPlotCurve::STYLE_DASH };
for ( size_t i = 0; i < resultNames.size(); ++i )
{
@ -366,7 +366,7 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability
maxValue = cvf::Math::clamp( maxValue, angleIncrement, 360.0 );
minValue = cvf::Math::clamp( minValue, 0.0, maxValue - 90.0 );
}
wellPathAnglesTrack->setWidthScaleFactor( RimWellLogTrack::NORMAL_TRACK );
wellPathAnglesTrack->setWidthScaleFactor( RimPlotInterface::NORMAL );
wellPathAnglesTrack->setVisibleXRange( minValue, maxValue );
wellPathAnglesTrack->setTickIntervals( 90.0, 30.0 );
wellPathAnglesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );

View File

@ -53,7 +53,6 @@ RimWellBoreStabilityPlot*
RimWellBoreStabilityPlot* plot = new RimWellBoreStabilityPlot();
plot->setAsPlotMdiWindow();
RiaApplication::instance()->project()->assignViewIdToView( plot );
wellLogPlotColl->wellLogPlots().push_back( plot );
@ -88,7 +87,6 @@ RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot( bool showAfterC
RimWellLogPlot* plot = new RimWellLogPlot();
plot->setAsPlotMdiWindow();
RiaApplication::instance()->project()->assignViewIdToView( plot );
wellLogPlotColl->wellLogPlots().push_back( plot );
@ -165,14 +163,14 @@ RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( bool
}
RimWellLogTrack* plotTrack = new RimWellLogTrack();
plot->addTrack( plotTrack );
plot->addPlot( plotTrack );
if ( !trackDescription.isEmpty() )
{
plotTrack->setDescription( trackDescription );
}
else
{
plotTrack->setDescription( QString( "Track %1" ).arg( plot->trackCount() ) );
plotTrack->setDescription( QString( "Track %1" ).arg( plot->plotCount() ) );
}
if ( caseToApply )
@ -224,10 +222,6 @@ void RicNewWellLogPlotFeatureImpl::updateAfterCreation( RimWellLogPlot* plot )
{
CVF_ASSERT( plot );
plot->loadDataAndUpdate();
plot->updateDepthZoom();
plot->updateConnectedEditors();
plot->updateTracks();
RiaApplication::instance()->project()->updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------

View File

@ -21,8 +21,8 @@
#include "RiaGuiApplication.h"
#include "RiuPlotMainWindow.h"
#include "RiuQwtPlotWidget.h"
#include "RiuWellLogPlot.h"
#include "RiuWellLogTrack.h"
#include "RicNewWellLogCurveExtractionFeature.h"
#include "RicWellLogPlotCurveFeatureImpl.h"
@ -62,8 +62,8 @@ void RicNewWellLogPlotTrackFeature::onActionTriggered( bool isChecked )
if ( wellLogPlot )
{
RimWellLogTrack* plotTrack = new RimWellLogTrack;
wellLogPlot->addTrack( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( wellLogPlot->trackCount() ) );
wellLogPlot->addPlot( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( wellLogPlot->plotCount() ) );
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>( wellLogPlot->viewWidget() );
RicWellLogTools::addWellLogExtractionCurve( plotTrack, nullptr, nullptr, nullptr, nullptr, -1, true );

View File

@ -81,9 +81,9 @@ void RicPasteWellLogTrackFeature::onActionTriggered( bool isChecked )
fileCurve->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
CVF_ASSERT( newObject );
wellLogPlot->addTrack( newObject );
wellLogPlot->addPlot( newObject );
newObject->setDescription( QString( "Track %1" ).arg( wellLogPlot->trackCount() ) );
newObject->setDescription( QString( "Track %1" ).arg( wellLogPlot->plotCount() ) );
// Resolve references after object has been inserted into the project data model
newObject->resolveReferencesRecursively();

View File

@ -21,8 +21,8 @@
#include "RiaGuiApplication.h"
#include "RiuPlotMainWindow.h"
#include "RiuQwtPlotWidget.h"
#include "RiuWellLogPlot.h"
#include "RiuWellLogTrack.h"
#include "RimWellLogCurve.h"
#include "RimWellLogPlot.h"
@ -74,65 +74,42 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra
for ( std::set<RimWellLogTrack*>::iterator tIt = srcTracks.begin(); tIt != srcTracks.end(); ++tIt )
{
( *tIt )->setAutoScaleXEnabled( true );
( *tIt )->updateParentPlotZoom();
( *tIt )->calculateXZoomRangeAndUpdateQwt();
}
destTrack->loadDataAndUpdate();
destTrack->setAutoScaleXEnabled( true );
destTrack->updateParentPlotZoom();
destTrack->calculateXZoomRangeAndUpdateQwt();
destTrack->updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellLogPlotTrackFeatureImpl::moveTracksToWellLogPlot( RimWellLogPlot* dstWellLogPlot,
const std::vector<RimWellLogTrack*>& tracksToMove,
RimWellLogTrack* trackToInsertAfter )
void RicWellLogPlotTrackFeatureImpl::movePlotsToGridPlotWindow( RimGridPlotWindow* gridPlotWindow,
const std::vector<RimPlotInterface*>& plotsToMove,
RimPlotInterface* plotToInsertAfter )
{
CVF_ASSERT( dstWellLogPlot );
CVF_ASSERT( gridPlotWindow );
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
std::set<RimWellLogPlot*> srcPlots;
for ( size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++ )
for ( size_t tIdx = 0; tIdx < plotsToMove.size(); tIdx++ )
{
RimWellLogTrack* track = tracksToMove[tIdx];
RimWellLogPlot* srcPlot;
track->firstAncestorOrThisOfType( srcPlot );
RimPlotInterface* plot = plotsToMove[tIdx];
caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>( plot );
RimGridPlotWindow* srcPlot;
pdmObject->firstAncestorOrThisOfType( srcPlot );
if ( srcPlot )
{
srcPlot->removeTrack( track );
srcPlots.insert( srcPlot );
srcPlot->removePlot( plot );
}
}
for ( std::set<RimWellLogPlot*>::iterator pIt = srcPlots.begin(); pIt != srcPlots.end(); ++pIt )
{
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>( ( *pIt )->viewWidget() );
plotWindow->setWidthOfMdiWindow( viewWidget, viewWidget->preferredWidth() );
( *pIt )->calculateAvailableDepthRange();
( *pIt )->updateTrackNames();
( *pIt )->updateDepthZoom();
( *pIt )->updateConnectedEditors();
}
size_t insertionStartIndex = 0;
if ( trackToInsertAfter ) insertionStartIndex = dstWellLogPlot->trackIndex( trackToInsertAfter ) + 1;
if ( plotToInsertAfter ) insertionStartIndex = gridPlotWindow->plotIndex( plotToInsertAfter ) + 1;
for ( size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++ )
for ( size_t tIdx = 0; tIdx < plotsToMove.size(); tIdx++ )
{
dstWellLogPlot->insertTrack( tracksToMove[tIdx], insertionStartIndex + tIdx );
gridPlotWindow->insertPlot( plotsToMove[tIdx], insertionStartIndex + tIdx );
}
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>( dstWellLogPlot->viewWidget() );
plotWindow->setWidthOfMdiWindow( viewWidget, viewWidget->preferredWidth() );
dstWellLogPlot->updateTrackNames();
dstWellLogPlot->updateTracks();
dstWellLogPlot->updateConnectedEditors();
}

View File

@ -21,6 +21,8 @@
#include <vector>
class RimGridPlotWindow;
class RimPlotInterface;
class RimWellLogPlot;
class RimWellLogTrack;
class RimWellLogCurve;
@ -34,7 +36,7 @@ public:
static void moveCurvesToWellLogPlotTrack( RimWellLogTrack* dstTrack,
const std::vector<RimWellLogCurve*>& curves,
RimWellLogCurve* insertAfterCurve );
static void moveTracksToWellLogPlot( RimWellLogPlot* wellLogPlot,
const std::vector<RimWellLogTrack*>& tracks,
RimWellLogTrack* trackToInsertAfter );
static void movePlotsToGridPlotWindow( RimGridPlotWindow* gridPlotWindow,
const std::vector<RimPlotInterface*>& plots,
RimPlotInterface* plotToInsertAfter );
};

View File

@ -1,6 +1,6 @@
set (SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RifEclipseDataTableFormatter.h
${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter.h
${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools.h
${CMAKE_CURRENT_LIST_DIR}/RifEclipseOutputFileTools.h
${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartDataAccess.h
@ -55,7 +55,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RifCsvDataTableFormatter.h
)
set (SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RifEclipseDataTableFormatter.cpp
${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter.cpp
${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RifEclipseOutputFileTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartDataAccess.cpp

View File

@ -30,7 +30,7 @@ RifCsvDataTableFormatter::RifCsvDataTableFormatter( QTextStream& out, const QStr
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifCsvDataTableFormatter& RifCsvDataTableFormatter::header( const std::vector<RifEclipseOutputTableColumn>& tableHeader )
RifCsvDataTableFormatter& RifCsvDataTableFormatter::header( const std::vector<RifTextDataTableColumn>& tableHeader )
{
outputBuffer();
m_columnHeaders = tableHeader;
@ -54,7 +54,7 @@ RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( const QString& str )
RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( double num )
{
size_t column = m_lineBuffer.size();
m_lineBuffer.push_back( RifEclipseDataTableFormatter::format( num, m_columnHeaders[column].doubleFormat ) );
m_lineBuffer.push_back( RifTextDataTableFormatter::format( num, m_columnHeaders[column].doubleFormat ) );
return *this;
}
@ -63,7 +63,7 @@ RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( double num )
//--------------------------------------------------------------------------------------------------
RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( int num )
{
m_lineBuffer.push_back( RifEclipseDataTableFormatter::format( num ) );
m_lineBuffer.push_back( RifTextDataTableFormatter::format( num ) );
return *this;
}
@ -72,7 +72,7 @@ RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( int num )
//--------------------------------------------------------------------------------------------------
RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( size_t num )
{
m_lineBuffer.push_back( RifEclipseDataTableFormatter::format( num ) );
m_lineBuffer.push_back( RifTextDataTableFormatter::format( num ) );
return *this;
}
@ -81,7 +81,7 @@ RifCsvDataTableFormatter& RifCsvDataTableFormatter::add( size_t num )
//--------------------------------------------------------------------------------------------------
void RifCsvDataTableFormatter::rowCompleted()
{
RifEclipseOutputTableLine line;
RifTextDataTableLine line;
line.data = m_lineBuffer;
line.lineType = CONTENTS;
line.appendTextSet = false;

View File

@ -18,7 +18,7 @@
#pragma once
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
//==================================================================================================
//
@ -30,7 +30,7 @@ class RifCsvDataTableFormatter
public:
RifCsvDataTableFormatter( QTextStream& out, const QString fieldSeparator = "," );
RifCsvDataTableFormatter& header( const std::vector<RifEclipseOutputTableColumn>& tableHeader );
RifCsvDataTableFormatter& header( const std::vector<RifTextDataTableColumn>& tableHeader );
RifCsvDataTableFormatter& add( const QString& str );
RifCsvDataTableFormatter& add( double num );
RifCsvDataTableFormatter& add( int num );
@ -42,9 +42,9 @@ private:
void outputBuffer();
private:
QTextStream& m_out;
std::vector<RifEclipseOutputTableColumn> m_columnHeaders;
std::vector<RifEclipseOutputTableLine> m_buffer;
std::vector<QString> m_lineBuffer;
QString m_fieldSeparator;
QTextStream& m_out;
std::vector<RifTextDataTableColumn> m_columnHeaders;
std::vector<RifTextDataTableLine> m_buffer;
std::vector<QString> m_lineBuffer;
QString m_fieldSeparator;
};

View File

@ -172,6 +172,27 @@ void RifEclipseOutputFileTools::timeSteps( const ecl_file_type* ecl_file,
years.insert( year );
}
std::set<double> uniqueDayValues;
for ( auto dayValue : dayValues )
{
uniqueDayValues.insert( dayValue );
}
if ( days.size() == 1 && months.size() == 1 && years.size() == 1 && uniqueDayValues.size() == 1 )
{
QDateTime reportDateTime = RiaQDateTimeTools::createUtcDateTime(
QDate( *years.begin(), *months.begin(), *days.begin() ) );
timeSteps->push_back( reportDateTime );
daysSinceSimulationStart->push_back( *uniqueDayValues.begin() );
// Early return, we have only one unique time step
// This state has been seen for cases with one file for each time step
// See https://github.com/OPM/ResInsight/issues/4904
return;
}
if ( days.size() > 1 ) allTimeStepsOnSameDate = false;
if ( months.size() > 1 ) allTimeStepsOnSameDate = false;
if ( years.size() > 1 ) allTimeStepsOnSameDate = false;

View File

@ -16,7 +16,7 @@
//
/////////////////////////////////////////////////////////////////////////////////
#include "RifEclipseDataTableFormatter.h"
#include "RifTextDataTableFormatter.h"
#include "cvfAssert.h"
@ -27,33 +27,36 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter::RifEclipseDataTableFormatter( QTextStream& out )
RifTextDataTableFormatter::RifTextDataTableFormatter( QTextStream& out )
: m_out( out )
, m_colSpacing( 5 )
, m_tableRowPrependText( " " )
, m_tableRowAppendText( " /" )
, m_commentPrefix( "-- " )
, m_headerPrefix( "-- " )
, m_maxDataRowWidth( MAX_ECLIPSE_DATA_ROW_WIDTH )
, m_defaultMarker( "1*" )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter::RifEclipseDataTableFormatter( const RifEclipseDataTableFormatter& rhs )
RifTextDataTableFormatter::RifTextDataTableFormatter( const RifTextDataTableFormatter& rhs )
: m_out( rhs.m_out )
, m_colSpacing( rhs.m_colSpacing )
, m_tableRowPrependText( rhs.m_tableRowPrependText )
, m_tableRowAppendText( rhs.m_tableRowAppendText )
, m_commentPrefix( rhs.m_commentPrefix )
, m_maxDataRowWidth( rhs.m_maxDataRowWidth )
, m_defaultMarker( rhs.m_defaultMarker )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter::~RifEclipseDataTableFormatter()
RifTextDataTableFormatter::~RifTextDataTableFormatter()
{
CVF_ASSERT( m_buffer.empty() );
CVF_ASSERT( m_columns.empty() );
@ -62,7 +65,7 @@ RifEclipseDataTableFormatter::~RifEclipseDataTableFormatter()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RifEclipseDataTableFormatter::columnSpacing() const
int RifTextDataTableFormatter::columnSpacing() const
{
return m_colSpacing;
}
@ -70,7 +73,7 @@ int RifEclipseDataTableFormatter::columnSpacing() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::setColumnSpacing( int spacing )
void RifTextDataTableFormatter::setColumnSpacing( int spacing )
{
m_colSpacing = spacing;
}
@ -78,7 +81,7 @@ void RifEclipseDataTableFormatter::setColumnSpacing( int spacing )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RifEclipseDataTableFormatter::tableRowPrependText() const
QString RifTextDataTableFormatter::tableRowPrependText() const
{
return m_tableRowPrependText;
}
@ -86,7 +89,7 @@ QString RifEclipseDataTableFormatter::tableRowPrependText() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RifEclipseDataTableFormatter::tableRowAppendText() const
QString RifTextDataTableFormatter::tableRowAppendText() const
{
return m_tableRowAppendText;
}
@ -94,7 +97,7 @@ QString RifEclipseDataTableFormatter::tableRowAppendText() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::setTableRowPrependText( const QString& text )
void RifTextDataTableFormatter::setTableRowPrependText( const QString& text )
{
m_tableRowPrependText = text;
}
@ -102,7 +105,7 @@ void RifEclipseDataTableFormatter::setTableRowPrependText( const QString& text )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::setTableRowLineAppendText( const QString& text )
void RifTextDataTableFormatter::setTableRowLineAppendText( const QString& text )
{
m_tableRowAppendText = text;
}
@ -110,7 +113,7 @@ void RifEclipseDataTableFormatter::setTableRowLineAppendText( const QString& tex
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RifEclipseDataTableFormatter::commentPrefix() const
QString RifTextDataTableFormatter::commentPrefix() const
{
return m_commentPrefix;
}
@ -118,7 +121,7 @@ QString RifEclipseDataTableFormatter::commentPrefix() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::setCommentPrefix( const QString& commentPrefix )
void RifTextDataTableFormatter::setCommentPrefix( const QString& commentPrefix )
{
m_commentPrefix = commentPrefix;
}
@ -126,7 +129,23 @@ void RifEclipseDataTableFormatter::setCommentPrefix( const QString& commentPrefi
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::setUnlimitedDataRowWidth()
QString RifTextDataTableFormatter::headerPrefix() const
{
return m_headerPrefix;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifTextDataTableFormatter::setHeaderPrefix( const QString& headerPrefix )
{
m_headerPrefix = headerPrefix;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifTextDataTableFormatter::setUnlimitedDataRowWidth()
{
m_maxDataRowWidth = std::numeric_limits<int>::max();
}
@ -134,7 +153,7 @@ void RifEclipseDataTableFormatter::setUnlimitedDataRowWidth()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RifEclipseDataTableFormatter::maxDataRowWidth() const
int RifTextDataTableFormatter::maxDataRowWidth() const
{
return m_maxDataRowWidth;
}
@ -142,11 +161,27 @@ int RifEclipseDataTableFormatter::maxDataRowWidth() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::outputBuffer()
void RifTextDataTableFormatter::setDefaultMarker( const QString& defaultMarker )
{
m_defaultMarker = defaultMarker;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RifTextDataTableFormatter::defaultMarker() const
{
return m_defaultMarker;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifTextDataTableFormatter::outputBuffer()
{
if ( !m_columns.empty() && !isAllHeadersEmpty( m_columns ) )
{
m_out << m_commentPrefix;
m_out << m_headerPrefix;
for ( size_t i = 0u; i < m_columns.size(); ++i )
{
m_out << formatColumn( m_columns[i].title, i );
@ -196,7 +231,7 @@ void RifEclipseDataTableFormatter::outputBuffer()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::outputComment( RifEclipseOutputTableLine& comment )
void RifTextDataTableFormatter::outputComment( RifTextDataTableLine& comment )
{
m_out << m_commentPrefix << comment.data[0] << "\n";
}
@ -204,7 +239,7 @@ void RifEclipseDataTableFormatter::outputComment( RifEclipseOutputTableLine& com
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::outputHorizontalLine( RifEclipseOutputTableLine& comment )
void RifTextDataTableFormatter::outputHorizontalLine( RifTextDataTableLine& comment )
{
if ( comment.lineType == HORIZONTAL_LINE )
{
@ -230,7 +265,7 @@ void RifEclipseDataTableFormatter::outputHorizontalLine( RifEclipseOutputTableLi
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifEclipseDataTableFormatter::isAllHeadersEmpty( const std::vector<RifEclipseOutputTableColumn>& headers )
bool RifTextDataTableFormatter::isAllHeadersEmpty( const std::vector<RifTextDataTableColumn>& headers )
{
for ( auto& header : headers )
{
@ -242,7 +277,7 @@ bool RifEclipseDataTableFormatter::isAllHeadersEmpty( const std::vector<RifEclip
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::tableCompleted()
void RifTextDataTableFormatter::tableCompleted()
{
outputBuffer();
@ -253,7 +288,7 @@ void RifEclipseDataTableFormatter::tableCompleted()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::tableCompleted( const QString& appendText, bool appendNewline )
void RifTextDataTableFormatter::tableCompleted( const QString& appendText, bool appendNewline )
{
outputBuffer();
@ -267,7 +302,7 @@ void RifEclipseDataTableFormatter::tableCompleted( const QString& appendText, bo
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::keyword( const QString& keyword )
RifTextDataTableFormatter& RifTextDataTableFormatter::keyword( const QString& keyword )
{
CVF_ASSERT( m_buffer.empty() );
CVF_ASSERT( m_columns.empty() );
@ -278,7 +313,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::keyword( const QStri
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::header( const std::vector<RifEclipseOutputTableColumn> header )
RifTextDataTableFormatter& RifTextDataTableFormatter::header( const std::vector<RifTextDataTableColumn> header )
{
outputBuffer();
m_columns = header;
@ -293,9 +328,9 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::header( const std::v
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::comment( const QString& comment )
RifTextDataTableFormatter& RifTextDataTableFormatter::comment( const QString& comment )
{
RifEclipseOutputTableLine line;
RifTextDataTableLine line;
line.data.push_back( comment );
line.lineType = COMMENT;
line.appendTextSet = false;
@ -313,10 +348,10 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::comment( const QStri
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addHorizontalLine( const QChar& character )
RifTextDataTableFormatter& RifTextDataTableFormatter::addHorizontalLine( const QChar& character )
{
RifEclipseOutputTableLine line;
QString data;
RifTextDataTableLine line;
QString data;
data += character;
line.data.push_back( data );
line.lineType = HORIZONTAL_LINE;
@ -335,7 +370,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addHorizontalLine( c
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( const QString& str )
RifTextDataTableFormatter& RifTextDataTableFormatter::add( const QString& str )
{
size_t column = m_lineBuffer.size();
CVF_ASSERT( column < m_columns.size() );
@ -347,7 +382,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( const QString&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( double num )
RifTextDataTableFormatter& RifTextDataTableFormatter::add( double num )
{
size_t column = m_lineBuffer.size();
CVF_ASSERT( column < m_columns.size() );
@ -359,7 +394,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( double num )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( int num )
RifTextDataTableFormatter& RifTextDataTableFormatter::add( int num )
{
size_t column = m_lineBuffer.size();
CVF_ASSERT( column < m_columns.size() );
@ -371,7 +406,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( int num )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( size_t num )
RifTextDataTableFormatter& RifTextDataTableFormatter::add( size_t num )
{
size_t column = m_lineBuffer.size();
CVF_ASSERT( column < m_columns.size() );
@ -383,7 +418,7 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add( size_t num )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addOneBasedCellIndex( size_t zeroBasedIndex )
RifTextDataTableFormatter& RifTextDataTableFormatter::addOneBasedCellIndex( size_t zeroBasedIndex )
{
size_t column = m_lineBuffer.size();
CVF_ASSERT( column < m_columns.size() );
@ -399,11 +434,11 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addOneBasedCellIndex
//--------------------------------------------------------------------------------------------------
/// Add default marker if the value equals the defaultValue, otherwise add value.
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addValueOrDefaultMarker( double value, double defaultValue )
RifTextDataTableFormatter& RifTextDataTableFormatter::addValueOrDefaultMarker( double value, double defaultValue )
{
if ( value == defaultValue )
{
return add( QString( "1*" ) );
return add( m_defaultMarker );
}
return add( value );
}
@ -411,9 +446,9 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addValueOrDefaultMar
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::rowCompleted()
void RifTextDataTableFormatter::rowCompleted()
{
RifEclipseOutputTableLine line;
RifTextDataTableLine line;
line.data = m_lineBuffer;
line.lineType = CONTENTS;
line.appendTextSet = false;
@ -424,9 +459,9 @@ void RifEclipseDataTableFormatter::rowCompleted()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::rowCompleted( const QString& appendText )
void RifTextDataTableFormatter::rowCompleted( const QString& appendText )
{
RifEclipseOutputTableLine line;
RifTextDataTableLine line;
line.data = m_lineBuffer;
line.lineType = CONTENTS;
line.appendTextSet = true;
@ -438,7 +473,7 @@ void RifEclipseDataTableFormatter::rowCompleted( const QString& appendText )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RifEclipseDataTableFormatter::measure( const QString str )
int RifTextDataTableFormatter::measure( const QString str )
{
return str.length();
}
@ -446,7 +481,7 @@ int RifEclipseDataTableFormatter::measure( const QString str )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RifEclipseDataTableFormatter::measure( double num, RifEclipseOutputTableDoubleFormatting doubleFormat )
int RifTextDataTableFormatter::measure( double num, RifTextDataTableDoubleFormatting doubleFormat )
{
return format( num, doubleFormat ).length();
}
@ -454,7 +489,7 @@ int RifEclipseDataTableFormatter::measure( double num, RifEclipseOutputTableDoub
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RifEclipseDataTableFormatter::measure( int num )
int RifTextDataTableFormatter::measure( int num )
{
return format( num ).length();
}
@ -462,7 +497,7 @@ int RifEclipseDataTableFormatter::measure( int num )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RifEclipseDataTableFormatter::measure( size_t num )
int RifTextDataTableFormatter::measure( size_t num )
{
return format( num ).length();
}
@ -470,7 +505,7 @@ int RifEclipseDataTableFormatter::measure( size_t num )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RifEclipseDataTableFormatter::tableWidth() const
int RifTextDataTableFormatter::tableWidth() const
{
int characterCount = m_tableRowPrependText.length();
@ -486,15 +521,15 @@ int RifEclipseDataTableFormatter::tableWidth() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RifEclipseDataTableFormatter::format( double num, RifEclipseOutputTableDoubleFormatting doubleFormat )
QString RifTextDataTableFormatter::format( double num, RifTextDataTableDoubleFormatting doubleFormat )
{
switch ( doubleFormat.format )
{
case RifEclipseOutputTableDoubleFormat::RIF_FLOAT:
case RifTextDataTableDoubleFormat::RIF_FLOAT:
return QString( "%1" ).arg( num, 0, 'f', doubleFormat.precision );
case RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC:
case RifTextDataTableDoubleFormat::RIF_SCIENTIFIC:
return QString( "%1" ).arg( num, 0, 'E' );
case RifEclipseOutputTableDoubleFormat::RIF_CONSISE:
case RifTextDataTableDoubleFormat::RIF_CONSISE:
return QString::number( num, 'g', doubleFormat.precision );
default:
return QString( "%1" );
@ -504,7 +539,7 @@ QString RifEclipseDataTableFormatter::format( double num, RifEclipseOutputTableD
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RifEclipseDataTableFormatter::format( int num )
QString RifTextDataTableFormatter::format( int num )
{
return QString( "%1" ).arg( num );
}
@ -512,7 +547,7 @@ QString RifEclipseDataTableFormatter::format( int num )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RifEclipseDataTableFormatter::format( size_t num )
QString RifTextDataTableFormatter::format( size_t num )
{
return QString( "%1" ).arg( num );
}
@ -520,9 +555,9 @@ QString RifEclipseDataTableFormatter::format( size_t num )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RifEclipseDataTableFormatter::formatColumn( const QString str, size_t columnIndex ) const
QString RifTextDataTableFormatter::formatColumn( const QString str, size_t columnIndex ) const
{
const RifEclipseOutputTableColumn& column = m_columns[columnIndex];
const RifTextDataTableColumn& column = m_columns[columnIndex];
if ( column.alignment == LEFT )
{

View File

@ -26,7 +26,7 @@
//==================================================================================================
//
//==================================================================================================
enum RifEclipseOutputTableLineType
enum RifTextDataTableLineType
{
COMMENT,
CONTENTS,
@ -36,7 +36,7 @@ enum RifEclipseOutputTableLineType
//==================================================================================================
//
//==================================================================================================
enum RifEclipseOutputTableAlignment
enum RifTextDataTableAlignment
{
LEFT,
RIGHT
@ -45,7 +45,7 @@ enum RifEclipseOutputTableAlignment
//==================================================================================================
//
//==================================================================================================
enum RifEclipseOutputTableDoubleFormat
enum RifTextDataTableDoubleFormat
{
RIF_SCIENTIFIC,
RIF_FLOAT,
@ -55,39 +55,38 @@ enum RifEclipseOutputTableDoubleFormat
//==================================================================================================
//
//==================================================================================================
struct RifEclipseOutputTableLine
struct RifTextDataTableLine
{
RifEclipseOutputTableLineType lineType;
std::vector<QString> data;
bool appendTextSet;
QString appendText;
RifTextDataTableLineType lineType;
std::vector<QString> data;
bool appendTextSet;
QString appendText;
};
//==================================================================================================
//
//==================================================================================================
struct RifEclipseOutputTableDoubleFormatting
struct RifTextDataTableDoubleFormatting
{
RifEclipseOutputTableDoubleFormatting( RifEclipseOutputTableDoubleFormat format = RIF_FLOAT, int precision = 5 )
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat format = RIF_FLOAT, int precision = 5 )
: format( format )
, precision( precision )
{
}
RifEclipseOutputTableDoubleFormat format;
int precision;
RifTextDataTableDoubleFormat format;
int precision;
};
//==================================================================================================
//
//==================================================================================================
struct RifEclipseOutputTableColumn
struct RifTextDataTableColumn
{
RifEclipseOutputTableColumn(
const QString& title,
RifEclipseOutputTableDoubleFormatting doubleFormat = RifEclipseOutputTableDoubleFormatting(),
RifEclipseOutputTableAlignment alignment = LEFT,
int width = -1 )
RifTextDataTableColumn( const QString& title,
RifTextDataTableDoubleFormatting doubleFormat = RifTextDataTableDoubleFormatting(),
RifTextDataTableAlignment alignment = LEFT,
int width = -1 )
: title( title )
, doubleFormat( doubleFormat )
, alignment( alignment )
@ -95,22 +94,22 @@ struct RifEclipseOutputTableColumn
{
}
QString title;
RifEclipseOutputTableDoubleFormatting doubleFormat;
RifEclipseOutputTableAlignment alignment;
int width;
QString title;
RifTextDataTableDoubleFormatting doubleFormat;
RifTextDataTableAlignment alignment;
int width;
};
//==================================================================================================
//
//==================================================================================================
class RifEclipseDataTableFormatter
class RifTextDataTableFormatter
{
public:
RifEclipseDataTableFormatter( QTextStream& out );
RifEclipseDataTableFormatter( const RifEclipseDataTableFormatter& rhs );
RifTextDataTableFormatter( QTextStream& out );
RifTextDataTableFormatter( const RifTextDataTableFormatter& rhs );
virtual ~RifEclipseDataTableFormatter();
virtual ~RifTextDataTableFormatter();
int columnSpacing() const;
void setColumnSpacing( int spacing );
@ -120,23 +119,27 @@ public:
void setTableRowLineAppendText( const QString& text );
QString commentPrefix() const;
void setCommentPrefix( const QString& commentPrefix );
QString headerPrefix() const;
void setHeaderPrefix( const QString& headerPrefix );
void setUnlimitedDataRowWidth();
int maxDataRowWidth() const;
void setDefaultMarker( const QString& defaultMarker );
QString defaultMarker() const;
RifEclipseDataTableFormatter& keyword( const QString& keyword );
RifEclipseDataTableFormatter& header( std::vector<RifEclipseOutputTableColumn> tableHeader );
RifEclipseDataTableFormatter& add( const QString& str );
RifEclipseDataTableFormatter& add( double num );
RifEclipseDataTableFormatter& add( int num );
RifEclipseDataTableFormatter& add( size_t num );
RifEclipseDataTableFormatter& addOneBasedCellIndex( size_t zeroBasedIndex );
RifEclipseDataTableFormatter& addValueOrDefaultMarker( double value, double defaultValue );
RifEclipseDataTableFormatter& comment( const QString& str );
RifEclipseDataTableFormatter& addHorizontalLine( const QChar& str );
void rowCompleted();
void rowCompleted( const QString& appendText );
void tableCompleted();
void tableCompleted( const QString& appendText, bool appendNewline );
RifTextDataTableFormatter& keyword( const QString& keyword );
RifTextDataTableFormatter& header( std::vector<RifTextDataTableColumn> tableHeader );
RifTextDataTableFormatter& add( const QString& str );
RifTextDataTableFormatter& add( double num );
RifTextDataTableFormatter& add( int num );
RifTextDataTableFormatter& add( size_t num );
RifTextDataTableFormatter& addOneBasedCellIndex( size_t zeroBasedIndex );
RifTextDataTableFormatter& addValueOrDefaultMarker( double value, double defaultValue );
RifTextDataTableFormatter& comment( const QString& str );
RifTextDataTableFormatter& addHorizontalLine( const QChar& str );
void rowCompleted();
void rowCompleted( const QString& appendText );
void tableCompleted();
void tableCompleted( const QString& appendText, bool appendNewline );
int tableWidth() const;
@ -144,29 +147,31 @@ protected:
friend class RifCsvDataTableFormatter;
int measure( const QString str );
int measure( double num, RifEclipseOutputTableDoubleFormatting doubleFormat );
int measure( double num, RifTextDataTableDoubleFormatting doubleFormat );
int measure( int num );
int measure( size_t num );
static QString format( double num, RifEclipseOutputTableDoubleFormatting doubleFormat );
static QString format( double num, RifTextDataTableDoubleFormatting doubleFormat );
static QString format( int num );
static QString format( size_t num );
QString formatColumn( const QString str, size_t columnIndex ) const;
void outputBuffer();
void outputComment( RifEclipseOutputTableLine& comment );
void outputHorizontalLine( RifEclipseOutputTableLine& comment );
void outputComment( RifTextDataTableLine& comment );
void outputHorizontalLine( RifTextDataTableLine& comment );
bool isAllHeadersEmpty( const std::vector<RifEclipseOutputTableColumn>& headers );
bool isAllHeadersEmpty( const std::vector<RifTextDataTableColumn>& headers );
private:
std::vector<RifEclipseOutputTableColumn> m_columns;
std::vector<RifEclipseOutputTableLine> m_buffer;
std::vector<QString> m_lineBuffer;
QTextStream& m_out;
int m_colSpacing;
QString m_tableRowPrependText;
QString m_tableRowAppendText;
QString m_commentPrefix;
int m_maxDataRowWidth;
std::vector<RifTextDataTableColumn> m_columns;
std::vector<RifTextDataTableLine> m_buffer;
std::vector<QString> m_lineBuffer;
QTextStream& m_out;
int m_colSpacing;
QString m_tableRowPrependText;
QString m_tableRowAppendText;
QString m_commentPrefix;
QString m_headerPrefix;
int m_maxDataRowWidth;
QString m_defaultMarker;
};

View File

@ -163,6 +163,7 @@ if (RESINSIGHT_GRPC_PYTHON_EXECUTABLE)
"rips/generated/RiaVersionInfo.py"
"rips/__init__.py"
"rips/case.py"
"rips/contour_map.py"
"rips/grid.py"
"rips/gridcasegroup.py"
"rips/project.py"

View File

@ -314,6 +314,15 @@ message ExportWellLogPlotDataRequest
double resampleInterval = 7;
}
message ExportContourMapToTextRequest
{
string exportFileName = 1;
bool exportLocalCoordinates = 2;
string undefinedValueLabel = 3;
bool excludeUndefinedValues = 4;
int32 viewId = 5;
}
/* CommandParams handles both command name and parameters in one.
* The message type and content is used as parameters and
* the name of the variable is used to find the command name. */
@ -325,43 +334,44 @@ message CommandParams
* the FilePathRequest message. */
oneof params
{
FilePathRequest openProject = 1;
Empty closeProject = 2;
FilePathRequest setStartDir = 3;
FilePathRequest loadCase = 4;
ReplaceCaseRequest replaceCase = 5;
ReplaceSourceCasesRequest replaceSourceCases = 6;
ExportMultiCaseRequest exportMultiCaseSnapshots = 7;
ExportSnapshotsRequest exportSnapshots = 8;
ExportPropertyRequest exportProperty = 9;
ExportPropertyInViewsRequest exportPropertyInViews = 10;
ExportWellPathCompRequest exportWellPathCompletions = 11;
ExportSimWellPathFracRequest exportSimWellFractureCompletions = 12;
ExportMswRequest exportMsw = 13;
ExportWellPathRequest exportWellPaths = 14;
ExportVisibleCellsRequest exportVisibleCells = 15;
SetExportFolderRequest setExportFolder = 16;
RunOctaveScriptRequest runOctaveScript = 17;
SetWindowSizeParams setMainWindowSize = 18;
ComputeCaseGroupStatRequest computeCaseGroupStatistics = 19;
SetTimeStepParams setTimeStep = 20;
ScaleFractureTemplateRequest scaleFractureTemplate = 21;
SetFracContainmentRequest setFractureContainment = 22;
CreateMultipleFracRequest createMultipleFractures = 23;
CreateLgrForCompRequest createLgrForCompletions = 24;
CreateSatPressPlotRequest createSaturationPressurePlots = 25;
ReplaceCaseRequests replaceMultipleCases = 26;
CreateGridCaseGroupRequest createGridCaseGroup = 27;
CreateStatisticsCaseRequest createStatisticsCase = 28;
ExportFlowInfoRequest exportFlowCharacteristics = 29;
CreateViewRequest createView = 30;
CloneViewRequest cloneView = 31;
CreateWbsPlotRequest createWellBoreStabilityPlot = 32;
ImportWellPathsRequest importWellPaths = 33;
ImportWellLogFilesRequest importWellLogFiles = 34;
ImportFormationNamesRequest importFormationNames = 35;
ExportWellLogPlotDataRequest exportWellLogPlotData = 36;
SetWindowSizeParams setPlotWindowSize = 37;
FilePathRequest openProject = 1;
Empty closeProject = 2;
FilePathRequest setStartDir = 3;
FilePathRequest loadCase = 4;
ReplaceCaseRequest replaceCase = 5;
ReplaceSourceCasesRequest replaceSourceCases = 6;
ExportMultiCaseRequest exportMultiCaseSnapshots = 7;
ExportSnapshotsRequest exportSnapshots = 8;
ExportPropertyRequest exportProperty = 9;
ExportPropertyInViewsRequest exportPropertyInViews = 10;
ExportWellPathCompRequest exportWellPathCompletions = 11;
ExportSimWellPathFracRequest exportSimWellFractureCompletions = 12;
ExportMswRequest exportMsw = 13;
ExportWellPathRequest exportWellPaths = 14;
ExportVisibleCellsRequest exportVisibleCells = 15;
SetExportFolderRequest setExportFolder = 16;
RunOctaveScriptRequest runOctaveScript = 17;
SetWindowSizeParams setMainWindowSize = 18;
ComputeCaseGroupStatRequest computeCaseGroupStatistics = 19;
SetTimeStepParams setTimeStep = 20;
ScaleFractureTemplateRequest scaleFractureTemplate = 21;
SetFracContainmentRequest setFractureContainment = 22;
CreateMultipleFracRequest createMultipleFractures = 23;
CreateLgrForCompRequest createLgrForCompletions = 24;
CreateSatPressPlotRequest createSaturationPressurePlots = 25;
ReplaceCaseRequests replaceMultipleCases = 26;
CreateGridCaseGroupRequest createGridCaseGroup = 27;
CreateStatisticsCaseRequest createStatisticsCase = 28;
ExportFlowInfoRequest exportFlowCharacteristics = 29;
CreateViewRequest createView = 30;
CloneViewRequest cloneView = 31;
CreateWbsPlotRequest createWellBoreStabilityPlot = 32;
ImportWellPathsRequest importWellPaths = 33;
ImportWellLogFilesRequest importWellLogFiles = 34;
ImportFormationNamesRequest importFormationNames = 35;
ExportWellLogPlotDataRequest exportWellLogPlotData = 36;
SetWindowSizeParams setPlotWindowSize = 37;
ExportContourMapToTextRequest exportContourMapToText = 38;
}
}

View File

@ -11,84 +11,92 @@ This pages is created based on the content in the **PythonExamples** folder loca
AllCases
--------
.. literalinclude:: ../../rips/PythonExamples/AllCases.py
AppInfo
-------
.. literalinclude:: ../../rips/PythonExamples/AppInfo.py
.. literalinclude:: ../../rips/PythonExamples/all_cases.py
CaseGridGroup
-------------
.. literalinclude:: ../../rips/PythonExamples/CaseGridGroup.py
.. literalinclude:: ../../rips/PythonExamples/case_grid_group.py
CaseInfoStreamingExample
------------------------
.. literalinclude:: ../../rips/PythonExamples/CaseInfoStreamingExample.py
.. literalinclude:: ../../rips/PythonExamples/case_info_streaming_example.py
CommandExample
--------------
.. literalinclude:: ../../rips/PythonExamples/CommandExample.py
.. literalinclude:: ../../rips/PythonExamples/command_example.py
Create WBS Plot
---------------
.. literalinclude:: ../../rips/PythonExamples/create_wbs_plot.py
ErrorHandling
-------------
.. literalinclude:: ../../rips/PythonExamples/ErrorHandling.py
.. literalinclude:: ../../rips/PythonExamples/error_handling.py
ExportPlots
-----------
.. literalinclude:: ../../rips/PythonExamples/export_plots.py
ExportSnapshots
---------------
.. literalinclude:: ../../rips/PythonExamples/ExportSnapshots.py
.. literalinclude:: ../../rips/PythonExamples/export_snapshots.py
GridInformation
---------------
.. literalinclude:: ../../rips/PythonExamples/GridInformation.py
.. literalinclude:: ../../rips/PythonExamples/grid_information.py
Import Well Paths
-----------------
.. literalinclude:: ../../rips/PythonExamples/import_well_paths_and_logs.py
InputPropTestAsync
------------------
.. literalinclude:: ../../rips/PythonExamples/InputPropTestAsync.py
.. literalinclude:: ../../rips/PythonExamples/input_prop_test_async.py
InputPropTestSync
-----------------
.. literalinclude:: ../../rips/PythonExamples/InputPropTestSync.py
.. literalinclude:: ../../rips/PythonExamples/input_prop_test_sync.py
InstanceExample
---------------
.. literalinclude:: ../../rips/PythonExamples/InstanceExample.py
.. literalinclude:: ../../rips/PythonExamples/instance_example.py
LaunchWithCommandLineOptions
----------------------------
.. literalinclude:: ../../rips/PythonExamples/LaunchWithCommandLineOptions.py
.. literalinclude:: ../../rips/PythonExamples/launch_with_commandline_options.py
SelectedCases
-------------
.. literalinclude:: ../../rips/PythonExamples/SelectedCases.py
.. literalinclude:: ../../rips/PythonExamples/selected_cases.py
SetCellResult
-------------
.. literalinclude:: ../../rips/PythonExamples/SetCellResult.py
.. literalinclude:: ../../rips/PythonExamples/set_cell_result.py
SetFlowDiagnosticsResult
------------------------
.. literalinclude:: ../../rips/PythonExamples/SetFlowDiagnosticsResult.py
.. literalinclude:: ../../rips/PythonExamples/set_flow_diagnostics_result.py
SetGridProperties
-----------------
.. literalinclude:: ../../rips/PythonExamples/SetGridProperties.py
.. literalinclude:: ../../rips/PythonExamples/set_grid_properties.py
SoilAverageAsync
----------------
.. literalinclude:: ../../rips/PythonExamples/SoilAverageAsync.py
.. literalinclude:: ../../rips/PythonExamples/soil_average_async.py
SoilAverageSync
---------------
.. literalinclude:: ../../rips/PythonExamples/SoilAverageSync.py
.. literalinclude:: ../../rips/PythonExamples/soil_average_sync.py
SoilPorvAsync
-------------
.. literalinclude:: ../../rips/PythonExamples/SoilPorvAsync.py
.. literalinclude:: ../../rips/PythonExamples/soil_porv_async.py
SoilPorvSync
------------
.. literalinclude:: ../../rips/PythonExamples/SoilPorvSync.py
.. literalinclude:: ../../rips/PythonExamples/soil_porv_sync.py
ViewExample
-----------
.. literalinclude:: ../../rips/PythonExamples/ViewExample.py
.. literalinclude:: ../../rips/PythonExamples/view_example.py

View File

@ -7,7 +7,7 @@ Instance Module
Example
-------
.. literalinclude:: ../../rips/PythonExamples/InstanceExample.py
.. literalinclude:: ../../rips/PythonExamples/instance_example.py
:language: python
:lines: 5-
:emphasize-lines: 3
@ -20,11 +20,17 @@ Case Module
Example
-------
.. literalinclude:: ../../rips/PythonExamples/AllCases.py
.. literalinclude:: ../../rips/PythonExamples/all_cases.py
:language: python
:lines: 5-
:emphasize-lines: 5
Contour Map Module
==================
.. autoclass:: rips.contour_map.ContourMap
:members:
Grid Module
===========
@ -70,7 +76,7 @@ Read two properties, multiply them together and push the results back to ResInsi
This is slow and inefficient, but works.
.. literalinclude:: ../../rips/PythonExamples/InputPropTestSync.py
.. literalinclude:: ../../rips/PythonExamples/input_prop_test_async.py
:language: python
:lines: 5-
@ -80,7 +86,7 @@ Read two properties at the same time chunk by chunk, multiply each chunk togethe
This is far more efficient.
.. literalinclude:: ../../rips/PythonExamples/InputPropTestAsync.py
.. literalinclude:: ../../rips/PythonExamples/input_prop_test_sync.py
:language: python
:lines: 5-

View File

@ -0,0 +1,32 @@
# Load ResInsight Processing Server Client Library
import rips
import tempfile
import pathlib
# Connect to ResInsight instance
resInsight = rips.Instance.find()
# Data will be written to temp
tmpdir = pathlib.Path(tempfile.gettempdir())
# Find all eclipse contour maps of the project
contour_maps = resInsight.project.contour_maps(rips.ContourMapType.ECLIPSE)
print("Number of eclipse contour maps:", len(contour_maps))
# Export the contour maps to a text file
for (index, contour_map) in enumerate(contour_maps):
filename = "eclipse_contour_map" + str(index) + ".txt"
filepath = tmpdir / filename
print("Exporting to:", filepath)
contour_map.export_to_text(str(filepath))
# The contour maps is also available for a Case
cases = resInsight.project.cases()
for case in cases:
contour_maps = case.contour_maps(rips.ContourMapType.GEO_MECH)
# Export the contour maps to a text file
for (index, contour_map) in enumerate(contour_maps):
filename = "geomech_contour_map" + str(index) + ".txt"
filepath = tmpdir / filename
print("Exporting to:", filepath)
contour_map.export_to_text(str(filepath))

View File

@ -10,4 +10,5 @@ from rips.instance import Instance
from rips.pdmobject import PdmObject
from rips.view import View
from rips.project import Project
from rips.plot import Plot
from rips.plot import Plot
from rips.contour_map import ContourMap, ContourMapType

View File

@ -18,7 +18,7 @@ import rips.generated.Properties_pb2_grpc as Properties_pb2_grpc
from rips.grid import Grid
from rips.pdmobject import PdmObject
from rips.view import View
from rips.contour_map import ContourMap, ContourMapType
class Case(PdmObject):
"""ResInsight case class
@ -250,6 +250,20 @@ class Case(PdmObject):
self._execute_command(createView=Cmd.CreateViewRequest(
caseId=self.case_id)).createViewResult.viewId)
def contour_maps(self, map_type=ContourMapType.ECLIPSE):
""" Get a list of all contour maps belonging to a project
Arguments:
map_type (enum): ContourMapType.ECLIPSE or ContourMapType.GEO_MECH
"""
pdm_objects = self.descendants(ContourMapType.get_identifier(map_type))
contour_maps = []
for pdm_object in pdm_objects:
contour_maps.append(ContourMap(pdm_object, self._project, map_type))
return contour_maps
def export_snapshots_of_all_views(self, prefix="", export_folder=""):
""" Export snapshots for all views in the case
@ -764,4 +778,4 @@ class Case(PdmObject):
formation_files = [formation_files]
res = self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
applyToCaseId=self.case_id))
applyToCaseId=self.case_id))

View File

@ -0,0 +1,51 @@
"""
ResInsight 3d contour map module
"""
import rips.generated.Commands_pb2 as Cmd
from rips.pdmobject import PdmObject
from rips.view import View
from enum import Enum
class ContourMapType(Enum):
ECLIPSE = 1
GEO_MECH = 2
@staticmethod
def get_identifier(map_type):
if map_type==ContourMapType.ECLIPSE:
return "RimContourMapView"
elif map_type==ContourMapType.GEO_MECH:
return "RimGeoMechContourMapView"
else:
raise Exception("Unknown contour map type: must be ECLIPSE or GEO_MECH")
class ContourMap(View):
"""ResInsight contour map class
Attributes:
view_id(int): View Id corresponding to the View Id in ResInsight project.
"""
def __init__(self, pdm_object, project, map_type):
View.__init__(self, pdm_object, project)
self.view_id = pdm_object.get_value("ViewId")
self.map_type = map_type
def export_to_text(self, export_file_name='', export_local_coordinates=False, undefined_value_label="NaN", exclude_undefined_values=False):
""" Export snapshot for the current view
Arguments:
export_file_name(str): The file location to store results in.
export_local_coordinates(bool): Should we export local coordinates, or UTM.
undefined_value_label(str): Replace undefined values with this label.
exclude_undefined_values(bool): Skip undefined values.
"""
return self._execute_command(
exportContourMapToText=Cmd.ExportContourMapToTextRequest(
exportFileName=export_file_name,
exportLocalCoordinates=export_local_coordinates,
undefinedValueLabel=undefined_value_label,
excludeUndefinedValues=exclude_undefined_values,
viewId=self.view_id))

View File

@ -10,6 +10,7 @@ from rips.gridcasegroup import GridCaseGroup
from rips.pdmobject import PdmObject
from rips.plot import Plot
from rips.view import View
from rips.contour_map import ContourMap, ContourMapType
import rips.generated.Commands_pb2 as Cmd
from rips.generated.Definitions_pb2 import Empty
@ -163,6 +164,15 @@ class Project(PdmObject):
return plot_object
return None
def contour_maps(self, map_type=ContourMapType.ECLIPSE):
"""Get a list of all contour maps belonging to a project"""
pdm_objects = self.descendants(ContourMapType.get_identifier(map_type))
contour_maps = []
for pdm_object in pdm_objects:
contour_maps.append(ContourMap(pdm_object, self._project, map_type))
return contour_maps
def well_paths(self):
"""Get a list of all the well path names in the project"""
pdm_objects = self.descendants("WellPathBase")
@ -307,4 +317,4 @@ class Project(PdmObject):
formation_files = [formation_files]
res = self._execute_command(importFormationNames=Cmd.ImportFormationNamesRequest(formationFiles=formation_files,
applyToCaseId=-1))
applyToCaseId=-1))

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