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

    r21402 r25835  
    5151}
    5252
    53 
    54 bool pxfakeRunSetStateByQuery(pxConfig *config, psMetadata *where, const char *state)
    55 {
    56     PS_ASSERT_PTR_NON_NULL(config, false);
    57     PS_ASSERT_PTR_NON_NULL(state, false);
    58 
    59     // check that state is a valid string value
    60     if (!pxIsValidState(state)) {
    61         psError(PS_ERR_UNKNOWN, false,
    62                 "invalid fakeRun state: %s", state);
    63         return false;
    64     }
    65 
    66     psString query = psStringCopy("UPDATE fakeRun JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET fakeRun.state = '%s'");
    67 
    68     if (where) {
    69         psString whereClause = psDBGenerateWhereSQL(where, NULL);
    70         psStringAppend(&query, " %s", whereClause);
    71         psFree(whereClause);
    72     }
    73 
    74     if (!p_psDBRunQueryF(config->dbh, query, state)) {
    75         psFree(query);
    76         psError(PS_ERR_UNKNOWN, false, "database error");
    77         return false;
    78     }
    79 
    80     psFree(query);
    81 
    82     return true;
    83 }
    84 
    85 
    86 bool pxfakeRunSetLabel(pxConfig *config, psS64 fake_id, const char *label)
    87 {
    88     PS_ASSERT_PTR_NON_NULL(config, false);
    89     // note label == NULL should be explicitly allowed
    90 
    91     char *query = "UPDATE fakeRun SET fakeRun.label = '%s' WHERE fake_id = %" PRId64;
    92     if (!p_psDBRunQueryF(config->dbh, query, label, fake_id)) {
    93         psError(PS_ERR_UNKNOWN, false,
    94                 "failed to change state for fake_id %" PRId64, fake_id);
    95         return false;
    96     }
    97 
    98     return true;
    99 }
    100 
    101 
    102 bool pxfakeRunSetLabelByQuery(pxConfig *config, psMetadata *where, const char *label)
    103 {
    104     PS_ASSERT_PTR_NON_NULL(config, false);
    105     // note label == NULL should be explicitly allowed
    106 
    107     psString query = psStringCopy("UPDATE fakeRun JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET fakeRun.label = '%s'");
    108 
    109     if (where) {
    110         psString whereClause = psDBGenerateWhereSQL(where, NULL);
    111         psStringAppend(&query, " %s", whereClause);
    112         psFree(whereClause);
    113     }
    114 
    115     if (!p_psDBRunQueryF(config->dbh, query, label)) {
    116         psFree(query);
    117         psError(PS_ERR_UNKNOWN, false, "database error");
    118         return false;
    119     }
    120 
    121     psFree(query);
    122 
    123     return true;
    124 }
    125 
    126 
    12753psS64 pxfakeQueueByCamID(pxConfig *config,
    12854                    psS64 cam_id,
    12955                    char *workdir,
    13056                    char *label,
     57                    char *data_group,
     58                    char *dist_group,
    13159                    char *reduction,
    13260                    char *expgroup,
    13361                    char *dvodb,
    13462                    char *tess_id,
    135                     char *end_stage)
     63                    char *end_stage,
     64                    char *note)
    13665{
    13766    PS_ASSERT_PTR_NON_NULL(config, false);
     
    15786                workdir  ? workdir  : "NULL",
    15887                label    ? label    : "NULL",
     88                data_group ? data_group : "NULL",
     89                dist_group ? dist_group : "NULL",
    15990                reduction? reduction: "NULL",
    16091                expgroup ? expgroup : "NULL",
     
    16293                tess_id  ? tess_id  : "NULL",
    16394                end_stage ? end_stage : "NULL",
     95                note     ? note     : "NULL",
    16496                (long long)cam_id
    16597    )) {
Note: See TracChangeset for help on using the changeset viewer.