- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/faketool.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/ippTools/src
- Property svn:ignore
-
old new 33 33 pstamptool 34 34 disttool 35 receivetool
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090301/ippTools/src/faketool.c
r23352 r24244 128 128 PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "dateobs", "<="); 129 129 PXOPT_COPY_STR(config->args, where, "-exp_tag", "exp_tag", "=="); 130 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");130 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 131 131 PXOPT_COPY_STR(config->args, where, "-filelevel", "filelevel", "=="); 132 132 PXOPT_COPY_STR(config->args, where, "-reduction", "reduction", "=="); … … 227 227 psFree(output); 228 228 return false; 229 } 230 231 // if end_stage is warp (or NULL), check for valid tess_id 232 for (long i = 0; i < psArrayLength(output); i++) { 233 psMetadata *md = output->data[i]; 234 235 bool status; 236 char *end_stage = psMetadataLookupStr(&status, md, "end_stage"); 237 if (end_stage && strcasecmp(end_stage, "warp")) continue; 238 239 char *raw_tess_id = psMetadataLookupStr(&status, md, "tess_id"); 240 if (raw_tess_id || tess_id) continue; 241 242 char *label = psMetadataLookupStr(&status, md, "label"); 243 psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id"); 244 245 if (!status) { 246 psError(PS_ERR_UNKNOWN, false, "cannot queue analysis to WARP without a defined tess id: label: %s, exp_id %" PRId64, label, exp_id); 247 psFree(output); 248 return false; 249 } 229 250 } 230 251 … … 355 376 356 377 psMetadata *where = psMetadataAlloc(); 378 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 357 379 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 358 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");359 380 PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "=="); 360 381 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); … … 421 442 psMetadata *where = psMetadataAlloc(); 422 443 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 423 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");444 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 424 445 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 425 446 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); … … 496 517 497 518 // default values 498 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);519 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 499 520 500 521 if (!psDBTransaction(config->dbh)) { … … 513 534 path_base, 514 535 "full", 515 code,536 fault, 516 537 NULL // epoch 517 538 )) { … … 542 563 543 564 psMetadata *where = psMetadataAlloc(); 544 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake Run.fake_id", "==");565 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 545 566 PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "=="); 546 567 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); … … 687 708 PS_ASSERT_PTR_NON_NULL(config, false); 688 709 689 PXOPT_LOOKUP_S16( code, config->args, "-code", true, false);710 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 690 711 691 712 psMetadata *where = psMetadataAlloc(); … … 693 714 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 694 715 695 if (!pxSetFaultCode(config->dbh, "fakeProcessedImfile", where, code)) {716 if (!pxSetFaultCode(config->dbh, "fakeProcessedImfile", where, fault)) { 696 717 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 697 718 psFree(where); … … 874 895 875 896 psMetadata *where = psMetadataAlloc(); 876 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");897 pxAddLabelSearchArgs (config, where, "-label", "fakeRun.label", "=="); 877 898 878 899 psString query = pxDataGet("faketool_pendingcleanuprun.sql"); … … 939 960 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 940 961 } 941 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");962 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 942 963 943 964 psString query = pxDataGet("faketool_pendingcleanupimfile.sql"); … … 1058 1079 psMetadata *where = psMetadataAlloc(); 1059 1080 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 1060 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");1081 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 1061 1082 1062 1083 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); … … 1238 1259 1239 1260 int numExportTables = 2; 1240 1261 1241 1262 PS_ASSERT_PTR_NON_NULL(config, NULL); 1242 1263 … … 1244 1265 PXOPT_LOOKUP_STR(outfile, config->args, "-outfile", true, false); 1245 1266 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1267 PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false); 1246 1268 1247 1269 FILE *f = fopen (outfile, "w"); … … 1292 1314 } 1293 1315 if (!psArrayLength(output)) { 1294 ps Trace("regtool", PS_LOG_INFO, "no rows found");1316 psError(PS_ERR_UNKNOWN, true, "no rows found"); 1295 1317 psFree(output); 1296 return true; 1318 return false; 1319 } 1320 1321 if (clean) { 1322 if (!strcmp(tables[i].tableName, "fakeRun")) { 1323 if(!pxSetStateCleaned("fakeRun", "state", output)) { 1324 psFree(output); 1325 psError(PS_ERR_UNKNOWN, false, "pxSetStateClean failed for table %s", tables[i].tableName); 1326 return false; 1327 } 1328 } 1297 1329 } 1298 1330 … … 1316 1348 1317 1349 PS_ASSERT_PTR_NON_NULL(config, NULL); 1318 1350 1319 1351 PXOPT_LOOKUP_STR(infile, config->args, "-infile", true, false); 1320 1352
Note:
See TracChangeset
for help on using the changeset viewer.
