#4793 Summary Plot Templates : Help accessible from About menu

This commit is contained in:
Magne Sjaastad
2019-09-27 15:15:09 +02:00
parent 856596c366
commit 1ab58449bd
6 changed files with 94 additions and 33 deletions

View File

@@ -18,6 +18,8 @@
#include "RicHelpFeatures.h"
#include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h"
#include "RiaApplication.h"
#include "RiaBaseDefs.h"
#include "RiaVersionInfo.h"
@@ -35,6 +37,7 @@
CAF_CMD_SOURCE_INIT( RicHelpAboutFeature, "RicHelpAboutFeature" );
CAF_CMD_SOURCE_INIT( RicHelpCommandLineFeature, "RicHelpCommandLineFeature" );
CAF_CMD_SOURCE_INIT( RicHelpSummaryCommandLineFeature, "RicHelpSummaryCommandLineFeature" );
CAF_CMD_SOURCE_INIT( RicHelpOpenUsersGuideFeature, "RicHelpOpenUsersGuideFeature" );
//--------------------------------------------------------------------------------------------------
@@ -205,6 +208,34 @@ void RicHelpCommandLineFeature::setupActionLook( QAction* actionToSetup )
actionToSetup->setText( "&Command Line Help" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicHelpSummaryCommandLineFeature::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHelpSummaryCommandLineFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
QString text = RicSummaryPlotFeatureImpl::summaryPlotCommandLineHelpText();
app->showFormattedTextInMessageBoxOrConsole( text );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHelpSummaryCommandLineFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "&Summary Command Line Help" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -48,6 +48,20 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
};
//==================================================================================================
///
//==================================================================================================
class RicHelpSummaryCommandLineFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};
//==================================================================================================
///
//==================================================================================================

View File

