aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-11-22 16:19:45 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-11-22 16:19:45 +0000
commitf81316b51a62c4faf02ee829c65d4227647db5f9 (patch)
tree27047ee0b7218b6bfe2ace3c03058a97f470d212
parentc1ada5f6bc86650342c9f8eafc676fc47e2eed22 (diff)
Option to run another DirAx cycle
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@204 bf6ca9ba-c028-0410-8290-897cf20841d1
-rw-r--r--data/displaywindow.ui1
-rw-r--r--src/dirax.c7
-rw-r--r--src/dirax.h1
-rw-r--r--src/displaywindow.c11
4 files changed, 17 insertions, 3 deletions
diff --git a/data/displaywindow.ui b/data/displaywindow.ui
index 3260dac..83be71c 100644
--- a/data/displaywindow.ui
+++ b/data/displaywindow.ui
@@ -18,6 +18,7 @@
<menu name="tools" action="ToolsAction">
<menuitem name="dirax" action="DirAxAction" />
+ <menuitem name="diraxrerun" action="DirAxReRunAction" />
<menuitem name="diraxstop" action="StopDirAxAction" />
<menuitem name="reproject" action="ReprojectAction" />
<menuitem name="refine" action="RefineAction" />
diff --git a/src/dirax.c b/src/dirax.c
index d7aa68c..e57be11 100644
--- a/src/dirax.c
+++ b/src/dirax.c
@@ -315,9 +315,12 @@ static gboolean dirax_readable(GIOChannel *dirax, GIOCondition condition, Contro
}
void dirax_stop(ControlContext *ctx) {
-
dirax_sendline_if_idle("end\n", ctx);
-
+}
+
+void dirax_rerun(ControlContext *ctx) {
+ dirax_sendline_if_idle("go\n", ctx);
+ ctx->dirax_step = 7;
}
void dirax_invoke(ControlContext *ctx) {
diff --git a/src/dirax.h b/src/dirax.h
index c463561..dce8492 100644
--- a/src/dirax.h
+++ b/src/dirax.h
@@ -21,6 +21,7 @@
#include "reflections.h"
extern void dirax_invoke(ControlContext *ctx);
+extern void dirax_rerun(ControlContext *ctx);
extern void dirax_stop(ControlContext *ctx);
extern ReflectionList *dirax_load(const char *filename);
extern int dirax_is_drxfile(const char *filename);
diff --git a/src/displaywindow.c b/src/displaywindow.c
index 0eed64c..25a48a4 100644
--- a/src/displaywindow.c
+++ b/src/displaywindow.c
@@ -948,6 +948,10 @@ static void displaywindow_dirax_stop(GtkWidget *widget, DisplayWindow *dw) {
dirax_stop(dw->ctx);
}
+static void displaywindow_dirax_rerun(GtkWidget *widget, DisplayWindow *dw) {
+ dirax_rerun(dw->ctx);
+}
+
static void displaywindow_addui_callback(GtkUIManager *ui, GtkWidget *widget, GtkContainer *container) {
gtk_box_pack_start(GTK_BOX(container), widget, FALSE, FALSE, 0);
@@ -1105,7 +1109,8 @@ static void displaywindow_addmenubar(DisplayWindow *dw) {
{ "ToolsAction", NULL, "_Tools", NULL, NULL, NULL },
{ "DirAxAction", GTK_STOCK_EXECUTE, "Start _DirAx", "<Ctrl>D", NULL, G_CALLBACK(displaywindow_dirax) },
- { "StopDirAxAction", GTK_STOCK_CLOSE, "Stop DirAx", NULL, NULL, G_CALLBACK(displaywindow_dirax_stop) },
+ { "DirAxReRunAction", NULL, "Run another DirAx cycle", NULL, NULL, G_CALLBACK(displaywindow_dirax_rerun) },
+ { "StopDirAxAction", NULL, "Stop DirAx", NULL, NULL, G_CALLBACK(displaywindow_dirax_stop) },
{ "ReprojectAction", NULL, "_Reproject Diffraction Patterns", NULL, NULL, G_CALLBACK(displaywindow_reproject) },
{ "RefineAction", GTK_STOCK_EXECUTE, "Refine Reconstruction", NULL, NULL, G_CALLBACK(displaywindow_refine) },
{ "SetAxisAction", NULL, "Set Tilt Axis Position", NULL, NULL, G_CALLBACK(displaywindow_setaxis) },
@@ -1227,16 +1232,20 @@ void displaywindow_update_dirax(ControlContext *ctx, DisplayWindow *dw) {
GtkWidget *start;
GtkWidget *stop;
+ GtkWidget *rerun;
start = gtk_ui_manager_get_widget(dw->ui, "/ui/displaywindow/tools/dirax");
stop = gtk_ui_manager_get_widget(dw->ui, "/ui/displaywindow/tools/diraxstop");
+ rerun = gtk_ui_manager_get_widget(dw->ui, "/ui/displaywindow/tools/diraxrerun");
if ( ctx->dirax ) {
gtk_widget_set_sensitive(GTK_WIDGET(start), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(stop), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(rerun), TRUE);
} else {
gtk_widget_set_sensitive(GTK_WIDGET(start), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(stop), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(rerun), FALSE);
}
}