Changeset 26915
- Timestamp:
- Feb 11, 2010, 3:01:34 PM (16 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 3 edited
-
share/addtool_find_cam_id.sql (modified) (1 diff)
-
src/addtool.c (modified) (3 diffs)
-
src/addtoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/addtool_find_cam_id.sql
r25789 r26915 6 6 JOIN rawExp 7 7 USING(exp_id) 8 LEFT JOIN (SELECT exp_id AS added_exp_id, 9 addRun.dvodb AS previous_dvodb 10 FROM addRun 11 JOIN camRun USING(cam_id) 12 JOIN chipRun USING(chip_id) 13 ) as foo 14 ON exp_id = added_exp_id 15 -- hook for qualifying the join on the previous_dvodb 16 AND %s 8 17 WHERE 9 18 camRun.state = 'full' 19 AND added_exp_id IS NULL 20 -- addtool adds checks on exposure being added to the dvodb previously -
trunk/ippTools/src/addtool.c
r26911 r26915 99 99 PXOPT_COPY_S64(config->args, where, "-cam_id", "camRun.cam_id", "=="); 100 100 pxAddLabelSearchArgs (config, where, "-label", "camRun.label", "=="); // define using camRun label 101 pxAddLabelSearchArgs (config, where, "-data_group","camRun.data_group", "=="); // define using camRun label 101 102 PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "=="); 102 103 … … 119 120 120 121 // find the cam_id of all the exposures that we want to queue up. 121 psString query = pxDataGet("addtool_find_cam_id.sql");122 if (! query) {122 psString bare_query = pxDataGet("addtool_find_cam_id.sql"); 123 if (!bare_query) { 123 124 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 124 125 psFree(where); 125 126 return false; 126 127 } 128 129 // prevent queueing an addRun if a given exposure has already been added to 130 // the given dvo database 131 psString dvodb_string = NULL; 132 if (dvodb) { 133 // user supplied dvodb 134 psStringAppend(&dvodb_string, "(previous_dvodb = '%s')", dvodb); 135 } else { 136 // inherit dvodb from camRun, avoid matching NULL 137 psStringAppend(&dvodb_string, "(camRun.dvodb IS NOT NULL AND previous_dvodb = camRun.dvodb)"); 138 } 139 // Take the bare query and add the dvodb selector 140 psString query = NULL; 141 psStringAppend(&query, bare_query, dvodb_string); 142 psFree(dvodb_string); 143 psFree(bare_query); 127 144 128 145 // use psDBGenerateWhereConditionSQL because the SQL ends in a WHERE … … 131 148 psStringAppend(&query, " AND %s", whereClause); 132 149 psFree(whereClause); 150 } else { 151 psError(PS_ERR_UNKNOWN, true, "search parameters are required"); 152 return false; 133 153 } 134 154 psFree(where); -
trunk/ippTools/src/addtoolConfig.c
r26911 r26915 52 52 pxcamSetSearchArgs(definebyqueryArgs); 53 53 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by camRun label", NULL); 54 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by camRun data_group", NULL); 54 55 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-reduction", 0, "search by camRun reduction class", NULL); 55 56 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-destreaked", 0, "only queue destreaked runs", false);
Note:
See TracChangeset
for help on using the changeset viewer.
