Changeset 11034
- Timestamp:
- Jan 11, 2007, 12:13:05 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 3 edited
-
chiptool.c (modified) (10 diffs)
-
chiptool.h (modified) (1 diff)
-
chiptoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r11033 r11034 29 29 #include "p2tool.h" 30 30 31 static bool quickMode(pxConfig *config);32 static bool defineMode(pxConfig *config);33 31 static bool pendingimfileMode(pxConfig *config); 34 32 static bool addprocessedimfileMode(pxConfig *config); … … 57 55 58 56 switch (config->mode) { 59 MODECASE(P2TOOL_MODE_QUICK, quickMode);60 MODECASE(P2TOOL_MODE_DEFINE, defineMode);61 57 MODECASE(P2TOOL_MODE_PENDINGIMFILE, pendingimfileMode); 62 58 MODECASE(P2TOOL_MODE_ADDPROCESSEDIMFILE, addprocessedimfileMode); … … 84 80 85 81 exit(EXIT_FAILURE); 86 }87 88 static bool quickMode(pxConfig *config)89 {90 PS_ASSERT_PTR_NON_NULL(config, NULL);91 92 psArray *rawFrames = rawScienceFrameSearch(config);93 if (!rawFrames) {94 psError(PS_ERR_UNKNOWN, false, "no rawScienceFrames found");95 return false;96 }97 bool status = rawScienceFramePrint(stdout, config, rawFrames);98 if (!status) {99 psError(PS_ERR_UNKNOWN, false, "rawScienceFramePrint() failed");100 return false;101 }102 103 return true;104 }105 106 static bool defineMode(pxConfig *config)107 {108 PS_ASSERT_PTR_NON_NULL(config, NULL);109 #if 0110 111 psArray *rawFrames = rawScienceFrameSearch(config);112 if (!rawFrames) {113 psError(PS_ERR_UNKNOWN, false, "no rawScienceFrames found");114 return false;115 }116 psArray *pendingFrames = p2PendingFrameSearch(config);117 // XXX compare raw frames to pending frames and remove duplicate118 // frames from the raw set. This may not be quiet right as it's119 // possible (likely?) that a rawScienceExp is inserted into the120 // dbh prior to /ALL/ of that exposure's Imfiles121 if (pendingFrames) {122 for (long i = 0; i < rawFrames->n; i++) {123 rawScienceFrame *rawFrame = rawFrames->data[i];124 for (long j = 0; j < pendingFrames->n; j++) {125 p2PendingFrame *pendingFrame = pendingFrames->data[j];126 if (strcmp(rawFrame->exposure->exp_tag,127 pendingFrame->exposure->exp_tag) == 0) {128 psArrayRemoveData(rawFrames, rawFrame);129 // dec the counter as the array just got shorter130 // and we don't want to skip elemnts131 i--;132 break;133 }134 }135 }136 137 psFree(pendingFrames);138 139 psArray *doneFrames = p2searchDoneFrames(config);140 if (doneFrames && (rawFrames->n > 0)) {141 for (long i = 0; i < rawFrames->n; i++) {142 rawScienceFrame *rawFrame = rawFrames->data[i];143 for (long j = 0; j < pendingFrames->n; j++) {144 p2DoneFrame *doneFrame = pendingFrames->data[j];145 if (strcmp(rawFrame->exposure->exp_tag,146 doneFrame->exposure->exp_tag) == 0) {147 psArrayRemoveData(rawFrames, rawFrame);148 // dec the counter as the array just got shorter149 // and we don't want to skip elemnts150 i--;151 break;152 }153 }154 }155 156 psFree(doneFrames);157 }158 }159 160 if (!rawFrames->n > 0) {161 psError(PS_ERR_UNKNOWN, false, "no unprocessed rawScienceFrames found");162 psFree(rawFrames);163 return false;164 }165 166 bool status = p2insertPendingFrames(config, rawFrames);167 if (!status) {168 psError(PS_ERR_UNKNOWN, false,"p2insertPendingFrames() failed");169 return false;170 }171 172 #endif173 return true;174 82 } 175 83 … … 257 165 } 258 166 167 259 168 static bool addprocessedimfileMode(pxConfig *config) 260 169 { … … 558 467 } 559 468 469 560 470 static bool maskedMode(pxConfig *config) 561 471 { … … 605 515 } 606 516 517 607 518 static bool unblockMode(pxConfig *config) 608 519 { … … 630 541 return true; 631 542 } 543 632 544 633 545 static bool p2ProcessedCompleteExp(pxConfig *config) … … 746 658 } 747 659 660 748 661 static p2ProcessedImfileRow *p2PendingToProcessedImfile(pxConfig *config, p2PendingImfileRow *imfile) 749 662 { … … 838 751 } 839 752 753 840 754 static p2ProcessedExpRow *p2PendingToProcessedExp(pxConfig *config, p2PendingExpRow *pendingExp) 841 755 { … … 850 764 } 851 765 766 852 767 static p3PendingExpRow *p2PendingToP3PendingExp(pxConfig *config, p2PendingExpRow *pendingExp) 853 768 { -
trunk/ippTools/src/chiptool.h
r11033 r11034 25 25 typedef enum { 26 26 P2TOOL_MODE_NONE = 0x0, 27 P2TOOL_MODE_QUICK,28 P2TOOL_MODE_DEFINE,29 27 P2TOOL_MODE_PENDINGIMFILE, 30 28 P2TOOL_MODE_ADDPROCESSEDIMFILE, -
trunk/ippTools/src/chiptoolConfig.c
r11033 r11034 38 38 goto FAIL; 39 39 } 40 41 // -quick42 psMetadata *quickArgs = psMetadataAlloc();43 44 // -define45 psMetadata *defineArgs = psMetadataAlloc();46 40 47 41 // -pendingimfile … … 154 148 155 149 psMetadata *argSets = psMetadataAlloc(); 156 PXTOOL_MODE("-quick", P2TOOL_MODE_QUICK, quickArgs);157 PXTOOL_MODE("-define", P2TOOL_MODE_DEFINE, defineArgs);158 150 PXTOOL_MODE("-pendingimfile", P2TOOL_MODE_PENDINGIMFILE, pendingimfileArgs); 159 151 PXTOOL_MODE("-addprocessedimfile",P2TOOL_MODE_ADDPROCESSEDIMFILE,addprocessedimfileArgs);
Note:
See TracChangeset
for help on using the changeset viewer.
