IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9272


Ignore:
Timestamp:
Oct 4, 2006, 4:03:21 PM (20 years ago)
Author:
jhoblitt
Message:

implement -pendingexp

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r9271 r9272  
    5858    // and have no associated imfiles left in newImfile
    5959
    60     char *query =
    61         "SELECT newExp.*"
    62         " FROM newExp"
    63         " LEFT JOIN newImfile USING(exp_tag)"
    64         " LEFT JOIN rawScienceExp USING(exp_tag)"
    65         " LEFT JOIN rawDetrendExp USING(exp_tag)"
    66         " WHERE"
    67         "   newExp.exp_tag IS NOT NULL"
    68         "   AND newImfile.exp_tag IS NULL"
    69         "   AND rawScienceExp.exp_tag IS NULL"
    70         "   AND newExp.imfiles ="
    71         "   (SELECT COUNT(exp_tag) FROM rawImfile"
    72         "       WHERE rawImfile.exp_tag = newExp.exp_tag)"
    73         ;
     60    psString query = psStringCopy("SELECT * FROM p3PendingExp");
     61
     62    if (config->where) {
     63        psString whereClause = psDBGenerateWhereSQL(config->where, NULL);
     64        psStringAppend(&query, " %s", whereClause);
     65        psFree(whereClause);
     66    }
    7467
    7568    if (!p_psDBRunQuery(config->dbh, query)) {
    7669        psError(PS_ERR_UNKNOWN, false, "database error");
     70        psFree(query);
    7771        return false;
    7872    }
     73    psFree(query);
    7974
    8075    psArray *output = p_psDBFetchResult(config->dbh);
     
    8580    if (!psArrayLength(output)) {
    8681        // XXX check psError here
    87         psError(PS_ERR_UNKNOWN, false, "no pending newExp rows found");
     82        psError(PS_ERR_UNKNOWN, false, "no p3PendingExp rows found");
    8883        psFree(output);
    8984        return true;
     
    10196
    10297    // negate simple so the default is true
    103     if (!ippdbPrintMetadatas(stdout, output, "newImfile", !simple)) {
     98    if (!ippdbPrintMetadatas(stdout, output, "p3PendingExp", !simple)) {
    10499        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    105100        psFree(output);
  • trunk/ippTools/src/camtoolConfig.c

    r9271 r9272  
    2424    // -pendingexp
    2525    psMetadata *pendingexpArgs = psMetadataAlloc();
    26     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
     26    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_tag", 0,
    2727        "search by exposure ID", NULL);
    28     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-inst",  0,
    29         "search by camera", NULL);
    30     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-telescope",  0,
    31         "search by telescope", NULL);
    32     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_type",  0,
    33         "search by exposure type", NULL);
    34     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-imfiles",  0,
    35         "search for exps with N imfiles", NULL);
    36     psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-simple",  0,
     28    psMetadataAddS32(pendingexpArgs, PS_LIST_TAIL, "-p2_version", 0,
     29        "search for exposures with this p2 version", -1);
     30    psMetadataAddS32(pendingexpArgs, PS_LIST_TAIL, "-p3_version", 0,
     31        "search for exposures with this p3 version", -1);
     32    psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-simple", 0,
    3733        "use the simple output format", false);
    3834   
Note: See TracChangeset for help on using the changeset viewer.