aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-03-31 09:31:59 +0200
committerThomas White <taw@physics.org>2020-07-29 18:42:57 +0200
commitc6632cec3bc17799d5d05fd750596f3283eb717b (patch)
treef17e6492d63a025d86bc5c493c1f1e1d956ed53b
parent799530870c75349fceed47b75120facb6a8345ec (diff)
Show actual percentage processed in progress bar
-rw-r--r--src/gui_backend_local.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui_backend_local.c b/src/gui_backend_local.c
index 00ba2037..8692d8f8 100644
--- a/src/gui_backend_local.c
+++ b/src/gui_backend_local.c
@@ -69,7 +69,6 @@ static gboolean index_readable(GIOChannel *source, GIOCondition cond,
struct crystfelproject *proj = vp;
struct local_backend_priv *priv = proj->backend_private;
gchar *line;
- double frac = 0.1;
check_zombies(priv);
@@ -83,10 +82,17 @@ static gboolean index_readable(GIOChannel *source, GIOCondition cond,
return FALSE;
}
chomp(line);
- STATUS("Got line '%s'\n", line);
- gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(proj->progressbar),
- frac);
+ if ( strstr(line, " images processed, ") != NULL ) {
+ double frac;
+ int n_proc;
+ sscanf(line, "%i ", &n_proc);
+ frac = (double)n_proc/proj->n_frames;
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(proj->progressbar),
+ frac);
+ } else {
+ STATUS("%s\n", line);
+ }
g_free(line);