aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-09-24 14:48:32 +0200
committerThomas White <taw@physics.org>2020-09-24 14:48:32 +0200
commit1006bbd62dd2d33abd00dfc703e006c0c8d43b2f (patch)
treed51ca56bd0b44ccfb3beea7969d1a1ddc9f9606b /src
parentc82b00b5bbbf684e3bd7a6540181e6d040b8b210 (diff)
Add "*.h5" match type
Diffstat (limited to 'src')
-rw-r--r--src/crystfel_gui.c2
-rw-r--r--src/gui_project.c3
-rw-r--r--src/gui_project.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c
index 2c624c5d..a9f510c2 100644
--- a/src/crystfel_gui.c
+++ b/src/crystfel_gui.c
@@ -499,6 +499,8 @@ static gint finddata_sig(GtkWidget *widget, struct crystfelproject *proj)
gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(ctx->type_combo), TRUE, TRUE, 2.0);
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(ctx->type_combo), "everything",
"All files in folder and subfolders");
+ gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(ctx->type_combo), "hdf5",
+ "All HDF5 files ('*.h5')");
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(ctx->type_combo), "lcls-cheetah-hdf5",
"Individual LCLS files from Cheetah ('LCLS*.h5')");
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(ctx->type_combo), "cheetah-cxi",
diff --git a/src/gui_project.c b/src/gui_project.c
index e6a3746f..4a4cff83 100644
--- a/src/gui_project.c
+++ b/src/gui_project.c
@@ -70,6 +70,7 @@ static const char *str_matchtype(enum match_type_id mt)
{
switch ( mt ) {
case MATCH_EVERYTHING : return "everything";
+ case MATCH_H5 : return "hdf5";
case MATCH_CHEETAH_LCLS_H5 : return "lcls-cheetah-hdf5";
case MATCH_CHEETAH_CXI : return "cheetah-cxi";
case MATCH_CBF : return "cbf";
@@ -82,6 +83,7 @@ static const char *str_matchtype(enum match_type_id mt)
enum match_type_id decode_matchtype(const char *type_id)
{
if ( strcmp(type_id, "everything") == 0 ) return MATCH_EVERYTHING;
+ if ( strcmp(type_id, "hdf5") == 0 ) return MATCH_H5;
if ( strcmp(type_id, "lcls-cheetah-hdf5") == 0 ) return MATCH_CHEETAH_LCLS_H5;
if ( strcmp(type_id, "cheetah-cxi") == 0 ) return MATCH_CHEETAH_CXI;
if ( strcmp(type_id, "cbf") == 0 ) return MATCH_CBF;
@@ -101,6 +103,7 @@ int match_filename(const char *fn, enum match_type_id mt)
ext = filename_extension(fn, &ext2);
if ( ext == NULL ) return 0;
+ if ( mt == MATCH_H5 ) return (strcmp(ext, ".h5")==0);
if ( mt == MATCH_CHEETAH_LCLS_H5 ) {
return ((strcmp(ext, ".h5")==0)
&& (strncmp(fn, "LCLS", 4)==0));
diff --git a/src/gui_project.h b/src/gui_project.h
index 7cd7145d..0e4c9859 100644
--- a/src/gui_project.h
+++ b/src/gui_project.h
@@ -39,6 +39,7 @@
enum match_type_id
{
MATCH_EVERYTHING,
+ MATCH_H5,
MATCH_CHEETAH_LCLS_H5,
MATCH_CHEETAH_CXI,
MATCH_CBF,