Changeset 23919
- Timestamp:
- Apr 17, 2009, 4:40:53 PM (17 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
chiptool.c (modified) (10 diffs)
-
chiptoolConfig.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r23873 r23919 125 125 psMetadata *where = psMetadataAlloc(); 126 126 pxchipGetSearchArgs (config, where); // rawExp only 127 PXOPT_COPY_STR(config->args, where, "-label", "rawExp.label", "LIKE");127 pxAddLabelSearchArgs (config, where, "-label", "newExp.label", "LIKE"); 128 128 129 129 // psListLength(where->list) is at least 1 because exp_type defaults to "object" … … 219 219 } 220 220 221 222 # define GET_VALUE(PTYPE,CTYPE,VALUE,NAME) \ 223 PTYPE VALUE; \ 224 { bool status; \ 225 VALUE = psMetadataLookup##CTYPE(&status, md, NAME); \ 226 if (!status) { \ 227 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for %s", NAME); \ 228 psFree(output); \ 229 return false; \ 230 } } 231 221 232 // loop over our list of exp_ids 222 233 for (long i = 0; i < psArrayLength(output); i++) { 223 234 psMetadata *md = output->data[i]; 224 235 225 bool status; 226 psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id"); 227 if (!status) { 228 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id"); 236 rawExpRow *row = rawExpObjectFromMetadata(md); 237 if (!row) { 238 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into chipRun"); 229 239 psFree(output); 230 240 return false; 231 241 } 232 // 242 243 GET_VALUE (psS64, S64, exp_id, "exp_id"); 244 GET_VALUE (psString, Str, raw_workdir, "workdir"); 245 GET_VALUE (psString, Str, raw_label, "label"); 246 GET_VALUE (psString, Str, raw_reduction, "reduction"); 247 // GET_VALUE (psString, Str, raw_expgroup, "expgroup"); 248 GET_VALUE (psString, Str, raw_dvodb, "dvodb"); 249 GET_VALUE (psString, Str, raw_tess_id, "tess_id"); 250 GET_VALUE (psString, Str, raw_end_stage, "end_stage"); 251 252 if (!row->exp_id) { 253 psError(PS_ERR_UNKNOWN, false, "failed to find value for exp_id"); 254 psFree(output); 255 return false; 256 } 257 233 258 // queue the exp 234 if (!pxchipQueueByExpTag(config, exp_id, workdir, label, reduction, expgroup, dvodb, tess_id, end_stage)) { 259 if (!pxchipQueueByExpTag(config, 260 exp_id, 261 workdir ? workdir : raw_workdir, 262 label ? label : raw_label, 263 reduction ? reduction : raw_reduction, 264 // expgroup ? expgroup : raw_expgroup, 265 // XXX how does expgroup get defined? 266 expgroup, 267 dvodb ? dvodb : raw_dvodb, 268 tess_id ? tess_id : raw_tess_id, 269 end_stage ? end_stage : raw_end_stage 270 )) { 235 271 if (!psDBRollback(config->dbh)) { 236 272 psError(PS_ERR_UNKNOWN, false, "database error"); … … 260 296 pxchipGetSearchArgs (config, where); // rawExp, chipRun 261 297 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 298 // we only allow a single label to match (do not use pxAddLabelSearchArgs here) 262 299 PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "=="); 263 300 PXOPT_COPY_STR(config->args, where, "-state", "chipRun.state", "=="); … … 312 349 pxchipGetSearchArgs (config, where); //chipRun, rawExp 313 350 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 314 PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "==");351 pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "=="); 315 352 316 353 psString query = pxDataGet("chiptool_pendingimfile.sql"); … … 563 600 PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "=="); 564 601 PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "=="); 565 PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "LIKE");602 pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "LIKE"); 566 603 PXOPT_COPY_S32(config->args, where, "-magicked", "chipRun.magicked", "=="); 567 604 … … 639 676 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 640 677 PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "=="); 641 PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "LIKE"); 678 // require a single label 679 PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "=="); 642 680 PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "=="); 643 681 PXOPT_COPY_S16(config->args, where, "-fault", "chipProcessedImfile.fault", "=="); … … 865 903 866 904 psMetadata *where = psMetadataAlloc(); 867 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");905 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 868 906 869 907 psString query = pxDataGet("chiptool_pendingcleanuprun.sql"); … … 929 967 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 930 968 } 931 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");969 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 932 970 933 971 psString query = pxDataGet("chiptool_pendingcleanupimfile.sql"); … … 1057 1095 1058 1096 psMetadata *where = psMetadataAlloc(); 1059 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");1097 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 1060 1098 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 1061 1099 … … 1118 1156 1119 1157 psMetadata *where = psMetadataAlloc(); 1120 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");1158 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 1121 1159 1122 1160 // look for completed chipPendingExp -
trunk/ippTools/src/chiptoolConfig.c
r23873 r23919 47 47 psMetadata *definebyqueryArgs = psMetadataAlloc(); 48 48 pxchipSetSearchArgs (definebyqueryArgs); 49 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", 0, "search by rawExp label (LIKE comparison)", NULL);49 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by rawExp label (LIKE comparison)", NULL); 50 50 51 51 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-exp_type", PS_META_REPLACE, "search by exp_type", "object"); … … 75 75 psMetadata *pendingimfileArgs = psMetadataAlloc(); 76 76 psMetadataAddS64(pendingimfileArgs, PS_LIST_TAIL, "-chip_id", 0, "search by chip ID", 0); 77 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-label", 0, "search by label", 0);77 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by label", 0); 78 78 pxchipSetSearchArgs(pendingimfileArgs); 79 79 psMetadataAddU64(pendingimfileArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); … … 157 157 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 158 158 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-reduction", 0, "search by reduction class", NULL); 159 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-label", 0, "search by chipRun label (LIKE comparison)", NULL);159 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by chipRun label (LIKE comparison)", NULL); 160 160 psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-magicked", 0, "search by magicked status", false); 161 161 psMetadataAddU64(processedimfileArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); … … 180 180 psMetadataAddS16(updateprocessedimfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code (required)", 0); 181 181 182 // -advanceexp183 psMetadata *advanceexpArgs = psMetadataAlloc();184 psMetadataAddS64(advanceexpArgs, PS_LIST_TAIL, "-chip_id", 0, "search by chip ID", 0);185 psMetadataAddStr(advanceexpArgs, PS_LIST_TAIL, "-label", 0, "advance exposures for specified label", NULL);186 psMetadataAddU64(advanceexpArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0);187 188 182 // -block 189 183 psMetadata *blockArgs = psMetadataAlloc(); … … 208 202 // -pendingcleanuprun 209 203 psMetadata *pendingcleanuprunArgs = psMetadataAlloc(); 210 psMetadataAddStr(pendingcleanuprunArgs, PS_LIST_TAIL, "-label", 0,"list blocks for specified label", NULL);204 psMetadataAddStr(pendingcleanuprunArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "list blocks for specified label", NULL); 211 205 psMetadataAddBool(pendingcleanuprunArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 212 206 psMetadataAddU64(pendingcleanuprunArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); … … 214 208 // -pendingcleanupimfile 215 209 psMetadata *pendingcleanupimfileArgs = psMetadataAlloc(); 216 psMetadataAddStr(pendingcleanupimfileArgs, PS_LIST_TAIL, "-label", 0,"list blocks for specified label", NULL);210 psMetadataAddStr(pendingcleanupimfileArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "list blocks for specified label", NULL); 217 211 psMetadataAddS64(pendingcleanupimfileArgs, PS_LIST_TAIL, "-chip_id", 0, "search by chip ID", 0); 218 212 psMetadataAddStr(pendingcleanupimfileArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exp_id", NULL); … … 228 222 // -run 229 223 psMetadata *runArgs = psMetadataAlloc(); 230 psMetadataAddStr(runArgs, PS_LIST_TAIL, "-label", 0,"search by label", NULL);224 psMetadataAddStr(runArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by label", NULL); 231 225 psMetadataAddBool(runArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 232 226 psMetadataAddU64(runArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 233 227 psMetadataAddStr(runArgs, PS_LIST_TAIL, "-state", 0, "search by state (required)", NULL); 228 229 // -advanceexp 230 psMetadata *advanceexpArgs = psMetadataAlloc(); 231 psMetadataAddS64(advanceexpArgs, PS_LIST_TAIL, "-chip_id", 0, "search by chip ID", 0); 232 psMetadataAddStr(advanceexpArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "advance exposures for specified label", NULL); 233 psMetadataAddU64(advanceexpArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 234 234 235 235 // -tocleanedimfile
Note:
See TracChangeset
for help on using the changeset viewer.
