9 QFile file ( xmlfile );
11 if ( ! file.open( QIODevice::ReadOnly | QIODevice::Text) )
14 if (
my_rank == 0 )
DbgLv(0) <<
"Cannot open file " << xmlfile;
15 printf(
"Cannot open file %s\n", xmlfile.toAscii().data() );
21 QXmlStreamReader xml( &file );
23 while ( ! xml.atEnd() )
27 if ( xml.isStartElement() )
29 if ( xml.name() ==
"US_JobSubmit" )
31 QXmlStreamAttributes a = xml.attributes();
35 if ( xml.name() ==
"job" )
38 if ( xml.name() ==
"dataset" )
60 s_attrs <<
"s" <<
"ff0" <<
"MW" <<
"vbar" <<
"D" <<
"f";
80 else if ( !
parameters[
"solute_type" ].isEmpty() )
110 QXmlStreamAttributes attr;
114 while ( ! xml.atEnd() )
117 xname = xml.name().toString();
119 if ( xml.isEndElement() && xname ==
"job" )
break;
121 if ( xml.isStartElement() )
123 attr = xml.attributes();
125 if ( xname ==
"cluster" )
127 cluster = attr.value(
"shortname" ).toString();
130 else if ( xname ==
"name" )
132 db_name = attr.value(
"value" ).toString();
135 else if ( xname ==
"udp" )
137 server = QHostAddress( attr.value(
"server" ).toString() );
138 port = (quint16)attr.value(
"port" ).toString().toInt();
141 else if ( xname ==
"global_fit" )
143 parameters[ xname ] = attr.value(
"value" ).toString();
146 else if ( xname ==
"request" )
150 attr.value(
"id" ).toString().toInt() );
154 else if ( xname ==
"jobParameters" )
156 while ( ! xml.atEnd() )
159 QString name = xml.name().toString();
161 if ( xml.isEndElement() && name ==
"jobParameters" )
break;
163 if ( xml.isStartElement() )
165 attr = xml.attributes();
167 if ( name ==
"bucket" )
169 QString ytyp0 = QString(
"ff0" );
171 QString stxmn = attr.value(
"x_min" ).toString();
172 QString stxmx = attr.value(
"x_max" ).toString();
173 QString stymn = attr.value(
"y_min" ).toString();
174 QString stymx = attr.value(
"y_max" ).toString();
175 QString stfmn = attr.value(
"ff0_min" ).toString();
176 QString stfmx = attr.value(
"ff0_max" ).toString();
177 QString stvmn = attr.value(
"vbar_min" ).toString();
178 QString stvmx = attr.value(
"vbar_max" ).toString();
179 double xmin = stxmn.toDouble();
180 double xmax = stxmx.toDouble();
181 double ymin = stymn.toDouble();
182 double ymax = stymx.toDouble();
184 if ( stxmx.isEmpty() )
186 xmin = attr.value(
"s_min").toString().toDouble();
187 xmax = attr.value(
"s_max").toString().toDouble();
188 if ( !stfmx.isEmpty() )
190 ymin = stfmn.toDouble();
191 ymax = stfmx.toDouble();
192 ytyp0 = QString(
"ff0" );
194 else if ( !stvmx.isEmpty() )
196 ymin = stvmn.toDouble();
197 ymax = stvmx.toDouble();
198 ytyp0 = QString(
"vbar" );
202 if ( ytype.isEmpty() )
209 if (
my_rank==0)
DbgLv(0) <<
"PF: xymnmx" << xmin << xmax << ymin << ymax;
210 int xpwr = (int)qFloor( log10( xmax ) ) - 6;
211 int ypwr = (int)qFloor( log10( ymax ) ) - 6;
212 double xinc = pow( 10.0, xpwr );
213 double yinc = pow( 10.0, ypwr );
214 if (
my_rank==0)
DbgLv(0) <<
"PF: xp yp xi yi" << xpwr << ypwr << xinc << yinc;
215 b.
x_min = qRound64( xmin / xinc ) * xinc;
216 b.
x_max = qRound64( xmax / xinc ) * xinc;
217 b.
y_min = qRound64( ymin / yinc ) * yinc;
218 b.
y_max = qRound64( ymax / yinc ) * yinc;
223 else if ( name ==
"CG_model" || name ==
"DC_model" )
225 parameters[ name ] = attr.value(
"filename").toString();
228 else if ( name ==
"bucket_fixed" )
230 parameters[ name ] = attr.value(
"value" ).toString();
231 parameters[
"xtype" ] = attr.value(
"xtype" ).toString();
232 parameters[
"ytype" ] = attr.value(
"ytype" ).toString();
233 parameters[
"ztype" ] = attr.value(
"fixedtype").toString();
237 else if ( name.startsWith(
"s_m" ) ||
238 name.startsWith(
"ff0_m" ) )
240 QString svalu = attr.value(
"value" ).toString();
242 name = name.replace(
"s_m",
"x_m" );
243 name = name.replace(
"ff0_m",
"y_m" );
249 parameters[ name ] = attr.value(
"value" ).toString();
269 &&
parameters[
"debug_timings" ].toInt() != 0 );
278 QXmlStreamAttributes a;
280 while ( ! xml.atEnd() )
283 QString name = xml.name().toString();
285 if ( xml.isEndElement() && xml.name() ==
"dataset" )
return;
287 if ( ! xml.isStartElement() )
continue;
289 if ( xml.name() ==
"files" )
292 if ( xml.name() ==
"solution" )
295 a = xml.attributes();
296 if ( xml.name() ==
"simpoints" )
299 = a.value(
"value" ).toString().toInt();
302 if ( xml.name() ==
"band_volume" )
305 = a.value(
"value" ).toString().toDouble();
308 if ( xml.name() ==
"radial_grid" )
311 a.value(
"value" ).toString().toInt();
314 if ( xml.name() ==
"time_grid" )
317 a.value(
"value" ).toString().toInt();
320 if ( xml.name() ==
"density" )
322 dataset->
density = a.value(
"value" ).toString().toDouble();
325 if ( xml.name() ==
"viscosity" )
327 dataset->
viscosity = a.value(
"value" ).toString().toDouble();
330 if ( xml.name() ==
"compress" )
332 dataset->
compress = a.value(
"value" ).toString().toDouble();
335 if ( xml.name() ==
"rotor_stretch" )
337 QStringList stretch =
338 a.value(
"value" ).toString().split(
" ", QString::SkipEmptyParts );
344 if ( xml.name() ==
"centerpiece_bottom" )
347 = a.value(
"value" ).toString().toDouble();
350 if ( xml.name() ==
"centerpiece_shape" )
352 QString shape = a.value(
"value" ).toString();
358 <<
"meniscus-matching"
362 = qMax( 0, shapes.indexOf( shape ) );
365 if ( xml.name() ==
"centerpiece_angle" )
368 = a.value(
"value" ).toString().toDouble();
371 if ( xml.name() ==
"centerpiece_pathlength" )
374 = a.value(
"value" ).toString().toDouble();
377 if ( xml.name() ==
"centerpiece_width" )
380 = a.value(
"value" ).toString().toDouble();
383 if ( xml.name() ==
"speedstep" )
397 while ( ! xml.atEnd() )
401 if ( xml.isEndElement() && xml.name() ==
"files" )
break;
403 if ( xml.isStartElement() )
405 QXmlStreamAttributes a = xml.attributes();
406 QString type = xml.name().toString();
407 QString filename = a.value(
"filename" ).toString();
409 if ( type ==
"auc" ) dataset->
auc_file = filename;
410 if ( type ==
"edit" ) dataset->
edit_file = filename;
411 if ( type ==
"noise" ) dataset->
noise_files << filename;
415 QString clambda = dataset->
edit_file.section(
".", -2, -2 );
416 if ( clambda.contains(
"-" ) )
418 clambda = clambda +
"@" + dataset->
auc_file.section(
".", -2, -2 );
419 QString fpart1 = dataset->
edit_file.section(
".", 0, -3 );
420 QString fpart2 = dataset->
edit_file.section(
".", -1, -1 );
421 dataset->
edit_file = fpart1 +
"." + clambda +
"." + fpart2;
429 while ( ! xml.atEnd() )
433 if ( xml.isEndElement() && xml.name() ==
"solution" )
break;
435 if ( xml.isStartElement() && xml.name() ==
"buffer" )
437 QXmlStreamAttributes a = xml.attributes();
438 dataset->
density = a.value(
"density" ).toString().toDouble();
439 dataset->
viscosity = a.value(
"viscosity" ).toString().toDouble();
440 dataset->
compress = a.value(
"compress" ).toString().toDouble();
441 dataset->
manual = a.value(
"manual" ).toString().toInt();
444 if ( xml.isStartElement() && xml.name() ==
"analyte" )
447 QXmlStreamAttributes a = xml.attributes();
449 aninfo.
analyte.
mw = a.value(
"mw" ).toString().toDouble();
450 aninfo.
analyte.
vbar20 = a.value(
"vbar20" ).toString().toDouble();
451 aninfo.
amount = a.value(
"amount" ).toString().toDouble();
452 QString atype = a.value(
"type" ).toString();
454 if ( atype ==
"DNA" )
456 if ( atype ==
"RNA" )
458 if ( atype ==
"Other" )