mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Summary Multi Plot: Minor adjustments (#8856)
Remove obsolete single summary template code Always use maximized state of the QMdiSubWindow when a plot or view is deleted. Move time axis to top Set correct text for unused axis Avoid assert when layout is requested for non existing legend
This commit is contained in:
@@ -100,6 +100,7 @@
|
||||
#include "RimParameterResultCrossPlot.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimPlotAxisPropertiesInterface.h"
|
||||
#include "RimPlotDataFilterCollection.h"
|
||||
#include "RimPlotDataFilterItem.h"
|
||||
#include "RimPltPlotCollection.h"
|
||||
@@ -680,7 +681,6 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicNewSummaryCrossPlotCurveFeature";
|
||||
menuBuilder << "RicNewPlotAxisPropertiesFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicSavePlotTemplateFeature";
|
||||
|
||||
// Export is not supported for cross plot
|
||||
if ( !summaryCrossPlot ) menuBuilder << "RicAsciiExportSummaryPlotFeature";
|
||||
@@ -1043,6 +1043,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicCreateMultiPlotFromSelectionFeature";
|
||||
menuBuilder << "RicCreatePlotFromTemplateByShortcutFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimPlotAxisPropertiesInterface*>( firstUiItem ) )
|
||||
{
|
||||
menuBuilder << "RicNewPlotAxisPropertiesFeature";
|
||||
}
|
||||
|
||||
if ( dynamic_cast<Rim3dView*>( firstUiItem ) )
|
||||
{
|
||||
|
||||
@@ -133,6 +133,21 @@ void RimPlotAxisProperties::enableRangeSettings( bool enable )
|
||||
m_isRangeSettingsEnabled = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisProperties::setNameForUnusedAxis()
|
||||
{
|
||||
QString name = "Unused ";
|
||||
|
||||
if ( m_plotAxis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT )
|
||||
name += "Left";
|
||||
else if ( m_plotAxis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT )
|
||||
name += "Right";
|
||||
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
|
||||
void setEnableTitleTextSettings( bool enable );
|
||||
void enableRangeSettings( bool enable );
|
||||
void setNameForUnusedAxis();
|
||||
void setNameAndAxis( const QString& name, RiaDefines::PlotAxis axis, int axisIndex = 0 );
|
||||
AxisTitlePositionType titlePosition() const override;
|
||||
|
||||
|
||||
@@ -511,7 +511,10 @@ QList<caf::PdmOptionItemInfo> RimSummaryCurve::calculateValueOptions( const caf:
|
||||
|
||||
for ( auto axis : plot->plotAxes() )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( axis->name(), axis ) );
|
||||
if ( dynamic_cast<RimPlotAxisProperties*>( axis ) )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( axis->name(), axis ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,12 +127,6 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot )
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_axisProperties, "AxisProperties", "Axes", ":/Axes16x16.png" );
|
||||
|
||||
auto leftAxis = addNewAxisProperties( RiuPlotAxis::defaultLeft(), "Left" );
|
||||
leftAxis->setAlwaysRequired( true );
|
||||
|
||||
auto rightAxis = addNewAxisProperties( RiuPlotAxis::defaultRight(), "Right" );
|
||||
rightAxis->setAlwaysRequired( true );
|
||||
|
||||
if ( m_isCrossPlot )
|
||||
{
|
||||
addNewAxisProperties( RiuPlotAxis::defaultBottom(), "Bottom" );
|
||||
@@ -145,6 +139,12 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot )
|
||||
m_axisProperties.push_back( timeAxisProperties );
|
||||
}
|
||||
|
||||
auto leftAxis = addNewAxisProperties( RiuPlotAxis::defaultLeft(), "Left" );
|
||||
leftAxis->setAlwaysRequired( true );
|
||||
|
||||
auto rightAxis = addNewAxisProperties( RiuPlotAxis::defaultRight(), "Right" );
|
||||
rightAxis->setAlwaysRequired( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_textCurveSetEditor, "SummaryPlotFilterTextCurveSetEditor", "Text Filter Curve Creator" );
|
||||
m_textCurveSetEditor.uiCapability()->setUiTreeHidden( true );
|
||||
m_textCurveSetEditor = new RimSummaryPlotFilterTextCurveSetEditor;
|
||||
@@ -813,27 +813,37 @@ void RimSummaryPlot::updateAxis( RiaDefines::PlotAxis plotAxis )
|
||||
if ( riuPlotAxis.axis() == plotAxis )
|
||||
{
|
||||
auto* axisProperties = dynamic_cast<RimPlotAxisProperties*>( yAxisProperties );
|
||||
if ( yAxisProperties->isActive() && hasVisibleCurvesForAxis( riuPlotAxis ) && axisProperties )
|
||||
if ( axisProperties )
|
||||
{
|
||||
plotWidget()->enableAxis( riuPlotAxis, true );
|
||||
|
||||
std::set<QString> timeHistoryQuantities;
|
||||
|
||||
for ( auto c : visibleTimeHistoryCurvesForAxis( riuPlotAxis ) )
|
||||
if ( yAxisProperties->isActive() && hasVisibleCurvesForAxis( riuPlotAxis ) )
|
||||
{
|
||||
timeHistoryQuantities.insert( c->quantityName() );
|
||||
plotWidget()->enableAxis( riuPlotAxis, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
plotWidget()->enableAxis( riuPlotAxis, false );
|
||||
}
|
||||
|
||||
RimSummaryPlotAxisFormatter calc( axisProperties,
|
||||
visibleSummaryCurvesForAxis( riuPlotAxis ),
|
||||
{},
|
||||
visibleAsciiDataCurvesForAxis( riuPlotAxis ),
|
||||
timeHistoryQuantities );
|
||||
calc.applyAxisPropertiesToPlot( plotWidget() );
|
||||
}
|
||||
else
|
||||
{
|
||||
plotWidget()->enableAxis( riuPlotAxis, false );
|
||||
if ( !hasVisibleCurvesForAxis( riuPlotAxis ) )
|
||||
{
|
||||
axisProperties->setNameForUnusedAxis();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::set<QString> timeHistoryQuantities;
|
||||
|
||||
for ( auto c : visibleTimeHistoryCurvesForAxis( riuPlotAxis ) )
|
||||
{
|
||||
timeHistoryQuantities.insert( c->quantityName() );
|
||||
}
|
||||
|
||||
RimSummaryPlotAxisFormatter calc( axisProperties,
|
||||
visibleSummaryCurvesForAxis( riuPlotAxis ),
|
||||
{},
|
||||
visibleAsciiDataCurvesForAxis( riuPlotAxis ),
|
||||
timeHistoryQuantities );
|
||||
calc.applyAxisPropertiesToPlot( plotWidget() );
|
||||
}
|
||||
}
|
||||
|
||||
plotWidget()->enableAxisNumberLabels( riuPlotAxis, axisProperties->showNumbers() );
|
||||
|
||||
Reference in New Issue
Block a user