- 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/pxwarp.c (modified) (2 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/pxwarp.c
r24487 r27840 29 29 #include "pxwarp.h" 30 30 31 bool pxwarpRunSetState(pxConfig *config, psS64 warp_id, const char *state)32 {33 PS_ASSERT_PTR_NON_NULL(config, false);34 PS_ASSERT_PTR_NON_NULL(state, false);35 36 // check that state is a valid string value37 if (!pxIsValidState(state)) {38 psError(PS_ERR_UNKNOWN, false, "invalid warpRun state: %s", state);39 return false;40 }41 42 char *query = "UPDATE warpRun SET state = '%s' WHERE warp_id = %" PRId64;43 if (!p_psDBRunQueryF(config->dbh, query, state, warp_id)) {44 psError(PS_ERR_UNKNOWN, false,45 "failed to change state for warp_id %" PRId64, warp_id);46 return false;47 }48 49 return true;50 }51 52 53 bool pxwarpRunSetStateByQuery(pxConfig *config, psMetadata *where, const char *state)54 {55 PS_ASSERT_PTR_NON_NULL(config, false);56 PS_ASSERT_PTR_NON_NULL(state, false);57 58 // check that state is a valid string value59 if (!pxIsValidState(state)) {60 psError(PS_ERR_UNKNOWN, false, "invalid warpRun state: %s", state);61 return false;62 }63 64 psString query = psStringCopy("UPDATE warpRun JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET warpRun.state = '%s'");65 66 if (where) {67 psString whereClause = psDBGenerateWhereSQL(where, NULL);68 if (whereClause && strlen(whereClause) > 0) {69 psStringAppend(&query, " %s", whereClause);70 }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 pxwarpRunSetLabel(pxConfig *config, psS64 warp_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 warpRun SET warpRun.label = '%s' WHERE warp_id = %" PRId64;92 if (!p_psDBRunQueryF(config->dbh, query, label, warp_id)) {93 psError(PS_ERR_UNKNOWN, false,94 "failed to change label for warp_id %" PRId64, warp_id);95 return false;96 }97 98 return true;99 }100 101 102 bool pxwarpRunSetLabelByQuery(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 warpRun JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET warpRun.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 31 bool pxwarpQueueByFakeID(pxConfig *config, 128 32 psS64 fake_id, 129 33 const char *workdir, 130 34 const char *label, 35 const char *data_group, 36 const char *dist_group, 131 37 const char *dvodb, 132 38 const char *tess_id, 133 39 const char *reduction, 134 const char *end_stage) 40 const char *end_stage, 41 const char *note) 135 42 { 136 43 PS_ASSERT_PTR_NON_NULL(config, false); … … 145 52 "dirty", // workdir_state 146 53 label, 54 data_group, 55 dist_group, 147 56 dvodb, 148 57 tess_id, 149 reduction,58 reduction, 150 59 end_stage, 151 60 NULL, // registered 152 0 // magicked zero when created will get updated when warpRun goes to 'full' 61 0, // magicked set to zero when created may get updated when warpRun goes to 'full' 62 NULL // note 153 63 )) { 154 64 psError(PS_ERR_UNKNOWN, false, "database error");
Note:
See TracChangeset
for help on using the changeset viewer.
