Changeset 14023 for trunk/ippTools/src/dettool.c
- Timestamp:
- Jul 5, 2007, 3:16:08 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (101 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r13977 r14023 173 173 " FROM rawExp" 174 174 " LEFT JOIN detInputExp" 175 " ON rawExp.exp_ tag = detInputExp.exp_tag"175 " ON rawExp.exp_id = detInputExp.exp_id" 176 176 " WHERE" 177 " detInputExp.exp_ tagIS NULL"177 " detInputExp.exp_id IS NULL" 178 178 " AND rawExp.obstype != 'object'" 179 179 ); … … 461 461 } 462 462 463 // we have to support multipe exp_ tags464 psMetadataItem *item = psMetadataLookup(config->args, "-exp_ tag");463 // we have to support multipe exp_ids 464 psMetadataItem *item = psMetadataLookup(config->args, "-exp_id"); 465 465 if (!item) { 466 466 // this shouldn't actually happen when using psArgs 467 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");467 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 468 468 return false; 469 469 } 470 470 psMetadata *where = psMetadataAlloc(); 471 471 472 // make sure that -exp_ tagwas parsed correctly472 // make sure that -exp_id was parsed correctly 473 473 // XXX this can be removed someday 474 474 if (item->type == PS_DATA_METADATA_MULTI) { … … 476 476 psMetadataItem *mItem = NULL; 477 477 while ((mItem = psListGetAndIncrement(iter))) { 478 psString exp_ tag= mItem->data.V;479 // if exp_ tag is NULL then it means that -exp_taghas not been478 psString exp_id = mItem->data.V; 479 // if exp_id is NULL then it means that -exp_id has not been 480 480 // specified 481 if (!exp_ tag) {481 if (!exp_id) { 482 482 psError(PS_ERR_UNKNOWN, true, 483 "at least one -exp_ tagis required");483 "at least one -exp_id is required"); 484 484 psFree(where); 485 485 return false; 486 486 } 487 487 488 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag",489 PS_META_DUPLICATE_OK, "==", exp_ tag)) {490 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");488 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 489 PS_META_DUPLICATE_OK, "==", exp_id)) { 490 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 491 491 psFree(iter); 492 492 psFree(where); … … 496 496 psFree(iter); 497 497 } else { 498 psAbort( "-exp_ tagwas not parsed correctly (this should not happen");498 psAbort( "-exp_id was not parsed correctly (this should not happen"); 499 499 } 500 500 … … 504 504 } 505 505 506 // check that the specified exp_ tags actually exist506 // check that the specified exp_ids actually exist 507 507 psArray *detrendExps = rawExpSelectRowObjects(config->dbh, where, 0); 508 508 psFree(where); … … 512 512 } 513 513 514 // we should have one rawExp row per exp_ tagspecified514 // we should have one rawExp row per exp_id specified 515 515 if (psListLength(item->data.list) != psArrayLength(detrendExps)) { 516 psAbort( "an -exp_ tagmatched more then one rawExp (this should not happen");516 psAbort( "an -exp_id matched more then one rawExp (this should not happen"); 517 517 518 518 } … … 1768 1768 " %d," 1769 1769 " 0," 1770 " detResidExp.exp_ tag,"1770 " detResidExp.exp_id," 1771 1771 " detResidExp.accept" 1772 1772 " FROM detResidExp" 1773 1773 " JOIN rawExp" 1774 " USING(exp_ tag)"1774 " USING(exp_id)" 1775 1775 " WHERE det_id = %d" 1776 1776 ); … … 1979 1979 det_id, 1980 1980 iteration, 1981 rawExp->exp_ tag,1981 rawExp->exp_id, 1982 1982 true // use 1983 1983 ); … … 1991 1991 // select rawExp.* 1992 1992 // by: 1993 // exp_ tag1993 // exp_id 1994 1994 1995 1995 psString query = psStringCopy( … … 1997 1997 " FROM detInputExp" 1998 1998 " JOIN rawExp" 1999 " USING(exp_ tag)"1999 " USING(exp_id)" 2000 2000 ); 2001 2001 … … 2058 2058 " FROM rawImfile" 2059 2059 " JOIN detInputExp" 2060 " USING(exp_ tag) "2060 " USING(exp_id) " 2061 2061 " JOIN rawExp" 2062 " USING(exp_ tag) "2062 " USING(exp_id) " 2063 2063 " JOIN detRun" 2064 2064 " ON detInputExp.det_id = detRun.det_id" … … 2130 2130 // 2131 2131 // det_id is in detInputExp 2132 // exp_ tagis in detInputExp2132 // exp_id is in detInputExp 2133 2133 // det_id is not in detProccessedImfile 2134 // exp_ tagis not in detProccessedImfile2134 // exp_id is not in detProccessedImfile 2135 2135 // class_is is not in detProccessedImfile 2136 2136 psString query = psStringCopy( … … 2146 2146 " USING(det_id, iteration)" 2147 2147 " JOIN rawExp" 2148 " ON detInputExp.exp_ tag = rawExp.exp_tag"2148 " ON detInputExp.exp_id = rawExp.exp_id" 2149 2149 " JOIN rawImfile" 2150 " ON detInputExp.exp_ tag = rawImfile.exp_tag"2150 " ON detInputExp.exp_id = rawImfile.exp_id" 2151 2151 " LEFT JOIN detProcessedImfile" 2152 2152 " ON detInputExp.det_id = detProcessedImfile.det_id" 2153 " AND rawImfile.exp_ tag = detProcessedImfile.exp_tag"2153 " AND rawImfile.exp_id = detProcessedImfile.exp_id" 2154 2154 " AND rawImfile.class_id = detProcessedImfile.class_id" 2155 2155 " WHERE" … … 2157 2157 " AND detRun.mode = 'master'" 2158 2158 " AND detProcessedImfile.det_id IS NULL" 2159 " AND detProcessedImfile.exp_ tagIS NULL"2159 " AND detProcessedImfile.exp_id IS NULL" 2160 2160 " AND detProcessedImfile.class_id IS NULL" 2161 2161 ); … … 2223 2223 } 2224 2224 2225 // select exp_ tags from detInputExp matching det_idp2225 // select exp_ids from detInputExp matching det_idp 2226 2226 // where query should be pre-generated 2227 2227 psArray *detInputExp = … … 2232 2232 } 2233 2233 2234 // generate where query with just the exp_ tags2235 psMetadata *where_exp_ tags = psMetadataAlloc();2234 // generate where query with just the exp_ids 2235 psMetadata *where_exp_ids = psMetadataAlloc(); 2236 2236 for (long i = 0; i < psArrayLength(detInputExp); i++) { 2237 2237 detInputExpRow *row = detInputExp->data[i]; 2238 if (!psMetadataAddS tr(where_exp_tags, PS_LIST_TAIL, "exp_tag",2239 PS_META_DUPLICATE_OK, "==", row->exp_ tag)2238 if (!psMetadataAddS64(where_exp_ids, PS_LIST_TAIL, "exp_id", 2239 PS_META_DUPLICATE_OK, "==", row->exp_id) 2240 2240 ) { 2241 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");2241 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 2242 2242 psFree(detInputExp); 2243 psFree(where_exp_ tags);2243 psFree(where_exp_ids); 2244 2244 return NULL; 2245 2245 } … … 2247 2247 psFree(detInputExp); 2248 2248 2249 // select rawImfiles with matching exp_ tags2249 // select rawImfiles with matching exp_ids 2250 2250 psArray *rawImfiles = 2251 rawImfileSelectRowObjects(config->dbh, where_exp_ tags, 0);2252 psFree(where_exp_ tags);2251 rawImfileSelectRowObjects(config->dbh, where_exp_ids, 0); 2252 psFree(where_exp_ids); 2253 2253 if (!rawImfiles) { 2254 2254 psError(PS_ERR_UNKNOWN, false, "no rawImfile rows found"); … … 2263 2263 PS_ASSERT_PTR_NON_NULL(config, false); 2264 2264 2265 // det_id, exp_ tag, class_id, uri, recipe, -bg, -bg_stdev2265 // det_id, exp_id, class_id, uri, recipe, -bg, -bg_stdev 2266 2266 // are required 2267 2267 bool status = false; … … 2275 2275 return false; 2276 2276 } 2277 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");2278 if (!status) { 2279 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");2280 return false; 2281 } 2282 if (!exp_ tag) {2283 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");2277 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 2278 if (!status) { 2279 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 2280 return false; 2281 } 2282 if (!exp_id) { 2283 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 2284 2284 return false; 2285 2285 } … … 2384 2384 } 2385 2385 2386 // find the matching rawImfile by exp_ tag/class_id2386 // find the matching rawImfile by exp_id/class_id 2387 2387 psMetadata *where = psMetadataAlloc(); 2388 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag", 0, "==", exp_tag)) {2389 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");2388 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) { 2389 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 2390 2390 psFree(where); 2391 2391 return false; … … 2415 2415 detProcessedImfileRow *detRow = detProcessedImfileRowAlloc( 2416 2416 (psS32)atol(det_id), 2417 exp_tag,2417 (psS64)atoll(exp_id), 2418 2418 class_id, 2419 2419 uri, … … 2461 2461 // select detRun.iteration 2462 2462 // select detRun.det_type 2463 // select detProcessedImfile.exp_ tag2463 // select detProcessedImfile.exp_id 2464 2464 // by: 2465 2465 // find the current iteration bassed on det_id 2466 // find all exp_ tags in the current det_id/iteration from detInputExp2467 // find all rawImfiles in the current exp_ tags2468 // compare to detProcessedImfiles by det_id/exp_ tag2466 // find all exp_ids in the current det_id/iteration from detInputExp 2467 // find all rawImfiles in the current exp_ids 2468 // compare to detProcessedImfiles by det_id/exp_id 2469 2469 // found how many imfile there are in each class_id 2470 2470 // and: … … 2477 2477 " iteration," 2478 2478 " det_type," 2479 " exp_ tag,"2479 " exp_id," 2480 2480 " camera," 2481 2481 " workdir" … … 2486 2486 " detRun.det_type," 2487 2487 " detRun.workdir," 2488 " detProcessedImfile.exp_ tag,"2488 " detProcessedImfile.exp_id," 2489 2489 " rawExp.camera," 2490 2490 " detProcessedImfile.class_id," … … 2494 2494 " USING(det_id, iteration)" 2495 2495 " JOIN rawExp" 2496 " ON detInputExp.exp_ tag = rawExp.exp_tag"2496 " ON detInputExp.exp_id = rawExp.exp_id" 2497 2497 " JOIN rawImfile" 2498 " ON rawExp.exp_ tag = rawImfile.exp_tag"2498 " ON rawExp.exp_id = rawImfile.exp_id" 2499 2499 " LEFT JOIN detProcessedImfile" 2500 2500 " ON detRun.det_id = detProcessedImfile.det_id" 2501 " AND detInputExp.exp_ tag = detProcessedImfile.exp_tag"2501 " AND detInputExp.exp_id = detProcessedImfile.exp_id" 2502 2502 " AND rawImfile.class_id = detProcessedImfile.class_id" 2503 2503 " LEFT JOIN detProcessedExp" 2504 2504 " ON detProcessedImfile.det_id = detProcessedExp.det_id" 2505 " AND detProcessedImfile.exp_ tag = detProcessedExp.exp_tag"2505 " AND detProcessedImfile.exp_id = detProcessedExp.exp_id" 2506 2506 " WHERE" 2507 2507 " detRun.state = 'run'" … … 2509 2509 " AND detProcessedImfile.fault = 0" 2510 2510 " AND detProcessedExp.det_id IS NULL" 2511 " AND detProcessedExp.exp_ tagIS NULL"2511 " AND detProcessedExp.exp_id IS NULL" 2512 2512 " AND detInputExp.include = 1" 2513 2513 " GROUP BY" 2514 " rawExp.exp_ tag,"2514 " rawExp.exp_id," 2515 2515 " detRun.det_id" 2516 2516 " HAVING" … … 2579 2579 PS_ASSERT_PTR_NON_NULL(config, false); 2580 2580 2581 // det_id, exp_ tag, recip, -bg, -bg_stdev2581 // det_id, exp_id, recip, -bg, -bg_stdev 2582 2582 // are required 2583 2583 bool status = false; … … 2591 2591 return false; 2592 2592 } 2593 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");2594 if (!status) { 2595 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");2596 return false; 2597 } 2598 if (!exp_ tag) {2599 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");2593 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 2594 if (!status) { 2595 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 2596 return false; 2597 } 2598 if (!exp_id) { 2599 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 2600 2600 return false; 2601 2601 } … … 2693 2693 " detRun.iteration," 2694 2694 " detRun.det_type," 2695 " detProcessedImfile.exp_ tag"2695 " detProcessedImfile.exp_id" 2696 2696 " FROM detRun" 2697 2697 " JOIN detInputExp" … … 2699 2699 " AND detRun.iteration = detInputExp.iteration" 2700 2700 " JOIN rawExp" 2701 " ON detInputExp.exp_ tag = rawExp.exp_tag"2701 " ON detInputExp.exp_id = rawExp.exp_id" 2702 2702 " JOIN detProcessedImfile" 2703 2703 " ON detInputExp.det_id = detProcessedImfile.det_id" 2704 " AND detInputExp.exp_ tag = detProcessedImfile.exp_tag"2704 " AND detInputExp.exp_id = detProcessedImfile.exp_id" 2705 2705 " LEFT JOIN detProcessedExp" 2706 2706 " ON detInputExp.det_id = detProcessedExp.det_id" 2707 " AND detProcessedImfile.exp_ tag= detProcessedExp.exp_tag"2707 " AND detProcessedImfile.exp_id= detProcessedExp.exp_id" 2708 2708 " LEFT JOIN rawImfile" 2709 " ON detInputExp.exp_ tag = rawImfile.exp_tag"2709 " ON detInputExp.exp_id = rawImfile.exp_id" 2710 2710 " AND detProcessedImfile.class_id = rawImfile.class_id" 2711 2711 " WHERE" … … 2713 2713 " AND detRun.mode = 'master'" 2714 2714 " AND detProcessedExp.det_id IS NULL" 2715 " AND detProcessedExp.exp_ tagIS NULL"2715 " AND detProcessedExp.exp_id IS NULL" 2716 2716 " AND detInputExp.include = 1" 2717 2717 " AND detRun.det_id = %s" 2718 " AND detProcessedImfile.exp_ tag= '%s'"2718 " AND detProcessedImfile.exp_id = '%s'" 2719 2719 " GROUP BY" 2720 2720 " detProcessedImfile.class_id," … … 2725 2725 ); 2726 2726 2727 if (!p_psDBRunQuery(config->dbh, query, det_id, exp_ tag)) {2727 if (!p_psDBRunQuery(config->dbh, query, det_id, exp_id)) { 2728 2728 psError(PS_ERR_UNKNOWN, false, "database error"); 2729 2729 psFree(query); … … 2747 2747 detProcessedExpRow *detRow = detProcessedExpRowAlloc( 2748 2748 (psS32)atol(det_id), 2749 exp_tag,2749 (psS64)atoll(exp_id), 2750 2750 recipe, 2751 2751 bg, … … 2872 2872 // by: 2873 2873 // find the current iteration bassed on det_id 2874 // find all exp_ tags in the current det_id/iteration from detInputExp2875 // find all rawImfiles in the current exp_ tags2876 // compare to detProcessedImfiles by det_id/exp_ tag2874 // find all exp_ids in the current det_id/iteration from detInputExp 2875 // find all rawImfiles in the current exp_ids 2876 // compare to detProcessedImfiles by det_id/exp_id 2877 2877 // found how many imfile there are in each class_id 2878 2878 // and: … … 2895 2895 " AND detRun.iteration = detInputExp.iteration\n" 2896 2896 " JOIN rawExp\n" 2897 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"2897 " ON detInputExp.exp_id = rawExp.exp_id\n" 2898 2898 " JOIN rawImfile\n" 2899 " ON detInputExp.exp_ tag = rawImfile.exp_tag\n"2899 " ON detInputExp.exp_id = rawImfile.exp_id\n" 2900 2900 " LEFT JOIN detProcessedImfile\n" 2901 2901 " ON detInputExp.det_id = detProcessedImfile.det_id\n" 2902 " AND detInputExp.exp_ tag = detProcessedImfile.exp_tag\n"2902 " AND detInputExp.exp_id = detProcessedImfile.exp_id\n" 2903 2903 " AND rawImfile.class_id = detProcessedImfile.class_id\n" 2904 2904 " LEFT JOIN detStackedImfile\n" … … 3007 3007 " ON detRun.det_id = detInputExp.det_id" 3008 3008 " AND detRun.iteration = detInputExp.iteration" 3009 " AND detProcessedImfile.exp_ tag = detInputExp.exp_tag"3009 " AND detProcessedImfile.exp_id = detInputExp.exp_id" 3010 3010 " JOIN rawExp" 3011 " ON rawExp.exp_ tag = detProcessedImfile.exp_tag"3011 " ON rawExp.exp_id = detProcessedImfile.exp_id" 3012 3012 " WHERE" 3013 3013 ); … … 3213 3213 if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", 3214 3214 (psS64)atoll(det_id))) { 3215 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");3215 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 3216 3216 psFree(where); 3217 3217 return false; … … 3377 3377 // by: 3378 3378 // find the current iteration bassed on det_id 3379 // find all exp_ tags in the current det_id/iteration from detInputExp3379 // find all exp_ids in the current det_id/iteration from detInputExp 3380 3380 // sort to detInputExp.imfiles to find the largest value per det_id/iter 3381 3381 // compare imfiles to the number of detStackedImfiles by class_id … … 3407 3407 " AND detRun.iteration = detInputExp.iteration" 3408 3408 " JOIN rawExp" 3409 " ON detInputExp.exp_ tag = rawExp.exp_tag"3409 " ON detInputExp.exp_id = rawExp.exp_id" 3410 3410 " JOIN detStackedImfile" 3411 3411 " ON detInputExp.det_id = detStackedImfile.det_id" … … 3423 3423 " AND detNormalizedStatImfile.class_id IS NULL" 3424 3424 " GROUP BY" 3425 " rawExp.exp_ tag,"3425 " rawExp.exp_id," 3426 3426 " detRun.iteration," 3427 3427 " detRun.det_id" … … 3633 3633 " USING(det_id, iteration)" 3634 3634 " JOIN rawExp" 3635 " ON detInputExp.exp_ tag = rawExp.exp_tag"3635 " ON detInputExp.exp_id = rawExp.exp_id" 3636 3636 " JOIN detNormalizedStatImfile" 3637 3637 " ON detStackedImfile.det_id = detNormalizedStatImfile.det_id" … … 3774 3774 psMetadata *where = psMetadataAlloc(); 3775 3775 for (long i = 0; i < psArrayLength(inputExps); i++) { 3776 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag",3776 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 3777 3777 PS_META_DUPLICATE_OK, "==", 3778 ((detInputExpRow *)inputExps->data[i])->exp_ tag)) {3779 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");3778 ((detInputExpRow *)inputExps->data[i])->exp_id)) { 3779 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 3780 3780 psFree(inputExps); 3781 3781 psFree(where); … … 3963 3963 " AND detRun.iteration = detInputExp.iteration" 3964 3964 " JOIN rawExp" 3965 " ON detInputExp.exp_ tag = rawExp.exp_tag"3965 " ON detInputExp.exp_id = rawExp.exp_id" 3966 3966 " JOIN detNormalizedImfile" 3967 3967 " ON detInputExp.det_id = detNormalizedImfile.det_id" 3968 3968 " AND detInputExp.iteration = detNormalizedImfile.iteration" 3969 3969 " LEFT JOIN rawImfile" 3970 " ON detInputExp.exp_ tag = rawImfile.exp_tag"3970 " ON detInputExp.exp_id = rawImfile.exp_id" 3971 3971 " AND detNormalizedImfile.class_id = rawImfile.class_id" 3972 3972 " LEFT JOIN detNormalizedExp" … … 4152 4152 " AND detRun.iteration = detInputExp.iteration" 4153 4153 " JOIN rawExp" 4154 " ON detInputExp.exp_ tag = rawExp.exp_tag"4154 " ON detInputExp.exp_id = rawExp.exp_id" 4155 4155 " JOIN detNormalizedImfile" 4156 4156 " ON detInputExp.det_id = detNormalizedImfile.det_id" 4157 4157 " AND detInputExp.iteration = detNormalizedImfile.iteration" 4158 4158 " LEFT JOIN rawImfile" 4159 " ON detInputExp.exp_ tag = rawImfile.exp_tag"4159 " ON detInputExp.exp_id = rawImfile.exp_id" 4160 4160 " AND detNormalizedImfile.class_id = rawImfile.class_id" 4161 4161 " LEFT JOIN detNormalizedExp" … … 4437 4437 " detRun.workdir,\n" 4438 4438 " detRun.reduction,\n" 4439 " detProcessedImfile.exp_ tag,\n"4439 " detProcessedImfile.exp_id,\n" 4440 4440 " detProcessedImfile.class_id,\n" 4441 4441 " detProcessedImfile.uri,\n" … … 4446 4446 " USING(det_id, iteration)\n" 4447 4447 " JOIN rawExp\n" 4448 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"4448 " ON detInputExp.exp_id = rawExp.exp_id\n" 4449 4449 " JOIN detProcessedImfile\n" 4450 4450 " ON detRun.det_id = detProcessedImfile.det_id\n" 4451 " AND detInputExp.exp_ tag = detProcessedImfile.exp_tag\n"4451 " AND detInputExp.exp_id = detProcessedImfile.exp_id\n" 4452 4452 " JOIN detNormalizedImfile\n" 4453 4453 " ON detRun.det_id = detNormalizedImfile.det_id\n" … … 4457 4457 " ON detRun.det_id = detResidImfile.det_id\n" 4458 4458 " AND detRun.iteration = detResidImfile.iteration\n" 4459 " AND detProcessedImfile.exp_ tag = detResidImfile.exp_tag\n"4459 " AND detProcessedImfile.exp_id = detResidImfile.exp_id\n" 4460 4460 " AND detProcessedImfile.class_id = detResidImfile.class_id\n" 4461 4461 " WHERE\n" … … 4465 4465 " AND detResidImfile.det_id IS NULL\n" 4466 4466 " AND detResidImfile.iteration IS NULL\n" 4467 " AND detResidImfile.exp_ tagIS NULL\n"4467 " AND detResidImfile.exp_id IS NULL\n" 4468 4468 " AND detResidImfile.class_id IS NULL\n" 4469 4469 " UNION" … … 4475 4475 " detRun.workdir,\n" 4476 4476 " detRun.reduction,\n" 4477 " rawImfile.exp_ tag,\n"4477 " rawImfile.exp_id,\n" 4478 4478 " rawImfile.class_id,\n" 4479 4479 " rawImfile.uri,\n" … … 4484 4484 " USING(det_id, iteration)\n" 4485 4485 " JOIN rawExp\n" 4486 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"4486 " ON detInputExp.exp_id = rawExp.exp_id\n" 4487 4487 " JOIN rawImfile\n" 4488 " ON detInputExp.exp_ tag = rawImfile.exp_tag\n"4488 " ON detInputExp.exp_id = rawImfile.exp_id\n" 4489 4489 " LEFT JOIN detResidImfile\n" 4490 4490 " ON detRun.det_id = detResidImfile.det_id\n" 4491 4491 " AND detRun.iteration = detResidImfile.iteration\n" 4492 " AND rawImfile.exp_ tag = detResidImfile.exp_tag\n"4492 " AND rawImfile.exp_id = detResidImfile.exp_id\n" 4493 4493 " AND rawImfile.class_id = detResidImfile.class_id\n" 4494 4494 " WHERE\n" … … 4497 4497 " AND detResidImfile.det_id IS NULL\n" 4498 4498 " AND detResidImfile.iteration IS NULL\n" 4499 " AND detResidImfile.exp_ tagIS NULL\n"4499 " AND detResidImfile.exp_id IS NULL\n" 4500 4500 " AND detResidImfile.class_id IS NULL\n" 4501 4501 ); … … 4658 4658 4659 4659 // make sure that there is a coresponding entry in detNormalizedImfile 4660 // and the exp_ tagspecified is valid4660 // and the exp_id specified is valid 4661 4661 // select * from detNormalizedImfile 4662 4662 // by det_id, iteration, class_id … … 4674 4674 " ON detRun.det_id = detResidImfile.det_id\n" 4675 4675 " AND detRun.iteration = detResidImfile.iteration\n" 4676 " AND detInputExp.exp_ tag = detResidImfile.exp_tag\n"4676 " AND detInputExp.exp_id = detResidImfile.exp_id\n" 4677 4677 " AND detNormalizedImfile.class_id = detResidImfile.class_id\n" 4678 4678 " WHERE\n" … … 4681 4681 " AND detResidImfile.det_id IS NULL\n" 4682 4682 " AND detResidImfile.iteration IS NULL\n" 4683 " AND detResidImfile.exp_ tagIS NULL\n"4683 " AND detResidImfile.exp_id IS NULL\n" 4684 4684 " AND detResidImfile.class_id IS NULL\n" 4685 4685 " UNION\n" … … 4703 4703 " USING(det_id, iteration)\n" 4704 4704 " JOIN rawExp\n" 4705 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"4705 " ON detInputExp.exp_id = rawExp.exp_id\n" 4706 4706 " JOIN rawImfile\n" 4707 " ON detInputExp.exp_ tag = rawImfile.exp_tag\n"4707 " ON detInputExp.exp_id = rawImfile.exp_id\n" 4708 4708 " LEFT JOIN detResidImfile\n" 4709 4709 " ON detRun.det_id = detResidImfile.det_id\n" 4710 4710 " AND detRun.iteration = detResidImfile.iteration\n" 4711 " AND rawImfile.exp_ tag = detResidImfile.exp_tag\n"4711 " AND rawImfile.exp_id = detResidImfile.exp_id\n" 4712 4712 " AND rawImfile.class_id = detResidImfile.class_id\n" 4713 4713 " WHERE\n" … … 4716 4716 " AND detResidImfile.det_id IS NULL\n" 4717 4717 " AND detResidImfile.iteration IS NULL\n" 4718 " AND detResidImfile.exp_ tagIS NULL\n"4718 " AND detResidImfile.exp_id IS NULL\n" 4719 4719 " AND detResidImfile.class_id IS NULL\n" 4720 " AND detInputExp.exp_ tag= '%1$s'\n"4720 " AND detInputExp.exp_id = '%1$s'\n" 4721 4721 ") AS foo\n" 4722 4722 " %2$s" … … 4776 4776 psFree(where); 4777 4777 4778 // exp_ tag is manadatory to cross check that this is a exp_tagfor this4778 // exp_id is manadatory to cross check that this is a exp_id for this 4779 4779 // detRun 4780 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");4781 if (!status) { 4782 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");4780 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 4781 if (!status) { 4782 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 4783 4783 psFree(whereClause); 4784 4784 psFree(query); 4785 4785 return false; 4786 4786 } 4787 if (!exp_ tag) {4788 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");4787 if (!exp_id) { 4788 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 4789 4789 psFree(whereClause); 4790 4790 psFree(query); … … 4792 4792 } 4793 4793 4794 if (!p_psDBRunQuery(config->dbh, query, exp_ tag, whereClause)) {4794 if (!p_psDBRunQuery(config->dbh, query, exp_id, whereClause)) { 4795 4795 psError(PS_ERR_UNKNOWN, false, "database error"); 4796 4796 psFree(whereClause); … … 4862 4862 4863 4863 bool status = false; 4864 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");4865 if (!status) { 4866 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");4867 return false; 4868 } 4869 if (!exp_ tag) {4870 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");4864 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 4865 if (!status) { 4866 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 4867 return false; 4868 } 4869 if (!exp_id) { 4870 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 4871 4871 return false; 4872 4872 } … … 4979 4979 normalizedImfile->det_id, 4980 4980 normalizedImfile->iteration, 4981 exp_tag,4981 (psS64)atoll(exp_id), 4982 4982 normalizedImfile->class_id, 4983 4983 uri, … … 5020 5020 // select detResidImfile.* 5021 5021 // by: 5022 // where det_id, iteration, exp_ tagis not in detResidExp;5022 // where det_id, iteration, exp_id is not in detResidExp; 5023 5023 5024 5024 psString query = psStringCopy( … … 5032 5032 " USING(det_id, iteration)" 5033 5033 " JOIN rawExp" 5034 " USING(exp_ tag)"5034 " USING(exp_id)" 5035 5035 " WHERE" 5036 5036 ); … … 5128 5128 // select detRun.iteration 5129 5129 // select detRun.det_type 5130 // select detInputExp.exp_ tag5130 // select detInputExp.exp_id 5131 5131 // select detInputExp.include 5132 5132 // by: 5133 5133 // find the current iteration bassed on det_id 5134 // find all exp_ tags in the current det_id/iteration from detInputExp5134 // find all exp_ids in the current det_id/iteration from detInputExp 5135 5135 // compare to detInputExp.imfiles to derResidImfile by class_id 5136 5136 // and: 5137 // detResidImfile.{det_id, iteration, exp_ tag} is not in detResidExp5137 // detResidImfile.{det_id, iteration, exp_id} is not in detResidExp 5138 5138 5139 5139 psString query = psStringCopy( … … 5143 5143 " det_type,\n" 5144 5144 " mode,\n" 5145 " exp_ tag,\n"5145 " exp_id,\n" 5146 5146 " include,\n" 5147 5147 " camera,\n" … … 5154 5154 " detRun.mode,\n" 5155 5155 " detRun.workdir,\n" 5156 " detInputExp.exp_ tag,\n"5156 " detInputExp.exp_id,\n" 5157 5157 " detInputExp.include,\n" 5158 5158 " rawExp.imfiles,\n" … … 5163 5163 " USING(det_id, iteration)\n" 5164 5164 " JOIN rawExp\n" 5165 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"5165 " ON detInputExp.exp_id = rawExp.exp_id\n" 5166 5166 " JOIN detResidImfile\n" 5167 5167 " ON detRun.det_id = detResidImfile.det_id\n" 5168 5168 " AND detRun.iteration = detResidImfile.iteration\n" 5169 " AND detInputExp.exp_ tag = detResidImfile.exp_tag\n"5169 " AND detInputExp.exp_id = detResidImfile.exp_id\n" 5170 5170 " LEFT JOIN detResidExp\n" 5171 5171 " ON detResidImfile.det_id = detResidExp.det_id\n" 5172 5172 " AND detResidImfile.iteration = detResidExp.iteration\n" 5173 " AND detResidImfile.exp_ tag = detResidExp.exp_tag\n"5173 " AND detResidImfile.exp_id = detResidExp.exp_id\n" 5174 5174 " WHERE\n" 5175 5175 " detRun.state = 'run'\n" … … 5177 5177 " AND detResidExp.det_id IS NULL\n" 5178 5178 " AND detResidExp.iteration IS NULL\n" 5179 " AND detResidExp.exp_ tagIS NULL\n"5179 " AND detResidExp.exp_id IS NULL\n" 5180 5180 " GROUP BY\n" 5181 " detInputExp.exp_ tag,\n"5181 " detInputExp.exp_id,\n" 5182 5182 " detRun.iteration,\n" 5183 5183 " detRun.det_id\n" … … 5258 5258 // select detRun.iteration 5259 5259 // select detRun.det_type 5260 // select detInputExp.exp_ tag5260 // select detInputExp.exp_id 5261 5261 // select detInputExp.include 5262 5262 // by: 5263 5263 // find the current iteration bassed on det_id 5264 // find all exp_ tags in the current det_id/iteration from detInputExp5264 // find all exp_ids in the current det_id/iteration from detInputExp 5265 5265 // compare to detInputExp.imfiles to derResidImfile by class_id 5266 5266 // and: 5267 // detResidImfile.{det_id, iteration, exp_ tag} is not in detResidExp5267 // detResidImfile.{det_id, iteration, exp_id} is not in detResidExp 5268 5268 5269 5269 psString query = psStringCopy( … … 5271 5271 " det_id," 5272 5272 " iteration," 5273 " exp_ tag,"5273 " exp_id," 5274 5274 " include" 5275 5275 " FROM" … … 5278 5278 " detRun.iteration," 5279 5279 " detRun.det_type," 5280 " detInputExp.exp_ tag,"5280 " detInputExp.exp_id," 5281 5281 " detInputExp.include," 5282 5282 " rawExp.imfiles" … … 5285 5285 " USING(det_id, iteration)" 5286 5286 " JOIN rawExp" 5287 " ON detInputExp.exp_ tag = rawExp.exp_tag"5287 " ON detInputExp.exp_id = rawExp.exp_id" 5288 5288 " JOIN detResidImfile" 5289 5289 " ON detRun.det_id = detResidImfile.det_id" 5290 5290 " AND detRun.iteration = detResidImfile.iteration" 5291 " AND detInputExp.exp_ tag = detResidImfile.exp_tag"5291 " AND detInputExp.exp_id = detResidImfile.exp_id" 5292 5292 " LEFT JOIN detResidExp" 5293 5293 " ON detResidImfile.det_id = detResidExp.det_id" 5294 5294 " AND detResidImfile.iteration = detResidExp.iteration" 5295 " AND detResidImfile.exp_ tag = detResidExp.exp_tag"5295 " AND detResidImfile.exp_id = detResidExp.exp_id" 5296 5296 " WHERE" 5297 5297 " detRun.state = 'run'" 5298 5298 " AND detResidExp.det_id IS NULL" 5299 5299 " AND detResidExp.iteration IS NULL" 5300 " AND detResidExp.exp_ tagIS NULL"5300 " AND detResidExp.exp_id IS NULL" 5301 5301 " GROUP BY" 5302 " detInputExp.exp_ tag,"5302 " detInputExp.exp_id," 5303 5303 " detRun.iteration," 5304 5304 " detRun.det_id" … … 5309 5309 5310 5310 { 5311 // build a query to search by det_id, iteration, exp_ tag5311 // build a query to search by det_id, iteration, exp_id 5312 5312 psMetadata *where = psMetadataAlloc(); 5313 5313 bool status = false; … … 5342 5342 return false; 5343 5343 } 5344 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");5345 if (!status) { 5346 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");5344 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 5345 if (!status) { 5346 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 5347 5347 psFree(where); 5348 5348 psFree(query); 5349 5349 return false; 5350 5350 } 5351 if (exp_ tag) {5352 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag", 0, "==", exp_tag)) {5353 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");5351 if (exp_id) { 5352 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) { 5353 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 5354 5354 psFree(where); 5355 5355 psFree(query); … … 5448 5448 return false; 5449 5449 } 5450 psString exp_ tag = psMetadataLookupStr(&status, row, "exp_tag");5451 if (!status) { 5452 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_ tag");5453 return false; 5454 } 5455 if (!exp_ tag) {5456 psError(PS_ERR_UNKNOWN, true, "exp_ tagis required");5450 psString exp_id = psMetadataLookupStr(&status, row, "exp_id"); 5451 if (!status) { 5452 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id"); 5453 return false; 5454 } 5455 if (!exp_id) { 5456 psError(PS_ERR_UNKNOWN, true, "exp_id is required"); 5457 5457 return false; 5458 5458 } … … 5565 5565 det_id, 5566 5566 iteration, 5567 exp_tag,5567 (psS64)atoll(exp_id), 5568 5568 recipe, 5569 5569 bg, … … 5611 5611 " USING(det_id, iteration)" 5612 5612 " JOIN detResidExp" 5613 " USING(det_id, iteration, exp_ tag)"5613 " USING(det_id, iteration, exp_id)" 5614 5614 " WHERE" 5615 5615 " detRun.state = 'run'" … … 5697 5697 // by: 5698 5698 // find the current iteration bassed on det_id 5699 // find all exp_ tags in the current det_id/iteration from detInputExp5700 // find all exp_ tags in the current det_id/iteration from detResidExp5701 // compare the counts of exp_ tags5699 // find all exp_ids in the current det_id/iteration from detInputExp 5700 // find all exp_ids in the current det_id/iteration from detResidExp 5701 // compare the counts of exp_ids 5702 5702 5703 5703 psString query = psStringCopy( … … 5716 5716 " detRun.mode,\n" 5717 5717 " detRun.workdir,\n" 5718 " detInputExp.exp_ tag,\n"5718 " detInputExp.exp_id,\n" 5719 5719 " rawExp.camera\n" 5720 5720 " FROM detRun\n" … … 5722 5722 " USING(det_id, iteration)\n" 5723 5723 " JOIN rawExp\n" 5724 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"5724 " ON detInputExp.exp_id = rawExp.exp_id\n" 5725 5725 " LEFT JOIN detResidExp\n" 5726 5726 " ON detRun.det_id = detResidExp.det_id\n" 5727 5727 " AND detRun.iteration = detResidExp.iteration\n" 5728 " AND detInputExp.exp_ tag = detResidExp.exp_tag\n"5728 " AND detInputExp.exp_id = detResidExp.exp_id\n" 5729 5729 " WHERE\n" 5730 5730 " detRun.state = 'run'\n" … … 5733 5733 " detRun.iteration\n" 5734 5734 " HAVING\n" 5735 " COUNT(detResidExp.exp_ tag) = COUNT(detInputExp.exp_tag)\n"5735 " COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id)\n" 5736 5736 " ) AS residdetrun\n" 5737 5737 ); … … 5797 5797 PS_ASSERT_PTR_NON_NULL(config, false); 5798 5798 5799 // build a query to search by det_id, iteration, exp_ tag5799 // build a query to search by det_id, iteration, exp_id 5800 5800 psMetadata *where = psMetadataAlloc(); 5801 5801 bool status = false; … … 5825 5825 return false; 5826 5826 } 5827 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");5828 if (!status) { 5829 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");5827 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 5828 if (!status) { 5829 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 5830 5830 psFree(where); 5831 5831 return false; 5832 5832 } 5833 if (exp_ tag) {5834 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag", 0, "==", exp_tag)) {5835 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");5833 if (exp_id) { 5834 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) { 5835 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 5836 5836 psFree(where); 5837 5837 return false; … … 5840 5840 5841 5841 // find the values we're going to set 5842 // copy everything but det_id, iteration, & exp_ tagfrom the args and5842 // copy everything but det_id, iteration, & exp_id from the args and 5843 5843 // remove the '-' prefix 5844 5844 psMetadata *set = psMetadataAlloc(); … … 5957 5957 // by: 5958 5958 // find the current iteration bassed on det_id 5959 // find all exp_ tags in the current det_id/iteration from detInputExp5960 // find all exp_ tags in the current det_id/iteration from detResidExp5961 // compare the counts of exp_ tags5959 // find all exp_ids in the current det_id/iteration from detInputExp 5960 // find all exp_ids in the current det_id/iteration from detResidExp 5961 // compare the counts of exp_ids 5962 5962 5963 5963 psString query = pxDataGet("dettool_find_completed_runs.sql"); … … 5968 5968 5969 5969 { 5970 // build a query to search by det_id, iteration, exp_ tag5970 // build a query to search by det_id, iteration, exp_id 5971 5971 psMetadata *where = psMetadataAlloc(); 5972 5972 bool status = false; … … 6271 6271 // select detRun.det_id 6272 6272 // select detRun.iteration 6273 // select detInputExp.exp_ tag6273 // select detInputExp.exp_id 6274 6274 // select detResidExp.accept 6275 6275 // by: 6276 6276 // find the current iteration bassed on det_id 6277 // find all exp_ tags in the current det_id/iteration from detInputExp6278 // find all exp_ tags in the current det_id/iteration from detResidExp6279 // compare the counts of exp_ tags6277 // find all exp_ids in the current det_id/iteration from detInputExp 6278 // find all exp_ids in the current det_id/iteration from detResidExp 6279 // compare the counts of exp_ids 6280 6280 6281 6281 psString query = psStringCopy( … … 6283 6283 " detRun.det_id AS det_id," 6284 6284 " detRun.iteration," 6285 " detInputExp.exp_ tag,"6285 " detInputExp.exp_id," 6286 6286 " detResidExp.accept" 6287 6287 " FROM detRun" … … 6292 6292 " ON detRun.det_id = detResidExp.det_id" 6293 6293 " AND detRun.iteration = detResidExp.iteration" 6294 " AND detInputExp.exp_ tag = detResidExp.exp_tag"6294 " AND detInputExp.exp_id = detResidExp.exp_id" 6295 6295 " WHERE" 6296 6296 " detRun.state = 'run'" … … 6310 6310 " detRun.det_id," 6311 6311 " detRun.iteration," 6312 " detInputExp.exp_ tag"6312 " detInputExp.exp_id" 6313 6313 " HAVING" 6314 " COUNT(detResidExp.exp_ tag) = COUNT(detInputExp.exp_tag)"6314 " COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id)" 6315 6315 ); 6316 6316 … … 6357 6357 for (long i = 0; i < psArrayLength(output); i++) { 6358 6358 psMetadata *row = output->data[i]; 6359 psString exp_ tag = psMetadataLookupStr(&status, row, "exp_tag");6359 psString exp_id = psMetadataLookupStr(&status, row, "exp_id"); 6360 6360 if (!status) { 6361 6361 // rollback … … 6363 6363 psError(PS_ERR_UNKNOWN, false, "database error"); 6364 6364 } 6365 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_ tag");6365 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id"); 6366 6366 psFree(output); 6367 6367 return false; … … 6383 6383 (psS32)atol(det_id), 6384 6384 newIteration, 6385 exp_tag,6385 (psS64)atoll(exp_id), 6386 6386 accept 6387 6387 ) … … 6424 6424 } 6425 6425 6426 // we have to support multipe exp_ tags6427 psMetadataItem *item = psMetadataLookup(config->args, "-exp_ tag");6426 // we have to support multipe exp_ids 6427 psMetadataItem *item = psMetadataLookup(config->args, "-exp_id"); 6428 6428 if (!item) { 6429 6429 // this shouldn't actually happen when using psArgs 6430 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");6431 return false; 6432 } 6433 6434 psList *exp_ tag_list = item->data.list;6430 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 6431 return false; 6432 } 6433 6434 psList *exp_id_list = item->data.list; 6435 6435 psMetadata *where = psMetadataAlloc(); 6436 // make sure that -exp_ tagwas parsed correctly6436 // make sure that -exp_id was parsed correctly 6437 6437 // XXX this can be removed someday 6438 6438 if (item->type == PS_DATA_METADATA_MULTI) { … … 6440 6440 psMetadataItem *mItem = NULL; 6441 6441 while ((mItem = psListGetAndIncrement(iter))) { 6442 psString exp_ tag= mItem->data.V;6443 // if exp_ tag is NULL then it means that -exp_taghas not been6442 psString exp_id = mItem->data.V; 6443 // if exp_id is NULL then it means that -exp_id has not been 6444 6444 // specified 6445 if (!exp_ tag) {6445 if (!exp_id) { 6446 6446 psError(PS_ERR_UNKNOWN, true, 6447 "at least one -exp_ tagis required");6447 "at least one -exp_id is required"); 6448 6448 psFree(where); 6449 6449 return false; 6450 6450 } 6451 6451 6452 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag",6453 PS_META_DUPLICATE_OK, "==", exp_ tag)) {6454 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");6452 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 6453 PS_META_DUPLICATE_OK, "==", exp_id)) { 6454 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 6455 6455 psFree(iter); 6456 6456 psFree(where); … … 6460 6460 psFree(iter); 6461 6461 } else { 6462 psAbort( "-exp_ tagwas not parsed correctly (this should not happen");6463 } 6464 6465 // check that the specified exp_ tags actually exist in the iteration zero6462 psAbort( "-exp_id was not parsed correctly (this should not happen"); 6463 } 6464 6465 // check that the specified exp_ids actually exist in the iteration zero 6466 6466 // detInputExp set 6467 6467 … … 6487 6487 } 6488 6488 6489 // build a hash for the valid exp_tags 6490 psHash *valid_exp_tags = psHashAlloc(psArrayLength(detrendExps)); 6489 // build a hash for the valid exp_ids 6490 psHash *valid_exp_ids = psHashAlloc(psArrayLength(detrendExps)); 6491 // XXX: FIXME! 6492 #if 0 6491 6493 for (long i = 0; i < psArrayLength(detrendExps); i++) { 6492 psHashAdd(valid_exp_ tags,6493 ((detInputExpRow *)detrendExps->data[i])->exp_ tag,6494 psHashAdd(valid_exp_ids, 6495 ((detInputExpRow *)detrendExps->data[i])->exp_id, 6494 6496 detrendExps->data[i] 6495 6497 ); 6496 6498 } 6499 #endif 6497 6500 psFree(detrendExps); 6498 6501 … … 6501 6504 if (!psDBTransaction(config->dbh)) { 6502 6505 psError(PS_ERR_UNKNOWN, false, "database error"); 6503 psFree(valid_exp_ tags);6506 psFree(valid_exp_ids); 6504 6507 return false; 6505 6508 } … … 6512 6515 psError(PS_ERR_UNKNOWN, false, "database error"); 6513 6516 } 6514 psFree(valid_exp_ tags);6515 return false; 6516 } 6517 6518 // check exp_ tags and build up an array of new detInputExp rows at the same6517 psFree(valid_exp_ids); 6518 return false; 6519 } 6520 6521 // check exp_ids and build up an array of new detInputExp rows at the same 6519 6522 // time 6520 psListIterator *iter = psListIteratorAlloc(exp_ tag_list, 0, false);6523 psListIterator *iter = psListIteratorAlloc(exp_id_list, 0, false); 6521 6524 psMetadataItem *mItem = NULL; 6522 psArray *newInputExps = psArrayAllocEmpty(psListLength(exp_ tag_list));6525 psArray *newInputExps = psArrayAllocEmpty(psListLength(exp_id_list)); 6523 6526 while ((mItem = psListGetAndIncrement(iter))) { 6524 detInputExpRow *inputExp = psHashLookup(valid_exp_ tags,6527 detInputExpRow *inputExp = psHashLookup(valid_exp_ids, 6525 6528 (char *)mItem->data.V); 6526 6529 if (!inputExp) { … … 6529 6532 psError(PS_ERR_UNKNOWN, false, "database error"); 6530 6533 } 6531 // invalid exp_ tag6532 psError(PS_ERR_UNKNOWN, false, "exp_ tag%s is invalid for det_id %s",6534 // invalid exp_id 6535 psError(PS_ERR_UNKNOWN, false, "exp_id %s is invalid for det_id %s", 6533 6536 (char *)mItem->data.V, det_id); 6534 6537 psFree(iter); 6535 psFree(valid_exp_ tags);6538 psFree(valid_exp_ids); 6536 6539 return false; 6537 6540 } … … 6539 6542 (psS32)atol(det_id), 6540 6543 newIteration, 6541 inputExp->exp_ tag,6544 inputExp->exp_id, 6542 6545 true // use 6543 6546 ); … … 6546 6549 } 6547 6550 psFree(iter); 6548 psFree(valid_exp_ tags);6551 psFree(valid_exp_ids); 6549 6552 6550 6553 for (long i = 0; i < psArrayLength(newInputExps); i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
