Changeset 7421 for trunk/ippTools/src/dettool.c
- Timestamp:
- Jun 7, 2006, 4:19:26 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r7387 r7421 31 31 static bool masterMode(pxConfig *config); 32 32 33 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id );33 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id, psS32 iteration); 34 34 static psArray *searchRawImfiles(pxConfig *config, psMetadata *where); 35 35 … … 83 83 84 84 // what type of detRun is this? 85 // det_type & iteration are required 85 86 psString det_type = psMetadataLookupStr(&status, config->args, "-det_type"); 86 // this flag is required 87 if (!status) { 88 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_type"); 89 return false; 90 } 87 91 if (!det_type) { 88 92 psError(PS_ERR_UNKNOWN, true, "-det_type is required"); 93 return false; 94 } 95 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration"); 96 if (!status) { 97 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration"); 98 return false; 99 } 100 if (!iteration) { 101 psError(PS_ERR_UNKNOWN, true, "-iteration is required"); 89 102 return false; 90 103 } … … 187 200 detInputExpRow *inputExp = rawDetrenTodetInputExpRow( 188 201 rawExps->data[i], 189 det_id 202 det_id, 203 iteration 190 204 ); 191 205 psArrayAdd(inputExps, 0, inputExp); … … 286 300 } 287 301 288 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id )302 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id, psS32 iteration) 289 303 { 290 304 PS_ASSERT_PTR_NON_NULL(rawExp, NULL); … … 292 306 return detInputExpRowAlloc( 293 307 det_id, 308 iteration, 294 309 rawExp->exp_id, 295 310 rawExp->camera, … … 765 780 return false; 766 781 } 782 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration"); 783 if (!status) { 784 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration"); 785 return false; 786 } 787 if (!iteration) { 788 psError(PS_ERR_UNKNOWN, true, "-iteration is required"); 789 return false; 790 } 767 791 psString class_id = psMetadataLookupStr(&status, config->args, "-class_id"); 768 792 if (!status) { … … 835 859 // create a new detStackedImfile object 836 860 detStackedImfileRow *stackedImfile = detStackedImfileRowAlloc( 837 (psS32)atol(det_id), class_id, uri, stats, recipe861 (psS32)atol(det_id), iteration, class_id, uri, stats, recipe 838 862 ); 839 863 … … 1091 1115 return false; 1092 1116 } 1117 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration"); 1118 if (!status) { 1119 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration"); 1120 return false; 1121 } 1122 if (!iteration) { 1123 psError(PS_ERR_UNKNOWN, true, "-iteration is required"); 1124 return false; 1125 } 1093 1126 psString class_id = psMetadataLookupStr(&status, config->args, "-class_id"); 1094 1127 if (!status) { … … 1169 1202 // create a new detNormalizedImfile object 1170 1203 detNormalizedImfileRow *masterImfile = detNormalizedImfileRowAlloc( 1171 (psS32)atol(det_id), class_id, uri, stats, recipe1204 (psS32)atol(det_id), iteration, class_id, uri, stats, recipe 1172 1205 ); 1173 1206 … … 1353 1386 return false; 1354 1387 } 1388 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration"); 1389 if (!status) { 1390 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration"); 1391 return false; 1392 } 1393 if (!iteration) { 1394 psError(PS_ERR_UNKNOWN, true, "-iteration is required"); 1395 return false; 1396 } 1355 1397 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 1356 1398 if (!status) { … … 1440 1482 detResidImfileAnalysisRow *residImfile = detResidImfileAnalysisRowAlloc( 1441 1483 (psS32)atol(det_id), 1484 iteration, 1442 1485 exp_id, 1443 1486 class_id, … … 1507 1550 return false; 1508 1551 } 1552 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration"); 1553 if (!status) { 1554 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration"); 1555 return false; 1556 } 1557 if (!iteration) { 1558 psError(PS_ERR_UNKNOWN, true, "-iteration is required"); 1559 return false; 1560 } 1509 1561 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 1510 1562 if (!status) { … … 1572 1624 detResidExpAnalysisRow *residExp = detResidExpAnalysisRowAlloc( 1573 1625 (psS32)atol(det_id), 1626 iteration, 1574 1627 exp_id, 1575 1628 stats, … … 1710 1763 { 1711 1764 PS_ASSERT_PTR_NON_NULL(config, false); 1712 return true; 1713 } 1765 1766 // join detMasterFrame & detNormalizedImfile tables 1767 // no options are required... use the default where statement 1768 psArray *normalizedImfiles = detNormalizedImfileSelectRowObjects( 1769 config->dbh, config->where, 0); 1770 if (!normalizedImfiles) { 1771 psError(PS_ERR_UNKNOWN, false, "no detNormalizedImfile rows found"); 1772 return false; 1773 } 1774 1775 if (psArrayLength(normalizedImfiles)) { 1776 // print imfile list 1777 psMetadata *output = psMetadataAlloc(); 1778 for (long i = 0; i < psArrayLength(normalizedImfiles); i++) { 1779 psMetadata *md = detMasterFrameMetadataFromObject( 1780 normalizedImfiles->data[i]); 1781 psMetadataAddMetadata( 1782 output, PS_LIST_TAIL, "detNormalizedImfile", 1783 PS_META_DUPLICATE_OK, NULL, md 1784 ); 1785 } 1786 1787 psString str = psMetadataConfigFormat(output); 1788 psFree(output); 1789 fprintf(stdout, "%s\n", str); 1790 psFree(str); 1791 } 1792 1793 psFree(normalizedImfiles); 1794 1795 return true; 1796 }
Note:
See TracChangeset
for help on using the changeset viewer.
