From d7d9c14116a4e1c41fe61a8caacc9129df62100e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 7 Sep 2020 15:19:44 +0200 Subject: Fix update_peaks logic --- src/crystfel_gui.c | 2 +- src/crystfel_gui.h | 2 ++ src/gui_index.c | 3 +++ src/gui_peaksearch.c | 16 +++++----------- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c index 32eebb05..e7abe61d 100644 --- a/src/crystfel_gui.c +++ b/src/crystfel_gui.c @@ -130,7 +130,7 @@ static void swap_data_arrays(struct image *a, struct image *b) /* Bring the image view up to date after changing the selected image */ -static void update_imageview(struct crystfelproject *proj) +void update_imageview(struct crystfelproject *proj) { char tmp[1024]; char *ev_str; diff --git a/src/crystfel_gui.h b/src/crystfel_gui.h index d0a4efcb..88952f7e 100644 --- a/src/crystfel_gui.h +++ b/src/crystfel_gui.h @@ -36,4 +36,6 @@ extern void add_running_task(struct crystfelproject *proj, struct crystfel_backend *backend, void *job_priv); +extern void update_imageview(struct crystfelproject *proj); + #endif diff --git a/src/gui_index.c b/src/gui_index.c index bd4cd652..b8e1aa7e 100644 --- a/src/gui_index.c +++ b/src/gui_index.c @@ -50,6 +50,7 @@ #include "crystfelindexingopts.h" #include "gui_project.h" #include "crystfel_gui.h" +#include "gui_peaksearch.h" void cell_explorer_sig(struct crystfelproject *proj) { @@ -425,6 +426,8 @@ static void run_indexing_once(struct crystfelproject *proj) cell = NULL; } + update_peaks(proj); + if ( proj->indexing_params.indexing_methods == NULL ) { methods = detect_indexing_methods(cell); STATUS("Auto-detected indexng methods: %s\n", diff --git a/src/gui_peaksearch.c b/src/gui_peaksearch.c index 24f35623..3bbb92bb 100644 --- a/src/gui_peaksearch.c +++ b/src/gui_peaksearch.c @@ -44,6 +44,7 @@ #include "crystfelimageview.h" #include "gui_project.h" +#include "crystfel_gui.h" void update_peaks(struct crystfelproject *proj) @@ -51,9 +52,6 @@ void update_peaks(struct crystfelproject *proj) if ( proj->n_frames == 0 ) return; if ( proj->cur_image == NULL ) return; - crystfel_image_view_set_show_peaks(CRYSTFEL_IMAGE_VIEW(proj->imageview), - proj->show_peaks); - if ( proj->show_peaks ) { image_feature_list_free(proj->cur_image->features); @@ -115,9 +113,6 @@ void update_peaks(struct crystfelproject *proj) break; } - - crystfel_image_view_set_image(CRYSTFEL_IMAGE_VIEW(proj->imageview), - proj->cur_image); } } @@ -136,7 +131,7 @@ static void check_param_callback(GtkWidget *checkbox, { int val = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox)); *(vals->pival) = val; - update_peaks(vals->proj); + update_imageview(vals->proj); } @@ -156,7 +151,7 @@ static void int_param_callback(GtkWidget *entry, if ( strcmp(cbvals->str_val, text) != 0 ) { *(cbvals->pival) = val; cbvals->proj->unsaved = 1; - update_peaks(cbvals->proj); + update_imageview(cbvals->proj); free(cbvals->str_val); cbvals->str_val = strdup(text); } @@ -188,7 +183,7 @@ static void float_param_callback(GtkWidget *entry, if ( strcmp(cbvals->str_val, text) != 0 ) { *(cbvals->pfval) = val; cbvals->proj->unsaved = 1; - update_peaks(cbvals->proj); + update_imageview(cbvals->proj); free(cbvals->str_val); cbvals->str_val = strdup(text); } @@ -420,7 +415,6 @@ static void peaksearch_algo_changed(GtkWidget *combo, gtk_widget_show_all(proj->peak_vbox); proj->unsaved = 1; - update_peaks(proj); } @@ -433,7 +427,7 @@ static void peaksearch_response_sig(GtkWidget *dialog, gint resp, proj->peak_search_params = proj->original_params; } - update_peaks(proj); + update_imageview(proj); gtk_widget_destroy(dialog); proj->peak_vbox = NULL; proj->peak_params = NULL; -- cgit v1.2.3