mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Source stepping and toolbar updates (#8866)
* Move layout options to separate toolbar * Enable stepping on quantities, remove special history curve stepping for now * Allow stepping ensembles and cases * Add step next/prev and add new sub plot
This commit is contained in:
BIN
ApplicationExeCode/Resources/AppendNext.png
Normal file
BIN
ApplicationExeCode/Resources/AppendNext.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1004 B |
74
ApplicationExeCode/Resources/AppendNext.svg
Normal file
74
ApplicationExeCode/Resources/AppendNext.svg
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="Layer_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
style="enable-background:new 0 0 16 16;"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="AppendNext.svg"
|
||||||
|
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||||
|
inkscape:export-filename="D:\Repos\OPM\ResInsight\ApplicationExeCode\Resources\AppendNext.png"
|
||||||
|
inkscape:export-xdpi="341.20468"
|
||||||
|
inkscape:export-ydpi="341.20468"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||||
|
id="defs9"><symbol
|
||||||
|
id="FirstAid"><title
|
||||||
|
id="title4273">First Aid</title><path
|
||||||
|
d="m 44,13 0,15 15,0 0,16 -15,0 0,15 -16,0 0,-15 -15,0 0,-16 15,0 0,-15 z"
|
||||||
|
style="stroke:none"
|
||||||
|
id="path4275" /></symbol><clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath7666"><use
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
xlink:href="#g7662"
|
||||||
|
id="use7668" /></clipPath></defs><sodipodi:namedview
|
||||||
|
id="namedview7"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="44.9375"
|
||||||
|
inkscape:cx="6.9652295"
|
||||||
|
inkscape:cy="6.2197497"
|
||||||
|
inkscape:window-width="2560"
|
||||||
|
inkscape:window-height="1351"
|
||||||
|
inkscape:window-x="-9"
|
||||||
|
inkscape:window-y="-9"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="g7616" />
|
||||||
|
<style
|
||||||
|
type="text/css"
|
||||||
|
id="style2">
|
||||||
|
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#75BEFF;}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<g
|
||||||
|
id="g7616"
|
||||||
|
inkscape:groupmode="layer"><g
|
||||||
|
id="g7664"
|
||||||
|
clip-path="url(#clipPath7666)"><g
|
||||||
|
inkscape:label="Clip"
|
||||||
|
id="g7662"><path
|
||||||
|
class="st0"
|
||||||
|
d="M 13.9,2.8 H 2.1 L 8,13.2 Z"
|
||||||
|
id="path4" /><use
|
||||||
|
xlink:href="#FirstAid"
|
||||||
|
style="opacity:0.69;fill:#008000;stroke:#000000"
|
||||||
|
id="use6694"
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
transform="matrix(0.16145491,0,0,0.15825119,5.9080974,4.7174215)" /></g></g></g></svg>
|
After Width: | Height: | Size: 2.3 KiB |
BIN
ApplicationExeCode/Resources/AppendPrev.png
Normal file
BIN
ApplicationExeCode/Resources/AppendPrev.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 965 B |
63
ApplicationExeCode/Resources/AppendPrev.svg
Normal file
63
ApplicationExeCode/Resources/AppendPrev.svg
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="Layer_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
style="enable-background:new 0 0 16 16;"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="AppendPrev.svg"
|
||||||
|
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||||
|
inkscape:export-filename="D:\Repos\OPM\ResInsight\ApplicationExeCode\Resources\AppendPrev.png"
|
||||||
|
inkscape:export-xdpi="314.46732"
|
||||||
|
inkscape:export-ydpi="314.46732"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||||
|
id="defs9"><symbol
|
||||||
|
id="FirstAid"><title
|
||||||
|
id="title1005">First Aid</title><path
|
||||||
|
d="m 44,13 0,15 15,0 0,16 -15,0 0,15 -16,0 0,-15 -15,0 0,-16 15,0 0,-15 z"
|
||||||
|
style="stroke:none"
|
||||||
|
id="path1007" /></symbol></defs><sodipodi:namedview
|
||||||
|
id="namedview7"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="44.9375"
|
||||||
|
inkscape:cx="6.9652295"
|
||||||
|
inkscape:cy="6.2197497"
|
||||||
|
inkscape:window-width="2560"
|
||||||
|
inkscape:window-height="1351"
|
||||||
|
inkscape:window-x="-9"
|
||||||
|
inkscape:window-y="-9"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="Layer_1" />
|
||||||
|
<style
|
||||||
|
type="text/css"
|
||||||
|
id="style2">
|
||||||
|
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#75BEFF;}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<g
|
||||||
|
id="g4186"><path
|
||||||
|
class="st0"
|
||||||
|
d="M 2.1,13.2 H 13.9 L 8,2.8 Z"
|
||||||
|
id="path4" /><use
|
||||||
|
xlink:href="#FirstAid"
|
||||||
|
style="opacity:0.78;fill:#008000;stroke:#000000"
|
||||||
|
id="use3426"
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
transform="matrix(0.15988928,0,0,0.15002721,6.0894814,-0.96147989)" /></g></svg>
|
After Width: | Height: | Size: 2.0 KiB |
@@ -259,6 +259,10 @@
|
|||||||
<file>well-log-plot.svg</file>
|
<file>well-log-plot.svg</file>
|
||||||
<file>window-management.svg</file>
|
<file>window-management.svg</file>
|
||||||
<file>DisableZoom.png</file>
|
<file>DisableZoom.png</file>
|
||||||
|
<file>AppendNext.svg</file>
|
||||||
|
<file>AppendPrev.svg</file>
|
||||||
|
<file>AppendNext.png</file>
|
||||||
|
<file>AppendPrev.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/Shader">
|
<qresource prefix="/Shader">
|
||||||
<file>fs_CellFace.glsl</file>
|
<file>fs_CellFace.glsl</file>
|
||||||
|
@@ -206,10 +206,11 @@ enum class RowCount
|
|||||||
|
|
||||||
enum class MultiPlotPageUpdateType : uint32_t
|
enum class MultiPlotPageUpdateType : uint32_t
|
||||||
{
|
{
|
||||||
NONE = 0b0000,
|
NONE = 0b00000000,
|
||||||
LEGEND = 0b0001,
|
LEGEND = 0b00000001,
|
||||||
PLOT = 0b0010,
|
PLOT = 0b00000010,
|
||||||
ALL = 0b0011
|
TITLE = 0b00000100,
|
||||||
|
ALL = 0b00000111
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr enum MultiPlotPageUpdateType operator|( const enum MultiPlotPageUpdateType selfValue,
|
constexpr enum MultiPlotPageUpdateType operator|( const enum MultiPlotPageUpdateType selfValue,
|
||||||
|
@@ -88,14 +88,9 @@ std::set<std::string> RiaSummaryAddressAnalyzer::quantityNamesNoHistory() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::string RiaSummaryAddressAnalyzer::quantityNameForTitle() const
|
std::string RiaSummaryAddressAnalyzer::quantityNameForTitle() const
|
||||||
{
|
{
|
||||||
if ( quantityNamesWithHistory().size() == 1 && quantityNamesNoHistory().empty() )
|
if ( quantities().size() == 1 )
|
||||||
{
|
{
|
||||||
return *quantityNamesWithHistory().begin();
|
return *quantities().begin();
|
||||||
}
|
|
||||||
|
|
||||||
if ( quantityNamesNoHistory().size() == 1 && quantityNamesWithHistory().empty() )
|
|
||||||
{
|
|
||||||
return *quantityNamesNoHistory().begin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
|
@@ -186,3 +186,25 @@ bool RimDataSourceSteppingTools::updateHistoryAndSummaryQuantityIfMatching( cons
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimDataSourceSteppingTools::updateQuantityIfMatching( const QVariant& oldValue,
|
||||||
|
const QVariant& newValue,
|
||||||
|
RifEclipseSummaryAddress* adr )
|
||||||
|
{
|
||||||
|
if ( !adr ) return false;
|
||||||
|
|
||||||
|
std::string oldString = oldValue.toString().toStdString();
|
||||||
|
std::string newString = newValue.toString().toStdString();
|
||||||
|
|
||||||
|
if ( adr->quantityName() == oldString )
|
||||||
|
{
|
||||||
|
adr->setQuantityName( newString );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@@ -41,4 +41,7 @@ public:
|
|||||||
static bool updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue,
|
static bool updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue,
|
||||||
const QVariant& newValue,
|
const QVariant& newValue,
|
||||||
RifEclipseSummaryAddress* adr );
|
RifEclipseSummaryAddress* adr );
|
||||||
|
|
||||||
|
static bool
|
||||||
|
updateQuantityIfMatching( const QVariant& oldValue, const QVariant& newValue, RifEclipseSummaryAddress* adr );
|
||||||
};
|
};
|
||||||
|
@@ -898,7 +898,15 @@ bool RimMultiPlot::isMouseCursorInsidePlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<caf::PdmFieldHandle*> RimMultiPlot::fieldsToShowInToolbar()
|
std::vector<caf::PdmFieldHandle*> RimMultiPlot::fieldsToShowInToolbar()
|
||||||
{
|
{
|
||||||
return { &m_pagePreviewMode, &m_columnCount, &m_rowsPerPage };
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<caf::PdmFieldHandle*> RimMultiPlot::fieldsToShowInLayoutToolbar()
|
||||||
|
{
|
||||||
|
return { &m_columnCount, &m_rowsPerPage, &m_pagePreviewMode };
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@@ -106,6 +106,7 @@ public:
|
|||||||
int axisValueFontSize() const;
|
int axisValueFontSize() const;
|
||||||
|
|
||||||
virtual std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
virtual std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||||
|
virtual std::vector<caf::PdmFieldHandle*> fieldsToShowInLayoutToolbar();
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
#include "PlotBuilderCommands/RicAppendSummaryPlotsForSummaryCasesFeature.h"
|
#include "PlotBuilderCommands/RicAppendSummaryPlotsForSummaryCasesFeature.h"
|
||||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||||
|
|
||||||
|
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||||
|
|
||||||
#include "RifEclEclipseSummary.h"
|
#include "RifEclEclipseSummary.h"
|
||||||
#include "RifEclipseRftAddress.h"
|
#include "RifEclipseRftAddress.h"
|
||||||
#include "RifEclipseSummaryAddress.h"
|
#include "RifEclipseSummaryAddress.h"
|
||||||
@@ -50,6 +52,7 @@
|
|||||||
#include "RimSummaryPlotSourceStepping.h"
|
#include "RimSummaryPlotSourceStepping.h"
|
||||||
#include "RimSummaryTimeAxisProperties.h"
|
#include "RimSummaryTimeAxisProperties.h"
|
||||||
|
|
||||||
|
#include "RiuPlotMainWindowTools.h"
|
||||||
#include "RiuSummaryMultiPlotBook.h"
|
#include "RiuSummaryMultiPlotBook.h"
|
||||||
#include "RiuSummaryVectorSelectionUi.h"
|
#include "RiuSummaryVectorSelectionUi.h"
|
||||||
|
|
||||||
@@ -118,6 +121,16 @@ RimSummaryMultiPlot::RimSummaryMultiPlot()
|
|||||||
m_disableWheelZoom.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
|
m_disableWheelZoom.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
|
||||||
m_disableWheelZoom.uiCapability()->setUiIconFromResourceString( ":/DisableZoom.png" );
|
m_disableWheelZoom.uiCapability()->setUiIconFromResourceString( ":/DisableZoom.png" );
|
||||||
|
|
||||||
|
CAF_PDM_InitField( &m_appendNextPlot, "AppendNextPlot", false, "", "", "Step Next and Add to New Plot" );
|
||||||
|
m_appendNextPlot.xmlCapability()->disableIO();
|
||||||
|
m_appendNextPlot.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
|
||||||
|
m_appendNextPlot.uiCapability()->setUiIconFromResourceString( ":/AppendNext.png" );
|
||||||
|
|
||||||
|
CAF_PDM_InitField( &m_appendPrevPlot, "AppendPrevPlot", false, "", "", "Step Previous and Add to New Plot" );
|
||||||
|
m_appendPrevPlot.xmlCapability()->disableIO();
|
||||||
|
m_appendPrevPlot.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
|
||||||
|
m_appendPrevPlot.uiCapability()->setUiIconFromResourceString( ":/AppendPrev.png" );
|
||||||
|
|
||||||
CAF_PDM_InitField( &m_linkSubPlotAxes, "LinkSubPlotAxes", true, "Link Sub Plot Axes" );
|
CAF_PDM_InitField( &m_linkSubPlotAxes, "LinkSubPlotAxes", true, "Link Sub Plot Axes" );
|
||||||
CAF_PDM_InitField( &m_autoAdjustAppearance, "AutoAdjustAppearance", false, "Auto Adjust Appearance" );
|
CAF_PDM_InitField( &m_autoAdjustAppearance, "AutoAdjustAppearance", false, "Auto Adjust Appearance" );
|
||||||
|
|
||||||
@@ -383,6 +396,18 @@ void RimSummaryMultiPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
|||||||
m_createPlotDuplicate = false;
|
m_createPlotDuplicate = false;
|
||||||
duplicate();
|
duplicate();
|
||||||
}
|
}
|
||||||
|
else if ( changedField == &m_appendNextPlot )
|
||||||
|
{
|
||||||
|
m_appendNextPlot = false;
|
||||||
|
int stepDirection = 1;
|
||||||
|
appendSubPlotByStepping( stepDirection );
|
||||||
|
}
|
||||||
|
else if ( changedField == &m_appendPrevPlot )
|
||||||
|
{
|
||||||
|
m_appendPrevPlot = false;
|
||||||
|
int stepDirection = -1;
|
||||||
|
appendSubPlotByStepping( stepDirection );
|
||||||
|
}
|
||||||
else if ( changedField == &m_autoAdjustAppearance )
|
else if ( changedField == &m_autoAdjustAppearance )
|
||||||
{
|
{
|
||||||
checkAndApplyAutoAppearance();
|
checkAndApplyAutoAppearance();
|
||||||
@@ -413,13 +438,16 @@ void RimSummaryMultiPlot::updatePlotWindowTitle()
|
|||||||
{
|
{
|
||||||
auto subPlotNameHelper = plot->plotTitleHelper();
|
auto subPlotNameHelper = plot->plotTitleHelper();
|
||||||
|
|
||||||
// Disable auto plot, as this is required to be able to include the information in the multi plot title
|
// Disable auto plot title, as this is required to be able to include the information in the multi plot title
|
||||||
plot->enableAutoPlotTitle( false );
|
plot->enableAutoPlotTitle( false );
|
||||||
|
|
||||||
auto plotName = subPlotNameHelper->aggregatedPlotTitle( *m_nameHelper );
|
auto plotName = subPlotNameHelper->aggregatedPlotTitle( *m_nameHelper );
|
||||||
|
plot->setPlotTitleVisible( true );
|
||||||
plot->setDescription( plotName );
|
plot->setDescription( plotName );
|
||||||
plot->updatePlotTitle();
|
plot->updatePlotTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !m_viewer.isNull() ) m_viewer->scheduleTitleUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -495,6 +523,9 @@ std::vector<caf::PdmFieldHandle*> RimSummaryMultiPlot::fieldsToShowInToolbar()
|
|||||||
toolBarFields.insert( std::end( toolBarFields ), std::begin( fields ), std::end( fields ) );
|
toolBarFields.insert( std::end( toolBarFields ), std::begin( fields ), std::end( fields ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toolBarFields.push_back( &m_appendPrevPlot );
|
||||||
|
toolBarFields.push_back( &m_appendNextPlot );
|
||||||
|
|
||||||
auto multiFields = RimMultiPlot::fieldsToShowInToolbar();
|
auto multiFields = RimMultiPlot::fieldsToShowInToolbar();
|
||||||
toolBarFields.insert( std::end( toolBarFields ), std::begin( multiFields ), std::end( multiFields ) );
|
toolBarFields.insert( std::end( toolBarFields ), std::begin( multiFields ), std::end( multiFields ) );
|
||||||
|
|
||||||
@@ -570,6 +601,7 @@ void RimSummaryMultiPlot::initAfterRead()
|
|||||||
void RimSummaryMultiPlot::onLoadDataAndUpdate()
|
void RimSummaryMultiPlot::onLoadDataAndUpdate()
|
||||||
{
|
{
|
||||||
RimMultiPlot::onLoadDataAndUpdate();
|
RimMultiPlot::onLoadDataAndUpdate();
|
||||||
|
updatePlotWindowTitle();
|
||||||
|
|
||||||
checkAndApplyAutoAppearance();
|
checkAndApplyAutoAppearance();
|
||||||
}
|
}
|
||||||
@@ -978,3 +1010,86 @@ QWidget* RimSummaryMultiPlot::createViewWidget( QWidget* mainWindowParent )
|
|||||||
|
|
||||||
return m_viewer;
|
return m_viewer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryMultiPlot::appendSubPlotByStepping( int direction )
|
||||||
|
{
|
||||||
|
if ( summaryPlots().empty() ) return;
|
||||||
|
|
||||||
|
auto newPlots = RicSummaryPlotBuilder::duplicatePlots( { summaryPlots().back() } );
|
||||||
|
if ( newPlots.empty() ) return;
|
||||||
|
|
||||||
|
RimSummaryPlot* newPlot = dynamic_cast<RimSummaryPlot*>( newPlots[0] );
|
||||||
|
if ( newPlot == nullptr ) return;
|
||||||
|
|
||||||
|
if ( m_sourceStepping()->stepDimension() == RimSummaryPlotSourceStepping::SourceSteppingDimension::SUMMARY_CASE )
|
||||||
|
{
|
||||||
|
newPlot->resolveReferencesRecursively();
|
||||||
|
|
||||||
|
RimSummaryCase* newCase = m_sourceStepping()->stepCase( direction );
|
||||||
|
for ( auto curve : newPlot->allCurves( RimSummaryDataSourceStepping::Axis::Y_AXIS ) )
|
||||||
|
{
|
||||||
|
curve->setSummaryCaseX( newCase );
|
||||||
|
curve->setSummaryCaseY( newCase );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( m_sourceStepping()->stepDimension() == RimSummaryPlotSourceStepping::SourceSteppingDimension::ENSEMBLE )
|
||||||
|
{
|
||||||
|
newPlot->resolveReferencesRecursively();
|
||||||
|
|
||||||
|
RimSummaryCaseCollection* newEnsemble = m_sourceStepping()->stepEnsemble( direction );
|
||||||
|
for ( auto curveSet : newPlot->curveSets() )
|
||||||
|
{
|
||||||
|
curveSet->setSummaryCaseCollection( newEnsemble );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto mods = RimSummaryAddressModifier::createAddressModifiersForPlot( newPlot );
|
||||||
|
for ( auto& mod : mods )
|
||||||
|
{
|
||||||
|
auto modifiedAdr = m_sourceStepping()->stepAddress( mod.address(), direction );
|
||||||
|
mod.setAddress( modifiedAdr );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addPlot( newPlot );
|
||||||
|
|
||||||
|
newPlot->resolveReferencesRecursively();
|
||||||
|
newPlot->loadDataAndUpdate();
|
||||||
|
|
||||||
|
updatePlotWindowTitle();
|
||||||
|
updateConnectedEditors();
|
||||||
|
|
||||||
|
RiuPlotMainWindowTools::selectAsCurrentItem( newPlot, true );
|
||||||
|
|
||||||
|
updateSourceStepper();
|
||||||
|
RiuPlotMainWindowTools::refreshToolbars();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryMultiPlot::updateSourceStepper()
|
||||||
|
{
|
||||||
|
if ( summaryPlots().empty() ) return;
|
||||||
|
|
||||||
|
RimSummaryPlot* plot = summaryPlots().back();
|
||||||
|
|
||||||
|
auto sourceStepper = plot->sourceStepper();
|
||||||
|
if ( sourceStepper == nullptr ) return;
|
||||||
|
|
||||||
|
m_sourceStepping->syncWithStepper( sourceStepper );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryMultiPlot::keepVisiblePageAfterUpdate( bool keepPage )
|
||||||
|
{
|
||||||
|
if ( !m_viewer ) return;
|
||||||
|
|
||||||
|
if ( keepPage ) m_viewer->keepCurrentPageAfterUpdate();
|
||||||
|
}
|
||||||
|
@@ -102,6 +102,8 @@ public:
|
|||||||
|
|
||||||
void checkAndApplyAutoAppearance();
|
void checkAndApplyAutoAppearance();
|
||||||
|
|
||||||
|
void keepVisiblePageAfterUpdate( bool keepPage );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool handleGlobalKeyEvent( QKeyEvent* keyEvent ) override;
|
bool handleGlobalKeyEvent( QKeyEvent* keyEvent ) override;
|
||||||
bool handleGlobalWheelEvent( QWheelEvent* wheelEvent ) override;
|
bool handleGlobalWheelEvent( QWheelEvent* wheelEvent ) override;
|
||||||
@@ -118,9 +120,12 @@ private:
|
|||||||
|
|
||||||
void updatePlotWindowTitle() override;
|
void updatePlotWindowTitle() override;
|
||||||
void computeAggregatedAxisRange();
|
void computeAggregatedAxisRange();
|
||||||
|
void updateSourceStepper();
|
||||||
|
|
||||||
void duplicate();
|
void duplicate();
|
||||||
|
|
||||||
|
void appendSubPlotByStepping( int direction );
|
||||||
|
|
||||||
void analyzePlotsAndAdjustAppearanceSettings();
|
void analyzePlotsAndAdjustAppearanceSettings();
|
||||||
|
|
||||||
void onSubPlotChanged( const caf::SignalEmitter* emitter );
|
void onSubPlotChanged( const caf::SignalEmitter* emitter );
|
||||||
@@ -134,6 +139,9 @@ private:
|
|||||||
caf::PdmField<bool> m_linkSubPlotAxes;
|
caf::PdmField<bool> m_linkSubPlotAxes;
|
||||||
caf::PdmField<bool> m_autoAdjustAppearance;
|
caf::PdmField<bool> m_autoAdjustAppearance;
|
||||||
|
|
||||||
|
caf::PdmField<bool> m_appendNextPlot;
|
||||||
|
caf::PdmField<bool> m_appendPrevPlot;
|
||||||
|
|
||||||
caf::PdmField<caf::AppEnum<AxisRangeAggregation>> m_axisRangeAggregation;
|
caf::PdmField<caf::AppEnum<AxisRangeAggregation>> m_axisRangeAggregation;
|
||||||
|
|
||||||
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_sourceStepping;
|
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_sourceStepping;
|
||||||
|
@@ -79,7 +79,7 @@ QString RimSummaryNameHelper::aggregatedPlotTitle( const RimSummaryNameHelper& o
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto quantity = this->titleQuantity();
|
auto quantity = this->titleQuantity();
|
||||||
if ( !other.isPlotDisplayingSingleQuantity() && !quantity.empty() )
|
if ( ( other.titleQuantity() != this->titleQuantity() ) && ( !quantity.empty() ) )
|
||||||
{
|
{
|
||||||
if ( !title.isEmpty() ) title += ", ";
|
if ( !title.isEmpty() ) title += ", ";
|
||||||
title += QString::fromStdString(
|
title += QString::fromStdString(
|
||||||
|
@@ -2751,3 +2751,11 @@ void RimSummaryPlot::onChildDeleted( caf::PdmChildArrayFieldHandle* childAr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimSummaryPlotSourceStepping* RimSummaryPlot::sourceStepper()
|
||||||
|
{
|
||||||
|
return m_sourceStepping();
|
||||||
|
}
|
||||||
|
@@ -204,6 +204,8 @@ public:
|
|||||||
|
|
||||||
std::vector<RimPlotCurve*> visibleCurvesForLegend() override;
|
std::vector<RimPlotCurve*> visibleCurvesForLegend() override;
|
||||||
|
|
||||||
|
RimSummaryPlotSourceStepping* sourceStepper();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// RimViewWindow overrides
|
// RimViewWindow overrides
|
||||||
void deleteViewWidget() override;
|
void deleteViewWidget() override;
|
||||||
|
@@ -46,6 +46,11 @@
|
|||||||
#include "cafPdmUiListEditor.h"
|
#include "cafPdmUiListEditor.h"
|
||||||
#include "cafPdmUiToolBarEditor.h"
|
#include "cafPdmUiToolBarEditor.h"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
template <>
|
template <>
|
||||||
@@ -58,6 +63,7 @@ void AppEnum<RimSummaryPlotSourceStepping::SourceSteppingDimension>::setUp()
|
|||||||
addItem( RimSummaryPlotSourceStepping::SourceSteppingDimension::GROUP, "GROUP", "Group" );
|
addItem( RimSummaryPlotSourceStepping::SourceSteppingDimension::GROUP, "GROUP", "Group" );
|
||||||
addItem( RimSummaryPlotSourceStepping::SourceSteppingDimension::REGION, "REGION", "Region" );
|
addItem( RimSummaryPlotSourceStepping::SourceSteppingDimension::REGION, "REGION", "Region" );
|
||||||
addItem( RimSummaryPlotSourceStepping::SourceSteppingDimension::BLOCK, "BLOCK", "Block" );
|
addItem( RimSummaryPlotSourceStepping::SourceSteppingDimension::BLOCK, "BLOCK", "Block" );
|
||||||
|
addItem( RimSummaryPlotSourceStepping::SourceSteppingDimension::AQUIFER, "AQUIFER", "Aquifer" );
|
||||||
setDefault( RimSummaryPlotSourceStepping::SourceSteppingDimension::QUANTITY );
|
setDefault( RimSummaryPlotSourceStepping::SourceSteppingDimension::QUANTITY );
|
||||||
}
|
}
|
||||||
} // namespace caf
|
} // namespace caf
|
||||||
@@ -228,58 +234,7 @@ QList<caf::PdmOptionItemInfo>
|
|||||||
{
|
{
|
||||||
if ( fieldNeedingOptions == &m_quantity )
|
if ( fieldNeedingOptions == &m_quantity )
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_FIELD;
|
std::map<QString, QString> displayAndValueStrings = optionsForQuantity( addresses );
|
||||||
|
|
||||||
auto visibleCurveAddresses = addressesForCurvesInPlot();
|
|
||||||
if ( !visibleCurveAddresses.empty() )
|
|
||||||
{
|
|
||||||
category = visibleCurveAddresses.begin()->category();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::map<QString, QString> displayAndValueStrings;
|
|
||||||
|
|
||||||
{
|
|
||||||
RiaSummaryAddressAnalyzer quantityAnalyzer;
|
|
||||||
|
|
||||||
auto subset = RiaSummaryAddressAnalyzer::addressesForCategory( addresses, category );
|
|
||||||
quantityAnalyzer.appendAddresses( subset );
|
|
||||||
|
|
||||||
RiaSummaryAddressAnalyzer analyzerForVisibleCurves;
|
|
||||||
analyzerForVisibleCurves.appendAddresses( visibleCurveAddresses );
|
|
||||||
|
|
||||||
if ( analyzerForVisibleCurves.quantityNamesWithHistory().empty() )
|
|
||||||
{
|
|
||||||
auto quantities = quantityAnalyzer.quantities();
|
|
||||||
for ( const auto& s : quantities )
|
|
||||||
{
|
|
||||||
QString valueString = QString::fromStdString( s );
|
|
||||||
|
|
||||||
displayAndValueStrings[valueString] = valueString;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// The plot displays a mix of simulated and observed vectors
|
|
||||||
// Create a combined item for source stepping
|
|
||||||
|
|
||||||
auto quantitiesWithHistory = quantityAnalyzer.quantityNamesWithHistory();
|
|
||||||
for ( const auto& s : quantitiesWithHistory )
|
|
||||||
{
|
|
||||||
QString valueString = QString::fromStdString( s );
|
|
||||||
QString displayString = valueString + " (H)";
|
|
||||||
|
|
||||||
displayAndValueStrings[displayString] = valueString;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto quantitiesNoHistory = quantityAnalyzer.quantityNamesNoHistory();
|
|
||||||
for ( const auto& s : quantitiesNoHistory )
|
|
||||||
{
|
|
||||||
QString valueString = QString::fromStdString( s );
|
|
||||||
|
|
||||||
displayAndValueStrings[valueString] = valueString;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( const auto& displayAndValue : displayAndValueStrings )
|
for ( const auto& displayAndValue : displayAndValueStrings )
|
||||||
{
|
{
|
||||||
@@ -460,15 +415,15 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
|||||||
if ( isYAxisStepping() )
|
if ( isYAxisStepping() )
|
||||||
{
|
{
|
||||||
auto adr = curve->summaryAddressY();
|
auto adr = curve->summaryAddressY();
|
||||||
RimDataSourceSteppingTools::updateHistoryAndSummaryQuantityIfMatching( oldValue, newValue, &adr );
|
if ( RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, &adr ) )
|
||||||
curve->setSummaryAddressY( adr );
|
curve->setSummaryAddressY( adr );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isXAxisStepping() )
|
if ( isXAxisStepping() )
|
||||||
{
|
{
|
||||||
auto adr = curve->summaryAddressX();
|
auto adr = curve->summaryAddressX();
|
||||||
RimDataSourceSteppingTools::updateHistoryAndSummaryQuantityIfMatching( oldValue, newValue, &adr );
|
if ( RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, &adr ) )
|
||||||
curve->setSummaryAddressX( adr );
|
curve->setSummaryAddressX( adr );
|
||||||
}
|
}
|
||||||
|
|
||||||
curve->setDefaultCurveAppearance();
|
curve->setDefaultCurveAppearance();
|
||||||
@@ -479,14 +434,15 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
|||||||
for ( auto curveSet : dataSourceSteppingObject()->curveSets() )
|
for ( auto curveSet : dataSourceSteppingObject()->curveSets() )
|
||||||
{
|
{
|
||||||
auto adr = curveSet->summaryAddress();
|
auto adr = curveSet->summaryAddress();
|
||||||
RimDataSourceSteppingTools::updateHistoryAndSummaryQuantityIfMatching( oldValue, newValue, &adr );
|
if ( RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, &adr ) )
|
||||||
curveSet->setSummaryAddress( adr );
|
curveSet->setSummaryAddress( adr );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_quantity.uiCapability()->updateConnectedEditors();
|
||||||
triggerLoadDataAndUpdate = true;
|
triggerLoadDataAndUpdate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( changedField != &m_quantity )
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress::SummaryVarCategory summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
RifEclipseSummaryAddress::SummaryVarCategory summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||||
if ( changedField == &m_wellName )
|
if ( changedField == &m_wellName )
|
||||||
@@ -555,17 +511,21 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
|||||||
{
|
{
|
||||||
RimSummaryPlot* summaryPlot = nullptr;
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
this->firstAncestorOrThisOfType( summaryPlot );
|
this->firstAncestorOrThisOfType( summaryPlot );
|
||||||
if ( summaryPlot )
|
|
||||||
{
|
|
||||||
summaryPlot->updatePlotTitle();
|
|
||||||
summaryPlot->loadDataAndUpdate();
|
|
||||||
summaryPlot->updateConnectedEditors();
|
|
||||||
}
|
|
||||||
|
|
||||||
RimSummaryMultiPlot* summaryMultiPlot = dynamic_cast<RimSummaryMultiPlot*>( m_objectForSourceStepping.p() );
|
RimSummaryMultiPlot* summaryMultiPlot = dynamic_cast<RimSummaryMultiPlot*>( m_objectForSourceStepping.p() );
|
||||||
if ( summaryMultiPlot )
|
if ( summaryMultiPlot )
|
||||||
{
|
{
|
||||||
|
summaryMultiPlot->keepVisiblePageAfterUpdate( true );
|
||||||
summaryMultiPlot->loadDataAndUpdate();
|
summaryMultiPlot->loadDataAndUpdate();
|
||||||
|
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||||
|
mainPlotWindow->updateMultiPlotToolBar();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
summaryPlot->updatePlotTitle();
|
||||||
|
summaryPlot->loadDataAndUpdate();
|
||||||
|
summaryPlot->updateConnectedEditors();
|
||||||
|
summaryPlot->curvesChanged.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
RimEnsembleCurveSetCollection* ensembleCurveColl = nullptr;
|
RimEnsembleCurveSetCollection* ensembleCurveColl = nullptr;
|
||||||
@@ -622,12 +582,6 @@ caf::PdmValueField* RimSummaryPlotSourceStepping::fieldToModify()
|
|||||||
case SourceSteppingDimension::BLOCK:
|
case SourceSteppingDimension::BLOCK:
|
||||||
return &m_cellBlock;
|
return &m_cellBlock;
|
||||||
|
|
||||||
case SourceSteppingDimension::SEGMENT:
|
|
||||||
return &m_segment;
|
|
||||||
|
|
||||||
case SourceSteppingDimension::COMPLETION:
|
|
||||||
return &m_completion;
|
|
||||||
|
|
||||||
case SourceSteppingDimension::AQUIFER:
|
case SourceSteppingDimension::AQUIFER:
|
||||||
return &m_aquifer;
|
return &m_aquifer;
|
||||||
|
|
||||||
@@ -1024,3 +978,311 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::toolbarFieldsFor
|
|||||||
|
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSummaryAddress addr, int direction )
|
||||||
|
{
|
||||||
|
auto addresses = adressesForSourceStepping();
|
||||||
|
RiaSummaryAddressAnalyzer analyzer;
|
||||||
|
analyzer.appendAddresses( addresses );
|
||||||
|
|
||||||
|
switch ( m_stepDimension() )
|
||||||
|
{
|
||||||
|
case SourceSteppingDimension::WELL:
|
||||||
|
{
|
||||||
|
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_WELL, "" );
|
||||||
|
auto& curName = addr.wellName();
|
||||||
|
auto found = std::find( ids.begin(), ids.end(), QString::fromStdString( curName ) );
|
||||||
|
if ( found != ids.end() )
|
||||||
|
{
|
||||||
|
if ( direction > 0 )
|
||||||
|
{
|
||||||
|
found++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( found != ids.begin() ) found--;
|
||||||
|
}
|
||||||
|
if ( found != ids.end() ) addr.setWellName( ( *found ).toStdString() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::GROUP:
|
||||||
|
{
|
||||||
|
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_GROUP, "" );
|
||||||
|
auto& curName = addr.groupName();
|
||||||
|
auto found = std::find( ids.begin(), ids.end(), QString::fromStdString( curName ) );
|
||||||
|
if ( found != ids.end() )
|
||||||
|
{
|
||||||
|
if ( direction > 0 )
|
||||||
|
{
|
||||||
|
found++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( found != ids.begin() ) found--;
|
||||||
|
}
|
||||||
|
if ( found != ids.end() ) addr.setGroupName( ( *found ).toStdString() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::REGION:
|
||||||
|
{
|
||||||
|
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_REGION, "" );
|
||||||
|
int curRegion = addr.regionNumber();
|
||||||
|
auto found = std::find( ids.begin(), ids.end(), curRegion );
|
||||||
|
if ( found != ids.end() )
|
||||||
|
{
|
||||||
|
if ( direction > 0 )
|
||||||
|
{
|
||||||
|
found++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( found != ids.begin() ) found--;
|
||||||
|
}
|
||||||
|
if ( found != ids.end() ) addr.setRegion( ( *found ).toInt() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::QUANTITY:
|
||||||
|
{
|
||||||
|
auto options = optionsForQuantity( addresses );
|
||||||
|
|
||||||
|
std::vector<QString> values;
|
||||||
|
for ( auto it = options.begin(); it != options.end(); it++ )
|
||||||
|
{
|
||||||
|
values.push_back( it->second );
|
||||||
|
}
|
||||||
|
|
||||||
|
QString qName = QString::fromStdString( addr.quantityName() );
|
||||||
|
auto found = std::find( values.begin(), values.end(), qName );
|
||||||
|
if ( found != values.end() )
|
||||||
|
{
|
||||||
|
if ( direction > 0 )
|
||||||
|
{
|
||||||
|
found++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( found != values.begin() ) found--;
|
||||||
|
}
|
||||||
|
if ( found != values.end() ) addr.setQuantityName( ( *found ).toStdString() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::BLOCK:
|
||||||
|
{
|
||||||
|
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_BLOCK, "" );
|
||||||
|
auto curName = addr.blockAsString();
|
||||||
|
auto found = std::find( ids.begin(), ids.end(), QString::fromStdString( curName ) );
|
||||||
|
if ( found != ids.end() )
|
||||||
|
{
|
||||||
|
if ( direction > 0 )
|
||||||
|
{
|
||||||
|
found++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( found != ids.begin() ) found--;
|
||||||
|
}
|
||||||
|
if ( found != ids.end() )
|
||||||
|
{
|
||||||
|
addr.setCellIjk( ( *found ).toStdString() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::AQUIFER:
|
||||||
|
{
|
||||||
|
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_AQUIFER, "" );
|
||||||
|
int curRegion = addr.aquiferNumber();
|
||||||
|
auto found = std::find( ids.begin(), ids.end(), curRegion );
|
||||||
|
if ( found != ids.end() )
|
||||||
|
{
|
||||||
|
if ( direction > 0 )
|
||||||
|
{
|
||||||
|
found++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( found != ids.begin() ) found--;
|
||||||
|
}
|
||||||
|
if ( found != ids.end() ) addr.setAquiferNumber( ( *found ).toInt() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryPlotSourceStepping::syncWithStepper( RimSummaryPlotSourceStepping* other )
|
||||||
|
{
|
||||||
|
switch ( m_stepDimension() )
|
||||||
|
{
|
||||||
|
case SourceSteppingDimension::SUMMARY_CASE:
|
||||||
|
m_summaryCase = other->m_summaryCase();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::ENSEMBLE:
|
||||||
|
m_ensemble = other->m_ensemble();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::WELL:
|
||||||
|
m_wellName = other->m_wellName();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::GROUP:
|
||||||
|
m_groupName = other->m_groupName();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::REGION:
|
||||||
|
m_region = other->m_region();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::QUANTITY:
|
||||||
|
m_quantity = other->m_quantity();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::BLOCK:
|
||||||
|
m_cellBlock = other->m_cellBlock();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SourceSteppingDimension::AQUIFER:
|
||||||
|
m_aquifer = other->m_aquifer();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::map<QString, QString> RimSummaryPlotSourceStepping::optionsForQuantity( std::set<RifEclipseSummaryAddress> addresses )
|
||||||
|
{
|
||||||
|
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_FIELD;
|
||||||
|
|
||||||
|
auto visibleCurveAddresses = addressesForCurvesInPlot();
|
||||||
|
if ( !visibleCurveAddresses.empty() )
|
||||||
|
{
|
||||||
|
category = visibleCurveAddresses.begin()->category();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<QString, QString> displayAndValueStrings;
|
||||||
|
|
||||||
|
{
|
||||||
|
RiaSummaryAddressAnalyzer quantityAnalyzer;
|
||||||
|
|
||||||
|
auto subset = RiaSummaryAddressAnalyzer::addressesForCategory( addresses, category );
|
||||||
|
quantityAnalyzer.appendAddresses( subset );
|
||||||
|
|
||||||
|
RiaSummaryAddressAnalyzer analyzerForVisibleCurves;
|
||||||
|
analyzerForVisibleCurves.appendAddresses( visibleCurveAddresses );
|
||||||
|
|
||||||
|
auto quantities = quantityAnalyzer.quantities();
|
||||||
|
for ( const auto& s : quantities )
|
||||||
|
{
|
||||||
|
QString valueString = QString::fromStdString( s );
|
||||||
|
|
||||||
|
displayAndValueStrings[valueString] = valueString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return displayAndValueStrings;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimSummaryPlotSourceStepping::SourceSteppingDimension RimSummaryPlotSourceStepping::stepDimension() const
|
||||||
|
{
|
||||||
|
return m_stepDimension();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimSummaryCase* RimSummaryPlotSourceStepping::stepCase( int direction )
|
||||||
|
{
|
||||||
|
std::vector<RimSummaryCase*> cases;
|
||||||
|
|
||||||
|
auto summaryCases = RimSummaryPlotSourceStepping::summaryCasesForSourceStepping();
|
||||||
|
for ( auto sumCase : summaryCases )
|
||||||
|
{
|
||||||
|
if ( sumCase->ensemble() )
|
||||||
|
{
|
||||||
|
if ( m_includeEnsembleCasesForCaseStepping() )
|
||||||
|
{
|
||||||
|
cases.push_back( sumCase );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cases.push_back( sumCase );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto found = std::find( cases.begin(), cases.end(), m_summaryCase() );
|
||||||
|
if ( found != cases.end() )
|
||||||
|
{
|
||||||
|
if ( direction > 0 )
|
||||||
|
{
|
||||||
|
found++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( found != cases.begin() ) found--;
|
||||||
|
}
|
||||||
|
if ( found != cases.end() ) return *found;
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_summaryCase;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimSummaryCaseCollection* RimSummaryPlotSourceStepping::stepEnsemble( int direction )
|
||||||
|
{
|
||||||
|
std::vector<RimSummaryCaseCollection*> ensembles;
|
||||||
|
|
||||||
|
RimProject* proj = RimProject::current();
|
||||||
|
for ( auto ensemble : proj->summaryGroups() )
|
||||||
|
{
|
||||||
|
if ( ensemble->isEnsemble() )
|
||||||
|
{
|
||||||
|
ensembles.push_back( ensemble );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto found = std::find( ensembles.begin(), ensembles.end(), m_ensemble() );
|
||||||
|
if ( found != ensembles.end() )
|
||||||
|
{
|
||||||
|
if ( direction > 0 )
|
||||||
|
{
|
||||||
|
found++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( found != ensembles.begin() ) found--;
|
||||||
|
}
|
||||||
|
if ( found != ensembles.end() ) return *found;
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_ensemble;
|
||||||
|
}
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
class RimSummaryCase;
|
class RimSummaryCase;
|
||||||
@@ -52,8 +53,6 @@ public:
|
|||||||
REGION,
|
REGION,
|
||||||
QUANTITY,
|
QUANTITY,
|
||||||
BLOCK,
|
BLOCK,
|
||||||
SEGMENT,
|
|
||||||
COMPLETION,
|
|
||||||
AQUIFER
|
AQUIFER
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -68,6 +67,14 @@ public:
|
|||||||
|
|
||||||
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||||
|
|
||||||
|
RifEclipseSummaryAddress stepAddress( RifEclipseSummaryAddress addr, int direction );
|
||||||
|
RimSummaryCase* stepCase( int direction );
|
||||||
|
RimSummaryCaseCollection* stepEnsemble( int direction );
|
||||||
|
|
||||||
|
void syncWithStepper( RimSummaryPlotSourceStepping* other );
|
||||||
|
|
||||||
|
RimSummaryPlotSourceStepping::SourceSteppingDimension stepDimension() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||||
|
|
||||||
@@ -101,6 +108,8 @@ private:
|
|||||||
|
|
||||||
RimSummaryDataSourceStepping* dataSourceSteppingObject() const;
|
RimSummaryDataSourceStepping* dataSourceSteppingObject() const;
|
||||||
|
|
||||||
|
std::map<QString, QString> optionsForQuantity( std::set<RifEclipseSummaryAddress> addresses );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmPointer<caf::PdmObject> m_objectForSourceStepping;
|
caf::PdmPointer<caf::PdmObject> m_objectForSourceStepping;
|
||||||
|
|
||||||
|
@@ -257,6 +257,17 @@ void RiuMultiPlotBook::setSubTitlesVisible( bool visible )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMultiPlotBook::scheduleTitleUpdate()
|
||||||
|
{
|
||||||
|
for ( auto page : m_pages )
|
||||||
|
{
|
||||||
|
page->scheduleUpdate( RiaDefines::MultiPlotPageUpdateType::TITLE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -719,6 +730,14 @@ void RiuMultiPlotBook::goToLastPage()
|
|||||||
changeCurrentPage( m_pages.size() - 1 );
|
changeCurrentPage( m_pages.size() - 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMultiPlotBook::keepCurrentPageAfterUpdate()
|
||||||
|
{
|
||||||
|
m_goToPageAfterUpdate = true;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@@ -69,6 +69,7 @@ public:
|
|||||||
|
|
||||||
void setTitleVisible( bool visible );
|
void setTitleVisible( bool visible );
|
||||||
void setSubTitlesVisible( bool visible );
|
void setSubTitlesVisible( bool visible );
|
||||||
|
void scheduleTitleUpdate();
|
||||||
|
|
||||||
void setTitleFontSizes( int titleFontSize, int subTitleFontSize );
|
void setTitleFontSizes( int titleFontSize, int subTitleFontSize );
|
||||||
void setLegendFontSize( int legendFontSize );
|
void setLegendFontSize( int legendFontSize );
|
||||||
@@ -90,6 +91,8 @@ public:
|
|||||||
void goToPrevPage();
|
void goToPrevPage();
|
||||||
void goToLastPage();
|
void goToLastPage();
|
||||||
|
|
||||||
|
void keepCurrentPageAfterUpdate();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void contextMenuEvent( QContextMenuEvent* ) override;
|
void contextMenuEvent( QContextMenuEvent* ) override;
|
||||||
|
|
||||||
|
@@ -573,14 +573,17 @@ void RiuMultiPlotPage::performUpdate( RiaDefines::MultiPlotPageUpdateType whatTo
|
|||||||
|
|
||||||
reinsertPlotWidgets();
|
reinsertPlotWidgets();
|
||||||
alignCanvasTops();
|
alignCanvasTops();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if ( ( whatToUpdate & RiaDefines::MultiPlotPageUpdateType::LEGEND ) == RiaDefines::MultiPlotPageUpdateType::LEGEND )
|
||||||
{
|
{
|
||||||
if ( ( whatToUpdate & RiaDefines::MultiPlotPageUpdateType::LEGEND ) == RiaDefines::MultiPlotPageUpdateType::LEGEND )
|
refreshLegends();
|
||||||
{
|
alignCanvasTops();
|
||||||
refreshLegends();
|
}
|
||||||
alignCanvasTops();
|
if ( ( whatToUpdate & RiaDefines::MultiPlotPageUpdateType::TITLE ) == RiaDefines::MultiPlotPageUpdateType::TITLE )
|
||||||
}
|
{
|
||||||
|
updateSubTitles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -197,6 +197,7 @@ void RiuPlotMainWindow::cleanupGuiBeforeProjectClose()
|
|||||||
|
|
||||||
m_wellLogPlotToolBarEditor->clear();
|
m_wellLogPlotToolBarEditor->clear();
|
||||||
m_multiPlotToolBarEditor->clear();
|
m_multiPlotToolBarEditor->clear();
|
||||||
|
m_multiPlotLayoutToolBarEditor->clear();
|
||||||
|
|
||||||
setWindowTitle( "Plots - ResInsight" );
|
setWindowTitle( "Plots - ResInsight" );
|
||||||
}
|
}
|
||||||
@@ -431,6 +432,9 @@ void RiuPlotMainWindow::createToolBars()
|
|||||||
m_multiPlotToolBarEditor = std::make_unique<caf::PdmUiToolBarEditor>( "Multi Plot", this );
|
m_multiPlotToolBarEditor = std::make_unique<caf::PdmUiToolBarEditor>( "Multi Plot", this );
|
||||||
m_multiPlotToolBarEditor->hide();
|
m_multiPlotToolBarEditor->hide();
|
||||||
|
|
||||||
|
m_multiPlotLayoutToolBarEditor = std::make_unique<caf::PdmUiToolBarEditor>( "Multi Plot Layout", this );
|
||||||
|
m_multiPlotLayoutToolBarEditor->hide();
|
||||||
|
|
||||||
if ( RiaPreferences::current()->useUndoRedo() )
|
if ( RiaPreferences::current()->useUndoRedo() )
|
||||||
{
|
{
|
||||||
QToolBar* toolbar = addToolBar( tr( "Edit" ) );
|
QToolBar* toolbar = addToolBar( tr( "Edit" ) );
|
||||||
@@ -689,14 +693,29 @@ void RiuPlotMainWindow::updateMultiPlotToolBar()
|
|||||||
{
|
{
|
||||||
std::vector<caf::PdmFieldHandle*> toolBarFields = plotWindow->fieldsToShowInToolbar();
|
std::vector<caf::PdmFieldHandle*> toolBarFields = plotWindow->fieldsToShowInToolbar();
|
||||||
|
|
||||||
m_multiPlotToolBarEditor->setFields( toolBarFields );
|
if ( toolBarFields.empty() )
|
||||||
m_multiPlotToolBarEditor->updateUi();
|
{
|
||||||
m_multiPlotToolBarEditor->show();
|
m_multiPlotToolBarEditor->clear();
|
||||||
|
m_multiPlotToolBarEditor->hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_multiPlotToolBarEditor->setFields( toolBarFields );
|
||||||
|
m_multiPlotToolBarEditor->updateUi();
|
||||||
|
m_multiPlotToolBarEditor->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<caf::PdmFieldHandle*> layoutFields = plotWindow->fieldsToShowInLayoutToolbar();
|
||||||
|
m_multiPlotLayoutToolBarEditor->setFields( layoutFields );
|
||||||
|
m_multiPlotLayoutToolBarEditor->updateUi();
|
||||||
|
m_multiPlotLayoutToolBarEditor->show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_multiPlotToolBarEditor->clear();
|
m_multiPlotToolBarEditor->clear();
|
||||||
m_multiPlotToolBarEditor->hide();
|
m_multiPlotToolBarEditor->hide();
|
||||||
|
m_multiPlotLayoutToolBarEditor->clear();
|
||||||
|
m_multiPlotLayoutToolBarEditor->hide();
|
||||||
}
|
}
|
||||||
refreshToolbars();
|
refreshToolbars();
|
||||||
}
|
}
|
||||||
|
@@ -134,6 +134,7 @@ private:
|
|||||||
|
|
||||||
std::unique_ptr<caf::PdmUiToolBarEditor> m_wellLogPlotToolBarEditor;
|
std::unique_ptr<caf::PdmUiToolBarEditor> m_wellLogPlotToolBarEditor;
|
||||||
std::unique_ptr<caf::PdmUiToolBarEditor> m_multiPlotToolBarEditor;
|
std::unique_ptr<caf::PdmUiToolBarEditor> m_multiPlotToolBarEditor;
|
||||||
|
std::unique_ptr<caf::PdmUiToolBarEditor> m_multiPlotLayoutToolBarEditor;
|
||||||
|
|
||||||
std::unique_ptr<caf::PdmUiPropertyView> m_pdmUiPropertyView;
|
std::unique_ptr<caf::PdmUiPropertyView> m_pdmUiPropertyView;
|
||||||
std::unique_ptr<caf::PdmUiPropertyView> m_summaryPlotManagerView;
|
std::unique_ptr<caf::PdmUiPropertyView> m_summaryPlotManagerView;
|
||||||
|
@@ -67,14 +67,21 @@ RiuSummaryQuantityNameInfoProvider::RiuSummaryQuantityInfo
|
|||||||
{
|
{
|
||||||
// Check for custom vector naming
|
// Check for custom vector naming
|
||||||
|
|
||||||
|
std::string postfix = quantity.substr( quantity.size() - 5, 5 );
|
||||||
std::string baseName = quantity.substr( 0, 5 );
|
std::string baseName = quantity.substr( 0, 5 );
|
||||||
while ( baseName.back() == '_' )
|
while ( baseName.back() == '_' )
|
||||||
baseName.pop_back();
|
baseName.pop_back();
|
||||||
|
|
||||||
|
bool isDifference = ( postfix == "_DIFF" );
|
||||||
|
|
||||||
it = m_summaryToDescMap.find( baseName );
|
it = m_summaryToDescMap.find( baseName );
|
||||||
|
|
||||||
if ( it != m_summaryToDescMap.end() )
|
if ( it != m_summaryToDescMap.end() )
|
||||||
{
|
{
|
||||||
|
if ( isDifference )
|
||||||
|
{
|
||||||
|
return RiuSummaryQuantityInfo( it->second.category, it->second.longName + " Difference" );
|
||||||
|
}
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user