IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 5, 2010, 5:38:46 PM (16 years ago)
Author:
Serge CHASTEL
Message:

addtool -definebyquery optimization

File:
1 edited

Legend:

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

    r28295 r28856  
    144144    PXOPT_LOOKUP_BOOL(simple,     config->args, "-simple", false);
    145145
    146 
    147 
    148     // find the cam_id of all the exposures that we want to queue up.
    149     psString bare_query = pxDataGet("addtool_find_cam_id.sql");
    150     if (!bare_query) {
    151         psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    152         psFree(where);
    153         return false;
    154     }
    155 
    156146    // prevent queueing an addRun if a given exposure has already been added to
    157147    // the given dvo database
    158148    psString dvodb_string = NULL;
     149    psString bare_query = NULL;
    159150    if (dvodb) {
    160         // user supplied dvodb
    161         psStringAppend(&dvodb_string, "(previous_dvodb = '%s')", dvodb);
     151      psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_cam_id_dvo.sql\n", dvodb);
     152        // find the cam_id of all the exposures that we want to queue up.
     153        bare_query = pxDataGet("addtool_find_cam_id_dvo.sql");
     154        // user supplied dvodb
     155        psStringAppend(&dvodb_string, "addRun.dvodb = '%s'", dvodb);
    162156    } else {
     157        psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_find_cam_id.sql\n");
     158        // find the cam_id of all the exposures that we want to queue up.
     159        bare_query = pxDataGet("addtool_find_cam_id.sql");
    163160        // inherit dvodb from camRun, avoid matching NULL
    164161        psStringAppend(&dvodb_string, "(camRun.dvodb IS NOT NULL AND previous_dvodb = camRun.dvodb)");
     162    }
     163    if (!bare_query) {
     164        psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement");
     165        psFree(where);
     166        return false;
    165167    }
    166168    // Take the bare query and add the dvodb selector
Note: See TracChangeset for help on using the changeset viewer.