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/chiptool.c

    r26465 r26567  
    720720    PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "==");
    721721    PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, NULL);
     722    if (psListLength(where->list) == 0) {
     723        psError(PS_ERR_UNKNOWN, true, "search parameters are required");
     724        return false;
     725    }
    722726       
    723727    if (!state) {
     
    12541258                    chipRun->tess_id,
    12551259                    chipRun->end_stage,
     1260                    chipRun->magicked,
    12561261                    NULL    // note does not propagate
    12571262        )) {
     
    12951300    }
    12961301
    1297     psString set_magic = "";
     1302    char *set_magicked_imfile = "";
     1303    char *set_magicked_run = "";
    12981304    if (!strcmp(data_state, "full")) {
    1299         // copy the magicked state from the input to the output when transitioning to full state
    1300         set_magic = "\n , chipProcessedImfile.magicked = rawImfile.magicked";
    1301     }
    1302 
    1303     // note only updates if chipRun.state = run_state
    1304     // XXX note that we have removed this constraint for now
    1305     if (!p_psDBRunQueryF(config->dbh, query, data_state, set_magic, chip_id, class_id)) {
     1305        // if (chipProcessedImfile.magicked < 0 and rawImfile.magicked = 0) leave magicked unchanged. This will
     1306        // block warp processing until destreaking has been done
     1307        // otherwise copy magicked from the rawImfile
     1308        // Same thing for chipRun/rawExp
     1309        set_magicked_imfile = "\n , chipProcessedImfile.magicked = IF((chipProcessedImfile.magicked < 0 AND rawImfile.magicked = 0), chipProcessedImfile.magicked, rawImfile.magicked)";
     1310        set_magicked_run = "\n , chipRun.magicked = IF((chipRun.magicked < 0 AND rawExp.magicked = 0), chipRun.magicked, rawExp.magicked)";
     1311    } else if (!strcmp(data_state, "cleaned") || !strcmp(data_state, "purged")) {
     1312        // if magicked is non-zero set it to -1
     1313        set_magicked_imfile = "\n, chipProcessedImfile.magicked = IF(chipProcessedImfile.magicked = 0, 0, -1)";
     1314        set_magicked_run = "\n, chipRun.magicked = IF(chipRun.magicked = 0, 0, -1)";
     1315    }
     1316
     1317    if (!p_psDBRunQueryF(config->dbh, query, data_state, set_magicked_imfile, chip_id, class_id)) {
    13061318        psFree(query);
    13071319        psError(PS_ERR_UNKNOWN, false, "database error");
     
    13201332
    13211333    query = pxDataGet("chiptool_change_exp_state.sql");
    1322     if (!p_psDBRunQueryF(config->dbh, query, data_state, chip_id, data_state)) {
     1334    if (!p_psDBRunQueryF(config->dbh, query, data_state, set_magicked_run, chip_id, data_state)) {
    13231335        psFree(query);
    13241336        // rollback
Note: See TracChangeset for help on using the changeset viewer.