18 query <<
"get_experiment_desc" << invID;
33 QString oper =
"upload/download";
34 QString lexpGUID =
"";
35 QString dexpGUID =
"";
38 bool havelraw =
false;
39 bool havelexp =
false;
40 bool havedraw =
false;
41 bool havedexp =
false;
42 bool haverexp = !rexpGUID.isEmpty();
54 havelexp = !lexpGUID.startsWith(
"0000" );
55 runID = cdesc.
filename.section(
"/", -1, -1 ).section(
".", 0, 0 );
61 if ( havelexp && havelraw )
69 query <<
"get_rawDataID_from_GUID" << cdesc.
dataGUID;
79 havedexp = ( jj >= 0 );
81 runID = ( havedexp ) ?
runIDs.at( jj ) : runID;
87 query <<
"get_experiment_info" <<
expID;
90 dexpGUID =
db->
value( 0 ).toString();
91 DbgLv(1) <<
"db get_exp_inf: expGUID" << dexpGUID;
92 DbgLv(1) <<
"db get_exp_inf: projID " <<
db->
value(1).toString();
93 DbgLv(1) <<
"db get_exp_inf: runID " <<
db->
value(2).toString();
94 DbgLv(1) <<
"db get_exp_inf: rotorID" <<
db->
value(6).toString();
95 DbgLv(1) <<
"db get_exp_inf: type " <<
db->
value(7).toString();
96 DbgLv(1) <<
"db get_exp_inf: comment" <<
db->
value(10).toString();
97 DbgLv(1) <<
"db get_exp_inf: dateUpd" <<
db->
value(12).toString();
98 if ( dexpGUID.isEmpty() || dexpGUID.startsWith(
"0000" ) )
100 QString projID =
db->
value( 1 ).toString();
101 QString runID =
db->
value( 2 ).toString();
102 QString labID =
db->
value( 3 ).toString();
103 QString instrID =
db->
value( 4 ).toString();
104 QString operID =
db->
value( 5 ).toString();
105 QString rotorID =
db->
value( 6 ).toString();
106 QString type =
db->
value( 7 ).toString();
107 QString runTemp =
db->
value( 8 ).toString();
108 QString label =
db->
value( 9 ).toString();
109 QString comment =
db->
value( 10 ).toString();
110 QString centrf =
db->
value( 11 ).toString();
111 QString persID =
db->
value( 13 ).toString();
112 dexpGUID = lexpGUID.isEmpty() ?
116 query <<
"update_experiment" << expID << dexpGUID
117 << projID << runID << labID << instrID
118 << operID << rotorID << type << runTemp << label
119 << comment << centrf;
124 DbgLv(1) <<
"Successful EXP update, GUID" << dexpGUID;
130 DbgLv(1) <<
" EXP update: ID exp run raw" << expID << runID <<
rawID;
134 qDebug() <<
"*ERROR* EXP update, GUID" << dexpGUID;
136 status = 6000 + stat;
146 if ( havedexp && havedraw )
151 if ( havedexp && havelexp )
153 if ( dexpGUID == lexpGUID )
163 tr(
"A parent Experiment record in the database\n"
164 "or on local disk is missing or inconsistent, so\n"
165 "you are unable to %1 this Raw record.\n\n"
166 "You may separately run us_convert and create\n"
167 "or repair the experiment record; then return here\n"
168 "later to attempt the operation on this record.\n\n"
172 msg += havedexp ? tr(
" Experiment is in database;\n" )
173 : tr(
" Experiment missing from database;\n" );
174 msg += havelexp ? tr(
" Experiment file exists locally;\n" )
175 : tr(
" Experiment missing from local disk;\n" );
176 msg += havedraw ? tr(
" Raw data is in database;\n" )
177 : tr(
" Raw data missing from database;\n" );
178 msg += havelraw ? tr(
" Raw data file exists locally;\n" )
179 : tr(
" Raw data missing from local disk;\n" );
180 msg += tr(
" Database experiment GUID:" );
181 msg += ( havedexp ?
"\n \"" + dexpGUID +
"\"\n"
182 : tr(
" (missing)\n" ) );
183 msg += tr(
" Local experiment GUID:" );
184 msg += ( havelexp ?
"\n \"" + lexpGUID +
"\"\n"
185 : tr(
" (missing)\n" ) );
186 msg += tr(
" Raw record parent GUID:" );
187 msg += ( haverexp ?
"\n \"" + rexpGUID +
"\"\n"
188 : tr(
" (missing)\n" ) );
190 QMessageBox::information(
parentw,
191 tr(
"Experiment Record Problem" ),
198 cdesc.
parentGUID = dexpGUID.isEmpty() ? lexpGUID : dexpGUID;
208 QString expGUID =
"00000000-0000-0000-0000-000000000000";
210 QString expfnam = aucfile.section(
"/", -1, -1 )
211 .section(
".", 0, 1 ) +
".xml";
212 QString expfile = aucfile.section(
"/", 0, -2 ) +
"/" + expfnam;
214 QFile file( expfile );
216 if ( file.open( QIODevice::ReadOnly | QIODevice::Text ) )
218 QXmlStreamReader xml( &file );
220 while( ! xml.atEnd() )
224 if ( xml.isStartElement() && xml.name() ==
"experiment" )
226 QXmlStreamAttributes a = xml.attributes();
227 expGUID = a.value(
"guid" ).toString();