/*** ^^A -*-C++-*- **********************************************/ /* multizg 18.05.2000 */ /****************************************************************/ /* Short Description : */ /* Performs multiple acquisitions on increasing expnos. */ /****************************************************************/ /* Keywords : */ /* serial acquisitions */ /****************************************************************/ /* Description/Usage : */ /* This AU program performs multiple acquisitions on */ /* increasing expnos. If datasets do not yet exist, the */ /* current dataset and its parameters are copied. If the */ /* data sets already exist, then the experiments are */ /* executed as they are. */ /* The total experiment time is estimated and printed out. */ /* The number of experiments to be performed can be */ /* specified on the command line : */ /* xau multizg */ /****************************************************************/ /* Author(s) : */ /* Name : Rainer Kerssebaum */ /* Organisation : Bruker Analytik */ /* Email : rainer.kerssebaum@bruker.de */ /****************************************************************/ /* Name Date Modification: */ /* rke 941207 created */ /* eng 000327 switch ZGSAFETY off if on */ /* eng 000518 PathSystemTemp instead of /tmp */ /****************************************************************/ /* $Id: multizg,v 1.10.12.1 2006/03/15 09:44:03 svcu Exp $ */ char *envpnt, tmpfile[PATH_MAX]; int startExpno; int expTime, zgsafety; /*static void PrintExpTime(); */ GETCURDATA; startExpno = expno; if (strlen(cmd) == 0) { i1=10; GETINT("Enter number of experiments : ",i1); } else { if (1 != sscanf(cmd, "%d", &i1)) { STOPMSG("illegal input"); } } expTime = 0; TIMES(i1) SETCURDATA; expTime += CalcExpTime() + 4; IEXPNO; END DEXPNO; PrintExpTime(expTime, i1); (void) sprintf (tmpfile,"%s/expt",PathSystemTemp()); (void) remove (tmpfile); /* Turn zg safety off if on. Turn it back on at the end. */ envpnt = getenv("UXNMR_SAFETY"); zgsafety = 0; if(envpnt != NULL) { if(strcasecmp(envpnt, "on") == 0) { zgsafety = 1; CPR_exec("env set UXNMR_SAFETY=off", WAIT_TERM); } } expno = startExpno; SETCURDATA; TIMES(i1) (void) sprintf(text,"running experiment # %d",loopcount1+1); Show_status(text); sleep(4); ZG; IEXPNO; END DEXPNO; if(zgsafety == 1) CPR_exec("env set UXNMR_SAFETY=on", WAIT_TERM); QUITMSG("--- multizg finished ---"); #include /* utilities for printing and calculation of experiment time */