IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 12, 2010, 2:07:51 PM (16 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/warptool.c

    r25935 r26567  
    16461646    }
    16471647
    1648     // note only updates if warpRun.state = run_state
    1649     // XXX note that we have removed this constraint for now
    1650     if (!p_psDBRunQueryF(config->dbh, query, data_state, warp_id, skycell_id)) {
     1648    char *set_magicked_skyfile = "";
     1649    char *set_magicked_run = "";
     1650    if (!strcmp(data_state, "full")) {
     1651        set_magicked_skyfile = "\n , warpSkyfile.magicked = IF((warpSkyfile.magicked < 0 AND chipRun.magicked = 0), warpSkyfile.magicked, chipRun.magicked)";
     1652        set_magicked_run = "\n,  warpRun.magicked = IF((warpRun.magicked < 0 AND chipRun.magicked = 0), warpRun.magicked, chipRun.magicked)";
     1653
     1654    } else if (!strcmp(data_state, "cleaned") || !strcmp(data_state, "purged")) {
     1655        set_magicked_skyfile = "\n, warpSkyfile.magicked = IF(warpSkyfile.magicked = 0, 0, -1)";
     1656        set_magicked_run = "\n, warpRun.magicked = IF(warpRun.magicked = 0, 0, -1)";
     1657    }
     1658
     1659    if (!p_psDBRunQueryF(config->dbh, query, data_state, set_magicked_skyfile, warp_id, skycell_id)) {
    16511660        psError(PS_ERR_UNKNOWN, false, "database error");
    16521661        // rollback
     
    16601669
    16611670    query = pxDataGet("warptool_change_run_state.sql");
    1662     if (!p_psDBRunQueryF(config->dbh, query, data_state, warp_id, data_state)) {
     1671    if (!p_psDBRunQueryF(config->dbh, query, data_state, set_magicked_run, warp_id, data_state)) {
    16631672        // rollback
    16641673        if (!psDBRollback(config->dbh)) {
Note: See TracChangeset for help on using the changeset viewer.