diff options
author | Thomas White <taw@physics.org> | 2023-05-15 17:17:33 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-07-28 13:22:05 +0200 |
commit | 6f774aaa68507d9dd0d1f8916d773a9bdb89f03b (patch) | |
tree | f602e69d6ebe325de083d1cb9f367debad1fc159 /libcrystfel/src/detgeom.c | |
parent | e6cee18a78236c5bb763c024e586c7154c82535c (diff) |
Add detgeom_show_hierarchy()
Diffstat (limited to 'libcrystfel/src/detgeom.c')
-rw-r--r-- | libcrystfel/src/detgeom.c | 25 |
1 files changed, 25 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); +} |