IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 18, 2010, 12:49:05 PM (16 years ago)
Author:
eugene
Message:

merging changes from trunk into branches/pap

Location:
branches/pap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ippToPsps/src/ippToPsps.c

    r27684 r28003  
    1818#include "ippToPsps.h"
    1919
     20extern int ippToPsps_batchTest(IppToPsps *data);
    2021extern int ippToPsps_batchInit(IppToPsps *data);
    2122extern int ippToPsps_batchDetection(IppToPsps *data);
     
    123124}
    124125
    125 // the available IPP data products
     126// the available IPP batch types for PSPS
    126127typedef enum {
    127128
    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
    133135
    134136} ippProducts;
     
    146148    psMetadataAddStr(arguments, PS_LIST_TAIL, "-results", 0, "Path to results output", NULL);
    147149    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);
    149151
    150152    bool ret = true;
     
    163165        this->fitsOutPath = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-output"));
    164166        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;
    173176
    174177        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) ||
    178181                !this->fitsOutPath ||
    179182                !this->configsDir ||
    180                 this->product == PRODUCT_UNDEFINED ) {
     183                this->batchType == BATCH_UNDEFINED ) {
    181184
    182185            usage(this,argv[0], arguments);
     
    196199    if(this->exitCode == PS_EXIT_SUCCESS) {
    197200
    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:
    202208                this->exitCode = ippToPsps_batchInit(this);
    203209                break;
    204             case PRODUCT_DETECTION:
     210            case BATCH_DETECTION:
    205211                this->exitCode = ippToPsps_batchDetection(this);
    206212                break;
    207             case PRODUCT_STACK:
     213            case BATCH_STACK:
    208214                this->exitCode = ippToPsps_batchStack(this);
    209215                break;
    210             case PRODUCT_DIFFERENCE:
     216            case BATCH_DIFFERENCE:
    211217                this->exitCode = ippToPsps_batchDifference(this);
    212218                break;
    213219            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);
    215221                this->exitCode = false;
    216222                break;
     
    260266    }
    261267
    262     if (this->product != PRODUCT_INIT && !ippToPsps_readInputFilePaths(this)) {
     268    if (this->batchType != BATCH_INIT && !ippToPsps_readInputFilePaths(this)) {
    263269
    264270        this->exitCode = PS_EXIT_DATA_ERROR;
     
    266272    }
    267273
    268     if (this->product == PRODUCT_INIT)
     274    if (this->batchType == BATCH_TEST)
     275        psStringAppend(&this->configsDir, "/test");
     276    if (this->batchType == BATCH_INIT)
    269277        psStringAppend(&this->configsDir, "/init");
    270     if (this->product == PRODUCT_DETECTION)
     278    if (this->batchType == BATCH_DETECTION)
    271279        psStringAppend(&this->configsDir, "/detection");
    272     if (this->product == PRODUCT_DIFFERENCE)
     280    if (this->batchType == BATCH_DIFFERENCE)
    273281        psStringAppend(&this->configsDir, "/diff");
    274     if (this->product == PRODUCT_STACK)
     282    if (this->batchType == BATCH_STACK)
    275283        psStringAppend(&this->configsDir, "/stack");
    276284
Note: See TracChangeset for help on using the changeset viewer.