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:
@@ -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 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotBook::keepCurrentPageAfterUpdate()
|
||||
{
|
||||
m_goToPageAfterUpdate = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -69,6 +69,7 @@ public:
|
||||
|
||||
void setTitleVisible( bool visible );
|
||||
void setSubTitlesVisible( bool visible );
|
||||
void scheduleTitleUpdate();
|
||||
|
||||
void setTitleFontSizes( int titleFontSize, int subTitleFontSize );
|
||||
void setLegendFontSize( int legendFontSize );
|
||||
@@ -90,6 +91,8 @@ public:
|
||||
void goToPrevPage();
|
||||
void goToLastPage();
|
||||
|
||||
void keepCurrentPageAfterUpdate();
|
||||
|
||||
protected:
|
||||
void contextMenuEvent( QContextMenuEvent* ) override;
|
||||
|
||||
|
||||
@@ -573,14 +573,17 @@ void RiuMultiPlotPage::performUpdate( RiaDefines::MultiPlotPageUpdateType whatTo
|
||||
|
||||
reinsertPlotWidgets();
|
||||
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_multiPlotToolBarEditor->clear();
|
||||
m_multiPlotLayoutToolBarEditor->clear();
|
||||
|
||||
setWindowTitle( "Plots - ResInsight" );
|
||||
}
|
||||
@@ -431,6 +432,9 @@ void RiuPlotMainWindow::createToolBars()
|
||||
m_multiPlotToolBarEditor = std::make_unique<caf::PdmUiToolBarEditor>( "Multi Plot", this );
|
||||
m_multiPlotToolBarEditor->hide();
|
||||
|
||||
m_multiPlotLayoutToolBarEditor = std::make_unique<caf::PdmUiToolBarEditor>( "Multi Plot Layout", this );
|
||||
m_multiPlotLayoutToolBarEditor->hide();
|
||||
|
||||
if ( RiaPreferences::current()->useUndoRedo() )
|
||||
{
|
||||
QToolBar* toolbar = addToolBar( tr( "Edit" ) );
|
||||
@@ -689,14 +693,29 @@ void RiuPlotMainWindow::updateMultiPlotToolBar()
|
||||
{
|
||||
std::vector<caf::PdmFieldHandle*> toolBarFields = plotWindow->fieldsToShowInToolbar();
|
||||
|
||||
m_multiPlotToolBarEditor->setFields( toolBarFields );
|
||||
m_multiPlotToolBarEditor->updateUi();
|
||||
m_multiPlotToolBarEditor->show();
|
||||
if ( toolBarFields.empty() )
|
||||
{
|
||||
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
|
||||
{
|
||||
m_multiPlotToolBarEditor->clear();
|
||||
m_multiPlotToolBarEditor->hide();
|
||||
m_multiPlotLayoutToolBarEditor->clear();
|
||||
m_multiPlotLayoutToolBarEditor->hide();
|
||||
}
|
||||
refreshToolbars();
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ private:
|
||||
|
||||
std::unique_ptr<caf::PdmUiToolBarEditor> m_wellLogPlotToolBarEditor;
|
||||
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_summaryPlotManagerView;
|
||||
|
||||
@@ -67,14 +67,21 @@ RiuSummaryQuantityNameInfoProvider::RiuSummaryQuantityInfo
|
||||
{
|
||||
// Check for custom vector naming
|
||||
|
||||
std::string postfix = quantity.substr( quantity.size() - 5, 5 );
|
||||
std::string baseName = quantity.substr( 0, 5 );
|
||||
while ( baseName.back() == '_' )
|
||||
baseName.pop_back();
|
||||
|
||||
bool isDifference = ( postfix == "_DIFF" );
|
||||
|
||||
it = m_summaryToDescMap.find( baseName );
|
||||
|
||||
if ( it != m_summaryToDescMap.end() )
|
||||
{
|
||||
if ( isDifference )
|
||||
{
|
||||
return RiuSummaryQuantityInfo( it->second.category, it->second.longName + " Difference" );
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user