diff options
author | Thomas White <taw@physics.org> | 2018-11-09 17:08:54 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-01-29 11:23:06 +0100 |
commit | e7d188319f92f72f193d43c2b0be445c46842718 (patch) | |
tree | 063d45b8cae1982c124b2de84e2c68dfba49cdd3 | |
parent | eed808506effc4b43d4a1686112bf2f71a61e1fc (diff) |
Add multi_event_geometry() function
-rw-r--r-- | libcrystfel/src/detector.c | 6 | ||||
-rw-r--r-- | libcrystfel/src/detector.h | 2 | ||||
-rw-r--r-- | src/dw-hdfsee.c | 3 | ||||
-rw-r--r-- | src/im-sandbox.c | 2 | ||||
-rw-r--r-- | src/list_events.c | 2 |
5 files changed, 11 insertions, 4 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c index b44f2d43..75d5bdb9 100644 --- a/libcrystfel/src/detector.c +++ b/libcrystfel/src/detector.c @@ -2301,3 +2301,9 @@ int single_panel_data_source(struct detector *det, const char *element) return 1; } + + +int multi_event_geometry(struct detector *det) +{ + return (det->path_dim != 0) || (det->dim_dim != 0); +} diff --git a/libcrystfel/src/detector.h b/libcrystfel/src/detector.h index cb0fc0c4..a7a4a01f 100644 --- a/libcrystfel/src/detector.h +++ b/libcrystfel/src/detector.h @@ -305,6 +305,8 @@ struct rg_collection *find_rigid_group_collection_by_name(struct detector *det, extern int detector_has_clen_references(struct detector *det); +extern int multi_event_geometry(struct detector *det); + #ifdef __cplusplus } #endif diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c index cb35c2f5..c4149cd4 100644 --- a/src/dw-hdfsee.c +++ b/src/dw-hdfsee.c @@ -3012,8 +3012,7 @@ DisplayWindow *displaywindow_open(char *filename, char *geom_filename, dw->multi_event = 0; } - if ( dw->image->det != NULL && ( dw->image->det->path_dim != 0 || - dw->image->det->dim_dim != 0 )) + if ( multi_event_geometry(dw->image->det) ) { struct hdfile *hdfile; diff --git a/src/im-sandbox.c b/src/im-sandbox.c index b73e4707..4c3314bf 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -295,7 +295,7 @@ static struct filename_plus_event *get_pattern(FILE *fh, int config_basename, fne = malloc(sizeof(struct filename_plus_event)); fne->filename = strdup(filename); - if ( det->path_dim !=0 || det->dim_dim !=0 ) { + if ( multi_event_geometry(gpctx->det) ) { fne->ev = copy_event(ev_list->events[event_index]); if ( event_index != ev_list->num_events-1 ) { event_index += 1; diff --git a/src/list_events.c b/src/list_events.c index c5f7ff9f..361ef40e 100644 --- a/src/list_events.c +++ b/src/list_events.c @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) return 1; } - if ( (det->path_dim == 0) && (det->dim_dim == 0) ) { + if ( !multi_event_geometry(det) ) { ERROR("This does not look like a multi-event geometry file.\n"); ERROR("Are you sure you need to use list_events instead of " "just 'find' or 'ls'?\n"); |