IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 10, 2006, 4:10:52 PM (20 years ago)
Author:
jhoblitt
Message:

improved comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/regtool.c

    r8281 r8285  
    6262    PS_ASSERT_PTR_NON_NULL(config, false);
    6363
    64     // return only exps that are not in rawScienceExp or rawDetrendExp and have
    65     // ALL of their imfiles in rawImfile (by count) and have no associated
    66     // imfiles left in newImfile
     64    // return only exps that:
     65    // are not in rawScienceExp
     66    // are not in rawDetrendExp
     67    // have ALL of their imfiles in rawImfile (by count)
     68    // and have no associated imfiles left in newImfile
    6769
    6870    char *query =
     
    116118    PS_ASSERT_PTR_NON_NULL(config, false);
    117119
    118     // select newImfiles who's exp_id is in newExp AND don't have their exp_id
    119     // in rawScienceExp or rawDetrendExp
     120    // select newImfiles that:
     121    // exp_id is in newExp
     122    // don't have their exp_id in rawScienceExp
     123    // don't have their exp_id in rawDetrendExp
    120124    // XXX having the same exp_id in newExp and raw*Exp is probably an error
    121125    // that should be checked for
     
    328332        psArray *rawImfiles = NULL;
    329333        {
     334            // build a query to search by exp_id
    330335            psMetadata *where = psMetadataAlloc();
    331336            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", newExp->exp_id)) {
     
    343348            psFree(where);
    344349        }
    345         // sanity check the number of rawImfiles found
     350        // sanity check that least results were found
    346351        if (!rawImfiles) {
    347352            // rollback
     
    354359            return false;
    355360        }
     361        // sanity check the number of rawImfiles found
    356362        if (psArrayLength(rawImfiles) != newExp->imfiles) {
    357363            // rollback
     
    416422    char *whereClaus = NULL;
    417423    {
     424        // build a query to search by exp_id, class, class_id
    418425        psMetadata *where = psMetadataAlloc();
    419426        bool status = false;
     
    485492
    486493        for (long i = 0; i < psArrayLength(newImfiles); i++) {
     494            // convert newImfile metadata -> newImfile object
    487495            newImfileRow *object = newImfileObjectFromMetadata(newImfiles->data[i]);
     496            // convert newImfile object -> rawImfile object
    488497            rawImfileRow *imfile = newToRawImfile(config, object);
    489498            if (!imfile) {
     
    497506                return false;
    498507            }
     508            // insert the rawImfile object into the database
    499509            if (!rawImfileInsertObject(config->dbh, imfile)) {
    500510                // rollback
     
    509519            }
    510520            psFree(imfile);
     521            // remove the neImfile object from the database
    511522            if (!newImfileDeleteObject(config->dbh, object)) {
    512523                // rollback
     
    539550    PS_ASSERT_PTR_NON_NULL(config, false);
    540551
     552    // find all rawImfiles matching the default query
    541553    psArray *rawImfiles = rawImfileSelectRowObjects(config->dbh, config->where, 0);
    542554    if (!rawImfiles) {
Note: See TracChangeset for help on using the changeset viewer.