24 DbgLv(1) <<
"REC_ULD: row" << row+1;
31 errMsg = tr(
"Cannot upload records whose ancestor"
32 " Raw record is not both DB and Local.\n"
33 "Use us_convert (Utilities->Convert Legacy Data)"
34 " to create or modify the ancestor Raw." );
45 errMsg = tr(
"The Local file record is older than the DB record." );
52 QString pathdir = filepath.section(
"/", 0, -2 );
53 QString filename = filepath.section(
"/", -1, -1 );
59 QString runID = filename.section(
".", 0, 0 );
60 QString tripl = filename.section(
".", -4, -2 )
61 .replace(
".",
" / " );
62 DbgLv(1) <<
"REC_ULD:RAW: runID" << runID <<
" tripl" << tripl;
72 QString(
"upload_aucData" ),
74 errMsg = tr(
"Raw upload writeBlobToDB() status %1" ).arg( stat );
75 stat = ( stat == 0 ) ? 0 : 3041;
81 QString runID = filename.section(
".", 0, 0 );
82 QString label = filename.section(
".", 0, 1 );
85 QString editID = QString::number( idData );
88 query <<
"get_rawDataID_from_GUID" << rawGUID;
93 errMsg = tr(
"Raw DB record for Edit could not be accessed: %1" )
101 DbgLv(1) <<
"editUpld: rawGUID" << rawGUID;
103 QString rawDataID =
db->
value( 0 ).toString();
105 DbgLv(1) <<
"editUpld: rawDataID" << rawDataID;
110 query <<
"new_editedData" << rawDataID << editGUID << runID
114 editID = QString::number( idData );
115 DbgLv(1) <<
"editUpld: NEW idData" << idData << editID;
119 query <<
"update_editedData" << editID << rawDataID << editGUID
122 DbgLv(1) <<
"editUpld: label" << label;
125 QString(
"upload_editData" ),
127 errMsg = tr(
"writeBlob Edited stat %1, idData %2" )
128 .arg( stat ).arg( idData );
129 stat = ( stat == 0 ) ? 0 : 3042;
139 model.
load( filepath );
142 errMsg = tr(
"model write to DB stat %1" ).arg( stat );
143 stat = ( stat == 0 ) ? 0 : 3043;
151 DbgLv(2) <<
"NOISE: (1) filepath" << filepath;
153 DbgLv(2) <<
"NOISE: (2) filepath" << filepath;
155 noise.
load( filepath );
157 errMsg = tr(
"noise write to DB stat %1" ).arg( stat );
158 stat = ( stat == 0 ) ? 0 : 3044;
186 errMsg = tr(
"Cannot download records whose ancestor"
187 " Raw record is not both DB and Local.\n"
188 "Use us_convert (Utilities->Convert Legacy Data)"
189 " to create or modify the ancestor Raw." );
195 QString dataID = QString::number( idData );
198 QString filename = filepath.section(
"/", -1, -1 );
199 QString runID = filename.section(
".", 0, 0 );
201 filepath = ( filepath == filename ) ?
206 QString filedir = filepath.section(
"/", 0, -2 );
208 if ( ! dirp.exists( filedir ) )
210 if ( ! dirp.mkpath( filedir ) )
213 errMsg = tr(
"Unable to create download directory\n" )
224 errMsg = tr(
"Raw download status %1" ).arg( stat )
232 errMsg = tr(
"Edited download status %1" ).arg( stat )
243 query <<
"get_model_info" << dataID;
250 QString contents =
db->
value( 2 ).toString();
251 QFile fileo( filepath );
252 if ( fileo.open( QIODevice::WriteOnly | QIODevice::Text ) )
254 QTextStream tso( &fileo );
263 errMsg = tr(
"Model load for download, status %1" ).arg( stat );
273 stat = noise.
load( dataID,
db );
277 stat = noise.
write( filepath );
281 errMsg = tr(
"Noise write for download, status %1" ).arg( stat );
291 errMsg = tr(
"Noise load for download, status %1" ).arg( stat );
318 QString dataID = QString::number( irecID );
329 query <<
"delete_rawData" << QString::number(
cdesc.
parentID );
334 errMsg = tr(
"delete_rawData status=%1" ).arg( stat );
344 query <<
"delete_editedData" << dataID;
345 DbgLv(1) <<
"EDT_RMV:" << query;
349 errMsg = tr(
"delete_editedData status=%1" ).arg( stat );
351 DbgLv(1) <<
"EDT_RMV: dataID" << dataID <<
"errMsg:" <<
errMsg;
356 DbgLv(1) <<
"EDT_RMV: stat" << stat;
362 query <<
"delete_model" << dataID;
366 errMsg = tr(
"delete_model status=%1" ).arg( stat );
367 DbgLv(1) <<
"MOD_RMV: dataID" << dataID <<
"errMsg:" <<
errMsg;
378 query <<
"delete_noise" << dataID;
382 errMsg = tr(
"delete_noise status=%1" ).arg( stat );
383 DbgLv(1) <<
"NOI_RMV: dataID" << dataID <<
"errMsg:" <<
errMsg;
413 QString filename = filepath.section(
"/", -1, -1 );
414 QFile file( filepath );
435 errMsg = tr(
"File remove error,\n" ) + filepath;
442 errMsg = tr(
"*ERROR* attempt to remove non-existent file\n" ) + filepath;
459 if ( !path.isEmpty() && QFile( path ).exists() )
485 if ( !path.isEmpty() && QFile( path ).exists() )
500 if ( ! dir.exists( path ) )
502 if ( ! dir.mkpath( path ) )
518 errMsg += tr(
"\n\n%1 error(s) on %2 attempted actions.\n" )
519 .arg( nacterrs ).arg( nactions );
535 while ( --jrow >= 0 )
541 if ( ( ddesc.
recState & bSrc ) == bSrc )