Changeset 37947
- Timestamp:
- Mar 4, 2015, 2:24:51 PM (11 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 3 edited
-
difftool.c (modified) (7 diffs)
-
difftool.h (modified) (1 diff)
-
difftoolConfig.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/difftool.c
r37938 r37947 42 42 static bool definepoprunMode(pxConfig *config); 43 43 static bool definewarpstackMode(pxConfig *config); 44 static bool definewarpstackOldMethodMode(pxConfig *config);44 //static bool definewarpstackOldMethodMode(pxConfig *config); 45 45 static bool definewarpwarpMode(pxConfig *config); 46 46 static bool definestackstackMode(pxConfig *config); … … 96 96 MODECASE(DIFFTOOL_MODE_DEFINEPOPRUN, definepoprunMode); 97 97 MODECASE(DIFFTOOL_MODE_DEFINEWARPSTACK, definewarpstackMode); 98 MODECASE(DIFFTOOL_MODE_DEFINEWARPSTACKOLDMETHOD, definewarpstackOldMethodMode);98 // MODECASE(DIFFTOOL_MODE_DEFINEWARPSTACKOLDMETHOD, definewarpstackOldMethodMode); 99 99 MODECASE(DIFFTOOL_MODE_DEFINEWARPWARP, definewarpwarpMode); 100 100 MODECASE(DIFFTOOL_MODE_DEFINESTACKSTACK, definestackstackMode); … … 1336 1336 return true; 1337 1337 } 1338 1339 // Do a pass through the result list to determine which runs should be excluded.1340 // This exclusion should do two things: If a skycell doesn't have a stack (as we do a LEFT JOIN) now,1341 // then that skycell needs to not be included in the diff. However, if we have available off,1342 // then we need to flag the entire exposure as bad.1343 psS64 previous_exp_id = 0;1344 long start_index = 0;1345 bool bad_exposure = false;1346 long Nskycells = 0;1347 for (long i = 0; i < output->n; i++) {1348 psMetadata *row = output->data[i];1349 bool mdok;1350 psS64 exp_id = psMetadataLookupS64(&mdok, row, "exp_id");1351 if (!mdok) {1352 psError(PXTOOLS_ERR_PROG, false, "exp_id not found");1353 if (!psDBRollback(config->dbh)) {1354 psError(PS_ERR_UNKNOWN, false, "database error");1355 }1356 return false;1357 }1358 1359 if (exp_id != previous_exp_id) { // Save the position of the start of this exposure.1360 if (Nskycells == 0) { // Ooops, we didn't find any good skycells for this exposure. Don't make an empty run.1361 for (long j = start_index; j < i; j++) { // Clear all the previous entries for this exposure.1362 psMetadata *old_row = output->data[j];1363 psMetadataAddBool(old_row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true); // No stack exists, so this row can't be diffed.1364 psMetadataAddBool(old_row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", true); // No stack exists, so this row can't be diffed.1365 }1366 }1367 previous_exp_id = exp_id;1368 start_index = i;1369 bad_exposure = false;1370 Nskycells = 0;1371 }1372 1373 if (bad_exposure) { // We've flagged this exposure as bad.1374 psMetadataAddBool(row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true);1375 psMetadataAddBool(row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", true);1376 continue;1377 }1378 1379 psMetadataAddBool(row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", false); // By default, this shouldn't be excluded.1380 psMetadataAddBool(row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", false);1381 1382 psS64 stack_id = psMetadataLookupS64(&mdok, row, "stack_id");1383 if (stack_id == PS_MAX_S64) { // stack_id IS NULL, we cannot make this skycell-level diff1384 psMetadataAddBool(row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true); // No stack exists, so this row can't be diffed.1385 1386 if (!available) { // We want to be strict about everything, so cancel this entire exposure.1387 bad_exposure = true; // New exposures with this exp_id will be flagged as bad.1388 for (long j = start_index; j < i; j++) { // Clear all the previous entries for this exposure.1389 psMetadata *old_row = output->data[j];1390 psMetadataAddBool(old_row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true); // No stack exists, so this row can't be diffed.1391 psMetadataAddBool(old_row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", true); // No stack exists, so this row can't be diffed.1392 }1393 }1394 }1395 else { // This looks fine.1396 Nskycells++;1397 }1398 }1399 1400 1401 1338 1402 1339 if (pretend) { … … 1451 1388 return false; 1452 1389 } 1453 }1454 1455 // Do exposure level exclusion here.1456 bool excludeExp = psMetadataLookupBool(&mdok, row, "excludeExp");1457 if (!mdok) {1458 psError(PXTOOLS_ERR_PROG, false, "excludeExp not found");1459 if (!psDBRollback(config->dbh)) {1460 psError(PS_ERR_UNKNOWN, false, "database error");1461 }1462 return false;1463 }1464 if (excludeExp) { // The pre-scan determined that no diff should be made for this exposure.1465 continue;1466 1390 } 1467 1391 … … 1520 1444 1521 1445 if (exp_id == last_exp_id) { 1522 bool exclude = psMetadataLookupBool(&mdok, row, "exclude");1523 if (!mdok) {1524 psError(PXTOOLS_ERR_PROG, false, "exclude not found");1525 if (!psDBRollback(config->dbh)) {1526 psError(PS_ERR_UNKNOWN, false, "database error");1527 }1528 return false;1529 }1530 if (exclude) { // skip this skycell, as we probably don't have a diff.1531 continue;1532 }1533 1446 psString skycell_id = psMetadataLookupStr(&mdok, row, "skycell_id"); 1534 1447 if (!mdok) { … … 1614 1527 } 1615 1528 1616 1529 #if (0) 1617 1530 static bool definewarpstackOldMethodMode(pxConfig *config) 1618 1531 { … … 2005 1918 return true; 2006 1919 } 2007 1920 #endif 2008 1921 2009 1922 static bool definewarpwarpMode(pxConfig *config) -
trunk/ippTools/src/difftool.h
r37938 r37947 54 54 DIFFTOOL_MODE_LISTSSRUN, 55 55 DIFFTOOL_MODE_SETSKYFILETOUPDATE, 56 DIFFTOOL_MODE_DEFINEWARPSTACKOLDMETHOD,56 // DIFFTOOL_MODE_DEFINEWARPSTACKOLDMETHOD, 57 57 } difftoolMode; 58 58 -
trunk/ippTools/src/difftoolConfig.c
r37938 r37947 274 274 pxspaceBoxAddArguments(definewarpstackArgs); 275 275 276 276 #if (0) 277 277 // -definewarpstackOldMethod 278 278 psMetadata *definewarpstackOldMethodArgs = psMetadataAlloc(); … … 303 303 304 304 pxspaceBoxAddArguments(definewarpstackOldMethodArgs); 305 305 #endif 306 306 307 307 // -definewarpwarp … … 511 511 PXOPT_ADD_MODE("-definepoprun", "", DIFFTOOL_MODE_DEFINEPOPRUN, definepoprunArgs); 512 512 PXOPT_ADD_MODE("-definewarpstack", "", DIFFTOOL_MODE_DEFINEWARPSTACK, definewarpstackArgs); 513 PXOPT_ADD_MODE("-definewarpstackOldMethod", "", DIFFTOOL_MODE_DEFINEWARPSTACKOLDMETHOD, definewarpstackOldMethodArgs);513 // PXOPT_ADD_MODE("-definewarpstackOldMethod", "", DIFFTOOL_MODE_DEFINEWARPSTACKOLDMETHOD, definewarpstackOldMethodArgs); 514 514 PXOPT_ADD_MODE("-definewarpwarp", "", DIFFTOOL_MODE_DEFINEWARPWARP, definewarpwarpArgs); 515 515 PXOPT_ADD_MODE("-definestackstack", "", DIFFTOOL_MODE_DEFINESTACKSTACK, definestackstackArgs);
Note:
See TracChangeset
for help on using the changeset viewer.
