- 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/pxfake.c (modified) (4 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/pxfake.c
r21402 r27840 51 51 } 52 52 53 54 bool pxfakeRunSetStateByQuery(pxConfig *config, psMetadata *where, const char *state)55 {56 PS_ASSERT_PTR_NON_NULL(config, false);57 PS_ASSERT_PTR_NON_NULL(state, false);58 59 // check that state is a valid string value60 if (!pxIsValidState(state)) {61 psError(PS_ERR_UNKNOWN, false,62 "invalid fakeRun state: %s", state);63 return false;64 }65 66 psString query = psStringCopy("UPDATE fakeRun JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET fakeRun.state = '%s'");67 68 if (where) {69 psString whereClause = psDBGenerateWhereSQL(where, NULL);70 psStringAppend(&query, " %s", whereClause);71 psFree(whereClause);72 }73 74 if (!p_psDBRunQueryF(config->dbh, query, state)) {75 psFree(query);76 psError(PS_ERR_UNKNOWN, false, "database error");77 return false;78 }79 80 psFree(query);81 82 return true;83 }84 85 86 bool pxfakeRunSetLabel(pxConfig *config, psS64 fake_id, const char *label)87 {88 PS_ASSERT_PTR_NON_NULL(config, false);89 // note label == NULL should be explicitly allowed90 91 char *query = "UPDATE fakeRun SET fakeRun.label = '%s' WHERE fake_id = %" PRId64;92 if (!p_psDBRunQueryF(config->dbh, query, label, fake_id)) {93 psError(PS_ERR_UNKNOWN, false,94 "failed to change state for fake_id %" PRId64, fake_id);95 return false;96 }97 98 return true;99 }100 101 102 bool pxfakeRunSetLabelByQuery(pxConfig *config, psMetadata *where, const char *label)103 {104 PS_ASSERT_PTR_NON_NULL(config, false);105 // note label == NULL should be explicitly allowed106 107 psString query = psStringCopy("UPDATE fakeRun JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET fakeRun.label = '%s'");108 109 if (where) {110 psString whereClause = psDBGenerateWhereSQL(where, NULL);111 psStringAppend(&query, " %s", whereClause);112 psFree(whereClause);113 }114 115 if (!p_psDBRunQueryF(config->dbh, query, label)) {116 psFree(query);117 psError(PS_ERR_UNKNOWN, false, "database error");118 return false;119 }120 121 psFree(query);122 123 return true;124 }125 126 127 53 psS64 pxfakeQueueByCamID(pxConfig *config, 128 54 psS64 cam_id, 129 55 char *workdir, 130 56 char *label, 57 char *data_group, 58 char *dist_group, 131 59 char *reduction, 132 60 char *expgroup, 133 61 char *dvodb, 134 62 char *tess_id, 135 char *end_stage) 63 char *end_stage, 64 char *note) 136 65 { 137 66 PS_ASSERT_PTR_NON_NULL(config, false); … … 145 74 psMemSetPersistent(query, true); 146 75 if (!query) { 147 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");76 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 148 77 return false; 149 78 } … … 157 86 workdir ? workdir : "NULL", 158 87 label ? label : "NULL", 88 data_group ? data_group : "NULL", 89 dist_group ? dist_group : "NULL", 159 90 reduction? reduction: "NULL", 160 91 expgroup ? expgroup : "NULL", … … 162 93 tess_id ? tess_id : "NULL", 163 94 end_stage ? end_stage : "NULL", 95 note ? note : "NULL", 164 96 (long long)cam_id 165 97 )) {
Note:
See TracChangeset
for help on using the changeset viewer.
