From 411f09b4a77566c539df6ef163e54544e792d0ed Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Mon, 5 Sep 2016 21:46:59 +0000 Subject: [PATCH] experimental: only show the last step if we have more than 2 steps (to avoid always showing the imaginary part for complex fields) --- Common/DefaultOptions.h | 3 ++- Common/OpenFile.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 625373c51f..def30ad324 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -1309,7 +1309,8 @@ StringXNumber SolverOptions_Number[] = { { F|O, "AutoShowViews" , opt_solver_auto_show_views , 2. , "Automcatically show newly merged results (0: none; 1: all; 2: last one)" }, { F|O, "AutoShowLastStep" , opt_solver_auto_show_last_step , 1. , - "Automatically show the last time step in newly merged results" }, + "Automatically show the last step in newly merged results, if there are " + "more than 2 steps" }, { F|O, "Plugins" , opt_solver_plugins , 0. , "Enable default solver plugins?" }, diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index 2cd5177246..80360803c3 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -616,12 +616,13 @@ int MergePostProcessingFile(const std::string &fileName, int showViews, } } - // if we added steps, go to the last one + // if we added steps, and we have more than 2 (to avoid always showing the + // imaginary part for complex fields), go to the last one if(showLastStep){ steps.resize(PView::list.size(), 0); for(unsigned int i = 0; i < PView::list.size(); i++){ int step = (int)opt_view_nb_timestep(i, GMSH_GET, 0); - if(step > steps[i]) + if(step > steps[i] && steps[i] > 1) opt_view_timestep(i, GMSH_SET|GMSH_GUI, step - 1); } } -- GitLab