IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 12, 2010, 2:07:51 PM (17 years ago)
Author:
bills
Message:

Make update processing compatible with magic. Fix some bugs in update for the warp stage
Make script changes to implement update for diff stage.
Change value of 'magicked' in the various runs and files to contain the value
the magic_id of the magicRun that corresponds to the streaks file used for desreaking.

File:
1 edited

Legend:

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

    r25835 r26567  
    129129}
    130130
    131 bool pxchipRunSetState(pxConfig *config, psS64 chip_id, const char *state, const bool magicked)
     131bool pxchipRunSetState(pxConfig *config, psS64 chip_id, const char *state, const psS64 magicked)
    132132{
    133133    PS_ASSERT_PTR_NON_NULL(config, false);
     
    140140    }
    141141
    142     char *query = "UPDATE chipRun SET state = '%s', magicked = %d WHERE chip_id = %" PRId64;
     142    char *query = "UPDATE chipRun SET state = '%s', magicked = %" PRId64 " WHERE chip_id = %" PRId64;
    143143    if (!p_psDBRunQueryF(config->dbh, query, state, magicked, chip_id)) {
    144144        psError(PS_ERR_UNKNOWN, false,
     
    174174
    175175    psString query = psStringCopy("UPDATE chipRun JOIN rawExp USING(exp_id) SET state = '%s'");
     176
     177    if (!strcmp(state, "cleaned") || !strcmp(state, "purged")) {
     178        // if magicked is non-zero set it to -1
     179        psStringAppend(&query, ", chipRun.magicked = IF(chipRun.magicked = 0, 0, -1)");
     180    }
    176181
    177182    if (where && psListLength(where->list) > 0) {
     
    219224        psStringAppend(&query, " %s", whereClause);
    220225        psFree(whereClause);
     226    } else {
     227        psError(PS_ERR_UNKNOWN, true, "search parameters are required");
     228        return false;
    221229    }
    222230
Note: See TracChangeset for help on using the changeset viewer.