Changeset 28245 for branches/czw_branch/20100519/ippTools/src
- Timestamp:
- Jun 7, 2010, 12:00:46 PM (16 years ago)
- Location:
- branches/czw_branch/20100519/ippTools/src
- Files:
-
- 6 edited
-
difftool.c (modified) (2 diffs)
-
difftoolConfig.c (modified) (2 diffs)
-
stacktool.c (modified) (12 diffs)
-
stacktoolConfig.c (modified) (2 diffs)
-
warptool.c (modified) (2 diffs)
-
warptoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20100519/ippTools/src/difftool.c
r28164 r28245 2356 2356 2357 2357 PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false); 2358 PXOPT_LOOKUP_STR( tangent_plane, config->args, "-tangent_plane", true, false);2358 PXOPT_LOOKUP_STR(projection_cell, config->args, "-projection_cell", true, false); 2359 2359 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", true, false); 2360 2360 … … 2364 2364 return(false); 2365 2365 } 2366 if (!p_psDBRunQueryF(config->dbh, query, diff_id, tangent_plane, path_base)) {2366 if (!p_psDBRunQueryF(config->dbh, query, diff_id, projection_cell, path_base)) { 2367 2367 psError(PS_ERR_UNKNOWN, false, "database error"); 2368 2368 psFree(query); -
branches/czw_branch/20100519/ippTools/src/difftoolConfig.c
r28164 r28245 327 327 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-diff_id", 0, "search by diff ID", 0); 328 328 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-tess_id", 0, "search by tessellation ID", NULL); 329 psMetadataAddStr(tosummaryArgs , PS_LIST_TAIL, "-warp_id", 0, "search by warp_id", NULL); 330 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-template", 0, "apply exposure args to template of bothways diff", false); 329 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL); 331 330 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exposure ID", 0); 332 331 psMetadataAddStr(tosummaryArgs , PS_LIST_TAIL, "-exp_name", 0, "search by exposure name", NULL); 332 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-warp_id", 0, "search by warp ID", 0); 333 333 334 psMetadataAddTime(tosummaryArgs, PS_LIST_TAIL, "-dateobs_begin", 0, "search for exposures by time (>=)", NULL); 334 335 psMetadataAddTime(tosummaryArgs, PS_LIST_TAIL, "-dateobs_end", 0, "search for exposures by time (<=)", NULL); 335 336 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-filter", 0, "search for filter", NULL); 337 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-magicked", 0, "search by magic id", 0); 336 338 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by diffRun label (LIKE comparison)", NULL); 337 339 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by diffRun data_group (LIKE comparison)", NULL); 338 340 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-dist_group", PS_META_DUPLICATE_OK, "search by diffRun dist_group (LIKE comparison)", NULL); 339 341 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-destreaked", 0, "search for runs that have been destreaked", false); 342 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-not_destreaked", 0, "search for runs that have not been destreaked", false); 343 340 344 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-all", 0, "search without arguments", false); 341 345 psMetadataAddU64(tosummaryArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); … … 345 349 psMetadata *addsummaryArgs = psMetadataAlloc(); 346 350 psMetadataAddS64(addsummaryArgs, PS_LIST_TAIL, "-diff_id", 0, "search by diff ID", 0); 347 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "- tangent_plane", 0, "set tangent plane", NULL);351 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-projection_cell", 0, "set projection cell", NULL); 348 352 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-path_base", 0, "set summary path base", NULL); 349 353 -
branches/czw_branch/20100519/ippTools/src/stacktool.c
r28164 r28245 106 106 exit(exit_status); 107 107 } 108 //stackAssociationRow *association = pxStackAssociationDefine(data_group,tess_id,filter,skycell_id); 109 stackAssociationRow *pxStackAssociationDefine(pxConfig *config, psS64 stack_id) { 110 psString select = pxDataGet("stacktool_associationdefine_select.sql"); 111 if (!select) { 112 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 113 return false; 114 } 115 116 psString idString = NULL; 117 psStringAppend(&idString, "%" PRId64, stack_id); 118 psStringSubstitute(&select,idString, "@STACK_ID@"); 119 psFree(idString); 120 121 if (!p_psDBRunQuery(config->dbh, select)) { 122 psError(PS_ERR_UNKNOWN,false, "database error"); 123 psFree(select); 124 return(NULL); 125 } 126 psFree(select); 127 psArray *output = p_psDBFetchResult(config->dbh); 128 if (!output) { 129 psErrorCode err = psErrorCodeLast(); 130 switch (err) { 131 case PS_ERR_DB_CLIENT: 132 psError(PXTOOLS_ERR_SYS, false, "database error"); 133 case PS_ERR_DB_SERVER: 134 psError(PXTOOLS_ERR_PROG, false, "database error"); 135 default: 136 psError(PXTOOLS_ERR_PROG, false, "unknown error"); 137 } 138 return(NULL); 139 } 140 if (psArrayLength(output) != 1) { 141 psWarning("stacktool: incorrect number of rows found"); 142 psFree(output); 143 return(NULL); 144 } 145 psMetadata *outrow = NULL; 146 for (long i = 0; i < output->n; i++) { 147 psMetadata *row = output->data[i]; 148 if (!psMetadataCopy(row,outrow)) { 149 psError(PS_ERR_UNKNOWN, false, "Failed to copy row to return"); 150 return(NULL); 151 } 152 } 153 psFree(output); 154 stackAssociationRow *sassRow = stackAssociationObjectFromMetadata(outrow); 155 psFree(outrow); 156 return(sassRow); 157 } 158 159 160 161 108 162 109 163 … … 399 453 psFree(run); 400 454 455 //CZW Add an association entry here. 456 // Define the requested association, and insert it if it doesn't already exist 457 stackAssociationRow *association = pxStackAssociationDefine(config,stack_id); 458 psS64 sass_id; 459 if (!association->sass_id) { 460 psTrace("stacktool.association",2,"No required Association found. Adding."); 461 462 if (!stackAssociationInsertObject(config->dbh,association)) { 463 if (!psDBRollback(config->dbh)) { 464 psError(PS_ERR_UNKNOWN, false, "database error"); 465 } 466 psError(PS_ERR_UNKNOWN, false, "database error"); 467 psFree(output); 468 psFree(run); 469 psFree(insert); 470 psFree(list); 471 psFree(association); 472 if (!psDBRollback(config->dbh)) { 473 psError(PS_ERR_UNKNOWN, false, "database error"); 474 } 475 return(false); 476 } 477 sass_id = psDBLastInsertID(config->dbh); 478 association->sass_id = sass_id; 479 } 480 // Insert the map entry for this row. 481 stackAssociationMapRow *maprow = stackAssociationMapRowAlloc(sass_id,stack_id); 482 if (!stackAssociationMapInsertObject(config->dbh,maprow)) { 483 if (!psDBRollback(config->dbh)) { 484 psError(PS_ERR_UNKNOWN, false, "database error"); 485 } 486 psError(PS_ERR_UNKNOWN, false, "database error"); 487 psFree(output); 488 psFree(run); 489 psFree(insert); 490 psFree(list); 491 psFree(association); 492 if (!psDBRollback(config->dbh)) { 493 psError(PS_ERR_UNKNOWN, false, "database error"); 494 } 495 return(false); 496 } 497 498 401 499 // Create a suitable insertion query for this run 402 500 psString thisInsert = psStringCopy(insert); … … 556 654 run->stack_id = psDBLastInsertID(config->dbh); 557 655 656 //CZW Add an association entry here. 657 558 658 // insert the stackInputSkyfile rows 559 659 psListIterator *iter = psListIteratorAlloc(warp_ids->data.list, 0, false); … … 607 707 #endif 608 708 psMetadata *where = psMetadataAlloc(); 609 PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "=="); 610 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 611 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 709 PXOPT_COPY_S64(config->args, where, "-stack_id", "stackRun.stack_id", "=="); 710 PXOPT_COPY_STR(config->args, where, "-label", "stackRun.label", "=="); 711 PXOPT_COPY_STR(config->args, where, "-state", "stackRun.state", "=="); 712 PXOPT_COPY_STR(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 612 713 if (!psListLength(where->list)) { 613 714 psFree(where); … … 616 717 } 617 718 719 //CZW join against stackAssociationMap 618 720 psString query = psStringCopy("UPDATE stackRun"); 619 721 … … 961 1063 psMetadata *where = psMetadataAlloc(); 962 1064 PXOPT_COPY_S64(config->args, where, "-stack_id", "stackSumSkyfile.stack_id", "=="); 1065 PXOPT_COPY_S64(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 963 1066 PXOPT_COPY_STR(config->args, where, "-tess_id", "stackRun.tess_id", "=="); 964 1067 PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "=="); … … 1134 1237 psMetadata *where = psMetadataAlloc(); 1135 1238 PXOPT_COPY_S64(config->args, where, "-stack_id", "stackSumSkyfile.warp_id", "=="); 1239 PXOPT_COPY_S64(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 1136 1240 PXOPT_COPY_STR(config->args, where, "-tess_id", "stackSumSkyfile.tess_id", "=="); 1137 1241 PXOPT_COPY_STR(config->args, where, "-state", "stackRun.state", "=="); … … 1215 1319 1216 1320 PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", true, false); 1217 PXOPT_LOOKUP_STR( tangent_plane, config->args, "-tangent_plane", true, false);1321 PXOPT_LOOKUP_STR(projection_cell, config->args, "-projection_cell", true, false); 1218 1322 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", true, false); 1219 1323 … … 1223 1327 return(false); 1224 1328 } 1225 if (!p_psDBRunQueryF(config->dbh, query, stack_id, tangent_plane, path_base)) {1329 if (!p_psDBRunQueryF(config->dbh, query, stack_id, projection_cell, path_base)) { 1226 1330 psError(PS_ERR_UNKNOWN, false, "database error"); 1227 1331 psFree(query); … … 1251 1355 1252 1356 psMetadata *where = psMetadataAlloc(); 1357 PXOPT_COPY_S64(config->args, where, "-stack_id", "stackRun.stack_id", "=="); 1358 PXOPT_COPY_S64(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 1359 1253 1360 pxAddLabelSearchArgs (config, where, "-label", "stackRun.label", "=="); 1254 1361 … … 1377 1484 psMetadata *where = psMetadataAlloc(); 1378 1485 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 1486 PXOPT_COPY_STR(config->args, where, "-sass_id", "sass_id", "=="); 1379 1487 1380 1488 psString query = pxDataGet("stacktool_donecleanup.sql"); … … 1446 1554 } 1447 1555 1556 //CZW I have not added sass information to the export/import run modes yet. 1448 1557 bool exportrunMode(pxConfig *config) 1449 1558 { -
branches/czw_branch/20100519/ippTools/src/stacktoolConfig.c
r28164 r28245 207 207 psMetadata *tosummaryArgs = psMetadataAlloc(); 208 208 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-stack_id", 0, "search by stack ID", 0); 209 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-sass_id", 0, "search by stack association ID", 0); 209 210 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-tess_id", 0, "search by tessellation ID", NULL); 210 211 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL); … … 221 222 psMetadata *addsummaryArgs = psMetadataAlloc(); 222 223 psMetadataAddS64(addsummaryArgs, PS_LIST_TAIL, "-stack_id", 0, "set stack ID", 0); 223 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "- tangent_plane", 0, "set tangent plane", NULL);224 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-projection_cell", 0, "set projection cell", NULL); 224 225 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-path_base", 0, "set summary path base", NULL); 225 226 -
branches/czw_branch/20100519/ippTools/src/warptool.c
r28164 r28245 1653 1653 1654 1654 PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", true, false); 1655 PXOPT_LOOKUP_STR( tangent_plane, config->args, "-tangent_plane", true, false);1655 PXOPT_LOOKUP_STR(projection_cell, config->args, "-projection_cell", true, false); 1656 1656 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", true, false); 1657 1657 … … 1661 1661 return(false); 1662 1662 } 1663 if (!p_psDBRunQueryF(config->dbh, query, warp_id, tangent_plane, path_base)) {1663 if (!p_psDBRunQueryF(config->dbh, query, warp_id, projection_cell, path_base)) { 1664 1664 psError(PS_ERR_UNKNOWN, false, "database error"); 1665 1665 psFree(query); -
branches/czw_branch/20100519/ippTools/src/warptoolConfig.c
r28164 r28245 336 336 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by warpRun data_group", NULL); 337 337 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-dist_group", PS_META_DUPLICATE_OK, "search by warpRun dist_group", NULL); 338 psMetadataAddBool( updaterunArgs, PS_LIST_TAIL, "-destreaked", 0, "search for runs that have been destreaked", false);339 psMetadataAddBool( updaterunArgs, PS_LIST_TAIL, "-not_destreaked", 0, "search for runs that have not been destreaked", false);338 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-destreaked", 0, "search for runs that have been destreaked", false); 339 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-not_destreaked", 0, "search for runs that have not been destreaked", false); 340 340 341 341 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-all", 0, "search without arguments", false); … … 346 346 psMetadata *addsummaryArgs = psMetadataAlloc(); 347 347 psMetadataAddS64(addsummaryArgs, PS_LIST_TAIL, "-warp_id", 0, "set warp ID", 0); 348 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "- tangent_plane", 0, "set tangent plane", NULL);348 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-projection_cell", 0, "set projection cell", NULL); 349 349 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-path_base", 0, "set summary path base", NULL); 350 350
Note:
See TracChangeset
for help on using the changeset viewer.
