Skip to content

Commit

Permalink
Added help option in the tui
Browse files Browse the repository at this point in the history
git-svn-id: http://ert.nr.no/repos/ert@4119 ecb61f28-d21e-0410-a4b6-a828cfe0ca3a
  • Loading branch information
myrseth committed Oct 17, 2012
1 parent 0824223 commit f0be037
Show file tree
Hide file tree
Showing 11 changed files with 263 additions and 12 deletions.
2 changes: 1 addition & 1 deletion devel/libenkf/applications/ert_tui/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ tui_objects = env.Object( ["enkf_tui_main.c" , "enkf_tui_fs.c" ,
"enkf_tui_plot_util.c" , "enkf_tui_run.c",
"enkf_tui_util.c" , "enkf_tui_init.c" ,
"enkf_tui_export.c" , "enkf_tui_analysis.c" ,
"enkf_tui_QC.c"])
"enkf_tui_QC.c" , "enkf_tui_help.c"])

define_fmt = "\'%s=\"%s\"\'"
main_object = env.Object("main.c" , CPPDEFINES = "DEVEL_VERSION")
Expand Down
3 changes: 2 additions & 1 deletion devel/libenkf/applications/ert_tui/enkf_tui_export.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <msg.h>
#include <gen_data.h>
#include <gen_data_config.h>

#include <enkf_tui_help.h>
#define PROMPT_LEN 60


Expand Down Expand Up @@ -780,6 +780,7 @@ void enkf_tui_export_menu(void * arg) {
menu_add_item(menu , "Export GEN_DATA/GEN_PARAM to file" , "dD" , enkf_tui_export_gen_data , enkf_main , NULL);
menu_add_separator( menu );
menu_add_item(menu , "EclWrite mean and std" , "mM" , enkf_tui_export_stat , enkf_main , NULL );
menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_export , enkf_main , NULL );
menu_run(menu);
menu_free(menu);
}
4 changes: 2 additions & 2 deletions devel/libenkf/applications/ert_tui/enkf_tui_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <enkf_types.h>
#include <enkf_fs.h>
#include <ranking_table.h>

#include <enkf_tui_help.h>

