IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7036


Ignore:
Timestamp:
May 1, 2006, 4:14:28 PM (20 years ago)
Author:
jhoblitt
Message:

implement -define

File:
1 edited

Legend:

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

    r6991 r7036  
    1010static bool pendingMode(pxConfig *config);
    1111static bool defineMode(pxConfig *config);
    12 static p1PendingExpRow *rawScienceTop1PendingExp(rawScienceExpRow *raw);
     12static p1PendingExpRow *rawScienceTop1PendingExp(pxConfig *config, rawScienceExpRow *raw);
    1313
    1414int main(int argc, char **argv)
     
    4242    PS_ASSERT_PTR_NON_NULL(config, false);
    4343
    44     psArray *p1PendingExp = p1PendingExpSelectRowObjects(config->dbh, NULL, 0);
     44    // return all p1PendingExp rows unless there CLI search options
     45    psArray *p1PendingExp = p1PendingExpSelectRowObjects(
     46        config->dbh,
     47        config->where ? config->where : NULL,
     48        0
     49    );
    4550    if (!p1PendingExp) {
    4651        psError(PS_ERR_UNKNOWN, false, "no p1PendingExp found");
     
    6974{
    7075    PS_ASSERT_PTR_NON_NULL(config, false);
     76   
     77    // return all rawScienceExp rows unless there CLI search options
     78    psArray *rawScienceExps = rawScienceExpSelectRowObjects(
     79        config->dbh,
     80        config->where ? config->where : NULL,
     81        0
     82    );
     83
     84    // insert the rawScienceExps into p1PendingExp
     85    // XXX for the being we're going to skip checking for duplicate entries
     86    // XXX this will have to implimented unless duplicate key insertion
     87    // XXX support is implimented in psDB
     88    for (long i = 0; i < psArrayLength(rawScienceExps); i++) {
     89        p1PendingExpRow * new = rawScienceTop1PendingExp(
     90                                            config, rawScienceExps->data[i]);
     91        if (!p1PendingExpInsertObject(config->dbh, new)) {
     92            psError(PS_ERR_UNKNOWN, false, "dbh access failed");
     93            return false;
     94        }
     95        psFree(new);
     96    }
    7197
    7298    return true;
    7399}
    74100
    75 static p1PendingExpRow *rawScienceTop1PendingExp(rawScienceExpRow *raw)
     101static p1PendingExpRow *rawScienceTop1PendingExp(pxConfig *config, rawScienceExpRow *raw)
    76102{
    77103    return p1PendingExpRowAlloc(
     
    82108//        newExp->class,
    83109        raw->imfiles,
    84         "my filter",
    85         "my stats",
    86         "my recipe",
    87         0xff // XXX calc version number
     110        raw->filter,
     111        raw->stats,
     112        "my recipe",                    //recipe
     113        0xff                            // XXX calc version number
    88114    );
    89115}
Note: See TracChangeset for help on using the changeset viewer.