IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23381


Ignore:
Timestamp:
Mar 18, 2009, 10:10:16 AM (17 years ago)
Author:
bills
Message:

add chipRun.magicked

Location:
trunk/ippTools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/chiptool_completely_processed_exp.sql

    r20608 r23381  
    1111    dvodb,
    1212    tess_id,
    13     end_stage
     13    end_stage,
     14    all_files_magicked as magicked
    1415FROM
    1516    (SELECT
    1617        chipRun.*,
    1718        rawImfile.class_id as rawimfile_class_id,
    18         chipProcessedImfile.class_id
     19        chipProcessedImfile.class_id,
     20        SUM(!chipProcessedImfile.magicked) = 0 as all_files_magicked
    1921    FROM chipRun
    2022    JOIN rawImfile
  • trunk/ippTools/src/chiptool.c

    r23339 r23381  
    209209            return false;
    210210        }
    211 
     211        //
    212212        // queue the exp
    213213        if (!pxchipQueueByExpTag(config, exp_id, workdir, label, reduction, expgroup, dvodb, tess_id, end_stage)) {
     
    415415    PXOPT_LOOKUP_F32(n_cr, config->args,           "-n_cr", false, false);
    416416    PXOPT_LOOKUP_STR(path_base, config->args,      "-path_base", false, false);
     417    PXOPT_LOOKUP_BOOL(magicked, config->args,      "-magicked", false);
    417418
    418419    // default values
     
    490491                                   path_base,
    491492                                   code,
    492                                    0    // magic_ds_id
     493                                   magicked
    493494            )) {
    494495        // rollback
     
    540541    PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "==");
    541542    PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "LIKE");
     543    PXOPT_COPY_S32(config->args, where, "-magicked", "chipRun.magicked", "==");
    542544
    543545    psString query = pxDataGet("chiptool_processedimfile.sql");
     
    11371139        }
    11381140
    1139         // set chipRun.state to 'stop'
    1140         if (!pxchipRunSetState(config, chipRun->chip_id, "full")) {
     1141        // set chipRun.state to 'stop' and update the magicked state
     1142        if (!pxchipRunSetState(config, chipRun->chip_id, "full", chipRun->magicked)) {
    11411143            psError(PS_ERR_UNKNOWN, false, "failed to change chipRun.state for chip_id: %" PRId64, chipRun->chip_id);
    11421144            psFree(chipRun);
     
    12091211    }
    12101212
    1211     // note only updates if chipRun.state = run_state
    1212     if (!p_psDBRunQueryF(config->dbh, query, data_state, chip_id, class_id, run_state)) {
     1213    psString set_magic = "";
     1214    if (!strcmp(data_state, "full")) {
     1215        // copy the magicked state from the input to the output when transitioning to full state
     1216        set_magic = "\n , chipProcessedImfile.magicked = rawImfile.magicked";
     1217    }
     1218
     1219    if (!p_psDBRunQueryF(config->dbh, query, data_state, set_magic, chip_id, class_id)) {
     1220        psFree(query);
    12131221        psError(PS_ERR_UNKNOWN, false, "database error");
    12141222        // rollback
     
    12271235    query = pxDataGet("chiptool_change_exp_state.sql");
    12281236    if (!p_psDBRunQueryF(config->dbh, query, data_state, chip_id, data_state)) {
     1237        psFree(query);
    12291238        // rollback
    12301239        if (!psDBRollback(config->dbh)) {
     
    12341243        return false;
    12351244    }
     1245    psFree(query);
    12361246
    12371247    if (!psDBCommit(config->dbh)) {
  • trunk/ippTools/src/chiptoolConfig.c

    r23339 r23381  
    147147    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-path_base",  0,            "define base output location", NULL);
    148148    psMetadataAddS16(addprocessedimfileArgs, PS_LIST_TAIL, "-code",  0,            "set fault code", 0);
     149    psMetadataAddBool(addprocessedimfileArgs, PS_LIST_TAIL, "-magicked",  0,        "define magicked status", false);
    149150
    150151    // -processedimfile
     
    155156    psMetadataAddStr(processedimfileArgs,  PS_LIST_TAIL, "-reduction",          0, "search by reduction class", NULL);
    156157    psMetadataAddStr(processedimfileArgs,  PS_LIST_TAIL, "-label",              0, "search by chipRun label (LIKE comparison)", NULL);
     158    psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-magicked",  0,        "search by magicked status", false);
    157159    pxchipSetSearchArgs(processedimfileArgs);
    158160    psMetadataAddU64(processedimfileArgs, PS_LIST_TAIL, "-limit",  0,           "limit result set to N items", 0);
  • trunk/ippTools/src/pxchip.h

    r19324 r23381  
    2525#include "pxtools.h"
    2626
    27 bool pxchipRunSetState(pxConfig *config, psS64 chip_id, const char *state);
     27bool pxchipRunSetState(pxConfig *config, psS64 chip_id, const char *state, const bool magicked);
    2828bool pxchipRunSetStateByQuery(pxConfig *config, psMetadata *where, const char *state);
    2929bool pxchipRunSetLabel(pxConfig *config, psS64 chip_id, const char *label);
Note: See TracChangeset for help on using the changeset viewer.