IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 7, 2009, 4:25:35 PM (17 years ago)
Author:
watersc1
Message:

Updates to various tools to fix errors in cleanup.

File:
1 edited

Legend:

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

    r24866 r25800  
    192192}
    193193
    194 
    195194bool pxchipRunSetLabel(pxConfig *config, psS64 chip_id, const char *label)
    196195{
     
    233232}
    234233
     234bool pxchipProcessedImfileSetStateByQuery(pxConfig *config, psMetadata *where, const char *state)
     235{
     236    PS_ASSERT_PTR_NON_NULL(config, false);
     237    PS_ASSERT_PTR_NON_NULL(state, false);
     238
     239    // check that state is a valid string value
     240    if (!pxIsValidState(state)) {
     241        psError(PS_ERR_UNKNOWN, false, "invalid chipProcessedImfile state: %s", state);
     242        return false;
     243    }
     244
     245/*     if (!strcmp(state, "full")) { */
     246/*         // There are states that need to be met for a run to be set to full that we don't */
     247/*         // check here. */
     248/*         // for example all of the run's Imfiles must have chipProcessedImfile.data_state == "full" */
     249/*         // chipRun.magicked = (SUM(!chipProcessedImfile.magicked) = 0) */
     250/*         // so don't do allow setting the state to full */
     251/*         psError(PS_ERR_UNKNOWN, true, "cannot use -updaterun so set chipRun state to full"); */
     252/*         return false; */
     253/*     } */
     254
     255    psString query = psStringCopy("UPDATE chipProcessedImfile JOIN chipRun USING(chip_id) JOIN rawExp ON chipRun.exp_id = rawExp.exp_id SET state = '%s'");
     256
     257    if (where && psListLength(where->list) > 0) {
     258        psString whereClause = psDBGenerateWhereSQL(where, NULL);
     259        psStringAppend(&query, " %s", whereClause);
     260        psFree(whereClause);
     261    }
     262
     263    if (!p_psDBRunQueryF(config->dbh, query, state)) {
     264        psFree(query);
     265        psError(PS_ERR_UNKNOWN, false, "database error");
     266        return false;
     267    }
     268
     269    psFree(query);
     270
     271    return true;
     272}
    235273
    236274psS64 pxchipQueueByExpTag(pxConfig *config,
Note: See TracChangeset for help on using the changeset viewer.