IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 23, 2011, 9:33:05 AM (15 years ago)
Author:
rhenders
Message:

New class to encapsulate initialization data

File:
1 edited

Legend:

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

    r31011 r31015  
    8787    if (this->dvoConfig != NULL) dvoConfigFree(this->dvoConfig);
    8888
     89    // destroy objects
    8990    this->config->destroy(this->config);
     91    this->initData->destroy(this->initData);
    9092
    9193    pmConfigDone();
     
    210212    }
    211213
    212 
    213 
     214    // check we have some input paths
    214215    if (haveFitsInPath && !readInputFilePaths(this)) {
    215216
     
    218219    }
    219220
    220     // create a config object
     221    // create an InitData object and get survey ID
     222    this->initData = new_InitData(configsBaseDir);
     223    if (strlen(this->surveyType) > 0 &&
     224            !this->initData->getSurveyId(this->initData, this->surveyType, &this->surveyID)) {
     225
     226        this->exitCode = PS_EXIT_CONFIG_ERROR;
     227        return false;
     228    }
     229
     230    // create a Config object
    221231    strcat(configsBaseDir, configsDir);
    222232    this->config = new_Config(configsBaseDir);
     
    227237    }
    228238
    229     // get survey ID using config object
    230     if (strlen(this->surveyType) > 0 && !this->config->getSurveyId(this->config, this->surveyType, &this->surveyID)) {
    231 
    232         this->exitCode = PS_EXIT_CONFIG_ERROR;
    233         return false;
    234     }
    235239    // create full FITS out path
    236     sprintf (fitsOutPath, "%s/%s", fitsOutPath, fitsOutFile);
     240    sprintf(fitsOutPath, "%s/%s", fitsOutPath, fitsOutFile);
    237241
    238242    // create an output FITS file
     
    321325    // set up function pointers
    322326    this->parseArguments = parseArguments;
    323     //this->init = init;
    324327    this->print = print;
    325     this->destroy = destroy;
    326 
    327328    this->gotResultsPath = gotResultsPath;
    328329    this->gotFitsInPath = gotFitsInPath;
     
    330331    this->gotConfig = gotConfig;
    331332    this->gotSurveyType = gotSurveyType;
     333    this->destroy = destroy;
    332334
    333335    assert(this);
Note: See TracChangeset for help on using the changeset viewer.