IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2012, 2:49:37 PM (14 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20111122/ippTools/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/ippTools/src

  • branches/eam_branches/ipp-20111122/ippTools/src/chiptool.c

    r32653 r33638  
    198198        GET_VALUE (psS64,    S64, exp_id,        "exp_id");
    199199        GET_VALUE (psString, Str, raw_workdir,   "workdir");
     200#ifdef notyet
     201        GET_VALUE (psString, Str, old_workdir,   "old_workdir");
     202        GET_VALUE (psString, Str, old_data_group, "old_data_group");
     203#else   
     204        const char *old_workdir = NULL;
     205        const char *old_data_group = NULL;
     206#endif
    200207        GET_VALUE (psString, Str, raw_label,     "label");
    201208        GET_VALUE (psString, Str, raw_reduction, "reduction");
     
    213220        if (!pxchipQueueByExpTag(config,
    214221                                 exp_id,
    215                                  workdir     ? workdir   : raw_workdir,
     222                                 workdir     ? workdir   : (old_workdir ? old_workdir : raw_workdir),
    216223                                 label       ? label     : raw_label,
    217                                  data_group  ? data_group : (label ? label : raw_label),
     224                                 data_group  ? data_group : (old_data_group ? old_data_group : (label ? label : raw_label)),
    218225                                 dist_group,
    219226                                 reduction   ? reduction : raw_reduction,
     
    345352    pxAddLabelSearchArgs (config, where, "-label", "chipOld.label", "LIKE");
    346353    pxAddLabelSearchArgs (config, where, "-data_group", "chipOld.data_group", "LIKE");
     354    PXOPT_COPY_STR(config->args,  where, "-state",   "chipOld.state",   "==");
    347355
    348356    // psListLength(where->list) is at least 1 because exp_type defaults to "object"
     
    354362    }
    355363
    356     PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", true, false);
     364    PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", false, false);
    357365    PXOPT_LOOKUP_STR(label, config->args, "-set_label", true, false);
    358366    PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false);
     
    468476    PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "==");
    469477    pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "==");
     478    PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "==");
    470479
    471480    psString query = pxDataGet("chiptool_pendingimfile.sql");
     
    10061015    PXOPT_COPY_S64(config->args, where, "-chip_id", "chipProcessedImfile.chip_id", "==");
    10071016    PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "==");
    1008     PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false);
     1017    PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "==");
     1018
     1019    PXOPT_LOOKUP_S64(cam_id, config->args, "-cam_id", false, false);
     1020    // if cam_id is not supplied chip_id is required
     1021    PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", cam_id ? false : true, false);
    10091022    PXOPT_LOOKUP_S64(class_id, config->args, "-class_id", true, false);
    10101023    PXOPT_LOOKUP_S16(quality, config->args, "-set_quality", true, false);
     
    10171030    if (psListLength(where->list) == 0) {
    10181031        // won't get here
    1019         psError(PXTOOLS_ERR_CONFIG, true, "-chip_id and -class_id are required");
     1032        psError(PXTOOLS_ERR_CONFIG, true, "-chip_id (or -cam_id) and -class_id are required");
    10201033        return false;
    10211034    }
     
    20242037        return false;
    20252038    }
    2026 
    20272039    psFree(setHook);
    20282040    psFree(query);
     2041
     2042    // if we are updating a whole chipRun set lingering chips with poor quality to full data_state
     2043    if (!class_id) {
     2044        query = "UPDATE chipProcessedImfile SET data_state ='full', fault = 0 WHERE chip_id = %" PRId64 " AND quality != 0 AND (data_state ='cleaned' OR data_state = 'update')";
     2045       
     2046        if (!p_psDBRunQueryF(config->dbh, query, chip_id)) {
     2047            psError(PS_ERR_UNKNOWN, false, "database error");
     2048            return false;
     2049        }
     2050    }
    20292051
    20302052    return true;
Note: See TracChangeset for help on using the changeset viewer.