aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-09-24 16:40:34 +0200
committerThomas White <taw@physics.org>2020-09-24 16:40:34 +0200
commit6a2abc87029df2742d05a4f2af66f6d146c06634 (patch)
tree3b55eb38c0866748657c4ef83e97b80ed621d9bf
parent1d077dacd4083b1b976237042d9029d450ed79d9 (diff)
GUI: Pass the real streams for the result to cell_explorer
-rw-r--r--src/gui_index.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/gui_index.c b/src/gui_index.c
index c8e3a6e9..f57147d8 100644
--- a/src/gui_index.c
+++ b/src/gui_index.c
@@ -122,9 +122,35 @@ void cell_explorer_sig(GtkWidget *widget, struct crystfelproject *proj)
{
GSubprocess *sp;
GError *error = NULL;
+ const gchar *results_name;
+ struct gui_result *res;
+ const gchar **streams;
+ int i;
+
+ results_name = gtk_combo_box_get_active_id(GTK_COMBO_BOX(proj->results_combo));
+ if ( strcmp(results_name, "crystfel-gui-internal") == 0 ) {
+ STATUS("Please select results first.\n");
+ return;
+ }
+
+ res = find_result_by_name(proj, results_name);
+ if ( res == NULL ) {
+ ERROR("Results for '%s' not found!\n", results_name);
+ return;
+ }
+
+ streams = malloc((res->n_streams+2)*sizeof(gchar *));
+ if ( streams == NULL ) return;
+
+ streams[0] = get_crystfel_exe("cell_explorer");
+ for ( i=0; i<res->n_streams; i++ ) {
+ streams[i+1] = res->streams[i];
+ }
+ streams[res->n_streams+1] = NULL;
- sp = g_subprocess_new(G_SUBPROCESS_FLAGS_NONE, &error,
- "cell_explorer", "test.stream", NULL);
+ sp = g_subprocess_newv(streams, G_SUBPROCESS_FLAGS_NONE,
+ &error);
+ free(streams);
if ( sp == NULL ) {
ERROR("Failed to start cell_explorer: %s\n",
error->message);