diff options
Diffstat (limited to 'libcrystfel/src/datatemplate.c')
-rw-r--r-- | libcrystfel/src/datatemplate.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libcrystfel/src/datatemplate.c b/libcrystfel/src/datatemplate.c index 2593a7f9..7117a62e 100644 --- a/libcrystfel/src/datatemplate.c +++ b/libcrystfel/src/datatemplate.c @@ -1303,6 +1303,23 @@ const char *data_template_panel_name(const DataTemplate *dt, int pn) } +int data_template_panel_name_to_number(const DataTemplate *dt, + const char *panel_name, + int *pn) +{ + if ( panel_name == NULL ) return 1; + + for ( i=0; i<dt->n_panels; i++ ) { + if ( strcmp(panel_name, dt->panels[i].name) == 0 ) { + *pn = i; + return 0; + } + } + + return 1; +} + + void data_template_add_copy_header(DataTemplate *dt, const char *header) { |