summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-09-30 15:20:02 +0200
committerThomas White <taw@physics.org>2019-09-30 15:20:02 +0200
commitee24b7f48571c2f56c72f75f2f510fd6e050a6e1 (patch)
treeac72139ca050ede9fcc23316caf5695edc8282ed
parente64ddcb421ffe44b276e7f68cc35f25ffdb8e25e (diff)
WIP
-rw-r--r--crystfel-demo.c41
-rw-r--r--data/crystfel-demo.glade108
2 files changed, 43 insertions, 106 deletions
diff --git a/crystfel-demo.c b/crystfel-demo.c
index b4e1025..e201d19 100644
--- a/crystfel-demo.c
+++ b/crystfel-demo.c
@@ -264,6 +264,42 @@ gint detector_shift(GtkWidget *widget, struct crystfeldemo *demo)
}
+gint calc_fom(GtkWidget *widget, struct crystfeldemo *demo)
+{
+ GError *error = NULL;
+ GSubprocess *sub;
+
+ sub = g_subprocess_new(G_SUBPROCESS_FLAGS_NONE,
+ &error, "xfce4-terminal",
+ "-x", "sh",
+ "calc-foms.sh",
+ NULL);
+
+ if ( sub == NULL ) {
+ printf("Failed to start demo process\n");
+ }
+ return 0;
+}
+
+
+gint show_reflist(GtkWidget *widget, struct crystfeldemo *demo)
+{
+ GError *error = NULL;
+ GSubprocess *sub;
+
+ sub = g_subprocess_new(G_SUBPROCESS_FLAGS_NONE,
+ &error, "xfce4-terminal",
+ "-x", "sh", "-c",
+ "less ${CRYSTFEL_DEMO_FILES}/merged.hkl"
+ NULL);
+
+ if ( sub == NULL ) {
+ printf("Failed to start demo process\n");
+ }
+ return 0;
+}
+
+
static int change_to_tempdir()
{
char tmpdir[64];
@@ -343,6 +379,11 @@ int main(int argc, char *argv[])
gtk_builder_add_callback_symbol(builder, "detector_shift",
G_CALLBACK(detector_shift));
+ gtk_builder_add_callback_symbol(builder, "calc_fom",
+ G_CALLBACK(calc_fom));
+ gtk_builder_add_callback_symbol(builder, "show_reflist",
+ G_CALLBACK(show_reflist));
+
gtk_builder_connect_signals(builder, &demo);
gtk_widget_show_all(window);
gtk_main();
diff --git a/data/crystfel-demo.glade b/data/crystfel-demo.glade
index 942cd52..a480fd6 100644
--- a/data/crystfel-demo.glade
+++ b/data/crystfel-demo.glade
@@ -514,6 +514,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <signal name="clicked" handler="calc_fom" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -527,6 +528,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <signal name="clicked" handler="show_reflist" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@@ -562,112 +564,6 @@
<property name="position">5</property>
</packing>
</child>
- <child>
- <object class="GtkExpander">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkFrame">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkAlignment">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">12</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">partialator -i indexing.stream -o merged.hkl --model=xsphere</property>
- <property name="wrap">True</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">8</property>
- <child>
- <object class="GtkButton">
- <property name="label" translatable="yes">Show pobs/pcalc graphs</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton">
- <property name="label" translatable="yes">Show residual contour maps</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Merge using post-refinement</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Bonus material (if enough time)</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">6</property>
- </packing>
- </child>
</object>
</child>
</object>