106{
107 char buf[256];
108 char key[256];
110
111 FILE *fp=fopen(
file,
"r");
113 printf(
"ERROR: enable to open file: %s \n",
file);
114 return(-1);
115 }else
116 printf(
"\nRead parameters from file: %s\n\n",
file );
117
118 while( fgets(buf,256,fp)!=
NULL ) {
119
120 for( int i=0; i<(int)strlen(buf); i++ )
121 if( buf[i]=='#' ) {
122 buf[i]='\0';
123 break;
124 }
125
126 if( sscanf(buf,"%s",key)!=1 ) continue;
127
128 if ( !strcmp(key,"RUNNAME") )
129 {
130 sscanf(buf+strlen(key),
"%s",
name);
132 }
133 else if ( !strcmp(key,"RUNTITLE") )
134 {
136 }
137 else if ( !strcmp(key,"CCD") )
138 {
140 }
141 else if ( !strcmp(key,"OBJECTIVE") )
142 {
144 }
145 else if ( !strcmp(key,"AREA") )
146 {
148 }
149 else if ( !strcmp(key,"PLATE") )
150 {
152 }
153 else if ( !strcmp(key,"PREDICTIONS") )
154 {
155 sscanf(buf+strlen(key),
"%s",
name);
157 }
158 else if ( !strcmp(key,"FIDUCIALS") )
159 {
160 sscanf(buf+strlen(key),
"%s",
name);
162 }
163
164 else if ( !strcmp(key,"LASTRUN") )
165 {
166 sscanf( buf+strlen(key),
"%d", &
eRunID );
168 }
169
170 }
171
173
174 return 0;
175}
int ReadParameters(const char *str)
Definition: EdbFiducial.cxx:99
int ReadParameters(const char *str)
Definition: EdbStage.cxx:94
Int_t ReadDA(char *file)
Definition: EdbFiducial.cxx:293
int ReadParameters(const char *str)
Definition: EdbStage.cxx:153
EdbRun * GetRun() const
Definition: EdbOnline.h:37
int ReadParameters(const char *str)
Definition: EdbRunHeader.cxx:188
int ReadDC(char *file)
Definition: EdbPrediction.cxx:203
EdbPredictionsBox * GetPredictions() const
Definition: EdbRun.h:119
EdbMarksSet * GetMarks() const
Definition: EdbRun.h:120
EdbRunHeader * GetHeader() const
Definition: EdbRun.h:138
EdbObjective * GetObjective() const
Definition: EdbStage.h:105
EdbCCD * GetCCD() const
Definition: EdbStage.h:104
TFile * file
Definition: write_pvr.C:3
#define NULL
Definition: nidaqmx.h:84