- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/pxchip.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/ippTools/src
- Property svn:ignore
-
old new 1 *.la 2 *.lo 1 3 .deps 2 4 .gdb_history … … 4 6 Makefile 5 7 Makefile.in 8 addtool 9 caltool 10 camtool 11 chiptool 6 12 config.h 7 13 config.h.in 8 stamp-h1 9 *.la 10 *.lo 14 detselect 15 dettool 16 difftool 17 disttool 18 dqstatstool 19 faketool 20 flatcorr 21 guidetool 22 magicdstool 23 magictool 24 pstamptool 25 pubtool 26 pxadmin 27 pxdata.c 28 pxinject 11 29 pxtoolsErrorCodes.c 12 30 pxtoolsErrorCodes.h 13 pxadmin14 pxinject15 pztool16 31 pzgetexp 17 32 pzgetimfiles 33 pztool 34 receivetool 18 35 regtool 19 guidetool 20 chiptool 21 camtool 36 stacktool 37 stamp-h1 22 38 warptool 23 difftool24 stacktool25 faketool26 dettool27 detselect28 pxdata.c29 magictool30 magicdstool31 caltool32 flatcorr33 pstamptool34 disttool35 receivetool36 37 pubtool
-
- Property svn:ignore
-
branches/simtest_nebulous_branches/ippTools/src/pxchip.c
r24866 r27840 96 96 PXOPT_COPY_STR(config->args, where, "-exp_type", "rawExp.exp_type", "=="); 97 97 PXOPT_COPY_STR(config->args, where, "-filelevel", "rawExp.filelevel", "=="); 98 PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", " ==");98 PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", "LIKE"); 99 99 PXOPT_COPY_F64(config->args, where, "-airmass_min", "rawExp.airmass", ">="); 100 100 PXOPT_COPY_F64(config->args, where, "-airmass_max", "rawExp.airmass", "<"); … … 125 125 PXOPT_COPY_F32(config->args, where, "-sun_angle_max", "rawExp.sun_angle", "<"); 126 126 PXOPT_COPY_STR(config->args, where, "-comment", "rawExp.comment", "LIKE"); 127 PXOPT_COPY_STR(config->args, where, "-obs_mode", "rawExp.obs_mode", " ==");128 return true; 129 } 130 131 bool pxchipRunSetState(pxConfig *config, psS64 chip_id, const char *state, const boolmagicked)127 PXOPT_COPY_STR(config->args, where, "-obs_mode", "rawExp.obs_mode", "LIKE"); 128 return true; 129 } 130 131 bool pxchipRunSetState(pxConfig *config, psS64 chip_id, const char *state, const psS64 magicked) 132 132 { 133 133 PS_ASSERT_PTR_NON_NULL(config, false); … … 140 140 } 141 141 142 char *query = "UPDATE chipRun SET state = '%s', magicked = % dWHERE chip_id = %" PRId64;142 char *query = "UPDATE chipRun SET state = '%s', magicked = %" PRId64 " WHERE chip_id = %" PRId64; 143 143 if (!p_psDBRunQueryF(config->dbh, query, state, magicked, chip_id)) { 144 144 psError(PS_ERR_UNKNOWN, false, … … 175 175 psString query = psStringCopy("UPDATE chipRun JOIN rawExp USING(exp_id) SET state = '%s'"); 176 176 177 if (!strcmp(state, "cleaned") || !strcmp(state, "purged")) { 178 // if magicked is non-zero set it to -1 179 psStringAppend(&query, ", chipRun.magicked = IF(chipRun.magicked = 0, 0, -1)"); 180 } 181 177 182 if (where && psListLength(where->list) > 0) { 178 183 psString whereClause = psDBGenerateWhereSQL(where, NULL); … … 192 197 } 193 198 194 195 bool pxchipRunSetLabel(pxConfig *config, psS64 chip_id, const char *label) 199 bool pxchipProcessedImfileSetStateByQuery(pxConfig *config, psMetadata *where, const char *state) 196 200 { 197 201 PS_ASSERT_PTR_NON_NULL(config, false); 198 // note label == NULL should be explicitly allowed199 200 char *query = "UPDATE chipRun SET label = '%s' WHERE chip_id = %" PRId64;201 if (!p _psDBRunQueryF(config->dbh, query, label, chip_id)) {202 psError(PS_ERR_UNKNOWN, false, 203 "failed to change state for chip_id %" PRId64, chip_id);204 return false;205 } 206 207 return true; 208 } 209 210 211 bool pxchipRunSetLabelByQuery(pxConfig *config, psMetadata *where, const char *label) 212 { 213 PS_ASSERT_PTR_NON_NULL(config, false); 214 // note label == NULL should be explicitly allowed 215 216 psString query = psStringCopy("UPDATE chip Run JOIN rawExp USING(exp_id) SET label= '%s'");202 PS_ASSERT_PTR_NON_NULL(state, false); 203 204 // check that state is a valid string value 205 if (!pxIsValidState(state)) { 206 psError(PS_ERR_UNKNOWN, false, "invalid chipProcessedImfile state: %s", state); 207 return false; 208 } 209 210 /* if (!strcmp(state, "full")) { */ 211 /* // There are states that need to be met for a run to be set to full that we don't */ 212 /* // check here. */ 213 /* // for example all of the run's Imfiles must have chipProcessedImfile.data_state == "full" */ 214 /* // chipRun.magicked = (SUM(!chipProcessedImfile.magicked) = 0) */ 215 /* // so don't do allow setting the state to full */ 216 /* psError(PS_ERR_UNKNOWN, true, "cannot use -updaterun so set chipRun state to full"); */ 217 /* return false; */ 218 /* } */ 219 220 psString query = psStringCopy("UPDATE chipProcessedImfile JOIN chipRun USING(chip_id) JOIN rawExp ON chipRun.exp_id = rawExp.exp_id SET data_state = '%s'"); 217 221 218 222 if (where && psListLength(where->list) > 0) { … … 220 224 psStringAppend(&query, " %s", whereClause); 221 225 psFree(whereClause); 222 } 223 224 if (!p_psDBRunQueryF(config->dbh, query, label)) { 226 } else { 227 psError(PS_ERR_UNKNOWN, true, "search parameters are required"); 228 return false; 229 } 230 231 if (!p_psDBRunQueryF(config->dbh, query, state)) { 225 232 psFree(query); 226 233 psError(PS_ERR_UNKNOWN, false, "database error"); … … 232 239 return true; 233 240 } 234 235 241 236 242 psS64 pxchipQueueByExpTag(pxConfig *config, … … 238 244 const char *workdir, 239 245 const char *label, 246 const char *data_group, 247 const char *dist_group, 240 248 const char *reduction, 241 249 const char *expgroup, 242 250 const char *dvodb, 243 251 const char *tess_id, 244 const char *end_stage) 252 const char *end_stage, 253 const char *note) 245 254 { 246 255 PS_ASSERT_PTR_NON_NULL(config, false); … … 260 269 "dirty", // workdir_state 261 270 label, 271 data_group, 272 dist_group, 262 273 reduction, 263 274 expgroup, … … 265 276 tess_id, 266 277 end_stage, 267 0 // magicked 278 0, // magicked 279 note 268 280 ) 269 281 ) {
Note:
See TracChangeset
for help on using the changeset viewer.