void enkf_tui_fs_ls_case(void * arg) {
enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
Expand Down Expand Up @@ -414,7 +414,7 @@ void enkf_tui_fs_menu(void * arg) {
/* Are these two in use??? */
menu_add_item(menu, "Copy full ensemble to another case", "eE", enkf_tui_fs_copy_ensemble, enkf_main, NULL);
menu_add_item(menu, "Copy ensemble of parameters to another case", "oO", enkf_tui_fs_copy_ensemble_of_parameters, enkf_main, NULL);

menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_cases , enkf_main , NULL);

menu_run(menu);
menu_free(menu);
Expand Down
213 changes: 213 additions & 0 deletions devel/libenkf/applications/ert_tui/enkf_tui_help.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
/*
Copyright (C) 2012 Statoil ASA, Norway.
The file 'enkf_tui_QC.c' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <util.h>
#include <ctype.h>
#include <menu.h>
#include <enkf_tui_run.h>
#include <enkf_tui_export.h>
#include <enkf_tui_plot.h>
#include <enkf_tui_table.h>
#include <enkf_tui_fs.h>
#include <enkf_tui_ranking.h>
#include <enkf_tui_QC.h>
#include <enkf_tui_help.h>
#include <enkf_tui_misc.h>
#include <enkf_main.h>
#include <enkf_sched.h>


void enkf_tui_help_manual_main( void * arg) {
system("firefox http://ert.nr.no/index.php/User_Manual &");
}

void enkf_tui_help_menu_main(void * arg) {

enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
plot_config_type * plot_config = enkf_main_get_plot_config( enkf_main );
{
const char * plot_path = plot_config_get_path( plot_config );
util_make_path( plot_path );
}

{
menu_type * menu = menu_alloc("Help: Main menu" , "Back" , "bB");
menu_add_helptext(menu , "Choose the different options from the main menu to read more about the different options.");
menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_main , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
}

void enkf_tui_help_manual_cases( void * arg) {
system("firefox http://ert.nr.no/index.php/User_Manual#Manage_cases &");
}

void enkf_tui_help_menu_cases(void * arg) {

enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
plot_config_type * plot_config = enkf_main_get_plot_config( enkf_main );
{
const char * plot_path = plot_config_get_path( plot_config );
util_make_path( plot_path );
}

{
menu_type * menu = menu_alloc("Help: Manage cases" , "Back" , "bB");
menu_add_helptext(menu , "Use this menu to navgate between cases and to initialize cases. A case has to be initialized before it can be used.");
menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_cases , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
}

void enkf_tui_help_manual_run( void * arg) {
system("firefox http://ert.nr.no/index.php/User_Manual#Run_or_restart_experiment &");
}

void enkf_tui_help_menu_run(void * arg) {

enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
plot_config_type * plot_config = enkf_main_get_plot_config( enkf_main );
{
const char * plot_path = plot_config_get_path( plot_config );
util_make_path( plot_path );
}

{
menu_type * menu = menu_alloc("Help: Run menu" , "Back" , "bB");
menu_add_helptext(menu , "This menu is used to do the main work in ERT. The first option, x: Ensemble run: history, will just run the case without any data conditioning. Options r and s will initiate classical enkf runs. The two options i and t invokes the ensemble kalman smoother.");
menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_run , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
}

void enkf_tui_help_manual_plot( void * arg) {
system("firefox http://ert.nr.no/index.php/User_Manual#Plot_Results &");
}

void enkf_tui_help_menu_plot(void * arg) {

enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
plot_config_type * plot_config = enkf_main_get_plot_config( enkf_main );
{
const char * plot_path = plot_config_get_path( plot_config );
util_make_path( plot_path );
}

{
menu_type * menu = menu_alloc("Help: Plot results" , "Back" , "bB");
menu_add_helptext(menu , "Use this option to plot results after the case has been run.");
menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_plot , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
}

void enkf_tui_help_manual_rank( void * arg) {
system("firefox http://ert.nr.no/index.php/User_Manual#Rank_Results &");
}

void enkf_tui_help_menu_rank(void * arg) {

enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
plot_config_type * plot_config = enkf_main_get_plot_config( enkf_main );
{
const char * plot_path = plot_config_get_path( plot_config );
util_make_path( plot_path );
}

{
menu_type * menu = menu_alloc("Help: Rank results" , "Back" , "bB");
menu_add_helptext(menu , "Use this option to rank results after the case has been run.");
menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_rank , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
}

void enkf_tui_help_manual_export( void * arg) {
system("firefox http://ert.nr.no/index.php/User_Manual#Export_data_to_other_formats &");
}

void enkf_tui_help_menu_export(void * arg) {

enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
plot_config_type * plot_config = enkf_main_get_plot_config( enkf_main );
{
const char * plot_path = plot_config_get_path( plot_config );
util_make_path( plot_path );
}

{
menu_type * menu = menu_alloc("Help: Export results" , "Back" , "bB");
menu_add_helptext(menu , "Use this option to export results after the case has been run.");
menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_export , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
}

void enkf_tui_help_manual_table( void * arg) {
system("firefox http://ert.nr.no/index.php/User_Manual#Table_of_results &");
}

void enkf_tui_help_menu_table(void * arg) {

enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
plot_config_type * plot_config = enkf_main_get_plot_config( enkf_main );
{
const char * plot_path = plot_config_get_path( plot_config );
util_make_path( plot_path );
}

{
menu_type * menu = menu_alloc("Help: Table of results" , "Back" , "bB");
menu_add_helptext(menu , "This option can generate a table of results after the case has been run.");
menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_table , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
}

void enkf_tui_help_manual_misc( void * arg) {
system("firefox http://ert.nr.no/index.php/User_Manual#Table_of_results &");
}

void enkf_tui_help_menu_misc(void * arg) {

enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
plot_config_type * plot_config = enkf_main_get_plot_config( enkf_main );
{
const char * plot_path = plot_config_get_path( plot_config );
util_make_path( plot_path );
}

{
menu_type * menu = menu_alloc("Help: Miscellanous" , "Back" , "bB");
menu_add_helptext(menu , "This option contains miscellaneous options.");
menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_misc , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
}

32 changes: 32 additions & 0 deletions devel/libenkf/applications/ert_tui/enkf_tui_help.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Copyright (C) 2012 Statoil ASA, Norway.
The file 'enkf_tui_QC.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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.
*/

#ifndef __ENKF_TUI_HELP_H__
#define __ENKF_TUI_HELP_H__



void enkf_tui_help_menu_main(void * );
void enkf_tui_help_menu_cases(void * );
void enkf_tui_help_menu_run(void * );
void enkf_tui_help_menu_plot(void * );
void enkf_tui_help_menu_rank(void * );
void enkf_tui_help_menu_export(void * );
void enkf_tui_help_menu_table(void * );
void enkf_tui_help_menu_misc(void * );
#endif
3 changes: 2 additions & 1 deletion devel/libenkf/applications/ert_tui/enkf_tui_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <enkf_tui_fs.h>
#include <enkf_tui_ranking.h>
#include <enkf_tui_QC.h>
#include <enkf_tui_help.h>
#include <enkf_tui_misc.h>
#include <enkf_main.h>
#include <enkf_sched.h>
Expand Down Expand Up @@ -61,7 +62,7 @@ void enkf_tui_main_menu(enkf_main_type * enkf_main) {
menu_add_item(menu , "Export data to other formats" , "eE" , enkf_tui_export_menu , enkf_main , NULL);
menu_add_item(menu , "Table of results" , "tT" , enkf_tui_table_menu , enkf_main , NULL);
menu_add_item(menu , "Miscellanous" , "mM" , enkf_tui_misc_menu , enkf_main , NULL);

menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_main , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
Expand Down
3 changes: 2 additions & 1 deletion devel/libenkf/applications/ert_tui/enkf_tui_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <enkf_tui_misc.h>
#include <ext_joblist.h>
#include <ext_job.h>

#include <enkf_tui_help.h>

static void enkf_tui_misc_printf_subst_list(void * arg) {
enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
Expand Down Expand Up @@ -68,6 +68,7 @@ void enkf_tui_misc_menu( void * arg) {
menu_type * menu = menu_alloc( "Misceallanous stuff" , "Back" , "bB");
menu_add_item(menu , "List all \'magic\' <...> strings" , "lL" , enkf_tui_misc_printf_subst_list , enkf_main , NULL);
menu_add_item(menu , "List all available forward model jobs","jJ" , enkf_tui_misc_list_jobs , enkf_main , NULL );
menu_add_item(menu , "Help","hH" , enkf_tui_help_menu_misc , enkf_main , NULL );
menu_run(menu);
menu_free(menu);
}
6 changes: 3 additions & 3 deletions devel/libenkf/applications/ert_tui/enkf_tui_plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#include <enkf_tui_plot_util.h>
#include <enkf_tui_plot.h>
#include <enkf_tui_fs.h>

#include <enkf_tui_help.h>
/**
The final plot path consists of three parts:
Expand Down Expand Up @@ -1170,7 +1170,7 @@ void enkf_tui_plot_menu(void * arg) {
menu_add_item(menu , "Plot all block observations (~RFT) versus depth" , "rR" , enkf_tui_plot_all_RFT , enkf_main , NULL);
menu_add_separator( menu );
menu_add_item(menu , "Sensitivity plot" , "sS" , enkf_tui_plot_sensitivity , enkf_main , NULL);
menu_add_item(menu , "Histogram" , "hH" , enkf_tui_plot_histogram , enkf_main , NULL);
menu_add_item(menu , "Histogram" , "H" , enkf_tui_plot_histogram , enkf_main , NULL);
menu_add_separator(menu);
{
menu_item_type * menu_item;
Expand All @@ -1191,7 +1191,7 @@ void enkf_tui_plot_menu(void * arg) {
menu_item_disable( menu_item );

}

menu_add_item(menu , "Help" , "h" , enkf_tui_help_menu_plot , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
Expand Down
3 changes: 2 additions & 1 deletion devel/libenkf/applications/ert_tui/enkf_tui_ranking.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <enkf_tui_util.h>
#include <ranking_table.h>
#include <misfit_ensemble.h>

#include <enkf_tui_help.h>

static void enkf_tui_ranking_make_misfit_ensemble( void * arg) {
arg_pack_type * arg_pack = arg_pack_safe_cast( arg );
Expand Down Expand Up @@ -202,6 +202,7 @@ void enkf_tui_ranking_menu(void * arg) {
if (!misfit_ensemble_initialized( misfit_ensemble ))
menu_item_disable( obs_item );
}
menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_rank , enkf_main , NULL);
menu_run(menu);
menu_free(menu);
}
Expand Down
3 changes: 2 additions & 1 deletion devel/libenkf/applications/ert_tui/enkf_tui_run.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <enkf_tui_analysis.h>
#include <ert_tui_const.h>
#include <ecl_config.h>

#include <enkf_tui_help.h>

/*
Set runpath runtime - disabled.
Expand Down Expand Up @@ -375,6 +375,7 @@ void enkf_tui_run_menu(void * arg) {
free(runpath_label);
}
*/
menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_run , enkf_main , NULL);
menu_run(menu);
menu_free(menu);

Expand Down
Loading

0 comments on commit f0be037

Please sign in to comment.