aboutsummaryrefslogtreecommitdiff
path: root/src/gui_project.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-03-04 13:58:42 +0100
committerThomas White <taw@physics.org>2022-03-04 13:58:42 +0100
commit1deed95e55c5a45d4887bb53a83976e4ead78bcb (patch)
tree98900bf5f5173985f9fc244783651678bf4aa124 /src/gui_project.c
parent634ac34f8ffde1d3991751230c57eba70529f005 (diff)
GUI: Fix stream rescan logic
Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/64
Diffstat (limited to 'src/gui_project.c')
-rw-r--r--src/gui_project.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui_project.c b/src/gui_project.c
index 16b8b8fc..59f9852a 100644
--- a/src/gui_project.c
+++ b/src/gui_project.c
@@ -1207,7 +1207,6 @@ int default_project(struct crystfelproject *proj)
proj->merging_opts = NULL;
proj->ambi_opts = NULL;
proj->tasks = NULL;
- proj->scanned_since_last_job_finished = 0;
proj->indexing_new_job_title = NULL;
proj->merging_new_job_title = NULL;
proj->ambi_new_job_title = NULL;
@@ -1362,6 +1361,7 @@ int add_indexing_result(struct crystfelproject *proj,
new_results[proj->n_results].name = strdup(name);
new_results[proj->n_results].streams = malloc(n_streams*sizeof(char *));
new_results[proj->n_results].n_streams = n_streams;
+ new_results[proj->n_results].need_rescan = 0;
new_results[proj->n_results].indices = malloc(n_streams*sizeof(StreamIndex *));
for ( i=0; i<n_streams; i++ ) {
@@ -1461,6 +1461,11 @@ struct image *find_indexed_image(struct crystfelproject *proj,
result = find_indexing_result_by_name(proj, results_name);
if ( result == NULL ) return NULL;
+ if ( !ever_scanned(result) ) {
+ update_result_index(result);
+ result->need_rescan = 0;
+ }
+
for ( i=0; i<result->n_streams; i++ ) {
if ( stream_select_chunk(NULL,
result->indices[i],
@@ -1472,9 +1477,10 @@ struct image *find_indexed_image(struct crystfelproject *proj,
}
}
- if ( !found && (permit_rescan || !ever_scanned(result)) ) {
+ if ( !found && (result->need_rescan || permit_rescan) ) {
/* Re-scan and try again */
update_result_index(result);
+ result->need_rescan = 0;
for ( i=0; i<result->n_streams; i++ ) {
if ( stream_select_chunk(NULL,
result->indices[i],