IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 2, 2007, 3:57:20 PM (19 years ago)
Author:
jhoblitt
Message:

merge chipqueue.c -> pxchip.c
merge camqueue.c -> pxcam.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/backtrack/ippTools/src/pxchip.c

    r13994 r13996  
    22 * pxchip.c
    33 *
    4  * Copyright (C) 2006  Joshua Hoblitt
     4 * Copyright (C) 2007  Joshua Hoblitt
    55 *
    66 * This program is free software; you can redistribute it and/or modify it
     
    5454    return true;
    5555}
     56
     57
     58bool pxchipQueueByExpTag(pxConfig *config,
     59                         psString exp_tag,
     60                         psString workdir,
     61                         psString label,
     62                         psString reduction,
     63                         psString expgroup,
     64                         psString dvodb)
     65{
     66    PS_ASSERT_PTR_NON_NULL(config, false);
     67
     68    // start a transaction
     69    if (!psDBTransaction(config->dbh)) {
     70        psError(PS_ERR_UNKNOWN, false, "database error");
     71        return false;
     72    }
     73   
     74    // create a chipRun
     75    if (!chipRunInsert(config->dbh,
     76            0x0,
     77            "run",      // state               
     78            workdir,
     79            "dirty",    // workdir_state
     80            label,
     81            reduction,
     82            expgroup,
     83            dvodb)
     84    ) {
     85        // rollback
     86        if (!psDBRollback(config->dbh)) {
     87            psError(PS_ERR_UNKNOWN, false, "database error");
     88        }
     89        psError(PS_ERR_UNKNOWN, false, "database error");
     90        return false;
     91    }
     92
     93#if 0
     94    // get the chip_id
     95    long chip_id = psDBLastInsertID(config->dbh);
     96#endif
     97
     98    // populate the chipPendingImfile table from rawImfile based on exp_tag,
     99    // where the coresponding newExp.state entry is set to stop
     100    psString query = pxDataGetCached("chiptool_queuerawimfile.sql");
     101    if (!query) {
     102        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     103        return false;
     104    }
     105
     106    // queue the imfiles for the exp_tag
     107    if (!p_psDBRunQuery(config->dbh, query, exp_tag)) {
     108        psError(PS_ERR_UNKNOWN, false, "database error");
     109        return false;
     110    }
     111
     112    // just to be safe, we should have changed at least one row
     113    if (psDBAffectedRows(config->dbh) < 1) {
     114        psError(PS_ERR_UNKNOWN, false,
     115                "no rows affected - should have changed at least one row");
     116        return false;
     117    }
     118
     119    // point of no return
     120    if (!psDBCommit(config->dbh)) {
     121        psError(PS_ERR_UNKNOWN, false, "database error");
     122        return false;
     123    }
     124
     125    return true;
     126}
Note: See TracChangeset for help on using the changeset viewer.