diff options
Diffstat (limited to 'src/gui_backend_local.c')
-rw-r--r-- | src/gui_backend_local.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gui_backend_local.c b/src/gui_backend_local.c index 5e65b3c1..41be3c33 100644 --- a/src/gui_backend_local.c +++ b/src/gui_backend_local.c @@ -90,7 +90,9 @@ static gboolean index_readable(GIOChannel *source, GIOCondition cond, } chomp(line); - if ( strstr(line, " images processed, ") != NULL ) { + if ( strncmp(line, "Final: ", 7) == 0 ) { + job->frac_complete = 1.0; + } else if ( strstr(line, " images processed, ") != NULL ) { int n_proc; sscanf(line, "%i ", &n_proc); job->frac_complete = (double)n_proc/job->n_frames; @@ -178,7 +180,8 @@ static void *run_indexing(char **filenames, free(job); return NULL; } - job->n_frames = job->n_frames; + job->n_frames = n_frames; + job->frac_complete = 0.0; strcpy(index_str, "--indexing=dirax"); /* FIXME */ @@ -263,6 +266,17 @@ static void *run_indexing(char **filenames, } +static int get_task_status(void *job_priv, + int *running, + float *frac_complete) +{ + struct local_job *job = job_priv; + *frac_complete = job->frac_complete; + *running = job->indexamajig_running; + return 0; +} + + static void cancel_task(void *job_priv) { struct local_job *job = job_priv; @@ -354,6 +368,7 @@ int make_local_backend(struct crystfel_backend *be) be->make_indexing_parameters_widget = make_indexing_parameters_widget; be->run_indexing = run_indexing; be->cancel_task = cancel_task; + be->task_status = get_task_status; be->indexing_opts_priv = make_default_local_opts(); if ( be->indexing_opts_priv == NULL ) return 1; be->write_indexing_opts = write_indexing_opts; |