Changeset 29982 for branches/czw_branch/20101203/ippTools/src
- Timestamp:
- Dec 8, 2010, 7:21:36 PM (16 years ago)
- Location:
- branches/czw_branch/20101203/ippTools/src
- Files:
-
- 5 edited
-
chiptool.c (modified) (2 diffs)
-
chiptoolConfig.c (modified) (1 diff)
-
pztool.c (modified) (1 diff)
-
regtool.c (modified) (7 diffs)
-
regtoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20101203/ippTools/src/chiptool.c
r29902 r29982 271 271 272 272 // default 273 PXOPT_LOOKUP_BOOL(unique, config->args, "-unique", false); 273 274 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 274 275 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 275 276 276 277 // find the exp_id of all the exposures that we want to queue up. 277 278 psString query = pxDataGet("chiptool_find_rawexp.sql"); … … 288 289 psFree(where); 289 290 291 if (unique) { 292 psStringAppend(&query, "AND chip_id IS NULL"); 293 } 294 290 295 if (!p_psDBRunQuery(config->dbh, query)) { 291 296 psError(PS_ERR_UNKNOWN, false, "database error"); -
branches/czw_branch/20101203/ippTools/src/chiptoolConfig.c
r29902 r29982 61 61 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_dist_group", 0, "define distribution group", NULL); 62 62 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_note", 0, "define note", NULL); 63 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-unique", 0, "only queue exposures that have no previous chipRun", false); 63 64 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-pretend", 0, "do not actually modify the database", false); 64 65 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); -
branches/czw_branch/20101203/ippTools/src/pztool.c
r27053 r29982 112 112 PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", true, false); 113 113 PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false); 114 114 115 115 if (!pzDataStoreInsert(config->dbh, 116 116 camera, -
branches/czw_branch/20101203/ippTools/src/regtool.c
r29965 r29982 331 331 332 332 psString previous_uri = NULL; 333 psString this_uri = NULL; 333 334 bool ok_to_burn = true; 334 335 bool already_burned = true; … … 340 341 psMetadata *row = output->data[i]; 341 342 342 // Use tmp_class_id because class_id may not be populated for all imfiles 343 // Add the information about this row and the previous, if it exists. 344 // Write the class_id stuff for debugging. 343 345 this_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id")); 344 346 psStringSubstitute(&this_class_id,"XY","ota"); 345 // Determine if we've crossed a class_id boundary. 347 psMetadataAddStr(row,PS_LIST_TAIL,"this_class_id",PS_META_REPLACE,"",this_class_id); 348 if (previous_class_id) { 349 psMetadataAddStr(row,PS_LIST_TAIL,"previous_class_id",PS_META_REPLACE,"",previous_class_id); 350 } 351 352 // Determine if we've crossed a class_id boundary, as this resets the bits. 346 353 if (previous_class_id) { 347 354 if (strcmp(this_class_id,previous_class_id) != 0) { … … 352 359 } 353 360 354 // If the state of this imfile is not "pending_burntool" then skip it, because 355 if (!ignore_state) { 356 psString imfile_state = psMetadataLookupStr(NULL,row,"imfile_state"); 357 358 if (!imfile_state) { 359 continue; 360 } 361 if (strcmp("pending_burntool",imfile_state) != 0) { 362 continue; 363 } 364 } 365 361 // Write the URIs as well. 362 this_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Duplicate, but helpful for my debugging. 363 psMetadataAddStr(row,PS_LIST_TAIL,"this_uri",PS_META_REPLACE,"",this_uri); 364 if (previous_uri) { 365 psMetadataAddStr(row,PS_LIST_TAIL,"previous_uri",PS_META_REPLACE,"",previous_uri); 366 } 367 368 // Check the two status variables 366 369 // Convert bits of the SQL query into booleans describing the data state 367 370 if ((psMetadataLookupS32(NULL,row,"is_downloaded") != 1)|| … … 381 384 psMetadataAddBool(row,PS_LIST_TAIL,"already_burned",PS_META_REPLACE,"",already_burned); 382 385 383 // We'll need to return the previous uri so we know where the input table is: 384 if (previous_uri) { 385 psMetadataAddStr(row,PS_LIST_TAIL,"previous_uri",PS_META_REPLACE,"",previous_uri); 386 psFree(previous_uri); 387 } 388 previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); 389 390 // Write the class_id stuff at the end for debugging. 391 psMetadataAddStr(row,PS_LIST_TAIL,"this_class_id",PS_META_REPLACE,"",this_class_id); 392 if (previous_class_id) { 393 psMetadataAddStr(row,PS_LIST_TAIL,"previous_class_id",PS_META_REPLACE,"",previous_class_id); 394 psFree(previous_class_id); 395 } 396 // Use tmp_class_id because class_id may not be populated for all imfiles 397 previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id")); 398 psStringSubstitute(&previous_class_id,"XY","ota"); 386 // Check the uri for this exposure 387 if (!this_uri) { 388 ok_to_burn = false; 389 already_burned = false; 390 391 // Save this round for next round. 392 psFree(previous_class_id); 393 psFree(previous_uri); 394 previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id")); 395 psStringSubstitute(&previous_class_id,"XY","ota"); 396 previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round. 397 continue; 398 } 399 400 // printf("STATUS: %s %s %s %s (%d %d)\n",this_uri,previous_uri,this_class_id,previous_class_id,ok_to_burn,already_burned); 401 402 // If the state of this imfile is not "pending_burntool" then we can't burn it. 403 if (!ignore_state) { 404 psString imfile_state = psMetadataLookupStr(NULL,row,"imfile_state"); 405 406 if (!imfile_state) { // imfile state is NULL, so we probably aren't registered. 407 ok_to_burn = false; 408 409 // Save this round for next round. 410 psFree(previous_class_id); 411 psFree(previous_uri); 412 previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id")); 413 psStringSubstitute(&previous_class_id,"XY","ota"); 414 previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round. 415 continue; 416 } 417 if (strcmp("pending_burntool",imfile_state) != 0) { // Probably the state is full, do not twiddle states 418 // Save this round for next round. 419 psFree(previous_class_id); 420 psFree(previous_uri); 421 previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id")); 422 psStringSubstitute(&previous_class_id,"XY","ota"); 423 previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round. 424 continue; 425 } 426 } 427 399 428 // Determine if we've already suggested an entry for this ota, and if not, copy this 400 429 // suggestion into our output result list. 401 430 if (!ok_to_burn || already_burned) { 431 // Save this round for next round. 432 psFree(previous_class_id); 433 psFree(previous_uri); 434 previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id")); 435 psStringSubstitute(&previous_class_id,"XY","ota"); 436 previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round. 402 437 continue; 403 438 } 404 439 // If we're here, then we think we could potentially burntool this file. 405 440 psArrayAdd(results,results->n,row); 406 // If we're here, then we think we could potentially burntool this file. 407 441 442 // Save this round for next round. 443 psFree(previous_class_id); 444 psFree(previous_uri); 445 previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id")); 446 psStringSubstitute(&previous_class_id,"XY","ota"); 447 previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round. 408 448 } 409 449 … … 499 539 PXOPT_LOOKUP_S32(bytes, config->args, "-bytes", false, false); 500 540 PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", false, false); 501 PXOPT_LOOKUP_B ool(video_cells, config->args, "-video_cells", false, false);541 PXOPT_LOOKUP_BOOL(video_cells, config->args, "-video_cells", false); 502 542 503 543 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); … … 1060 1100 PXOPT_LOOKUP_F32(moon_phase, config->args, "-moon_phase", false, false); 1061 1101 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 1102 PXOPT_LOOKUP_STR(data_group, config->args, "-data_group", false, false); 1103 PXOPT_LOOKUP_STR(dist_group, config->args, "-dist_group", false, false); 1104 PXOPT_LOOKUP_STR(chip_workdir,config->args, "-chip_workdir", false, false); 1062 1105 PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false); 1063 1106 … … 1259 1302 // else continue on... 1260 1303 1261 1304 chip_workdir = chip_workdir ? chip_workdir : workdir; 1262 1305 // insert an entry into the chipPendingExp table 1263 1306 // this can only be run as the newExp's state has been set to stop 1264 1307 if (!pxchipQueueByExpTag(config, 1265 1308 exp_id, 1266 workdir,1309 chip_workdir, 1267 1310 label, 1268 NULL, // data_group 1269 NULL, // dist_group 1311 data_group, 1312 dist_group, 1270 1313 reduction, 1271 1314 NULL, // expgroup -
branches/czw_branch/20101203/ippTools/src/regtoolConfig.c
r29965 r29982 268 268 ADD_OPT(F32, addprocessedexpArgs, "-moon_phase", "define moon phase (0.0 = new)", NAN); 269 269 ADD_OPT(Str, addprocessedexpArgs, "-label", "define label for chip stage (non-detrend data only)", NULL); 270 ADD_OPT(Str, addprocessedexpArgs, "-data_group", "define data_group for chip stage (non-detrend data only)", NULL); 271 ADD_OPT(Str, addprocessedexpArgs, "-dist_group", "define dist_group for chip stage (non-detrend data only)", NULL); 272 ADD_OPT(Str, addprocessedexpArgs, "-chip_workdir", "define workdir for chip stage (non-detrend data only)", NULL); 270 273 ADD_OPT(Str, addprocessedexpArgs, "-hostname", "define host name", NULL); 271 274 ADD_OPT(S16, addprocessedexpArgs, "-fault", "set fault code", 0);
Note:
See TracChangeset
for help on using the changeset viewer.
