mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Minor adjustments (#9070)
* Add system commands to test toolbar * #9069 Summary Plot: Update only Y axis values during source stepping * Reduce default brightness for ensemble summary curves * Add a separate flag to control linking of time axis * Make sure interactive zoom in plot is handled * Move message dock window to right dock panel
This commit is contained in:
parent
8aaf98823a
commit
5078f4072f
@ -101,6 +101,14 @@ RiaPreferencesSystem* RiaPreferencesSystem::current()
|
||||
return RiaApplication::instance()->preferences()->systemPreferences();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferencesSystem::setAppendClassNameToUiText( bool enable )
|
||||
{
|
||||
m_appendClassNameToUiText = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
|
||||
static RiaPreferencesSystem* current();
|
||||
|
||||
void setAppendClassNameToUiText( bool enable );
|
||||
bool appendClassNameToUiText() const;
|
||||
bool appendFieldKeywordToToolTipText() const;
|
||||
bool showViewIdInProjectTree() const;
|
||||
|
@ -19,6 +19,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigGeoMechFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportObjectAndFieldKeywordsFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicShowClassNamesFeature.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -42,6 +43,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigGeoMechFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportObjectAndFieldKeywordsFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicShowClassNamesFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "RiaRegressionTestRunner.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QDir>
|
||||
|
||||
@ -46,5 +48,51 @@ void RicLaunchRegressionTestsFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicLaunchRegressionTestsFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Launch Regression Tests" );
|
||||
actionToSetup->setText( "Regression Tests" );
|
||||
}
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicLaunchRegressionTestDialogFeature, "RicLaunchRegressionTestDialogFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicLaunchRegressionTestDialogFeature::showRegressionTestDialog()
|
||||
{
|
||||
RiaRegressionTest regTestConfig;
|
||||
regTestConfig.readSettingsFromApplicationStore();
|
||||
|
||||
caf::PdmUiPropertyViewDialog regressionTestDialog( nullptr, ®TestConfig, "Regression Test", "" );
|
||||
regressionTestDialog.resize( QSize( 600, 350 ) );
|
||||
|
||||
if ( regressionTestDialog.exec() == QDialog::Accepted )
|
||||
{
|
||||
// Write preferences using QSettings and apply them to the application
|
||||
regTestConfig.writeSettingsToApplicationStore();
|
||||
|
||||
RiaRegressionTestRunner::instance()->executeRegressionTests();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicLaunchRegressionTestDialogFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicLaunchRegressionTestDialogFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RicLaunchRegressionTestDialogFeature::showRegressionTestDialog();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicLaunchRegressionTestDialogFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Reg Test Dialog" );
|
||||
}
|
||||
|
@ -32,3 +32,18 @@ private:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicLaunchRegressionTestDialogFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
static void showRegressionTestDialog();
|
||||
|
||||
private:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
|
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022 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 "RicShowClassNamesFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesSystem.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicShowClassNamesFeature, "RicShowClassNamesFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicShowClassNamesFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowClassNamesFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RiaPreferences::current()->systemPreferences()->setAppendClassNameToUiText( isChecked );
|
||||
|
||||
RiaGuiApplication::instance()->applyPreferences();
|
||||
RiaGuiApplication::instance()->applyGuiPreferences();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowClassNamesFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Class Names" );
|
||||
actionToSetup->setCheckable( true );
|
||||
actionToSetup->setChecked( isCommandChecked() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicShowClassNamesFeature::isCommandChecked()
|
||||
{
|
||||
return RiaPreferences::current()->systemPreferences()->appendClassNameToUiText();
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022 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 "cafCmdFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicShowClassNamesFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
bool isCommandChecked() override;
|
||||
};
|
@ -526,6 +526,15 @@ void RimMultiPlot::zoomAll()
|
||||
updateZoom();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMultiPlot::zoomAllYAxes()
|
||||
{
|
||||
setAutoScaleYEnabled( true );
|
||||
updateZoom();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -101,6 +101,7 @@ public:
|
||||
bool showPlotTitles() const;
|
||||
|
||||
void zoomAll() override;
|
||||
void zoomAllYAxes();
|
||||
|
||||
QString asciiDataForPlotExport() const;
|
||||
|
||||
|
@ -25,8 +25,10 @@
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RimPlotAxisAnnotation.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
|
||||
#include "cafPdmUiSliderEditor.h"
|
||||
#include "cafPdmUiTreeAttributes.h"
|
||||
|
||||
#include "cvfVector2.h"
|
||||
|
||||
@ -682,6 +684,28 @@ caf::FontTools::FontSize RimPlotAxisProperties::plotFontSize() const
|
||||
return RiaPreferences::current()->defaultPlotFontSize();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisProperties::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
RimSummaryMultiPlot* summaryMultiPlot = nullptr;
|
||||
firstAncestorOfType( summaryMultiPlot );
|
||||
|
||||
if ( summaryMultiPlot && summaryMultiPlot->isSubPlotAxesLinked() )
|
||||
{
|
||||
auto* treeItemAttribute = dynamic_cast<caf::PdmUiTreeViewItemAttribute*>( attribute );
|
||||
if ( treeItemAttribute )
|
||||
{
|
||||
treeItemAttribute->tags.clear();
|
||||
auto tag = caf::PdmUiTreeViewItemAttribute::Tag::create();
|
||||
tag->icon = caf::IconProvider( ":/chain.png" );
|
||||
|
||||
treeItemAttribute->tags.push_back( std::move( tag ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -133,6 +133,7 @@ private:
|
||||
void updateOptionSensitivity();
|
||||
void updateOverriddenLabelAndReadOnlyState();
|
||||
caf::FontTools::FontSize plotFontSize() const;
|
||||
void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_isActive;
|
||||
|
@ -18,10 +18,7 @@
|
||||
|
||||
#include "RimPlotAxisPropertiesInterface.h"
|
||||
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmUiTreeAttributes.h"
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimPlotAxisPropertiesInterface,
|
||||
"PlotAxisPropertiesInterface",
|
||||
@ -120,25 +117,3 @@ bool RimPlotAxisPropertiesInterface::isAppearanceOverridden() const
|
||||
{
|
||||
return m_isAppearanceOverridden();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisPropertiesInterface::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
RimSummaryMultiPlot* summaryMultiPlot = nullptr;
|
||||
firstAncestorOfType( summaryMultiPlot );
|
||||
|
||||
if ( summaryMultiPlot && summaryMultiPlot->isSubPlotAxesLinked() )
|
||||
{
|
||||
auto* treeItemAttribute = dynamic_cast<caf::PdmUiTreeViewItemAttribute*>( attribute );
|
||||
if ( treeItemAttribute )
|
||||
{
|
||||
treeItemAttribute->tags.clear();
|
||||
auto tag = caf::PdmUiTreeViewItemAttribute::Tag::create();
|
||||
tag->icon = caf::IconProvider( ":/chain.png" );
|
||||
|
||||
treeItemAttribute->tags.push_back( std::move( tag ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,9 +90,6 @@ public:
|
||||
protected:
|
||||
bool isAppearanceOverridden() const;
|
||||
|
||||
private:
|
||||
void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_isAppearanceOverridden;
|
||||
};
|
||||
|
@ -143,6 +143,7 @@ RimSummaryMultiPlot::RimSummaryMultiPlot()
|
||||
m_appendPrevCurve.uiCapability()->setUiIconFromResourceString( ":/AppendPrevCurve.png" );
|
||||
|
||||
CAF_PDM_InitField( &m_linkSubPlotAxes, "LinkSubPlotAxes", true, "Link Sub Plot Axes" );
|
||||
CAF_PDM_InitField( &m_linkTimeAxis, "LinkTimeAxis", true, "Link Time Axis" );
|
||||
CAF_PDM_InitField( &m_autoAdjustAppearance, "AutoAdjustAppearance", true, "Auto Adjust Appearance" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_axisRangeAggregation, "AxisRangeAggregation", "Axis Range Control" );
|
||||
@ -381,6 +382,7 @@ void RimSummaryMultiPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
|
||||
auto axesGroup = uiOrdering.addNewGroup( "Axes" );
|
||||
axesGroup->add( &m_axisRangeAggregation );
|
||||
axesGroup->add( &m_linkSubPlotAxes );
|
||||
axesGroup->add( &m_linkTimeAxis );
|
||||
axesGroup->add( &m_autoAdjustAppearance );
|
||||
|
||||
m_linkSubPlotAxes.uiCapability()->setUiReadOnly( m_autoAdjustAppearance() );
|
||||
@ -428,7 +430,16 @@ void RimSummaryMultiPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
onLoadDataAndUpdate();
|
||||
updateLayout();
|
||||
}
|
||||
else if ( changedField == &m_linkSubPlotAxes || changedField == &m_axisRangeAggregation )
|
||||
else if ( changedField == &m_linkTimeAxis )
|
||||
{
|
||||
auto plots = summaryPlots();
|
||||
if ( !plots.empty() )
|
||||
{
|
||||
syncTimeAxisRanges( plots.front() );
|
||||
}
|
||||
}
|
||||
else if ( changedField == &m_linkSubPlotAxes || changedField == &m_axisRangeAggregation ||
|
||||
changedField == &m_linkTimeAxis )
|
||||
{
|
||||
syncAxisRanges();
|
||||
|
||||
@ -795,7 +806,7 @@ void RimSummaryMultiPlot::syncAxisRanges()
|
||||
}
|
||||
|
||||
// Reset zoom to make sure the complete range for min/max is available
|
||||
RimMultiPlot::zoomAll();
|
||||
RimMultiPlot::zoomAllYAxes();
|
||||
|
||||
if ( m_axisRangeAggregation() == AxisRangeAggregation::SUB_PLOTS )
|
||||
{
|
||||
@ -804,7 +815,7 @@ void RimSummaryMultiPlot::syncAxisRanges()
|
||||
// gather current min/max values for each category (axis label)
|
||||
for ( auto plot : summaryPlots() )
|
||||
{
|
||||
for ( auto axis : plot->plotAxes() )
|
||||
for ( auto axis : plot->plotYAxes() )
|
||||
{
|
||||
double minVal = axis->visibleRangeMin();
|
||||
double maxVal = axis->visibleRangeMax();
|
||||
@ -826,7 +837,7 @@ void RimSummaryMultiPlot::syncAxisRanges()
|
||||
// set all plots to use the global min/max values for each category
|
||||
for ( auto plot : summaryPlots() )
|
||||
{
|
||||
for ( auto axis : plot->plotAxes() )
|
||||
for ( auto axis : plot->plotYAxes() )
|
||||
{
|
||||
auto [minVal, maxVal] = axisRanges[axis->plotAxisType()];
|
||||
if ( axis->isAxisInverted() ) std::swap( minVal, maxVal );
|
||||
@ -844,6 +855,24 @@ void RimSummaryMultiPlot::syncAxisRanges()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlot::syncTimeAxisRanges( RimSummaryPlot* summaryPlot )
|
||||
{
|
||||
if ( m_linkTimeAxis )
|
||||
{
|
||||
for ( auto plot : summaryPlots() )
|
||||
{
|
||||
if ( plot != summaryPlot )
|
||||
{
|
||||
plot->copyAxisPropertiesFromOther( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM, *summaryPlot );
|
||||
plot->updateAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -975,7 +1004,7 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange()
|
||||
{
|
||||
std::map<RiuPlotAxis, std::pair<double, double>> axisRanges;
|
||||
|
||||
for ( auto axis : plot->plotAxes() )
|
||||
for ( auto axis : plot->plotYAxes() )
|
||||
{
|
||||
for ( auto curve : plot->summaryCurves() )
|
||||
{
|
||||
@ -1042,7 +1071,7 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange()
|
||||
}
|
||||
|
||||
// set all plots to use the global min/max values for each category
|
||||
for ( auto axis : plot->plotAxes() )
|
||||
for ( auto axis : plot->plotYAxes() )
|
||||
{
|
||||
auto [minVal, maxVal] = axisRanges[axis->plotAxisType()];
|
||||
if ( RiaDefines::isVertical( axis->plotAxisType().axis() ) && !std::isinf( minVal ) && !std::isinf( maxVal ) )
|
||||
@ -1170,7 +1199,7 @@ void RimSummaryMultiPlot::analyzePlotsAndAdjustAppearanceSettings()
|
||||
else
|
||||
timeAxisProp->setMajorTickmarkCount( RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_FEW );
|
||||
|
||||
for ( RimPlotAxisPropertiesInterface* axisInterface : p->plotAxes() )
|
||||
for ( RimPlotAxisPropertiesInterface* axisInterface : p->plotYAxes() )
|
||||
{
|
||||
auto axisProp = dynamic_cast<RimPlotAxisProperties*>( axisInterface );
|
||||
|
||||
@ -1226,6 +1255,14 @@ bool RimSummaryMultiPlot::isSubPlotAxesLinked() const
|
||||
return m_linkSubPlotAxes();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryMultiPlot::isTimeAxisLinked() const
|
||||
{
|
||||
return m_linkTimeAxis();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1251,6 +1288,8 @@ void RimSummaryMultiPlot::onSubPlotChanged( const caf::SignalEmitter* emitter )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlot::onSubPlotAxisChanged( const caf::SignalEmitter* emitter, RimSummaryPlot* summaryPlot )
|
||||
{
|
||||
syncTimeAxisRanges( summaryPlot );
|
||||
|
||||
if ( !m_linkSubPlotAxes() )
|
||||
{
|
||||
syncAxisRanges();
|
||||
|
@ -84,6 +84,7 @@ public:
|
||||
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar() override;
|
||||
|
||||
void syncAxisRanges();
|
||||
void syncTimeAxisRanges( RimSummaryPlot* summaryPlot );
|
||||
|
||||
void handleDroppedObjects( const std::vector<caf::PdmObjectHandle*>& objects );
|
||||
|
||||
@ -96,6 +97,7 @@ public:
|
||||
|
||||
void setSubPlotAxesLinked( bool enable );
|
||||
bool isSubPlotAxesLinked() const;
|
||||
bool isTimeAxisLinked() const;
|
||||
|
||||
std::pair<int, int> gridLayoutInfoForSubPlot( RimSummaryPlot* summaryPlot ) const;
|
||||
|
||||
@ -150,6 +152,7 @@ private:
|
||||
caf::PdmField<bool> m_disableWheelZoom;
|
||||
caf::PdmField<bool> m_createPlotDuplicate;
|
||||
caf::PdmField<bool> m_linkSubPlotAxes;
|
||||
caf::PdmField<bool> m_linkTimeAxis;
|
||||
caf::PdmField<bool> m_autoAdjustAppearance;
|
||||
|
||||
caf::PdmField<bool> m_hidePlotsWithValuesBelow;
|
||||
|
@ -623,6 +623,22 @@ void RimSummaryPlot::copyAxisPropertiesFromOther( const RimSummaryPlot& sourceSu
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::copyAxisPropertiesFromOther( RiaDefines::PlotAxis plotAxisType, const RimSummaryPlot& sourceSummaryPlot )
|
||||
{
|
||||
for ( auto ap : sourceSummaryPlot.plotAxes() )
|
||||
{
|
||||
if ( ap->plotAxisType().axis() != plotAxisType ) continue;
|
||||
|
||||
QString data = ap->writeObjectToXmlString();
|
||||
|
||||
axisPropertiesForPlotAxis( ap->plotAxisType() )
|
||||
->readObjectFromXmlString( data, caf::PdmDefaultObjectFactory::instance() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -769,15 +785,18 @@ void RimSummaryPlot::applyDefaultCurveAppearances()
|
||||
cvf::Color3f curveColor;
|
||||
if ( RiaPreferencesSummary::current()->colorCurvesByPhase() )
|
||||
{
|
||||
auto basePhaseColor = RimSummaryCurveAppearanceCalculator::assignColorByPhase( curveSet->summaryAddress() );
|
||||
|
||||
curveColor = RiaColorTools::blendCvfColors( basePhaseColor, cvf::Color3f::WHITE, 1, 3 );
|
||||
curveColor = RimSummaryCurveAppearanceCalculator::assignColorByPhase( curveSet->summaryAddress() );
|
||||
}
|
||||
else
|
||||
{
|
||||
curveColor = RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f( colorIndex++ );
|
||||
}
|
||||
|
||||
int weightBaseColor = 10;
|
||||
int weightWhite = 25;
|
||||
|
||||
curveColor = RiaColorTools::blendCvfColors( curveColor, cvf::Color3f::WHITE, weightBaseColor, weightWhite );
|
||||
|
||||
curveSet->setColor( curveColor );
|
||||
}
|
||||
}
|
||||
@ -1192,6 +1211,8 @@ void RimSummaryPlot::zoomAll()
|
||||
setAutoScaleXEnabled( true );
|
||||
setAutoScaleYEnabled( true );
|
||||
updateZoomInParentPlot();
|
||||
|
||||
axisChanged.send( this );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -2282,6 +2303,8 @@ void RimSummaryPlot::onPlotZoomed()
|
||||
setAutoScaleXEnabled( false );
|
||||
setAutoScaleYEnabled( false );
|
||||
updateZoomFromParentPlot();
|
||||
|
||||
axisChanged.send( this );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -2755,6 +2778,20 @@ std::vector<RimPlotAxisPropertiesInterface*> RimSummaryPlot::plotAxes() const
|
||||
return axisProps;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimPlotAxisPropertiesInterface*> RimSummaryPlot::plotYAxes() const
|
||||
{
|
||||
std::vector<RimPlotAxisPropertiesInterface*> axisProps;
|
||||
for ( const auto& ap : m_axisProperties )
|
||||
{
|
||||
if ( RiaDefines::isVertical( ap->plotAxisType().axis() ) ) axisProps.push_back( ap );
|
||||
}
|
||||
|
||||
return axisProps;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -150,6 +150,7 @@ public:
|
||||
void updateCurveNames();
|
||||
|
||||
void copyAxisPropertiesFromOther( const RimSummaryPlot& sourceSummaryPlot );
|
||||
void copyAxisPropertiesFromOther( RiaDefines::PlotAxis plotAxisType, const RimSummaryPlot& sourceSummaryPlot );
|
||||
void copyMatchingAxisPropertiesFromOther( const RimSummaryPlot& sourceSummaryPlot );
|
||||
|
||||
void updateAll();
|
||||
@ -196,6 +197,7 @@ public:
|
||||
std::vector<RimSummaryCurve*> allCurves( RimSummaryDataSourceStepping::Axis axis ) const override;
|
||||
|
||||
std::vector<RimPlotAxisPropertiesInterface*> plotAxes() const;
|
||||
std::vector<RimPlotAxisPropertiesInterface*> plotYAxes() const;
|
||||
|
||||
RimPlotAxisPropertiesInterface* axisPropertiesForPlotAxis( RiuPlotAxis plotAxis ) const;
|
||||
|
||||
|
@ -516,7 +516,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
{
|
||||
summaryMultiPlot->updatePlots();
|
||||
summaryMultiPlot->updatePlotWindowTitle();
|
||||
summaryMultiPlot->zoomAll();
|
||||
summaryMultiPlot->zoomAllYAxes();
|
||||
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
mainPlotWindow->updateMultiPlotToolBar();
|
||||
}
|
||||
|
@ -24,12 +24,14 @@
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiDateEditor.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmUiTimeEditor.h"
|
||||
#include "cafPdmUiTreeAttributes.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
@ -163,6 +165,28 @@ caf::FontTools::FontSize RimSummaryTimeAxisProperties::plotFontSize() const
|
||||
return RiaPreferences::current()->defaultPlotFontSize();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryTimeAxisProperties::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
RimSummaryMultiPlot* summaryMultiPlot = nullptr;
|
||||
firstAncestorOfType( summaryMultiPlot );
|
||||
|
||||
if ( summaryMultiPlot && summaryMultiPlot->isTimeAxisLinked() )
|
||||
{
|
||||
auto* treeItemAttribute = dynamic_cast<caf::PdmUiTreeViewItemAttribute*>( attribute );
|
||||
if ( treeItemAttribute )
|
||||
{
|
||||
treeItemAttribute->tags.clear();
|
||||
auto tag = caf::PdmUiTreeViewItemAttribute::Tag::create();
|
||||
tag->icon = caf::IconProvider( ":/chain.png" );
|
||||
|
||||
treeItemAttribute->tags.push_back( std::move( tag ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -125,6 +125,9 @@ protected:
|
||||
void updateDateVisibleRange();
|
||||
caf::FontTools::FontSize plotFontSize() const;
|
||||
|
||||
private:
|
||||
void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<caf::AppEnum<TimeModeType>> m_timeMode;
|
||||
caf::PdmField<caf::AppEnum<TimeUnitType>> m_timeUnit;
|
||||
|
@ -74,6 +74,7 @@
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include "ApplicationCommands/RicLaunchRegressionTestsFeature.h"
|
||||
#include "ExportCommands/RicSnapshotAllViewsToFileFeature.h"
|
||||
#include "MeasurementCommands/RicToggleMeasurementModeFeature.h"
|
||||
#include "SummaryPlotCommands/RicEditSummaryPlotFeature.h"
|
||||
@ -707,6 +708,8 @@ void RiuMainWindow::createToolBars()
|
||||
toolbar->setObjectName( toolbar->windowTitle() );
|
||||
toolbar->addAction( cmdFeatureMgr->action( "RicLaunchUnitTestsFeature" ) );
|
||||
toolbar->addAction( cmdFeatureMgr->action( "RicLaunchRegressionTestsFeature" ) );
|
||||
toolbar->addAction( cmdFeatureMgr->action( "RicLaunchRegressionTestDialogFeature" ) );
|
||||
toolbar->addAction( cmdFeatureMgr->action( "RicShowClassNamesFeature" ) );
|
||||
toolbar->addAction( cmdFeatureMgr->action( "RicRunCommandFileFeature" ) );
|
||||
toolbar->addAction( cmdFeatureMgr->action( "RicExecuteLastUsedScriptFeature" ) );
|
||||
toolbar->addAction( cmdFeatureMgr->action( "RicExportCompletionsForVisibleWellPathsFeature" ) );
|
||||
@ -1944,19 +1947,7 @@ void RiuMainWindow::slotCreateCommandObject()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::slotShowRegressionTestDialog()
|
||||
{
|
||||
RiaRegressionTest regTestConfig;
|
||||
regTestConfig.readSettingsFromApplicationStore();
|
||||
|
||||
caf::PdmUiPropertyViewDialog regressionTestDialog( this, ®TestConfig, "Regression Test", "" );
|
||||
regressionTestDialog.resize( QSize( 600, 350 ) );
|
||||
|
||||
if ( regressionTestDialog.exec() == QDialog::Accepted )
|
||||
{
|
||||
// Write preferences using QSettings and apply them to the application
|
||||
regTestConfig.writeSettingsToApplicationStore();
|
||||
|
||||
RiaRegressionTestRunner::instance()->executeRegressionTests();
|
||||
}
|
||||
RicLaunchRegressionTestDialogFeature::showRegressionTestDialog();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -551,7 +551,7 @@ void RiuPlotMainWindow::createDockPanels()
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::plotMainWindowMessagesName() );
|
||||
m_messagePanel = new RiuMessagePanel( dockWidget );
|
||||
dockWidget->setWidget( m_messagePanel );
|
||||
addDockWidget( Qt::BottomDockWidgetArea, dockWidget );
|
||||
splitDockWidget( rightTabbedWidgets.front(), dockWidget, Qt::Vertical );
|
||||
dockWidget->hide();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user