16 QVector< US_mwlRamp::RampRawData >& allData, QString& runID_xml_mwl )
23 QDir ddir(
cur_dir,
"*", QDir::Name, QDir::Files | QDir::Readable );
30 runID_xml_mwl =
runID;
35 QString old_runID =
runID;
36 runID.replace( QRegExp(
"![A-Za-z0-9_-]" ),
"_" );
38 if (
runID != old_runID )
40 QMessageBox::warning( 0,
41 tr(
"RunID Name Changed" ),
42 tr(
"The runID name has been changed. It may consist only\n"
43 "of alphanumeric characters, underscore, or hyphen.\n"
44 " New runID: " ) +
runID );
48 QStringList mwrfs = ddir.entryList( QStringList(
"*.mwsr" ),
49 QDir::Files, QDir::Name );
54 le_status->setText( QString(
"%1 files from %2 ..." )
56 qApp->processEvents();
57 qDebug() <<
"MwDa: nfile" <<
nfile;
60 for (
int ii = 0; ii <
nfile; ii++ )
62 QString fname = mwrfs.at( ii );
63 QString fpath =
cur_dir + fname;
64 QString acell = fname.section(
".", -3, -3 );
65 QString chann = fname.section(
".", -2, -2 );
69 if ( !
cells.contains( acell ) )
cells << acell;
70 if ( !chans.contains( chann ) ) chans << chann;
77 int ncell =
cells.size();
78 int nchan = chans.size();
83 qDebug() <<
"kcelchn ncelchn" << kcelchn <<
ncelchn;
88 le_status->setText( QString(
"%1 cell(s) and %2 channel(s) ..." )
89 .arg( ncell ).arg( nchan ) );
90 qApp->processEvents();
92 for (
int ii = 0; ii < ncell; ii++ )
94 for (
int jj = 0; jj < nchan; jj++ )
96 QString celchn =
cells[ ii ] +
" / " + chans[ jj ];
101 for (
int cc = 0; cc <
cellchans.size(); cc++)
106 if ( ! fi.open( QIODevice::ReadOnly ) )
108 qDebug() <<
"*ERROR* Unable to open" <<
fpaths.at(cc);
112 QDataStream ds( &fi );
116 ds.readRawData( cbuf, 2 );
117 raw.
cell = QChar(
'0' | cbuf[ 0 ] );
118 raw.
chan = QChar( cbuf[ 1 ] );
126 qDebug() <<
"#scans" << n;
129 qDebug() <<
"#wl" << n_wl;
131 qint16 wl_array_temp;
133 for (
int ii = 0; ii < n_wl; ii++)
136 raw.
wl_array [ii] = (int)wl_array_temp;
140 for (
int ii = 0; ii<n; ii++)
146 for (
int ii = 0; ii<n; ii++)
152 for (
int ii = 0; ii<n; ii++)
156 qDebug() <<
"n_wl n" << n_wl << n;
159 for (
int wl = 0; wl<n_wl; wl++)
163 qDebug()<<
"sizeintarray"<<raw.
intarray.size() <<
"raw.intarray[cc].size()"<<raw.
intarray[cc].size();
164 for (
int wl = 0; wl<n_wl; wl++)
166 for (
int dat = 0; dat<n; dat++)
184 qDebug() <<
"alldat"<< allData[cc].
chan<<
"temp"<<allData[cc].temperature;
187 for (
int ii = 0; ii <
nlamb_i; ii++)
188 {
ri_wavelns.append(
int(allData[0].wl_array[ii]));}
189 qDebug() <<
"ri"<<
ri_wavelns.size() <<
"raw"<< allData[0].wl_array.size();
191 for (
int cc = 0; cc <
ncelchn; cc++ )
201 QStringList mwrfs = ddir.entryList( QStringList(
"*.mwsr.xml" ),
202 QDir::Files, QDir::Name );
203 int nxfile = mwrfs.count();
207 qDebug() <<
"*ERROR* '*.mwsr.xml' count > 1" << nxfile << curdir;
210 qDebug() << mwrfs.size();
211 QString fname = mwrfs.at( 0 );
212 QString fpath = curdir + fname;
216 if ( ! xfi.open( QIODevice::ReadOnly ) )
218 qDebug() <<
"*ERROR* Unable to open" << fname;
223 QXmlStreamReader xml( &xfi );
231 while( ! xml.atEnd() )
234 if ( xml.isStartElement() )
236 QXmlStreamAttributes att = xml.attributes();
237 if ( xml.name() ==
"runID" )
239 runID = att.value(
"name" ).toString();
240 radius = att.value(
"radius_measurement" ).toString().toDouble();
242 else if ( xml.name() ==
"cell" )
244 celi = att.value(
"id" ).toString();
245 celi = QString::number( celi.toInt() );
247 else if ( xml.name() ==
"channel" )
249 chni = att.value(
"id" ).toString();
250 cech = celi +
" / " + chni;
251 QString desc= att.value(
"sample" ).toString();
252 menisc = att.value(
"radius_meniscus").toString().toDouble();
253 bott = att.value(
"radius_bottom" ).toString().toDouble();