diff options
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/detgeom.c | 25 | ||||
-rw-r--r-- | libcrystfel/src/detgeom.h | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/libcrystfel/src/detgeom.c b/libcrystfel/src/detgeom.c index bd98aed2..7f458343 100644 --- a/libcrystfel/src/detgeom.c +++ b/libcrystfel/src/detgeom.c @@ -186,3 +186,28 @@ struct detgeom_panel *detgeom_find_panel(struct detgeom *dg, const char *name) } return NULL; } + + +static void detgeom_show_group(const struct detgeom_panel_group *group, int level) +{ + int i; + + for ( i=0; i<level; i++ ) STATUS(" "); + + if ( group == NULL ) { + STATUS("!!!\n"); + return; + } + + STATUS("%s\n", group->name); + + for ( i=0; i<group->n_children; i++ ) { + detgeom_show_group(group->children[i], level+1); + } +} + + +void detgeom_show_hierarchy(const struct detgeom *dg) +{ + detgeom_show_group(dg->top_group, 0); +} diff --git a/libcrystfel/src/detgeom.h b/libcrystfel/src/detgeom.h index b06ccb8f..0b37e9f1 100644 --- a/libcrystfel/src/detgeom.h +++ b/libcrystfel/src/detgeom.h @@ -125,6 +125,8 @@ extern double detgeom_mean_camera_length(struct detgeom *dg); extern struct detgeom_panel *detgeom_find_panel(struct detgeom *dg, const char *name); +extern void detgeom_show_hierarchy(const struct detgeom *dg); + #ifdef __cplusplus } #endif |