- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/faketool.c (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/ippTools/src
- Property svn:ignore
-
old new 1 *.la 2 *.lo 1 3 .deps 2 4 .gdb_history … … 4 6 Makefile 5 7 Makefile.in 8 addtool 9 caltool 10 camtool 11 chiptool 6 12 config.h 7 13 config.h.in 8 stamp-h1 9 *.la 10 *.lo 14 detselect 15 dettool 16 difftool 17 disttool 18 dqstatstool 19 faketool 20 flatcorr 21 guidetool 22 magicdstool 23 magictool 24 pstamptool 25 pubtool 26 pxadmin 27 pxdata.c 28 pxinject 11 29 pxtoolsErrorCodes.c 12 30 pxtoolsErrorCodes.h 13 pxadmin14 pxinject15 pztool16 31 pzgetexp 17 32 pzgetimfiles 33 pztool 34 receivetool 18 35 regtool 19 guidetool 20 chiptool 21 camtool 36 stacktool 37 stamp-h1 22 38 warptool 23 difftool24 stacktool25 faketool26 dettool27 detselect28 pxdata.c29 magictool30 magicdstool31 caltool32 flatcorr33 pstamptool34 disttool35 receivetool36 37 pubtool
-
- Property svn:ignore
-
branches/simtest_nebulous_branches/ippTools/src/faketool.c
r24866 r27840 52 52 static bool tofullimfileMode(pxConfig *config); 53 53 static bool topurgedimfileMode(pxConfig *config); 54 static bool toscrubbedimfileMode(pxConfig *config); 54 55 static bool exportrunMode(pxConfig *config); 55 56 static bool importrunMode(pxConfig *config); … … 91 92 MODECASE(FAKETOOL_MODE_TOFULLIMFILE, tofullimfileMode); 92 93 MODECASE(FAKETOOL_MODE_TOPURGEDIMFILE, topurgedimfileMode); 94 MODECASE(FAKETOOL_MODE_TOSCRUBBEDIMFILE, toscrubbedimfileMode); 93 95 MODECASE(FAKETOOL_MODE_EXPORTRUN, exportrunMode); 94 96 MODECASE(FAKETOOL_MODE_IMPORTRUN, importrunMode); … … 121 123 122 124 psMetadata *where = psMetadataAlloc(); 125 PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "=="); 126 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 123 127 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 124 128 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); … … 128 132 PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "dateobs", "<="); 129 133 PXOPT_COPY_STR(config->args, where, "-exp_tag", "exp_tag", "=="); 130 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 134 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); // XXX does this choose the right label? 131 135 PXOPT_COPY_STR(config->args, where, "-filelevel", "filelevel", "=="); 132 136 PXOPT_COPY_STR(config->args, where, "-reduction", "reduction", "=="); … … 164 168 && !psMetadataLookupBool(NULL, config->args, "-all")) { 165 169 psFree(where); 166 psError(PXTOOLS_ERR_ DATA, false, "search parameters are required");170 psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required"); 167 171 return false; 168 172 } … … 175 179 PXOPT_LOOKUP_STR(tess_id, config->args, "-set_tess_id", false, false); 176 180 PXOPT_LOOKUP_STR(end_stage, config->args, "-set_end_stage", false, false); 181 PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false); 182 PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false); 183 PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false); 177 184 178 185 // default … … 183 190 psString query = pxDataGet("faketool_find_camrun.sql"); 184 191 if (!query) { 185 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");192 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 186 193 psFree(where); 187 194 return false; … … 263 270 264 271 // queue the exp 265 if (!pxfakeQueueByCamID(config, cam_id, workdir, label, reduction, expgroup, dvodb, tess_id, end_stage)) {272 if (!pxfakeQueueByCamID(config, cam_id, workdir, label, data_group ? data_group : label, dist_group, reduction, expgroup, dvodb, tess_id, end_stage, note)) { 266 273 if (!psDBRollback(config->dbh)) { 267 274 psError(PS_ERR_UNKNOWN, false, "database error"); … … 328 335 PXOPT_COPY_F32(config->args, where, "-sun_angle_max", "sun_angle", "<"); 329 336 PXOPT_COPY_STR(config->args, where, "-label", "fakeRun.label", "=="); 330 331 if (!psListLength(where->list) 332 && !psMetadataLookupBool(NULL, config->args, "-all")) { 337 PXOPT_COPY_STR(config->args, where, "-data_group", "fakeRun.data_group", "=="); 338 PXOPT_COPY_STR(config->args, where, "-dist_group", "fakeRun.dist_group", "=="); 339 340 if (!psListLength(where->list)) { 333 341 psFree(where); 334 342 where = NULL; 335 psError(PXTOOLS_ERR_DATA, false, "search parameters are required"); 336 return false; 337 } 338 339 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 340 PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false); 341 342 if ((!state) && (!label)) { 343 psError(PXTOOLS_ERR_DATA, false, "parameters are required"); 344 psFree(where); 345 return false; 346 } 347 348 if (state) { 349 // set fakeRun.state to state 350 if (!pxfakeRunSetStateByQuery(config, where, state)) { 351 psFree(where); 352 return false; 353 } 354 } 355 356 if (label) { 357 // set fakeRun.label to label 358 if (!pxfakeRunSetLabelByQuery(config, where, label)) { 359 psFree(where); 360 return false; 361 } 362 } 363 343 psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required"); 344 return false; 345 } 346 347 psString query = psStringCopy("UPDATE fakeRun JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id)"); 348 349 // pxUpdateRun gets parameters from config->args and updates 350 bool result = pxUpdateRun(config, where, &query, "fakeRun", "fake_id", "fakeProcessedImfile", true); 351 if (!result) { 352 psError(psErrorCodeLast(), false, "pxUpdateRun failed"); 353 } 354 355 psFree(query); 364 356 psFree(where); 365 357 366 return true;358 return result; 367 359 } 368 360 … … 383 375 psString query = pxDataGet("faketool_find_pendingexp.sql"); 384 376 if (!query) { 385 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");377 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 386 378 psFree(where); 387 379 return false; … … 450 442 psString query = pxDataGet("faketool_pendingimfile.sql"); 451 443 if (!query) { 452 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");444 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 453 445 return false; 454 446 } … … 566 558 PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "=="); 567 559 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); 568 PXOPT_COPY_STR(config->args, where, "-inst", "rawExp. telescope", "==");569 PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", " ==");560 PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.camera", "=="); 561 PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", "LIKE"); 570 562 571 563 psString query = pxDataGet("faketool_processedimfile.sql"); 572 564 if (!query) { 573 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");565 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 574 566 return false; 575 567 } 576 568 577 569 if (where && psListLength(where->list)) { 578 psString whereClause = psDBGenerateWhereConditionSQL(where, "fakeProcessedImfile");570 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 579 571 psStringAppend(&query, " AND %s", whereClause); 580 572 psFree(whereClause); … … 675 667 && !psMetadataLookupBool(NULL, config->args, "-all")) { 676 668 psFree(where); 677 psError(PXTOOLS_ERR_ DATA, false, "search parameters are required");669 psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required"); 678 670 return false; 679 671 } … … 681 673 psString query = pxDataGet("faketool_revertprocessedimfile.sql"); 682 674 if (!query) { 683 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");675 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 684 676 psFree(where); 685 677 return false; … … 822 814 psString query = pxDataGet("faketool_unmasked.sql"); 823 815 if (!query) { 824 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");816 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 825 817 return false; 826 818 } … … 899 891 psString query = pxDataGet("faketool_pendingcleanuprun.sql"); 900 892 if (!query) { 901 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");893 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 902 894 return false; 903 895 } … … 964 956 psString query = pxDataGet("faketool_pendingcleanupimfile.sql"); 965 957 if (!query) { 966 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");958 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 967 959 return false; 968 960 } … … 1025 1017 psString query = pxDataGet("faketool_donecleanup.sql"); 1026 1018 if (!query) { 1027 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");1019 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 1028 1020 return false; 1029 1021 } … … 1087 1079 psString query = pxDataGet("faketool_completely_processed_exp.sql"); 1088 1080 if (!query) { 1089 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");1081 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 1090 1082 return false; 1091 1083 } … … 1160 1152 fakeRun->workdir, 1161 1153 fakeRun->label, 1154 fakeRun->data_group, 1155 fakeRun->dist_group, 1162 1156 fakeRun->dvodb, 1163 1157 fakeRun->tess_id, 1164 1158 fakeRun->reduction, 1165 fakeRun->end_stage 1159 fakeRun->end_stage, 1160 NULL // note does not propagate 1166 1161 )) { 1167 1162 psError(PS_ERR_UNKNOWN, false, "failed to queue warpRun"); … … 1251 1246 return change_imfile_data_state(config, "purged", "goto_purged"); 1252 1247 } 1248 static bool toscrubbedimfileMode(pxConfig *config) 1249 { 1250 return change_imfile_data_state(config, "scrubbed", "goto_scrubbed"); 1251 } 1253 1252 1254 1253 bool exportrunMode(pxConfig *config) … … 1273 1272 return false; 1274 1273 } 1275 1274 if (!pxExportVersion(config, f)) { 1275 psError(PS_ERR_UNKNOWN, false, "failed to write dbversion output file"); 1276 return false; 1277 } 1276 1278 psMetadata *where = psMetadataAlloc(); 1277 1279 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); … … 1285 1287 psString query = pxDataGet(tables[i].sqlFilename); 1286 1288 if (!query) { 1287 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");1289 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 1288 1290 return false; 1289 1291 } … … 1354 1356 psMetadata *input = psMetadataConfigRead (NULL, &nFail, infile, false); 1355 1357 1356 fprintf (stdout, "---- input ----\n"); 1358 #ifdef notdef 1359 fprintf (stderr, "---- input ----\n"); 1357 1360 psMetadataPrint (stderr, input, 1); 1358 1361 #endif 1362 1363 if (!pxCheckImportVersion(config, input)) { 1364 psError(PS_ERR_UNKNOWN, false, "pxCheckImportVersion failed"); 1365 return false; 1366 } 1359 1367 psMetadataItem *item = psMetadataLookup (input, "fakeRun"); 1360 1368 psAssert (item, "entry not in input?");
Note:
See TracChangeset
for help on using the changeset viewer.
