Changeset 28003 for branches/pap/ippToPsps/src/ippToPsps.c
- Timestamp:
- May 18, 2010, 12:49:05 PM (16 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippToPsps/src/ippToPsps.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ippToPsps/src/ippToPsps.c
r27684 r28003 18 18 #include "ippToPsps.h" 19 19 20 extern int ippToPsps_batchTest(IppToPsps *data); 20 21 extern int ippToPsps_batchInit(IppToPsps *data); 21 22 extern int ippToPsps_batchDetection(IppToPsps *data); … … 123 124 } 124 125 125 // the available IPP data products126 // the available IPP batch types for PSPS 126 127 typedef enum { 127 128 128 PRODUCT_INIT, 129 PRODUCT_DETECTION, 130 PRODUCT_STACK, 131 PRODUCT_DIFFERENCE, 132 PRODUCT_UNDEFINED 129 BATCH_TEST, 130 BATCH_INIT, 131 BATCH_DETECTION, 132 BATCH_STACK, 133 BATCH_DIFFERENCE, 134 BATCH_UNDEFINED 133 135 134 136 } ippProducts; … … 146 148 psMetadataAddStr(arguments, PS_LIST_TAIL, "-results", 0, "Path to results output", NULL); 147 149 psMetadataAddStr(arguments, PS_LIST_TAIL, "-config", 0, "Path to config dir", NULL); 148 psMetadataAddStr(arguments, PS_LIST_TAIL, "- product", 0, "Product type: [det|stack|diff]", NULL);150 psMetadataAddStr(arguments, PS_LIST_TAIL, "-batch", 0, "Product type: [det|stack|diff]", NULL); 149 151 150 152 bool ret = true; … … 163 165 this->fitsOutPath = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-output")); 164 166 this->configsDir = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-config")); 165 tmp = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-product")); 166 167 if (!tmp) this->product = PRODUCT_UNDEFINED; 168 else if (strcmp(tmp, "init") == 0) this->product = PRODUCT_INIT; 169 else if (strcmp(tmp, "det") == 0) this->product = PRODUCT_DETECTION; 170 else if (strcmp(tmp, "stack") == 0) this->product = PRODUCT_STACK; 171 else if (strcmp(tmp, "diff") == 0) this->product = PRODUCT_DIFFERENCE; 172 else this->product = PRODUCT_UNDEFINED; 167 tmp = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-batch")); 168 169 if (!tmp) this->batchType = BATCH_UNDEFINED; 170 else if (strcmp(tmp, "test") == 0) this->batchType = BATCH_TEST; 171 else if (strcmp(tmp, "init") == 0) this->batchType = BATCH_INIT; 172 else if (strcmp(tmp, "det") == 0) this->batchType = BATCH_DETECTION; 173 else if (strcmp(tmp, "stack") == 0) this->batchType = BATCH_STACK; 174 else if (strcmp(tmp, "diff") == 0) this->batchType = BATCH_DIFFERENCE; 175 else this->batchType = BATCH_UNDEFINED; 173 176 174 177 if ( 175 (this-> product != PRODUCT_INIT && !this->fitsInPath) ||176 (this-> product != PRODUCT_INIT && !this->resultsPath) ||177 (this-> product != PRODUCT_INIT && this->expId == -1) ||178 (this->batchType != BATCH_INIT && !this->fitsInPath) || 179 (this->batchType != BATCH_INIT && !this->resultsPath) || 180 (this->batchType != BATCH_INIT && this->expId == -1) || 178 181 !this->fitsOutPath || 179 182 !this->configsDir || 180 this-> product == PRODUCT_UNDEFINED ) {183 this->batchType == BATCH_UNDEFINED ) { 181 184 182 185 usage(this,argv[0], arguments); … … 196 199 if(this->exitCode == PS_EXIT_SUCCESS) { 197 200 198 // which product? 199 switch(this->product) { 200 201 case PRODUCT_INIT: 201 // which batchType? 202 switch(this->batchType) { 203 204 case BATCH_TEST: 205 this->exitCode = ippToPsps_batchTest(this); 206 break; 207 case BATCH_INIT: 202 208 this->exitCode = ippToPsps_batchInit(this); 203 209 break; 204 case PRODUCT_DETECTION:210 case BATCH_DETECTION: 205 211 this->exitCode = ippToPsps_batchDetection(this); 206 212 break; 207 case PRODUCT_STACK:213 case BATCH_STACK: 208 214 this->exitCode = ippToPsps_batchStack(this); 209 215 break; 210 case PRODUCT_DIFFERENCE:216 case BATCH_DIFFERENCE: 211 217 this->exitCode = ippToPsps_batchDifference(this); 212 218 break; 213 219 default: 214 psError(PS_ERR_UNKNOWN, false, "Unable to run for this product type (%d)", this->product);220 psError(PS_ERR_UNKNOWN, false, "Unable to run for this batch type (%d)", this->batchType); 215 221 this->exitCode = false; 216 222 break; … … 260 266 } 261 267 262 if (this-> product != PRODUCT_INIT && !ippToPsps_readInputFilePaths(this)) {268 if (this->batchType != BATCH_INIT && !ippToPsps_readInputFilePaths(this)) { 263 269 264 270 this->exitCode = PS_EXIT_DATA_ERROR; … … 266 272 } 267 273 268 if (this->product == PRODUCT_INIT) 274 if (this->batchType == BATCH_TEST) 275 psStringAppend(&this->configsDir, "/test"); 276 if (this->batchType == BATCH_INIT) 269 277 psStringAppend(&this->configsDir, "/init"); 270 if (this-> product == PRODUCT_DETECTION)278 if (this->batchType == BATCH_DETECTION) 271 279 psStringAppend(&this->configsDir, "/detection"); 272 if (this-> product == PRODUCT_DIFFERENCE)280 if (this->batchType == BATCH_DIFFERENCE) 273 281 psStringAppend(&this->configsDir, "/diff"); 274 if (this-> product == PRODUCT_STACK)282 if (this->batchType == BATCH_STACK) 275 283 psStringAppend(&this->configsDir, "/stack"); 276 284
Note:
See TracChangeset
for help on using the changeset viewer.
