IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 9, 2006, 7:18:59 PM (20 years ago)
Author:
jhoblitt
Message:

add -processed iteration support

File:
1 edited

Legend:

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

    r7509 r7512  
    519519    PS_ASSERT_PTR_NON_NULL(config, false);
    520520   
    521     // find all matching detProcessedImfiles
    522     // where query should be pre-generated
     521    // find all matching detProcessedImfiles where query should be
     522    // pre-generated the entry for iteration must be pruned from the default
     523    // search as processed imfiles aren't 'iterated'
     524    bool status = false;
     525    psMetadata *prunedWhere = psMetadataCopy(NULL, config->where);
     526    psMetadataLookupS32(&status, prunedWhere, "iteration");
     527    if (status) {
     528        if (!psMetadataRemove(prunedWhere, 0, "iteration")) {
     529            psError(PS_ERR_UNKNOWN, false, "failed to remove item iteration");
     530            return false;
     531        }
     532    }
    523533    psArray *processedImfiles =
    524         detProcessedImfileSelectRowObjects(config->dbh, config->where, 0);
     534        detProcessedImfileSelectRowObjects(config->dbh, prunedWhere, 0);
     535    psFree(prunedWhere);
    525536    if (!processedImfiles) {
    526537        psError(PS_ERR_UNKNOWN, false, "no detProcessedImfile rows found");
     
    529540
    530541    // remove detStackedImfiles unless -unmask
    531     bool status = false;
    532542    if (!psMetadataLookupBool(&status, config->args, "-unmask")) {
    533543        // detStackedImfiles doesn't have an exp_id so we have to generate the
     
    540550            return false;
    541551        }
     552        psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration");
     553        if (!status) {
     554            psError(PS_ERR_UNKNOWN, false,
     555                    "failed to lookup value for -iteration");
     556            return false;
     557        }
    542558        psString class_id = psMetadataLookupStr(&status, config->args,
    543559            "-class_id");
     
    555571                return false;
    556572            }
     573        }
     574        // iteration always has a value (and it may be 0 anyways)
     575        if (!psMetadataAddS32(where, PS_LIST_TAIL, "iteration", 0, "==",
     576                    iteration)) {
     577            psError(PS_ERR_UNKNOWN, false, "failed to add item iteration");
     578            psFree(where);
     579            return false;
    557580        }
    558581        if (class_id) {
Note: See TracChangeset for help on using the changeset viewer.