IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7351


Ignore:
Timestamp:
Jun 5, 2006, 2:37:36 PM (20 years ago)
Author:
jhoblitt
Message:

finish implementation of -addresid

File:
1 edited

Legend:

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

    r7335 r7351  
    13901390    // check det_id, exp_id, & class_id against the input rawImfiles
    13911391   
     1392    // XXX what we really want here is to do a join but psDB doesn't support
     1393    // that type of operation
    13921394    // we have to generate our own where claus as we want to exclude -stats
    13931395    // from the search
     
    14041406        return false;
    14051407    }
    1406     if (!psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==", class_id)) {
    1407         psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
    1408         psFree(where);
    1409         return false;
    1410     }
    14111408
    14121409    psArray *rawImfiles = searchRawImfiles(config, where);
     
    14191416    }
    14201417
    1421     // database sanity check
    1422     if (psArrayLength(rawImfiles) > 1) {
    1423         // abort
     1418    // iterate through rawImfiles looking for a match to our class_id
     1419    bool found = false;
     1420    for (long i = 0; i < psArrayLength(rawImfiles); i++) {
     1421        if (strcmp(class_id,
     1422                ((rawImfileRow *)rawImfiles->data[i])->class_id) == 0) {
     1423            found = true;
     1424            break;
     1425        }
     1426    }
     1427
     1428    if (!found) {
     1429        psError(PS_ERR_UNKNOWN, true,
     1430    "det_id %s, exp_id %s, class_id %s does not corespond to an input imfile",
     1431            det_id, exp_id, class_id);
     1432        return false;
     1433    }
     1434
     1435    // create a new detResidImfileRow and insert it
     1436    detResidImfileAnalysisRow *residImfile = detResidImfileAnalysisRowAlloc(
     1437                (psS32)atol(det_id),
     1438                exp_id,
     1439                class_id,
     1440                stats,
     1441                recipe
     1442            );
     1443
     1444    if (!detResidImfileAnalysisInsertObject(config->dbh, residImfile)) {
     1445            psError(PS_ERR_UNKNOWN, false, "database error");
     1446            return false;
    14241447    }
    14251448
Note: See TracChangeset for help on using the changeset viewer.