@@ -283,32 +283,9 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
{
if ( arguments[optionIdx] == "-help" )
{
// clang-format off
RiaApplication::instance()->showFormattedTextInMessageBoxOrConsole(
"The --summaryplot option has the following syntax:\n"
"\n"
"[<plotOptions>] <eclipsesummaryvectorfilters> [<eclipsedatafiles>]\n"
"\n"
"It Creates one summary plot for each of the the summary vectors matched by the "
"<eclipsesummaryvectorfilters> using all the <eclipsedatafiles> in each plot.\n"
"The <eclipsesummaryvectorfilters> has the syntax <vectorname>[:<item>[:<subitem>[:i,j,k]]] and can be repeated.\n"
"Wildcards can also be used, eg. \"WOPT:*\" to select the total oil production from all the wells.\n"
"3D Grid properties from restart files can also be requested in the form <propertyname>:i,i,k.\n"
"The <eclipsedatafiles> can be written with or without extension.\n"
"As long as only summary vectors are requested, only the corresponding SMSPEC file will be opened for each case.\n"
"If a grid property is requested, however (eg. SOIL:20,21,1) the corresponding EGRID and restart data will be loaded as well.\n"
"\n"
"The summary plot options are: \n"
" -help\t Show this help text and ignore the rest of the options.\n"
" -h\t Include history vectors. Will be read from the summary file if the vectors exist.\n"
" \t Only history vectors from the first summary case in the project will be included.\n"
" -nl\t Omit legend in plot.\n"
" -s\t Create only one plot including all the defined vectors and cases.\n"
" -n\t Scale all curves into the range 0.0-1.0. Useful when using -s.\n"
" -e\t Import all the cases as an ensemble, and create ensemble curves sets instead of single curves.\n"
" -c <parametername>\t Same as -e, but colors the curves by the ensemble parameter <parametername> . \n"
" -cl <parametername>\t Same as -c, but uses logarithmic legend.\n" );
// clang-format on
QString text = RicSummaryPlotFeatureImpl::summaryPlotCommandLineHelpText();
RiaApplication::instance()->showFormattedTextInMessageBoxOrConsole( text );
return;
}
@@ -418,7 +395,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
if ( summaryAddressFilters.size() )
{
RimSummaryCaseCollection* ensemble = nullptr;
RimSummaryCaseCollection* ensemble = nullptr;
if ( isEnsembleMode )
{
@@ -680,9 +657,9 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
RiuPlotMainWindow* mpw = RiaGuiApplication::instance()->mainPlotWindow();
// Needed to avoid unneccessary activation of sub windows (plots)
// which results in population of property editor, and missing deleteLater because we are outside any event loop
// when switching object. Results in stray widgets.
mpw->setBlockSlotSubWindowActivated( true );
// which results in population of property editor, and missing deleteLater because we are outside any event
// loop when switching object. Results in stray widgets.
mpw->setBlockSlotSubWindowActivated( true );
RiuPlotMainWindowTools::showPlotMainWindow();
mpw->setBlockSlotSubWindowActivated( false );
RiuPlotMainWindowTools::setExpanded( lastPlotCreated );
@@ -845,3 +822,38 @@ void RicSummaryPlotFeatureImpl::filteredSummaryAdressesFromCase(
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RicSummaryPlotFeatureImpl::summaryPlotCommandLineHelpText()
{
// clang-format off
QString txt =
"The --summaryplot option has the following syntax:\n"
"\n"
"[<plotOptions>] <eclipsesummaryvectorfilters> [<eclipsedatafiles>]\n"
"\n"
"It creates one summary plot for each of the the summary vectors matched by the "
"<eclipsesummaryvectorfilters> using all the <eclipsedatafiles> in each plot.\n"
"The <eclipsesummaryvectorfilters> has the syntax <vectorname>[:<item>[:<subitem>[:i,j,k]]] and can be repeated.\n"
"Wildcards can also be used, eg. \"WOPT:*\" to select the total oil production from all the wells.\n"
"3D Grid properties from restart files can also be requested in the form <propertyname>:i,i,k.\n"
"The <eclipsedatafiles> can be written with or without extension.\n"
"As long as only summary vectors are requested, only the corresponding SMSPEC file will be opened for each case.\n"
"If a grid property is requested, however (eg. SOIL:20,21,1) the corresponding EGRID and restart data will be loaded as well.\n"
"\n"
"The summary plot options are: \n"
" -help\t Show this help text and ignore the rest of the options.\n"
" -h\t Include history vectors. Will be read from the summary file if the vectors exist.\n"
" \t Only history vectors from the first summary case in the project will be included.\n"
" -nl\t Omit legend in plot.\n"
" -s\t Create only one plot including all the defined vectors and cases.\n"
" -n\t Scale all curves into the range 0.0-1.0. Useful when using -s.\n"
" -e\t Import all the cases as an ensemble, and create ensemble curves sets instead of single curves.\n"
" -c <parametername>\t Same as -e, but colors the curves by the ensemble parameter <parametername> . \n"
" -cl <parametername>\t Same as -c, but uses logarithmic legend.\n";
// clang-format on
return txt;
}

View File

@@ -44,6 +44,8 @@ public:
std::set<RifEclipseSummaryAddress>* setToInsertFilteredAddressesIn,
std::vector<bool>* usedFilters );
static QString summaryPlotCommandLineHelpText();
private:
static std::vector<RimSummaryCurve*> addCurvesFromAddressFiltersToPlot( const QStringList& curveFilters,
RimSummaryPlot* plot,

View File

@@ -535,6 +535,7 @@ void RiuMainWindow::createMenus()
QMenu* helpMenu = menuBar()->addMenu( "&Help" );
helpMenu->addAction( cmdFeatureMgr->action( "RicHelpAboutFeature" ) );
helpMenu->addAction( cmdFeatureMgr->action( "RicHelpCommandLineFeature" ) );
helpMenu->addAction( cmdFeatureMgr->action( "RicHelpSummaryCommandLineFeature" ) );
helpMenu->addSeparator();
helpMenu->addAction( cmdFeatureMgr->action( "RicHelpOpenUsersGuideFeature" ) );
}
@@ -1456,9 +1457,9 @@ void RiuMainWindow::selectedObjectsChanged()
// Set focus in MDI area to this window if it exists
if ( selectedReservoirView->viewer() )
{
setBlockSlotSubWindowActivated(true);
setActiveViewer(selectedReservoirView->viewer()->layoutWidget());
setBlockSlotSubWindowActivated(false);
setBlockSlotSubWindowActivated( true );
setActiveViewer( selectedReservoirView->viewer()->layoutWidget() );
setBlockSlotSubWindowActivated( false );
isActiveViewChanged = true;
}

View File

@@ -293,6 +293,7 @@ void RiuPlotMainWindow::createMenus()
QMenu* helpMenu = menuBar()->addMenu( "&Help" );
helpMenu->addAction( cmdFeatureMgr->action( "RicHelpAboutFeature" ) );
helpMenu->addAction( cmdFeatureMgr->action( "RicHelpCommandLineFeature" ) );
helpMenu->addAction( cmdFeatureMgr->action( "RicHelpSummaryCommandLineFeature" ) );
helpMenu->addSeparator();
helpMenu->addAction( cmdFeatureMgr->action( "RicHelpOpenUsersGuideFeature" ) );
}