IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23919


Ignore:
Timestamp:
Apr 17, 2009, 4:40:53 PM (17 years ago)
Author:
eugene
Message:

convert -label options to multi where appropriate; fix definebyquery (was not passing along tess_id, reduction, etc from newExp, only supplied values or NULL)

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r23873 r23919  
    125125    psMetadata *where = psMetadataAlloc();
    126126    pxchipGetSearchArgs (config, where); // rawExp only
    127     PXOPT_COPY_STR(config->args, where, "-label", "rawExp.label", "LIKE");
     127    pxAddLabelSearchArgs (config, where, "-label", "newExp.label", "LIKE");
    128128
    129129    // psListLength(where->list) is at least 1 because exp_type defaults to "object"
     
    219219    }
    220220
     221
     222# define GET_VALUE(PTYPE,CTYPE,VALUE,NAME)                              \
     223    PTYPE VALUE;                                                        \
     224    { bool status;                                                      \
     225        VALUE = psMetadataLookup##CTYPE(&status, md, NAME);             \
     226        if (!status) {                                                  \
     227            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for %s", NAME); \
     228            psFree(output);                                             \
     229            return false;                                               \
     230        } }
     231
    221232    // loop over our list of exp_ids
    222233    for (long i = 0; i < psArrayLength(output); i++) {
    223234        psMetadata *md = output->data[i];
    224235
    225         bool status;
    226         psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");
    227         if (!status) {
    228             psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id");
     236        rawExpRow *row = rawExpObjectFromMetadata(md);
     237        if (!row) {
     238            psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into chipRun");
    229239            psFree(output);
    230240            return false;
    231241        }
    232         //
     242
     243        GET_VALUE (psS64,    S64, exp_id,        "exp_id");
     244        GET_VALUE (psString, Str, raw_workdir,   "workdir");
     245        GET_VALUE (psString, Str, raw_label,     "label");
     246        GET_VALUE (psString, Str, raw_reduction, "reduction");
     247        // GET_VALUE (psString, Str, raw_expgroup,  "expgroup");
     248        GET_VALUE (psString, Str, raw_dvodb,     "dvodb");
     249        GET_VALUE (psString, Str, raw_tess_id,   "tess_id");
     250        GET_VALUE (psString, Str, raw_end_stage, "end_stage");
     251
     252        if (!row->exp_id) {
     253            psError(PS_ERR_UNKNOWN, false, "failed to find value for exp_id");
     254            psFree(output);
     255            return false;
     256        }
     257
    233258        // queue the exp
    234         if (!pxchipQueueByExpTag(config, exp_id, workdir, label, reduction, expgroup, dvodb, tess_id, end_stage)) {
     259        if (!pxchipQueueByExpTag(config,
     260                                 exp_id,
     261                                 workdir     ? workdir   : raw_workdir,
     262                                 label       ? label     : raw_label,
     263                                 reduction   ? reduction : raw_reduction,
     264                                 // expgroup    ? expgroup  : raw_expgroup,
     265                                 // XXX how does expgroup get defined?
     266                                 expgroup,
     267                                 dvodb       ? dvodb     : raw_dvodb,
     268                                 tess_id     ? tess_id   : raw_tess_id,
     269                                 end_stage   ? end_stage : raw_end_stage
     270                                 )) {
    235271            if (!psDBRollback(config->dbh)) {
    236272                psError(PS_ERR_UNKNOWN, false, "database error");
     
    260296    pxchipGetSearchArgs (config, where); // rawExp, chipRun
    261297    PXOPT_COPY_S64(config->args,  where, "-chip_id", "chipRun.chip_id", "==");
     298    // we only allow a single label to match (do not use pxAddLabelSearchArgs here)
    262299    PXOPT_COPY_STR(config->args,  where, "-label",   "chipRun.label",   "==");
    263300    PXOPT_COPY_STR(config->args,  where, "-state",   "chipRun.state",   "==");
     
    312349    pxchipGetSearchArgs (config, where); //chipRun, rawExp
    313350    PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "==");
    314     PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "==");
     351    pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "==");
    315352
    316353    psString query = pxDataGet("chiptool_pendingimfile.sql");
     
    563600    PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "==");
    564601    PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "==");
    565     PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "LIKE");
     602    pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "LIKE");
    566603    PXOPT_COPY_S32(config->args, where, "-magicked", "chipRun.magicked", "==");
    567604
     
    639676    PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "==");
    640677    PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "==");
    641     PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "LIKE");
     678    // require a single label
     679    PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "==");
    642680    PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "==");
    643681    PXOPT_COPY_S16(config->args, where, "-fault", "chipProcessedImfile.fault", "==");
     
    865903
    866904    psMetadata *where = psMetadataAlloc();
    867     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     905    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
    868906
    869907    psString query = pxDataGet("chiptool_pendingcleanuprun.sql");
     
    929967        PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
    930968    }
    931     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     969    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
    932970
    933971    psString query = pxDataGet("chiptool_pendingcleanupimfile.sql");
     
    10571095
    10581096    psMetadata *where = psMetadataAlloc();
    1059     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     1097    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
    10601098    PXOPT_COPY_STR(config->args, where, "-state", "state", "==");
    10611099
     
    11181156
    11191157    psMetadata *where = psMetadataAlloc();
    1120     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     1158    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
    11211159
    11221160    // look for completed chipPendingExp
  • trunk/ippTools/src/chiptoolConfig.c

    r23873 r23919  
    4747    psMetadata *definebyqueryArgs = psMetadataAlloc();
    4848    pxchipSetSearchArgs (definebyqueryArgs);
    49     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label",              0, "search by rawExp label (LIKE comparison)", NULL);
     49    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by rawExp label (LIKE comparison)", NULL);
    5050
    5151    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-exp_type",          PS_META_REPLACE, "search by exp_type", "object");
     
    7575    psMetadata *pendingimfileArgs = psMetadataAlloc();
    7676    psMetadataAddS64(pendingimfileArgs, PS_LIST_TAIL, "-chip_id",  0,            "search by chip ID", 0);
    77     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-label",  0, "search by label", 0);
     77    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-label",  PS_META_DUPLICATE_OK, "search by label", 0);
    7878    pxchipSetSearchArgs(pendingimfileArgs);
    7979    psMetadataAddU64(pendingimfileArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
     
    157157    psMetadataAddStr(processedimfileArgs,  PS_LIST_TAIL, "-class_id",           0, "search by class ID", NULL);
    158158    psMetadataAddStr(processedimfileArgs,  PS_LIST_TAIL, "-reduction",          0, "search by reduction class", NULL);
    159     psMetadataAddStr(processedimfileArgs,  PS_LIST_TAIL, "-label",              0, "search by chipRun label (LIKE comparison)", NULL);
     159    psMetadataAddStr(processedimfileArgs,  PS_LIST_TAIL, "-label",  PS_META_DUPLICATE_OK, "search by chipRun label (LIKE comparison)", NULL);
    160160    psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-magicked",  0,        "search by magicked status", false);
    161161    psMetadataAddU64(processedimfileArgs,  PS_LIST_TAIL, "-limit",  0,           "limit result set to N items", 0);
     
    180180    psMetadataAddS16(updateprocessedimfileArgs, PS_LIST_TAIL, "-fault",  0,            "set fault code (required)", 0);
    181181
    182     // -advanceexp
    183     psMetadata *advanceexpArgs = psMetadataAlloc();
    184     psMetadataAddS64(advanceexpArgs, PS_LIST_TAIL, "-chip_id",  0,          "search by chip ID", 0);
    185     psMetadataAddStr(advanceexpArgs, PS_LIST_TAIL, "-label",  0,            "advance exposures for specified label", NULL);
    186     psMetadataAddU64(advanceexpArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
    187 
    188182    // -block
    189183    psMetadata *blockArgs = psMetadataAlloc();
     
    208202    // -pendingcleanuprun
    209203    psMetadata *pendingcleanuprunArgs = psMetadataAlloc();
    210     psMetadataAddStr(pendingcleanuprunArgs, PS_LIST_TAIL, "-label",  0,            "list blocks for specified label", NULL);
     204    psMetadataAddStr(pendingcleanuprunArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "list blocks for specified label", NULL);
    211205    psMetadataAddBool(pendingcleanuprunArgs, PS_LIST_TAIL, "-simple",  0,            "use the simple output format", false);
    212206    psMetadataAddU64(pendingcleanuprunArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
     
    214208    // -pendingcleanupimfile
    215209    psMetadata *pendingcleanupimfileArgs = psMetadataAlloc();
    216     psMetadataAddStr(pendingcleanupimfileArgs, PS_LIST_TAIL, "-label",  0,            "list blocks for specified label", NULL);
     210    psMetadataAddStr(pendingcleanupimfileArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "list blocks for specified label", NULL);
    217211    psMetadataAddS64(pendingcleanupimfileArgs, PS_LIST_TAIL, "-chip_id", 0,          "search by chip ID", 0);
    218212    psMetadataAddStr(pendingcleanupimfileArgs, PS_LIST_TAIL, "-exp_id",                 0,            "search by exp_id", NULL);
     
    228222    // -run
    229223    psMetadata *runArgs = psMetadataAlloc();
    230     psMetadataAddStr(runArgs, PS_LIST_TAIL, "-label",  0,      "search by label", NULL);
     224    psMetadataAddStr(runArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by label", NULL);
    231225    psMetadataAddBool(runArgs, PS_LIST_TAIL, "-simple",  0,     "use the simple output format", false);
    232226    psMetadataAddU64(runArgs, PS_LIST_TAIL, "-limit",  0,       "limit result set to N items", 0);
    233227    psMetadataAddStr(runArgs, PS_LIST_TAIL, "-state", 0,        "search by state (required)", NULL);
     228
     229    // -advanceexp
     230    psMetadata *advanceexpArgs = psMetadataAlloc();
     231    psMetadataAddS64(advanceexpArgs, PS_LIST_TAIL, "-chip_id",  0,          "search by chip ID", 0);
     232    psMetadataAddStr(advanceexpArgs, PS_LIST_TAIL, "-label",  PS_META_DUPLICATE_OK, "advance exposures for specified label", NULL);
     233    psMetadataAddU64(advanceexpArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
    234234
    235235    // -tocleanedimfile
Note: See TracChangeset for help on using the changeset viewer.