diff options
author | Thomas White <taw@physics.org> | 2021-05-07 16:47:53 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-05-07 16:47:53 +0200 |
commit | 36f0f48a9203e961fcaf546ded68451589d4dd18 (patch) | |
tree | 5cd3f33493ba853537d99218132e3f9116053685 /src/gui_project.c | |
parent | 949b13b3b10a4e4f64a7ebeb6bd7e57ddeed0a11 (diff) |
GUI: Add missing initialisation/load/save for ambi.backend
Diffstat (limited to 'src/gui_project.c')
-rw-r--r-- | src/gui_project.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui_project.c b/src/gui_project.c index 920bc310..d0bf66db 100644 --- a/src/gui_project.c +++ b/src/gui_project.c @@ -486,6 +486,10 @@ static void handle_var(const char *key, const char *val, proj->merging_backend_selected = find_backend(val, proj); } + if ( strcmp(key, "ambi.backend") == 0 ) { + proj->ambi_backend_selected = find_backend(val, proj); + } + if ( strcmp(key, "show_centre") == 0 ) { proj->show_centre = parse_int(val); } @@ -978,6 +982,13 @@ int save_project(struct crystfelproject *proj) if ( proj->ambi_params.operator != NULL ) { fprintf(fh, "ambi.operator %s\n", proj->ambi_params.operator); } + fprintf(fh, "ambi.backend %s\n", + proj->backends[proj->ambi_backend_selected].name); + for ( i=0; i<proj->n_backends; i++ ) { + struct crystfel_backend *be; + be = &proj->backends[i]; + be->write_ambi_opts(be->ambi_opts_priv, fh); + } if ( proj->ambi_new_job_title != NULL ) { fprintf(fh, "ambi.new_job_title %s\n", proj->ambi_new_job_title); @@ -1100,6 +1111,7 @@ void default_project(struct crystfelproject *proj) proj->indexing_backend_selected = 0; proj->merging_backend_selected = 0; + proj->ambi_backend_selected = 0; proj->n_backends = 0; proj->backends = malloc(2*sizeof(struct crystfel_backend)); /* FIXME: Crappy error handling */ |