aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-08-04 11:13:22 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:35 +0100
commitd31ae34ed2a084b6c43a5f6a18071d66ca68c18e (patch)
tree2bcb7595238f851b986409ebcc30a8bf52a67599 /src
parente23381049dcdbd2c3f1f39276adb3c466d646868 (diff)
Complain loudly if DirAx or MOSFLM don't work as expected
Diffstat (limited to 'src')
-rw-r--r--src/dirax.c7
-rw-r--r--src/mosflm.c11
2 files changed, 16 insertions, 2 deletions
diff --git a/src/dirax.c b/src/dirax.c
index 58e71ddc..bb1cb808 100644
--- a/src/dirax.c
+++ b/src/dirax.c
@@ -63,6 +63,7 @@ struct dirax_data {
/* DirAx auto-indexing high-level stuff */
int step;
+ int finished_ok;
int read_cell;
int best_acl;
int best_acl_nh;
@@ -232,6 +233,7 @@ static void dirax_send_next(struct image *image, struct dirax_data *dirax)
case 6 :
dirax_sendline("go\n", dirax);
+ dirax->finished_ok = 1;
break;
case 7 :
@@ -483,6 +485,7 @@ void run_dirax(struct image *image)
fcntl(dirax->pty, F_SETFL, opts | O_NONBLOCK);
dirax->step = 1; /* This starts the "initialisation" procedure */
+ dirax->finished_ok = 0;
dirax->read_cell = 0;
dirax->n_acls_tried = 0;
dirax->best_acl_nh = 0;
@@ -518,5 +521,9 @@ void run_dirax(struct image *image)
free(dirax->rbuffer);
waitpid(dirax->pid, &status, 0);
+ if ( dirax->finished_ok == 0 ) {
+ ERROR("DirAx doesn't seem to be working properly.\n");
+ }
+
free(dirax);
}
diff --git a/src/mosflm.c b/src/mosflm.c
index 088ef52d..1cd05ada 100644
--- a/src/mosflm.c
+++ b/src/mosflm.c
@@ -88,6 +88,7 @@ struct mosflm_data {
char imagefile[128];
char sptfile[128];
int step;
+ int finished_ok;
UnitCell *target_cell;
};
@@ -374,6 +375,7 @@ static void mosflm_send_next(struct image *image, struct mosflm_data *mosflm)
case 10 :
mosflm_sendline("GO\n", mosflm);
+ mosflm->finished_ok = 1;
break;
default:
@@ -558,6 +560,7 @@ void run_mosflm(struct image *image, UnitCell *cell)
fcntl(mosflm->pty, F_SETFL, opts | O_NONBLOCK);
mosflm->step = 1; /* This starts the "initialisation" procedure */
+ mosflm->finished_ok = 0;
do {
@@ -590,8 +593,12 @@ void run_mosflm(struct image *image, UnitCell *cell)
free(mosflm->rbuffer);
waitpid(mosflm->pid, &status, 0);
- /* Read the mosflm NEWMAT file and set cell candidate if found */
- read_newmat(mosflm->newmatfile, image);
+ if ( mosflm->finished_ok == 0 ) {
+ ERROR("MOSFLM doesn't seem to be working properly.\n");
+ } else {
+ /* Read the mosflm NEWMAT file and get cell if found */
+ read_newmat(mosflm->newmatfile, image);
+ }
free(mosflm);
}