IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16051


Ignore:
Timestamp:
Jan 8, 2008, 4:39:55 PM (18 years ago)
Author:
jhoblitt
Message:

more code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/end_stage/ippTools/src/regtool.c

    r16050 r16051  
    813813
    814814    bool status = false;
    815     // required
     815    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
     816    if (!status) {
     817        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
     818        return false;
     819    }
     820    if (!exp_id) {
     821        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
     822        return false;
     823    }
     824
     825    bool detrend = psMetadataLookupBool(&status, config->args, "-detrend");
     826    if (!status) {
     827        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -detrend");
     828        return false;
     829    }
     830
     831    psString dvodb = psMetadataLookupStr(&status, config->args, "-dvodb");
     832    if (!status) {
     833        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -dvodb");
     834        return false;
     835    }
     836
     837    psString tess_id = psMetadataLookupStr(&status, config->args, "-tess_id");
     838    if (!status) {
     839        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tess_id");
     840        return false;
     841    }
     842
     843    psString end_stage = psMetadataLookupStr(&status, config->args, "-end_stage");
     844    if (!status) {
     845        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -end_stage");
     846        return false;
     847    }
    816848    psString exp_name = psMetadataLookupStr(&status, config->args, "-exp_name");
    817849    if (!status) {
     
    11281160    if (!status) {
    11291161        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code");
    1130         return false;
    1131     }
    1132     psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
    1133     if (!status) {
    1134         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
    1135         return false;
    1136     }
    1137     if (!exp_id) {
    1138         psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
    1139         return false;
    1140     }
    1141 
    1142     bool detrend = psMetadataLookupBool(&status, config->args, "-detrend");
    1143     if (!status) {
    1144         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -detrend");
    1145         return false;
    1146     }
    1147 
    1148     psString dvodb = psMetadataLookupStr(&status, config->args, "-dvodb");
    1149     if (!status) {
    1150         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -dvodb");
    1151         return false;
    1152     }
    1153 
    1154     psString tess_id = psMetadataLookupStr(&status, config->args, "-tess_id");
    1155     if (!status) {
    1156         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tess_id");
    1157         return false;
    1158     }
    1159 
    1160     psString end_stage = psMetadataLookupStr(&status, config->args, "-end_stage");
    1161     if (!status) {
    1162         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -end_stage");
    11631162        return false;
    11641163    }
     
    13021301    }
    13031302
    1304     // if this is a detrend image don't put it in the chip queue (and we're
    1305     // done)
    1306     if (detrend) {
    1307         psFree(newExp);
    1308 
    1309         // set the state for the newExp to stop
    1310         if (!pxnewExpSetState(config, exp_id, "stop")) {
    1311             // rollback
    1312             if (!psDBRollback(config->dbh)) {
    1313                 psError(PS_ERR_UNKNOWN, false, "database error");
    1314             }
    1315             psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_id: %s", exp_id);
    1316             return false;
    1317         }
    1318 
    1319         return true;
    1320     }
    1321 
    1322 
    13231303    // set the state for the newExp to stop
    13241304    if (!pxnewExpSetState(config, exp_id, "stop")) {
     
    13301310        psFree(newExp);
    13311311        return false;
     1312    }
     1313
     1314    // if this is a detrend image don't put it in the chip queue (and we're
     1315    // done)
     1316    if (detrend) {
     1317        psFree(newExp);
     1318        return true;
    13321319    }
    13331320
Note: See TracChangeset for help on using the changeset viewer.