From f0be03732ccb03f0281be4f2a9888e6edac19533 Mon Sep 17 00:00:00 2001 From: myrseth Date: Wed, 17 Oct 2012 11:36:17 +0000 Subject: [PATCH] Added help option in the tui git-svn-id: http://ert.nr.no/repos/ert@4119 ecb61f28-d21e-0410-a4b6-a828cfe0ca3a --- devel/libenkf/applications/ert_tui/SConstruct | 2 +- .../applications/ert_tui/enkf_tui_export.c | 3 +- .../applications/ert_tui/enkf_tui_fs.c | 4 +- .../applications/ert_tui/enkf_tui_help.c | 213 ++++++++++++++++++ .../applications/ert_tui/enkf_tui_help.h | 32 +++ .../applications/ert_tui/enkf_tui_main.c | 3 +- .../applications/ert_tui/enkf_tui_misc.c | 3 +- .../applications/ert_tui/enkf_tui_plot.c | 6 +- .../applications/ert_tui/enkf_tui_ranking.c | 3 +- .../applications/ert_tui/enkf_tui_run.c | 3 +- .../applications/ert_tui/enkf_tui_table.c | 3 +- 11 files changed, 263 insertions(+), 12 deletions(-) create mode 100644 devel/libenkf/applications/ert_tui/enkf_tui_help.c create mode 100644 devel/libenkf/applications/ert_tui/enkf_tui_help.h diff --git a/devel/libenkf/applications/ert_tui/SConstruct b/devel/libenkf/applications/ert_tui/SConstruct index 16abc6dcfe9..dd21fc19484 100644 --- a/devel/libenkf/applications/ert_tui/SConstruct +++ b/devel/libenkf/applications/ert_tui/SConstruct @@ -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") diff --git a/devel/libenkf/applications/ert_tui/enkf_tui_export.c b/devel/libenkf/applications/ert_tui/enkf_tui_export.c index ce3b89fa907..f90624d7bc3 100644 --- a/devel/libenkf/applications/ert_tui/enkf_tui_export.c +++ b/devel/libenkf/applications/ert_tui/enkf_tui_export.c @@ -34,7 +34,7 @@ #include #include #include - +#include #define PROMPT_LEN 60 @@ -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); } diff --git a/devel/libenkf/applications/ert_tui/enkf_tui_fs.c b/devel/libenkf/applications/ert_tui/enkf_tui_fs.c index 82501404e33..13c4436f20d 100644 --- a/devel/libenkf/applications/ert_tui/enkf_tui_fs.c +++ b/devel/libenkf/applications/ert_tui/enkf_tui_fs.c @@ -30,7 +30,7 @@ #include #include #include - +#include void enkf_tui_fs_ls_case(void * arg) { enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); @@ -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); diff --git a/devel/libenkf/applications/ert_tui/enkf_tui_help.c b/devel/libenkf/applications/ert_tui/enkf_tui_help.c new file mode 100644 index 00000000000..7eec4933875 --- /dev/null +++ b/devel/libenkf/applications/ert_tui/enkf_tui_help.c @@ -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 + for more details. +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +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); + } +} + diff --git a/devel/libenkf/applications/ert_tui/enkf_tui_help.h b/devel/libenkf/applications/ert_tui/enkf_tui_help.h new file mode 100644 index 00000000000..80bd0d9656e --- /dev/null +++ b/devel/libenkf/applications/ert_tui/enkf_tui_help.h @@ -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 + 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 diff --git a/devel/libenkf/applications/ert_tui/enkf_tui_main.c b/devel/libenkf/applications/ert_tui/enkf_tui_main.c index 7fa634c6049..72095f12a3d 100644 --- a/devel/libenkf/applications/ert_tui/enkf_tui_main.c +++ b/devel/libenkf/applications/ert_tui/enkf_tui_main.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -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); } diff --git a/devel/libenkf/applications/ert_tui/enkf_tui_misc.c b/devel/libenkf/applications/ert_tui/enkf_tui_misc.c index 897d87399cb..f5db84740f0 100644 --- a/devel/libenkf/applications/ert_tui/enkf_tui_misc.c +++ b/devel/libenkf/applications/ert_tui/enkf_tui_misc.c @@ -24,7 +24,7 @@ #include #include #include - +#include static void enkf_tui_misc_printf_subst_list(void * arg) { enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); @@ -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); } diff --git a/devel/libenkf/applications/ert_tui/enkf_tui_plot.c b/devel/libenkf/applications/ert_tui/enkf_tui_plot.c index 8cf425d74e4..c10af93be18 100644 --- a/devel/libenkf/applications/ert_tui/enkf_tui_plot.c +++ b/devel/libenkf/applications/ert_tui/enkf_tui_plot.c @@ -62,7 +62,7 @@ #include #include #include - +#include /** The final plot path consists of three parts: @@ -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; @@ -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); } diff --git a/devel/libenkf/applications/ert_tui/enkf_tui_ranking.c b/devel/libenkf/applications/ert_tui/enkf_tui_ranking.c index a5055eadb93..87b423e0ade 100644 --- a/devel/libenkf/applications/ert_tui/enkf_tui_ranking.c +++ b/devel/libenkf/applications/ert_tui/enkf_tui_ranking.c @@ -29,7 +29,7 @@ #include #include #include - +#include static void enkf_tui_ranking_make_misfit_ensemble( void * arg) { arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); @@ -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); } diff --git a/devel/libenkf/applications/ert_tui/enkf_tui_run.c b/devel/libenkf/applications/ert_tui/enkf_tui_run.c index c83e12d0c66..62d68c4eeef 100644 --- a/devel/libenkf/applications/ert_tui/enkf_tui_run.c +++ b/devel/libenkf/applications/ert_tui/enkf_tui_run.c @@ -38,7 +38,7 @@ #include #include #include - +#include /* Set runpath runtime - disabled. @@ -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); diff --git a/devel/libenkf/applications/ert_tui/enkf_tui_table.c b/devel/libenkf/applications/ert_tui/enkf_tui_table.c index e48356c8ec9..f5b4bbc2711 100644 --- a/devel/libenkf/applications/ert_tui/enkf_tui_table.c +++ b/devel/libenkf/applications/ert_tui/enkf_tui_table.c @@ -37,7 +37,7 @@ #include #include #include - +#include @@ -243,6 +243,7 @@ void enkf_tui_table_menu(void * arg) { menu_add_item(menu , "Ensemble of parameters" , "eE" , enkf_tui_table_ensemble , enkf_main , NULL); menu_add_item(menu , "GEN_KW ensemble" , "gG" , enkf_tui_table_GEN_KW_ensemble , enkf_main , NULL); menu_add_item(menu , "Time development of parameters" , "tT" , enkf_tui_table_time , enkf_main , NULL); + menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_table , enkf_main , NULL); menu_run(menu); menu_free(menu); }