aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-10-20 14:51:53 +0200
committerThomas White <taw@physics.org>2021-10-20 14:56:58 +0200
commit992b30aae2cedb427637f625d0bf5aef623885c6 (patch)
tree3efcc6374a972462a5ad329b4231f8dce372352f /src
parentd6982b711b365477a3e44d2e20044f770fb9010f (diff)
GUI: Set project name in MTZ files
Closes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/28
Diffstat (limited to 'src')
-rw-r--r--src/gui_export.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui_export.c b/src/gui_export.c
index 36f1a032..44a6ffc1 100644
--- a/src/gui_export.c
+++ b/src/gui_export.c
@@ -94,6 +94,8 @@ static int export_to_mtz(struct gui_merge_result *result,
SymOpList *sym;
int r;
char *crystal_name;
+ char *dir_name;
+ char *dir_basename;
reflist = read_reflections_2(result->hkl, &sym_str);
if ( reflist == NULL ) return 1;
@@ -102,15 +104,17 @@ static int export_to_mtz(struct gui_merge_result *result,
sym = get_pointgroup(sym_str);
if ( sym == NULL ) return 1;
- /* FIXME: Proposed labelling (GitLab #28):
- * project = basename of folder containing crystfel.project */
+ dir_name = getcwd(NULL, 0);
+ dir_basename = safe_basename(dir_name);
crystal_name = result->indexing_result_name;
if ( crystal_name == NULL ) {
crystal_name = "unknown";
}
r = write_to_mtz(reflist, sym, cell, min_res, max_res, filename,
- result->name, crystal_name, "project", bij);
+ result->name, crystal_name, dir_basename, bij);
+ free(dir_name);
+ free(dir_basename);
free_symoplist(sym);
free(sym_str);
reflist_free(reflist);