IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 6, 2010, 11:40:28 AM (16 years ago)
Author:
rhenders
Message:

More meaningful names: products are now batches

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/src/ippToPsps.c

    r27845 r27871  
    124124}
    125125
    126 // the available IPP data products
     126// the available IPP batch types for PSPS
    127127typedef enum {
    128128
    129     PRODUCT_TEST,
    130     PRODUCT_INIT,
    131     PRODUCT_DETECTION,
    132     PRODUCT_STACK,
    133     PRODUCT_DIFFERENCE,
    134     PRODUCT_UNDEFINED
     129    BATCH_TEST,
     130    BATCH_INIT,
     131    BATCH_DETECTION,
     132    BATCH_STACK,
     133    BATCH_DIFFERENCE,
     134    BATCH_UNDEFINED
    135135
    136136} ippProducts;
     
    148148    psMetadataAddStr(arguments, PS_LIST_TAIL, "-results", 0, "Path to results output", NULL);
    149149    psMetadataAddStr(arguments, PS_LIST_TAIL, "-config", 0, "Path to config dir", NULL);
    150     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);
    151151
    152152    bool ret = true;
     
    165165        this->fitsOutPath = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-output"));
    166166        this->configsDir = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-config"));
    167         tmp = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-product"));
    168 
    169         if (!tmp) this->product = PRODUCT_UNDEFINED;
    170         else if (strcmp(tmp, "test") == 0) this->product = PRODUCT_TEST;
    171         else if (strcmp(tmp, "init") == 0) this->product = PRODUCT_INIT;
    172         else if (strcmp(tmp, "det") == 0) this->product = PRODUCT_DETECTION;
    173         else if (strcmp(tmp, "stack") == 0) this->product = PRODUCT_STACK;
    174         else if (strcmp(tmp, "diff") == 0) this->product = PRODUCT_DIFFERENCE;
    175         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;
    176176
    177177        if (
    178                 (this->product != PRODUCT_INIT && !this->fitsInPath) ||
    179                 (this->product != PRODUCT_INIT && !this->resultsPath) ||
    180                 (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) ||
    181181                !this->fitsOutPath ||
    182182                !this->configsDir ||
    183                 this->product == PRODUCT_UNDEFINED ) {
     183                this->batchType == BATCH_UNDEFINED ) {
    184184
    185185            usage(this,argv[0], arguments);
     
    199199    if(this->exitCode == PS_EXIT_SUCCESS) {
    200200
    201         // which product?
    202         switch(this->product) {
    203 
    204             case PRODUCT_TEST:
     201        // which batchType?
     202        switch(this->batchType) {
     203
     204            case BATCH_TEST:
    205205                this->exitCode = ippToPsps_batchTest(this);
    206206                break;
    207             case PRODUCT_INIT:
     207            case BATCH_INIT:
    208208                this->exitCode = ippToPsps_batchInit(this);
    209209                break;
    210             case PRODUCT_DETECTION:
     210            case BATCH_DETECTION:
    211211                this->exitCode = ippToPsps_batchDetection(this);
    212212                break;
    213             case PRODUCT_STACK:
     213            case BATCH_STACK:
    214214                this->exitCode = ippToPsps_batchStack(this);
    215215                break;
    216             case PRODUCT_DIFFERENCE:
     216            case BATCH_DIFFERENCE:
    217217                this->exitCode = ippToPsps_batchDifference(this);
    218218                break;
    219219            default:
    220                 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);
    221221                this->exitCode = false;
    222222                break;
     
    266266    }
    267267
    268     if (this->product != PRODUCT_INIT && !ippToPsps_readInputFilePaths(this)) {
     268    if (this->batchType != BATCH_INIT && !ippToPsps_readInputFilePaths(this)) {
    269269
    270270        this->exitCode = PS_EXIT_DATA_ERROR;
     
    272272    }
    273273
    274     if (this->product == PRODUCT_TEST)
     274    if (this->batchType == BATCH_TEST)
    275275        psStringAppend(&this->configsDir, "/test");
    276     if (this->product == PRODUCT_INIT)
     276    if (this->batchType == BATCH_INIT)
    277277        psStringAppend(&this->configsDir, "/init");
    278     if (this->product == PRODUCT_DETECTION)
     278    if (this->batchType == BATCH_DETECTION)
    279279        psStringAppend(&this->configsDir, "/detection");
    280     if (this->product == PRODUCT_DIFFERENCE)
     280    if (this->batchType == BATCH_DIFFERENCE)
    281281        psStringAppend(&this->configsDir, "/diff");
    282     if (this->product == PRODUCT_STACK)
     282    if (this->batchType == BATCH_STACK)
    283283        psStringAppend(&this->configsDir, "/stack");
    284284
Note: See TracChangeset for help on using the changeset viewer.