version 1.106, 2006/01/19 13:24:36
|
version 1.109, 2006/01/24 19:37:15
|
Line 1
|
Line 1
|
/* $Id$ |
/* $Id$ |
$State$ |
$State$ |
$Log$ |
$Log$ |
|
Revision 1.109 2006/01/24 19:37:15 brouard |
|
(Module): Comments (lines starting with a #) are allowed in data. |
|
|
|
Revision 1.108 2006/01/19 18:05:42 lievre |
|
Gnuplot problem appeared... |
|
To be fixed |
|
|
|
Revision 1.107 2006/01/19 16:20:37 brouard |
|
Test existence of gnuplot in imach path |
|
|
Revision 1.106 2006/01/19 13:24:36 brouard |
Revision 1.106 2006/01/19 13:24:36 brouard |
Some cleaning and links added in html output |
Some cleaning and links added in html output |
|
|
Line 227
|
Line 237
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
|
#include <limits.h> |
|
#include <sys/types.h> |
|
#include <sys/stat.h> |
|
#include <errno.h> |
|
extern int errno; |
|
|
/* #include <sys/time.h> */ |
/* #include <sys/time.h> */ |
#include <time.h> |
#include <time.h> |
#include "timeval.h" |
#include "timeval.h" |
Line 235
|
Line 251
|
/* #define _(String) gettext (String) */ |
/* #define _(String) gettext (String) */ |
|
|
#define MAXLINE 256 |
#define MAXLINE 256 |
|
|
#define GNUPLOTPROGRAM "gnuplot" |
#define GNUPLOTPROGRAM "gnuplot" |
/*#define GNUPLOTPROGRAM "..\\gp37mgw\\wgnuplot"*/ |
/*#define GNUPLOTPROGRAM "..\\gp37mgw\\wgnuplot"*/ |
#define FILENAMELENGTH 132 |
#define FILENAMELENGTH 132 |
/*#define DEBUG*/ |
|
/*#define windows*/ |
|
#define GLOCK_ERROR_NOPATH -1 /* empty path */ |
#define GLOCK_ERROR_NOPATH -1 /* empty path */ |
#define GLOCK_ERROR_GETCWD -2 /* cannot get cwd */ |
#define GLOCK_ERROR_GETCWD -2 /* cannot get cwd */ |
|
|
Line 257
|
Line 273
|
#define AGEGOMP 10. /* Minimal age for Gompertz adjustment */ |
#define AGEGOMP 10. /* Minimal age for Gompertz adjustment */ |
#ifdef UNIX |
#ifdef UNIX |
#define DIRSEPARATOR '/' |
#define DIRSEPARATOR '/' |
|
#define CHARSEPARATOR "/" |
#define ODIRSEPARATOR '\\' |
#define ODIRSEPARATOR '\\' |
#else |
#else |
#define DIRSEPARATOR '\\' |
#define DIRSEPARATOR '\\' |
|
#define CHARSEPARATOR "\\" |
#define ODIRSEPARATOR '/' |
#define ODIRSEPARATOR '/' |
#endif |
#endif |
|
|
Line 332 long time_value;
|
Line 350 long time_value;
|
extern long time(); |
extern long time(); |
char strcurr[80], strfor[80]; |
char strcurr[80], strfor[80]; |
|
|
|
char *endptr; |
|
long lval; |
|
|
#define NR_END 1 |
#define NR_END 1 |
#define FREE_ARG char* |
#define FREE_ARG char* |
#define FTOL 1.0e-10 |
#define FTOL 1.0e-10 |
Line 388 double ftolhess; /* Tolerance for comput
|
Line 409 double ftolhess; /* Tolerance for comput
|
/**************** split *************************/ |
/**************** split *************************/ |
static int split( char *path, char *dirc, char *name, char *ext, char *finame ) |
static int split( char *path, char *dirc, char *name, char *ext, char *finame ) |
{ |
{ |
/* From a file name with full path (either Unix or Windows) we extract the directory (dirc) |
/* From a file name with (full) path (either Unix or Windows) we extract the directory (dirc) |
the name of the file (name), its extension only (ext) and its first part of the name (finame) |
the name of the file (name), its extension only (ext) and its first part of the name (finame) |
*/ |
*/ |
char *ss; /* pointer */ |
char *ss; /* pointer */ |
Line 397 static int split( char *path, char *dirc
|
Line 418 static int split( char *path, char *dirc
|
l1 = strlen(path ); /* length of path */ |
l1 = strlen(path ); /* length of path */ |
if ( l1 == 0 ) return( GLOCK_ERROR_NOPATH ); |
if ( l1 == 0 ) return( GLOCK_ERROR_NOPATH ); |
ss= strrchr( path, DIRSEPARATOR ); /* find last / */ |
ss= strrchr( path, DIRSEPARATOR ); /* find last / */ |
if ( ss == NULL ) { /* no directory, so use current */ |
if ( ss == NULL ) { /* no directory, so determine current directory */ |
|
strcpy( name, path ); /* we got the fullname name because no directory */ |
/*if(strrchr(path, ODIRSEPARATOR )==NULL) |
/*if(strrchr(path, ODIRSEPARATOR )==NULL) |
printf("Warning you should use %s as a separator\n",DIRSEPARATOR);*/ |
printf("Warning you should use %s as a separator\n",DIRSEPARATOR);*/ |
/* get current working directory */ |
/* get current working directory */ |
Line 405 static int split( char *path, char *dirc
|
Line 427 static int split( char *path, char *dirc
|
if ( getcwd( dirc, FILENAME_MAX ) == NULL ) { |
if ( getcwd( dirc, FILENAME_MAX ) == NULL ) { |
return( GLOCK_ERROR_GETCWD ); |
return( GLOCK_ERROR_GETCWD ); |
} |
} |
strcpy( name, path ); /* we've got it */ |
/* got dirc from getcwd*/ |
|
printf(" DIRC = %s \n",dirc); |
} else { /* strip direcotry from path */ |
} else { /* strip direcotry from path */ |
ss++; /* after this, the filename */ |
ss++; /* after this, the filename */ |
l2 = strlen( ss ); /* length of filename */ |
l2 = strlen( ss ); /* length of filename */ |
Line 413 static int split( char *path, char *dirc
|
Line 436 static int split( char *path, char *dirc
|
strcpy( name, ss ); /* save file name */ |
strcpy( name, ss ); /* save file name */ |
strncpy( dirc, path, l1 - l2 ); /* now the directory */ |
strncpy( dirc, path, l1 - l2 ); /* now the directory */ |
dirc[l1-l2] = 0; /* add zero */ |
dirc[l1-l2] = 0; /* add zero */ |
|
printf(" DIRC2 = %s \n",dirc); |
} |
} |
|
/* We add a separator at the end of dirc if not exists */ |
l1 = strlen( dirc ); /* length of directory */ |
l1 = strlen( dirc ); /* length of directory */ |
/*#ifdef windows |
if( dirc[l1-1] != DIRSEPARATOR ){ |
if ( dirc[l1-1] != '\\' ) { dirc[l1] = '\\'; dirc[l1+1] = 0; } |
dirc[l1] = DIRSEPARATOR; |
#else |
dirc[l1+1] = 0; |
if ( dirc[l1-1] != '/' ) { dirc[l1] = '/'; dirc[l1+1] = 0; } |
printf(" DIRC3 = %s \n",dirc); |
#endif |
} |
*/ |
|
ss = strrchr( name, '.' ); /* find last / */ |
ss = strrchr( name, '.' ); /* find last / */ |
if (ss >0){ |
if (ss >0){ |
ss++; |
ss++; |
Line 430 static int split( char *path, char *dirc
|
Line 454 static int split( char *path, char *dirc
|
strncpy( finame, name, l1-l2); |
strncpy( finame, name, l1-l2); |
finame[l1-l2]= 0; |
finame[l1-l2]= 0; |
} |
} |
|
|
return( 0 ); /* we're done */ |
return( 0 ); /* we're done */ |
} |
} |
|
|
Line 3203 void printinghtml(char fileres[], char t
|
Line 3228 void printinghtml(char fileres[], char t
|
double jprev2, double mprev2,double anprev2){ |
double jprev2, double mprev2,double anprev2){ |
int jj1, k1, i1, cpt; |
int jj1, k1, i1, cpt; |
|
|
fprintf(fichtm,"<ul><li><a> href="#firstorder">Result files (first order: no variance)</a>\n \ |
fprintf(fichtm,"<ul><li><a href='#firstorder'>Result files (first order: no variance)</a>\n \ |
<li><a> href="#secondorder">Result files (second order (variance)</a>\n \ |
<li><a href='#secondorder'>Result files (second order (variance)</a>\n \ |
</ul>"); |
</ul>"); |
fprintf(fichtm,"<ul><li><h4><a name="firstorder">Result files (first order: no variance)</a></h4>\n \ |
fprintf(fichtm,"<ul><li><h4><a name='firstorder'>Result files (first order: no variance)</a></h4>\n \ |
- Observed prevalence in each state (during the period defined between %.lf/%.lf/%.lf and %.lf/%.lf/%.lf): <a href=\"%s\">%s</a> <br>\n ", |
- Observed prevalence in each state (during the period defined between %.lf/%.lf/%.lf and %.lf/%.lf/%.lf): <a href=\"%s\">%s</a> <br>\n ", |
jprev1, mprev1,anprev1,jprev2, mprev2,anprev2,subdirf2(fileres,"p"),subdirf2(fileres,"p")); |
jprev1, mprev1,anprev1,jprev2, mprev2,anprev2,subdirf2(fileres,"p"),subdirf2(fileres,"p")); |
fprintf(fichtm,"\ |
fprintf(fichtm,"\ |
Line 3257 fprintf(fichtm," \n<ul><li><b>Graphs</b>
|
Line 3282 fprintf(fichtm," \n<ul><li><b>Graphs</b>
|
|
|
|
|
fprintf(fichtm,"\ |
fprintf(fichtm,"\ |
\n<br><li><h4> <a name="secondorder">Result files (second order: variances)</a></h4>\n\ |
\n<br><li><h4> <a name='secondorder'>Result files (second order: variances)</a></h4>\n\ |
- Parameter file with estimated parameters and covariance matrix: <a href=\"%s\">%s</a> <br>\n", rfileres,rfileres); |
- Parameter file with estimated parameters and covariance matrix: <a href=\"%s\">%s</a> <br>\n", rfileres,rfileres); |
|
|
fprintf(fichtm," - Variance of one-step probabilities: <a href=\"%s\">%s</a> <br>\n", |
fprintf(fichtm," - Variance of one-step probabilities: <a href=\"%s\">%s</a> <br>\n", |
Line 4059 int main(int argc, char *argv[])
|
Line 4084 int main(int argc, char *argv[])
|
{ |
{ |
int movingaverage(double ***probs, double bage,double fage, double ***mobaverage, int mobilav); |
int movingaverage(double ***probs, double bage,double fage, double ***mobaverage, int mobilav); |
int i,j, k, n=MAXN,iter,m,size=100,cptcode, cptcod; |
int i,j, k, n=MAXN,iter,m,size=100,cptcode, cptcod; |
|
int linei; |
int jj, ll, li, lj, lk, imk; |
int jj, ll, li, lj, lk, imk; |
int numlinepar=0; /* Current linenumber of parameter file */ |
int numlinepar=0; /* Current linenumber of parameter file */ |
int itimes; |
int itimes; |
Line 4067 int main(int argc, char *argv[])
|
Line 4093 int main(int argc, char *argv[])
|
char ca[32], cb[32], cc[32]; |
char ca[32], cb[32], cc[32]; |
/* FILE *fichtm; *//* Html File */ |
/* FILE *fichtm; *//* Html File */ |
/* FILE *ficgp;*/ /*Gnuplot File */ |
/* FILE *ficgp;*/ /*Gnuplot File */ |
|
struct stat info; |
double agedeb, agefin,hf; |
double agedeb, agefin,hf; |
double ageminpar=1.e20,agemin=1.e20, agemaxpar=-1.e20, agemax=-1.e20; |
double ageminpar=1.e20,agemin=1.e20, agemaxpar=-1.e20, agemax=-1.e20; |
|
|
Line 4167 int main(int argc, char *argv[])
|
Line 4194 int main(int argc, char *argv[])
|
printf("pathtot=%s, path=%s, optionfile=%s\n",pathtot,path,optionfile);*/ |
printf("pathtot=%s, path=%s, optionfile=%s\n",pathtot,path,optionfile);*/ |
/* cutv(path,optionfile,pathtot,'\\');*/ |
/* cutv(path,optionfile,pathtot,'\\');*/ |
|
|
|
/* Split argv[0], imach program to get pathimach */ |
|
printf("\nargv[0]=%s argv[1]=%s, \n",argv[0],argv[1]); |
split(argv[0],pathimach,optionfile,optionfilext,optionfilefiname); |
split(argv[0],pathimach,optionfile,optionfilext,optionfilefiname); |
|
printf("\nargv[0]=%s pathimach=%s, \noptionfile=%s \noptionfilext=%s \noptionfilefiname=%s\n",argv[0],pathimach,optionfile,optionfilext,optionfilefiname); |
/* strcpy(pathimach,argv[0]); */ |
/* strcpy(pathimach,argv[0]); */ |
|
/* Split argv[1]=pathtot, parameter file name to get path, optionfile, extension and name */ |
split(pathtot,path,optionfile,optionfilext,optionfilefiname); |
split(pathtot,path,optionfile,optionfilext,optionfilefiname); |
printf("pathimach=%s, pathtot=%s,\npath=%s,\noptionfile=%s \noptionfilext=%s \noptionfilefiname=%s\n",pathimach,pathtot,path,optionfile,optionfilext,optionfilefiname); |
printf("\npathtot=%s,\npath=%s,\noptionfile=%s \noptionfilext=%s \noptionfilefiname=%s\n",pathtot,path,optionfile,optionfilext,optionfilefiname); |
chdir(path); |
chdir(path); |
strcpy(command,"mkdir "); |
strcpy(command,"mkdir "); |
strcat(command,optionfilefiname); |
strcat(command,optionfilefiname); |
Line 4337 int main(int argc, char *argv[])
|
Line 4368 int main(int argc, char *argv[])
|
} |
} |
fflush(ficlog); |
fflush(ficlog); |
|
|
|
|
p=param[1][1]; |
p=param[1][1]; |
|
|
/* Reads comments: lines beginning with '#' */ |
/* Reads comments: lines beginning with '#' */ |
Line 4461 int main(int argc, char *argv[])
|
Line 4491 int main(int argc, char *argv[])
|
ncodemax=ivector(1,8); |
ncodemax=ivector(1,8); |
|
|
i=1; |
i=1; |
while (fgets(line, MAXLINE, fic) != NULL) { |
linei=0; |
if ((i >= firstobs) && (i <=lastobs)) { |
while ((fgets(line, MAXLINE, fic) != NULL) ||((i >= firstobs) && (i <=lastobs))) { |
for(j=0; line[j] != '\n';j++){ /* Untabifies line */ |
linei=linei+1; |
|
printf("IIIII= %d linei=%d\n",i,linei); |
|
for(j=strlen(line); j>=0;j--){ /* Untabifies line */ |
if(line[j] == '\t') |
if(line[j] == '\t') |
line[j] = ' '; |
line[j] = ' '; |
} |
} |
|
for(j=strlen(line)-1; (line[j]==' ')||(line[j]==10);j--){;};line[j+1]=0; /* Trims blanks at end of line */ |
|
if(line[0]=='#'){ |
|
fprintf(ficlog,"Comment line\n%s\n",line); |
|
printf("Comment line\n%s\n",line); |
|
continue; |
|
} |
for (j=maxwav;j>=1;j--){ |
for (j=maxwav;j>=1;j--){ |
cutv(stra, strb,line,' '); s[j][i]=atoi(strb); |
cutv(stra, strb,line,' '); |
|
errno=0; |
|
lval=strtol(strb,&endptr,10); |
|
/* if (errno == ERANGE && (lval == LONG_MAX || lval == LONG_MIN))*/ |
|
if( strb[0]=='\0' || (*endptr != '\0')){ |
|
printf("Error reading data around '%d' at line number %d %s for individual %d\nShould be a status of wave %d. Setting maxwav=%d might be wrong. Exiting.\n",lval, i,line,linei,j,maxwav); |
|
exit(1); |
|
} |
|
s[j][i]=lval; |
|
|
|
strcpy(line,stra); |
|
cutv(stra, strb,line,'/'); |
|
errno=0; |
|
lval=strtol(strb,&endptr,10); |
|
if( strb[0]=='\0' || (*endptr != '\0')){ |
|
printf("Error reading data around '%d'.at line number %ld %s for individual %d\nShould be a year of exam at wave %d. Exiting.\n",lval, i,line,linei,j); |
|
exit(1); |
|
} |
|
anint[j][i]=(double)(lval); |
|
|
|
strcpy(line,stra); |
|
cutv(stra, strb,line,' '); |
|
errno=0; |
|
lval=strtol(strb,&endptr,10); |
|
if( strb[0]=='\0' || (*endptr != '\0')){ |
|
printf("Error reading data around '%d' at line number %ld %s for individual %d\nShould be a month of exam at wave %d. Exiting.\n",lval, i,line, linei,j); |
|
exit(1); |
|
} |
|
mint[j][i]=(double)(lval); |
strcpy(line,stra); |
strcpy(line,stra); |
cutv(stra, strb,line,'/'); anint[j][i]=(double)(atoi(strb)); strcpy(line,stra); |
|
cutv(stra, strb,line,' '); mint[j][i]=(double)(atoi(strb)); strcpy(line,stra); |
|
} |
} |
|
|
cutv(stra, strb,line,'/'); andc[i]=(double)(atoi(strb)); strcpy(line,stra); |
cutv(stra, strb,line,'/'); |
cutv(stra, strb,line,' '); moisdc[i]=(double)(atoi(strb)); strcpy(line,stra); |
errno=0; |
|
lval=strtol(strb,&endptr,10); |
cutv(stra, strb,line,'/'); annais[i]=(double)(atoi(strb)); strcpy(line,stra); |
if( strb[0]=='\0' || (*endptr != '\0')){ |
cutv(stra, strb,line,' '); moisnais[i]=(double)(atoi(strb)); strcpy(line,stra); |
printf("Error reading data around '%d' at line number %ld %s for individual %d\nShould be a year of death. Exiting.\n",lval, i,line,linei); |
|
exit(1); |
|
} |
|
andc[i]=(double)(lval); |
|
strcpy(line,stra); |
|
|
|
cutv(stra, strb,line,' '); |
|
errno=0; |
|
lval=strtol(strb,&endptr,10); |
|
if( strb[0]=='\0' || (*endptr != '\0')){ |
|
printf("Error reading data around '%d' at line number %ld %s for individual %d\nShould be a month of death. Exiting.\n",lval,i,line, linei); |
|
exit(1); |
|
} |
|
moisdc[i]=(double)(lval); |
|
|
|
strcpy(line,stra); |
|
cutv(stra, strb,line,'/'); |
|
errno=0; |
|
lval=strtol(strb,&endptr,10); |
|
if( strb[0]=='\0' || (*endptr != '\0')){ |
|
printf("Error reading data around '%d' at line number %ld %s for individual %d\nShould be a year of birth. Exiting.\n",lval, i,line, linei); |
|
exit(1); |
|
} |
|
annais[i]=(double)(lval); |
|
|
|
strcpy(line,stra); |
|
cutv(stra, strb,line,' '); |
|
errno=0; |
|
lval=strtol(strb,&endptr,10); |
|
if( strb[0]=='\0' || (*endptr != '\0')){ |
|
printf("Error reading data around '%d' at line number %ld %s for individual %d\nShould be a month of birth. Exiting.\n",lval,i,line,linei); |
|
exit(1); |
|
} |
|
moisnais[i]=(double)(lval); |
|
strcpy(line,stra); |
|
|
|
cutv(stra, strb,line,' '); |
|
errno=0; |
|
lval=strtol(strb,&endptr,10); |
|
if( strb[0]=='\0' || (*endptr != '\0')){ |
|
printf("Error reading data around '%d' at line number %ld %s for individual %d\nShould be a weight. Exiting.\n",lval, i,line,linei); |
|
exit(1); |
|
} |
|
weight[i]=(double)(lval); |
|
strcpy(line,stra); |
|
|
cutv(stra, strb,line,' '); weight[i]=(double)(atoi(strb)); strcpy(line,stra); |
|
for (j=ncovcol;j>=1;j--){ |
for (j=ncovcol;j>=1;j--){ |
cutv(stra, strb,line,' '); covar[j][i]=(double)(atoi(strb)); strcpy(line,stra); |
cutv(stra, strb,line,' '); |
|
errno=0; |
|
lval=strtol(strb,&endptr,10); |
|
if( strb[0]=='\0' || (*endptr != '\0')){ |
|
printf("Error reading data around '%d' at line number %ld %s for individual %d\nShould be a covar (meaning 0 for the reference or 1). Exiting.\n",lval, i,line,linei); |
|
exit(1); |
|
} |
|
if(lval <0 || lval >1){ |
|
printf("Error reading data around '%d' at line number %ld %s for individual %d\nShould be a value of the %d covar (meaning 0 for the reference or 1. IMaCh does not build design variables, do it your self). Exiting.\n",lval,i,line,linei,j); |
|
exit(1); |
|
} |
|
covar[j][i]=(double)(lval); |
|
strcpy(line,stra); |
} |
} |
lstra=strlen(stra); |
lstra=strlen(stra); |
|
|
if(lstra > 9){ /* More than 2**32 or max of what printf can write with %ld */ |
if(lstra > 9){ /* More than 2**32 or max of what printf can write with %ld */ |
stratrunc = &(stra[lstra-9]); |
stratrunc = &(stra[lstra-9]); |
num[i]=atol(stratrunc); |
num[i]=atol(stratrunc); |
} |
} |
else |
else |
num[i]=atol(stra); |
num[i]=atol(stra); |
|
printf ("num [i] %ld %d\n",i, num[i]);fflush(stdout); |
/*if((s[2][i]==2) && (s[3][i]==-1)&&(s[4][i]==9)){ |
/*if((s[2][i]==2) && (s[3][i]==-1)&&(s[4][i]==9)){ |
printf("%ld %.lf %.lf %.lf %.lf/%.lf %.lf/%.lf %.lf/%.lf %d %.lf/%.lf %d %.lf/%.lf %d %.lf/%.lf %d\n",num[i],(covar[1][i]), (covar[2][i]),weight[i], (moisnais[i]), (annais[i]), (moisdc[i]), (andc[i]), (mint[1][i]), (anint[1][i]), (s[1][i]), (mint[2][i]), (anint[2][i]), (s[2][i]), (mint[3][i]), (anint[3][i]), (s[3][i]), (mint[4][i]), (anint[4][i]), (s[4][i])); ij=ij+1;}*/ |
printf("%ld %.lf %.lf %.lf %.lf/%.lf %.lf/%.lf %.lf/%.lf %d %.lf/%.lf %d %.lf/%.lf %d %.lf/%.lf %d\n",num[i],(covar[1][i]), (covar[2][i]),weight[i], (moisnais[i]), (annais[i]), (moisdc[i]), (andc[i]), (mint[1][i]), (anint[1][i]), (s[1][i]), (mint[2][i]), (anint[2][i]), (s[2][i]), (mint[3][i]), (anint[3][i]), (s[3][i]), (mint[4][i]), (anint[4][i]), (s[4][i])); ij=ij+1;}*/ |
|
|
i=i+1; |
i=i+1; |
} |
} /* End loop reading data */ |
} |
|
/* printf("ii=%d", ij); |
/* printf("ii=%d", ij); |
scanf("%d",i);*/ |
scanf("%d",i);*/ |
imx=i-1; /* Number of individuals */ |
imx=i-1; /* Number of individuals */ |
Line 4645 int main(int argc, char *argv[])
|
Line 4764 int main(int argc, char *argv[])
|
} |
} |
} |
} |
else if(s[m][i] !=9){ /* Standard case, age in fractional |
else if(s[m][i] !=9){ /* Standard case, age in fractional |
years but with the precision of a |
years but with the precision of a month */ |
month */ |
|
agev[m][i]=(mint[m][i]/12.+1./24.+anint[m][i])-(moisnais[i]/12.+1./24.+annais[i]); |
agev[m][i]=(mint[m][i]/12.+1./24.+anint[m][i])-(moisnais[i]/12.+1./24.+annais[i]); |
if((int)mint[m][i]==99 || (int)anint[m][i]==9999) |
if((int)mint[m][i]==99 || (int)anint[m][i]==9999) |
agev[m][i]=1; |
agev[m][i]=1; |
Line 5530 lsurv=vector(1,AGESUP);
|
Line 5648 lsurv=vector(1,AGESUP);
|
/*------ End -----------*/ |
/*------ End -----------*/ |
|
|
chdir(path); |
chdir(path); |
|
#ifndef UNIX |
|
/* strcpy(plotcmd,"\""); */ |
|
#endif |
|
strcpy(plotcmd,pathimach); |
|
/*strcat(plotcmd,CHARSEPARATOR);*/ |
|
strcat(plotcmd,GNUPLOTPROGRAM); |
|
#ifndef UNIX |
|
strcat(plotcmd,".exe"); |
|
/* strcat(plotcmd,"\"");*/ |
|
#endif |
|
if(stat(plotcmd,&info)){ |
|
printf("Error gnuplot program not found: %s\n",plotcmd);fflush(stdout); |
|
} |
|
|
|
#ifndef UNIX |
strcpy(plotcmd,"\""); |
strcpy(plotcmd,"\""); |
|
#endif |
strcat(plotcmd,pathimach); |
strcat(plotcmd,pathimach); |
strcat(plotcmd,GNUPLOTPROGRAM); |
strcat(plotcmd,GNUPLOTPROGRAM); |
|
#ifndef UNIX |
|
strcat(plotcmd,".exe"); |
strcat(plotcmd,"\""); |
strcat(plotcmd,"\""); |
|
#endif |
strcat(plotcmd," "); |
strcat(plotcmd," "); |
strcat(plotcmd,optionfilegnuplot); |
strcat(plotcmd,optionfilegnuplot); |
printf("Starting graphs with: %s",plotcmd);fflush(stdout); |
printf("Starting graphs with: %s",plotcmd);fflush(stdout); |
|
|
if((outcmd=system(plotcmd)) != 0){ |
if((outcmd=system(plotcmd)) != 0){ |
printf(" Problem with gnuplot\n"); |
printf("\n Problem with gnuplot\n"); |
} |
} |
printf(" Wait..."); |
printf(" Wait..."); |
while (z[0] != 'q') { |
while (z[0] != 'q') { |