IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13996


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

Location:
branches/backtrack/ippTools/src
Files:
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • branches/backtrack/ippTools/src/Makefile.am

    r13994 r13996  
    5757        pxregister.c \
    5858        pxchip.c \
    59         pxcam.c \
    60         chipqueue.c \
    61         camqueue.c
     59        pxcam.c
    6260
    6361# for pxtools.h
  • branches/backtrack/ippTools/src/camtool.c

    r13994 r13996  
    258258
    259259        // queue the exp
    260         if (!camQueueChipID(config,
     260        if (!pxcamQueueByChipID(config,
    261261                    row->chip_id,
    262262                    workdir     ? workdir   : row->workdir,
  • branches/backtrack/ippTools/src/camtool.h

    r12237 r13996  
    3838pxConfig *camtoolConfig(pxConfig *config, int argc, char **argv);
    3939
    40 bool camQueueChipID(pxConfig *config,
    41                     psS64 chip_id,
    42                     psString workdir,
    43                     psString label,
    44                     psString recipe,
    45                     psString expgroup,
    46                     psString dvodb);
    47 
    4840#endif // CAMTOOL_H
  • branches/backtrack/ippTools/src/chiptool.c

    r13994 r13996  
    242242
    243243        // queue the exp
    244         if (!chipQueueExpTag(config, exp_tag, workdir, label, reduction, expgroup, dvodb)) {
     244        if (!pxchipQueueByExpTag(config, exp_tag, workdir, label, reduction, expgroup, dvodb)) {
    245245            if (!psDBRollback(config->dbh)) {
    246246                psError(PS_ERR_UNKNOWN, false, "database error");
     
    844844        // camQueueChipID() can only be run after chipRun.state has been set to
    845845        // stop
    846         if (!camQueueChipID(config,
     846        if (!pxcamQueueByChipID(config,
    847847                    chipRun->chip_id,
    848848                    chipRun->workdir,
  • branches/backtrack/ippTools/src/chiptool.h

    r13578 r13996  
    3838pxConfig *chiptoolConfig(pxConfig *config, int argc, char **argv);
    3939
    40 bool chipQueueExpTag(pxConfig *config,
    41                      psString exp_tag,
    42                      psString workdir,
    43                      psString label,
    44                      psString recipe,
    45                      psString expgroup,
    46                      psString dvodb);
    47 
    4840#endif // CHIPTOOL_H
  • 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}
  • branches/backtrack/ippTools/src/pxchip.h

    r13994 r13996  
    2727bool pxchipRunSetState(pxConfig *config, psS64 chip_id, const char *state);
    2828
     29bool pxchipQueueByExpTag(pxConfig *config,
     30                         psString exp_tag,
     31                         psString workdir,
     32                         psString label,
     33                         psString recipe,
     34                         psString expgroup,
     35                         psString dvodb);
     36
    2937#endif // PXCHIP_H
  • branches/backtrack/ippTools/src/regtool.c

    r13990 r13996  
    634634        // insert an entry into the chipPendingExp table
    635635        // this can only be run as the newExp's state has been set to stop
    636         if (!chipQueueExpTag(config, exp_tag, NULL, NULL, NULL, NULL, NULL)) {
     636        if (!pxchipQueueByExpTag(config, exp_tag, NULL, NULL, NULL, NULL, NULL)) {
    637637            // rollback
    638638            if (!psDBRollback(config->dbh)) {
Note: See TracChangeset for help on using the changeset viewer.