IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18618


Ignore:
Timestamp:
Jul 18, 2008, 12:20:51 PM (18 years ago)
Author:
Paul Price
Message:

Fixing -template for -inputskyfile, and adding -input

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r18615 r18618  
    293293    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    294294    PXOPT_LOOKUP_BOOL(template, config->args, "-template", false);
     295    PXOPT_LOOKUP_BOOL(input, config->args, "-input", false);
     296
     297    if (template && input) {
     298        // User apparently wants both, which is the default behaviour
     299        template = false;
     300        input = false;
     301    }
    295302
    296303    // find all rawImfiles matching the default query
     
    301308    }
    302309
    303     if (template) {
    304         // list only faulted rows
    305         psStringAppend(&query, " %s", "WHERE template != 0");
    306     } else {
    307         // don't list faulted rows
    308         psStringAppend(&query, " %s", "WHERE template = 0");
    309     }
    310 
    311310    if (psListLength(where->list)) {
    312311        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    313         psStringAppend(&query, " AND %s", whereClause);
     312        psStringAppend(&query, " WHERE %s", whereClause);
    314313        psFree(whereClause);
    315314    }
     315
     316    // Add condition to get only templates or only inputs
     317    {
     318        psString whereClause = NULL;
     319        if (template) {
     320            psStringAppend(&whereClause, " %s", " template != 0");
     321        } else if (input) {
     322            psStringAppend(&whereClause, " %s", " template = 0");
     323        }
     324        if (whereClause) {
     325            psStringAppend(&query, " %s %s", psListLength(where->list) ? "AND" : "WHERE", whereClause);
     326        }
     327        psFree(whereClause);
     328    }
     329
    316330    psFree(where);
    317331
  • trunk/ippTools/src/difftoolConfig.c

    r18561 r18618  
    7373    psMetadataAddStr(inputskyfileArgs, PS_LIST_TAIL, "-tess_id", 0,            "search by tess ID", NULL);
    7474    psMetadataAddStr(inputskyfileArgs, PS_LIST_TAIL, "-kind", 0,            "search by kind", NULL);
    75     psMetadataAddBool(inputskyfileArgs, PS_LIST_TAIL, "-template",  0,            "search by subtrahend", false);
     75    psMetadataAddBool(inputskyfileArgs, PS_LIST_TAIL, "-template",  0,            "find only subtrahend", false);
     76    psMetadataAddBool(inputskyfileArgs, PS_LIST_TAIL, "-input", 0, "find only minuend", false);
    7677    psMetadataAddU64(inputskyfileArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
    7778    psMetadataAddBool(inputskyfileArgs, PS_LIST_TAIL, "-simple",  0,            "use the simple output format", false);
Note: See TracChangeset for help on using the changeset viewer.