IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 14, 2009, 11:06:18 AM (17 years ago)
Author:
bills
Message:

Add data_group, dist_group, and note to the pipeline. These new columns will be used
for some of the tasks that label was used previously.

File:
1 edited

Legend:

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

    r24866 r25835  
    141141}
    142142
    143 
    144 bool pxcamRunSetStateByQuery(pxConfig *config, psMetadata *where, const char *state)
    145 {
    146     PS_ASSERT_PTR_NON_NULL(config, false);
    147     PS_ASSERT_PTR_NON_NULL(state, false);
    148 
    149     // check that state is a valid string value
    150     if (!pxIsValidState(state)) {
    151         psError(PS_ERR_UNKNOWN, false,
    152                 "invalid chipRun state: %s", state);
    153         return false;
    154     }
    155 
    156     psString query = psStringCopy("UPDATE camRun JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET camRun.state = '%s'");
    157 
    158     if (where) {
    159         psString whereClause = psDBGenerateWhereSQL(where, NULL);
    160         psStringAppend(&query, " %s", whereClause);
    161         psFree(whereClause);
    162     }
    163 
    164     if (!p_psDBRunQueryF(config->dbh, query, state)) {
    165         psFree(query);
    166         psError(PS_ERR_UNKNOWN, false, "database error");
    167         return false;
    168     }
    169 
    170     psFree(query);
    171 
    172     return true;
    173 }
    174 
    175 
    176 bool pxcamRunSetLabel(pxConfig *config, psS64 cam_id, const char *label)
    177 {
    178     PS_ASSERT_PTR_NON_NULL(config, false);
    179     // note label == NULL should be explicitly allowed
    180 
    181     char *query = "UPDATE camRun SET camRun.label = '%s' WHERE cam_id = %" PRId64;
    182     if (!p_psDBRunQueryF(config->dbh, query, label, cam_id)) {
    183         psError(PS_ERR_UNKNOWN, false,
    184                 "failed to change state for cam_id %" PRId64, cam_id);
    185         return false;
    186     }
    187 
    188     return true;
    189 }
    190 
    191 bool pxcamRunSetLabelByQuery(pxConfig *config, psMetadata *where, const char *label)
    192 {
    193     PS_ASSERT_PTR_NON_NULL(config, false);
    194     // note label == NULL should be explicitly allowed
    195 
    196     psString query = psStringCopy("UPDATE camRun JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET camRun.label = '%s'");
    197 
    198     if (where) {
    199         psString whereClause = psDBGenerateWhereSQL(where, NULL);
    200         psStringAppend(&query, " %s", whereClause);
    201         psFree(whereClause);
    202     }
    203 
    204     if (!p_psDBRunQueryF(config->dbh, query, label)) {
    205         psFree(query);
    206         psError(PS_ERR_UNKNOWN, false, "database error");
    207         return false;
    208     }
    209 
    210     psFree(query);
    211 
    212     return true;
    213 }
    214 
    215 
    216143bool pxcamQueueByChipID(pxConfig *config,
    217144                    psS64 chip_id,
    218145                    char *workdir,
    219146                    char *label,
     147                    char *data_group,
     148                    char *dist_group,
    220149                    char *recipe,
    221150                    char *expgroup,
    222151                    char *dvodb,
    223152                    char *tess_id,
    224                     char *end_stage)
     153                    char *end_stage,
     154                    char *note)
    225155{
    226156    PS_ASSERT_PTR_NON_NULL(config, false);
     
    245175                "dirty", //workdir_state
    246176                label    ? label    : "NULL",
     177                data_group ? data_group : "NULL",
     178                dist_group ? dist_group : "NULL",
    247179                recipe   ? recipe   : "NULL",
    248180                expgroup ? expgroup : "NULL",
     
    250182                tess_id  ? tess_id  : "NULL",
    251183                end_stage ? end_stage : "NULL",
     184                note     ? note     : "NULL",
    252185                (long long)chip_id
    253186    )) {
Note: See TracChangeset for help on using the changeset viewer.