/****************************************************************/ /* multigo 09.01.1999 */ /* modified 10.22.1999 */ /* modified 02.15.2000 */ /****************************************************************/ /* Short Description : */ /* Performs multiple acquisitions on Loop(N)[(Exp1..n)] */ /* back up a fid file per each accumulation */ /* DS runs at first accumulation only (zg), so */ /* next loop (go) does not include dummy scan */ /****************************************************************/ /* Author(s) : */ /* Name : Atsushi Asano */ /* Organisation : NIST (NDA in Japan) */ /* Email : asanoa@nda.ac.jp */ /****************************************************************/ /* $Id: multizg,v 1.5.2.2 1998/05/29 16:01:41 eng Exp $ */ int startExpno; int expTime; int i5; char answer[3]; char ans[3]; static void PrintExpTime(); GETCURDATA; startExpno = expno; if (strlen(cmd) == 0) { i1=1; GETINT("Enter number of experiments : ",i1); } else { if (1 != sscanf(cmd, "%d", &i1)) { STOPMSG("illegal input"); } } if (strlen(cmd) == 0) { i2=4; GETINT("Enter loop number : ",i2); } if (i2 <= 0) { i2 = 1; } /* calculation time ? */ /* if the number of loop (i2) is very large, 10 or 20, or more it takes a quite much time to calculate time. you can calculate the time by, 1;"expt" including DS and 2;"expt" without DS, 1*i1+2*i1*i2 provides the time */ (void) strcpy(answer,"y"); GETSTRING(" Do you want to calc. the time (y/n) ?", answer); if (!strcmp(answer,"y")) { /* calculation the spend time */ expTime = 0; TIMES(i1) SETCURDATA; expTime += CalcExpTime() + 4; FETCHPAR("ds", &i5); STOREPAR("ds", 0); /* caluculation time during go loop */ if (i2 > 1) { for (i3=2; i3<=i2; i3++) { expTime += CalcExpTime() + 4; } } STOREPAR("ds", i5); IEXPNO; END /*DEXPNO;*/ /* this is needless because the first expono is set at the bellow */ PrintExpTime(expTime, i1); } /* make duplicate of fid to fid2 ? */ (void) strcpy(ans,"n"); GETSTRING(" Do you want to make copy of fid to fid2 (y/n) ?", ans); (void) unlink ("/tmp/expt"); expno = startExpno; SETCURDATA; TIMES(i1) (void) sprintf(text,"running experiment # %d",loopcount1+1); Show_status(text); sleep(1); Show_status("running loop # 1"); sleep(1); ZG; if (!strcmp(ans,"y")) { (void) sprintf(text,"cp -f %s/data/%s/nmr/%s/%d/fid %s/data/%s/nmr/%s/%d/fid2", disk, user, name, expno, disk, user, name, expno); Show_status(text); sleep(2); system(text); } IEXPNO; END TIMES2(i2-1) expno = startExpno; TIMES(i1) FETCHPAR("ds", &i5); STOREPAR("ds", 0); (void) sprintf(text,"running experiment # %d",loopcount1+1); Show_status(text); sleep(1); (void) sprintf(text,"running loop # %d",loopcount2+2); Show_status(text); sleep(1); GO; if (!strcmp(ans,"y")) { (void) sprintf(text,"cp -f %s/data/%s/nmr/%s/%d/fid %s/data/%s/nmr/%s/%d/fid2", disk, user, name, expno, disk, user, name, expno); Show_status(text); sleep(2); system(text); } STOREPAR("ds", i5); IEXPNO; END END QUITMSG("--- multigo finished ---"); #include /* utilities for printing and calculation of experiment time */