Changeset 6341
- Timestamp:
- Feb 7, 2006, 10:36:15 AM (20 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 13 edited
-
chiptool.c (modified) (5 diffs)
-
chiptoolConfig.c (modified) (1 diff)
-
p2insertPendingFrames.c (modified) (2 diffs)
-
p2searchDoneFrames.c (modified) (2 diffs)
-
p2searchPendingFrames.c (modified) (4 diffs)
-
p2updatePending.c (modified) (3 diffs)
-
pxadminConfig.c (modified) (1 diff)
-
pxconfig.c (modified) (2 diffs)
-
pxframes.c (modified) (6 diffs)
-
pxtables.c (modified) (3 diffs)
-
pxtools.h (modified) (1 diff)
-
regtool.c (modified) (4 diffs)
-
regtoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r6261 r6341 76 76 // frames from the raw set. This may not be quiet right as it's 77 77 // possible (likely?) that a rawScienceExp is inserted into the 78 // d atabaseprior to /ALL/ of that exposure's Imfiles78 // dbh prior to /ALL/ of that exposure's Imfiles 79 79 if (pendingFrames) { 80 80 for (int i = 0; i < rawFrames->n; i++) { … … 164 164 psArray *doneImfiles = p2pendingToDoneImfile(pendingImfiles); 165 165 for (int i = 0; i < doneImfiles->n; i++) { 166 if (!p2DoneImfileInsertObject(config->d atabase, doneImfiles->data[i])) {167 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");166 if (!p2DoneImfileInsertObject(config->dbh, doneImfiles->data[i])) { 167 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 168 168 return false; 169 169 } 170 170 } 171 171 // delete from pending 172 if (p2PendingImfileDeleteRowObjects(config->d atabase, pendingImfiles, MAX_ROWS) < 0) {172 if (p2PendingImfileDeleteRowObjects(config->dbh, pendingImfiles, MAX_ROWS) < 0) { 173 173 // there must be atleast 1 Imfile to get this far 174 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");174 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 175 175 return false; 176 176 } … … 188 188 psMetadata *where = psMetadataAlloc(); 189 189 psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", pendingExp->exp_id); 190 psArray *pendingImfiles = p2PendingImfileSelectRowObjects(config->d atabase, where, MAX_ROWS);190 psArray *pendingImfiles = p2PendingImfileSelectRowObjects(config->dbh, where, MAX_ROWS); 191 191 psFree(where) 192 192 if (!pendingImfiles) { … … 195 195 nukeMe->n = 0; 196 196 psArrayAdd(nukeMe, 0, pendingExp); 197 bool status = p2PendingExpDeleteRowObjects(config->d atabase, nukeMe, MAX_ROWS);197 bool status = p2PendingExpDeleteRowObjects(config->dbh, nukeMe, MAX_ROWS); 198 198 psFree(nukeMe); 199 199 if (!status) { 200 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");200 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 201 201 return false; 202 202 } … … 208 208 return false; 209 209 } 210 if (!p2DoneExpInsertObject(config->d atabase, doneExp)) {211 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");210 if (!p2DoneExpInsertObject(config->dbh, doneExp)) { 211 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 212 212 return false; 213 213 } -
trunk/ippTools/src/chiptoolConfig.c
r6261 r6341 163 163 164 164 // define Database handle, if used 165 config->d atabase= pmConfigDB(config->site);165 config->dbh = pmConfigDB(config->site); 166 166 167 167 return true; -
trunk/ippTools/src/p2insertPendingFrames.c
r6336 r6341 19 19 psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", PS_META_REPLACE, "==", 20 20 rawFrame->exposure->exp_id); 21 psArray *exposures = p2PendingExpSelectRowObjects(config->d atabase,21 psArray *exposures = p2PendingExpSelectRowObjects(config->dbh, 22 22 where, MAX_ROWS); 23 23 psFree(where); … … 67 67 } 68 68 69 if (!p2PendingExpInsertObject(config->d atabase, pendingExposure)) {70 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");69 if (!p2PendingExpInsertObject(config->dbh, pendingExposure)) { 70 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 71 71 return false; 72 72 } 73 73 74 74 for (int i = 0; i < pendingImages->n; i++) { 75 if (!p2PendingImfileInsertObject(config->d atabase,75 if (!p2PendingImfileInsertObject(config->dbh, 76 76 pendingImages->data[i])) { 77 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");77 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 78 78 return false; 79 79 } -
trunk/ippTools/src/p2searchDoneFrames.c
r6221 r6341 5 5 PS_ASSERT_PTR_NON_NULL(config, NULL); 6 6 7 psArray *exposures = p2DoneExpSelectRowObjects(config->d atabase,7 psArray *exposures = p2DoneExpSelectRowObjects(config->dbh, 8 8 config->where, MAX_ROWS); 9 9 if (!exposures) { … … 25 25 exposure->exp_id); 26 26 27 psArray *images = p2DoneImfileSelectRowObjects(config->d atabase, where,27 psArray *images = p2DoneImfileSelectRowObjects(config->dbh, where, 28 28 MAX_ROWS); 29 29 psFree(where); 30 30 if (!images) { 31 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");31 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 32 32 33 33 return NULL; -
trunk/ippTools/src/p2searchPendingFrames.c
r6258 r6341 5 5 PS_ASSERT_PTR_NON_NULL(config, NULL); 6 6 7 psArray *exposures = p2PendingExpSelectRowObjects(config->d atabase,7 psArray *exposures = p2PendingExpSelectRowObjects(config->dbh, 8 8 config->where, MAX_ROWS); 9 9 if (!exposures) { … … 25 25 psMetadataAddS32(where, PS_LIST_TAIL, "p2_version", PS_META_REPLACE, "==", exposure->p2_version); 26 26 27 psArray *images = p2PendingImfileSelectRowObjects(config->d atabase, where, MAX_ROWS);27 psArray *images = p2PendingImfileSelectRowObjects(config->dbh, where, MAX_ROWS); 28 28 29 29 p2PendingFrame *frame = p2PendingFrameAlloc(exposure, images); … … 43 43 PS_ASSERT_PTR_NON_NULL(config, NULL); 44 44 45 psArray *imfiles = p2PendingImfileSelectRowObjects(config->d atabase,45 psArray *imfiles = p2PendingImfileSelectRowObjects(config->dbh, 46 46 config->where, MAX_ROWS); 47 47 if (!imfiles) { … … 58 58 PS_ASSERT_PTR_NON_NULL(config, NULL); 59 59 60 psArray *exps = p2PendingExpSelectRowObjects(config->d atabase,60 psArray *exps = p2PendingExpSelectRowObjects(config->dbh, 61 61 config->where, 62 62 MAX_ROWS); -
trunk/ippTools/src/p2updatePending.c
r6336 r6341 10 10 // select all of the exposures which are still pending 11 11 psMetadataAddS32 (where, PS_LIST_TAIL, "STATE", 0, "==", PX_MODE_PENDING); 12 psArray *exposures = p2PendingExpSelectRowObjects (config->d atabase, where, MAX_ROWS);12 psArray *exposures = p2PendingExpSelectRowObjects (config->dbh, where, MAX_ROWS); 13 13 14 14 // we will now select all of the matching images which are done … … 20 20 psMetadataAddStr (where, PS_LIST_TAIL, "EXP_ID", PS_META_REPLACE, "==", exposure->exp_id); 21 21 psMetadataAddS32 (where, PS_LIST_TAIL, "P2_VERSION", PS_META_REPLACE, "==", exposure->p2_version); 22 psArray *images = p2PendingImfileSelectRowObjects (config->d atabase, where, MAX_ROWS);22 psArray *images = p2PendingImfileSelectRowObjects (config->dbh, where, MAX_ROWS); 23 23 if (images->n != exposure->imfiles) { 24 24 // free things … … 28 28 // XXX add P2 stats here? 29 29 // exposure->state = PX_MODE_DONE; 30 // p2PendingExposureUpdateRows (config->d atabase, exposure);30 // p2PendingExposureUpdateRows (config->dbh, exposure); 31 31 } 32 32 return true; -
trunk/ippTools/src/pxadminConfig.c
r6261 r6341 73 73 74 74 // define Database handle, if used 75 config->d atabase= pmConfigDB(config->site);75 config->dbh = pmConfigDB(config->site); 76 76 return true; 77 77 } -
trunk/ippTools/src/pxconfig.c
r6339 r6341 16 16 config->camera_name = NULL; 17 17 config->filter = NULL; 18 config->d atabase= NULL;18 config->dbh = NULL; 19 19 config->site = NULL; 20 20 config->recipe = NULL; … … 37 37 psFree(config->camera_name); 38 38 psFree(config->filter); 39 psFree(config->d atabase);39 psFree(config->dbh); 40 40 psFree(config->site); 41 41 psFree(config->recipe); -
trunk/ippTools/src/pxframes.c
r6337 r6341 79 79 PS_ASSERT_PTR_NON_NULL(config, NULL); \ 80 80 \ 81 psArray *exposures = exptype##SelectRowObjects(config->d atabase, \81 psArray *exposures = exptype##SelectRowObjects(config->dbh, \ 82 82 config->where, MAX_ROWS); \ 83 83 if (!exposures) { \ … … 97 97 exposure->exp_id); \ 98 98 \ 99 psArray *images = imfiletype##SelectRowObjects(config->d atabase, where, \99 psArray *images = imfiletype##SelectRowObjects(config->dbh, where, \ 100 100 MAX_ROWS); \ 101 101 psFree(where); \ … … 155 155 { 156 156 PS_ASSERT_PTR_NON_NULL(config, false); 157 PS_ASSERT_PTR_NON_NULL(config->d atabase, false);157 PS_ASSERT_PTR_NON_NULL(config->dbh, false); 158 158 PS_ASSERT_PTR_NON_NULL(frame, false); 159 159 160 psDB *dbh = config->d atabase;160 psDB *dbh = config->dbh; 161 161 162 162 if (!rawScienceExpInsertObject(dbh, frame->exposure)) { 163 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");163 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 164 164 return false; 165 165 } … … 168 168 for (long i = 0; i < images->n; i++) { 169 169 if (!rawImfileInsertObject(dbh, images->data[i])) { 170 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");170 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 171 171 return false; 172 172 } … … 214 214 { 215 215 PS_ASSERT_PTR_NON_NULL(config, false); 216 PS_ASSERT_PTR_NON_NULL(config->d atabase, false);216 PS_ASSERT_PTR_NON_NULL(config->dbh, false); 217 217 PS_ASSERT_PTR_NON_NULL(frame, false); 218 218 219 psDB *dbh = config->d atabase;219 psDB *dbh = config->dbh; 220 220 221 221 if (!rawDetrendExpInsertObject(dbh, frame->exposure)) { 222 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");222 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 223 223 return false; 224 224 } … … 227 227 for (long i = 0; i < images->n; i++) { 228 228 if (!rawImfileInsertObject(dbh, images->data[i])) { 229 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");229 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 230 230 return false; 231 231 } -
trunk/ippTools/src/pxtables.c
r6336 r6341 6 6 PS_ASSERT_PTR_NON_NULL(config, false); 7 7 8 if (!newExpCreateTable(config->d atabase)) {9 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");8 if (!newExpCreateTable(config->dbh)) { 9 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 10 10 status = false; 11 11 } 12 if (!newImfileCreateTable(config->d atabase)) {13 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");12 if (!newImfileCreateTable(config->dbh)) { 13 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 14 14 status = false; 15 15 } 16 if (!rawScienceExpCreateTable(config->d atabase)) {17 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");16 if (!rawScienceExpCreateTable(config->dbh)) { 17 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 18 18 status = false; 19 19 } 20 if (!rawImfileCreateTable(config->d atabase)) {21 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");20 if (!rawImfileCreateTable(config->dbh)) { 21 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 22 22 status = false; 23 23 } 24 if (!rawDetrendExpCreateTable(config->d atabase)) {25 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");24 if (!rawDetrendExpCreateTable(config->dbh)) { 25 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 26 26 status = false; 27 27 } 28 if (!p1PendingExpCreateTable(config->d atabase)) {29 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");28 if (!p1PendingExpCreateTable(config->dbh)) { 29 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 30 30 status = false; 31 31 } 32 if (!p2PendingExpCreateTable(config->d atabase)) {33 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");32 if (!p2PendingExpCreateTable(config->dbh)) { 33 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 34 34 status = false; 35 35 } 36 if (!p2PendingImfileCreateTable(config->d atabase)) {37 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");36 if (!p2PendingImfileCreateTable(config->dbh)) { 37 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 38 38 status = false; 39 39 } 40 if (!p2DoneExpCreateTable(config->d atabase)) {41 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");40 if (!p2DoneExpCreateTable(config->dbh)) { 41 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 42 42 status = false; 43 43 } 44 if (!p2DoneImfileCreateTable(config->d atabase)) {45 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");44 if (!p2DoneImfileCreateTable(config->dbh)) { 45 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 46 46 status = false; 47 47 } 48 if (!p3PendingExpCreateTable(config->d atabase)) {49 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");48 if (!p3PendingExpCreateTable(config->dbh)) { 49 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 50 50 status = false; 51 51 } 52 if (!masterDetrendFramesCreateTable(config->d atabase)) {53 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");52 if (!masterDetrendFramesCreateTable(config->dbh)) { 53 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 54 54 status = false; 55 55 } 56 if (!masterDetrendImfileCreateTable(config->d atabase)) {57 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");56 if (!masterDetrendImfileCreateTable(config->dbh)) { 57 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 58 58 status = false; 59 59 } … … 77 77 if (strcmp (answer, "YES")) goto escape; 78 78 79 fprintf (stdout, "enter d atabaseconnection password: ");79 fprintf (stdout, "enter dbh connection password: "); 80 80 fgets (line, 128, stdin); 81 81 sscanf (line, "%s", answer); … … 88 88 } 89 89 90 if (!newExpDropTable(config->d atabase)) {91 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");90 if (!newExpDropTable(config->dbh)) { 91 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 92 92 status = false; 93 93 } 94 if (!newImfileDropTable(config->d atabase)) {95 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");94 if (!newImfileDropTable(config->dbh)) { 95 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 96 96 status = false; 97 97 } 98 if (!rawScienceExpDropTable(config->d atabase)) {99 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");98 if (!rawScienceExpDropTable(config->dbh)) { 99 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 100 100 status = false; 101 101 } 102 if (!rawImfileDropTable(config->d atabase)) {103 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");102 if (!rawImfileDropTable(config->dbh)) { 103 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 104 104 status = false; 105 105 } 106 if (!rawDetrendExpDropTable(config->d atabase)) {107 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");106 if (!rawDetrendExpDropTable(config->dbh)) { 107 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 108 108 status = false; 109 109 } 110 if (!p1PendingExpDropTable(config->d atabase)) {111 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");110 if (!p1PendingExpDropTable(config->dbh)) { 111 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 112 112 status = false; 113 113 } 114 if (!p2PendingExpDropTable(config->d atabase)) {115 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");114 if (!p2PendingExpDropTable(config->dbh)) { 115 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 116 116 status = false; 117 117 } 118 if (!p2PendingImfileDropTable(config->d atabase)) {119 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");118 if (!p2PendingImfileDropTable(config->dbh)) { 119 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 120 120 status = false; 121 121 } 122 if (!p2DoneExpDropTable(config->d atabase)) {123 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");122 if (!p2DoneExpDropTable(config->dbh)) { 123 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 124 124 status = false; 125 125 } 126 if (!p2DoneImfileDropTable(config->d atabase)) {127 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");126 if (!p2DoneImfileDropTable(config->dbh)) { 127 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 128 128 status = false; 129 129 } 130 if (!p3PendingExpDropTable(config->d atabase)) {131 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");130 if (!p3PendingExpDropTable(config->dbh)) { 131 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 132 132 status = false; 133 133 } 134 if (!masterDetrendFramesDropTable(config->d atabase)) {135 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");134 if (!masterDetrendFramesDropTable(config->dbh)) { 135 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 136 136 status = false; 137 137 } 138 if (!masterDetrendImfileDropTable(config->d atabase)) {139 psError(PS_ERR_UNKNOWN, false, "d atabaseaccess failed");138 if (!masterDetrendImfileDropTable(config->dbh)) { 139 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 140 140 status = false; 141 141 } -
trunk/ippTools/src/pxtools.h
r6338 r6341 36 36 char *camera_name; 37 37 char *filter; 38 psDB *d atabase;38 psDB *dbh; 39 39 psMetadata *site; 40 40 psMetadata *recipe; -
trunk/ippTools/src/regtool.c
r6338 r6341 86 86 psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, NULL, 87 87 newFrame->exposure->camera); 88 psArray *configs = p0CameraConfigSelectRowObjects(config->d atabase, where, MAX_ROWS);88 psArray *configs = p0CameraConfigSelectRowObjects(config->dbh, where, MAX_ROWS); 89 89 psFree(where); 90 90 // if there is no match then we default to sending into into p2 … … 94 94 newFrame->exposure 95 95 ); 96 p2PendingExpInsertObject(config->d atabase, p2PendingExp);96 p2PendingExpInsertObject(config->dbh, p2PendingExp); 97 97 psFree(p2PendingExp); 98 98 continue; … … 108 108 newFrame->exposure 109 109 ); 110 p1PendingExpInsertObject(config->d atabase, p1PendingExp);110 p1PendingExpInsertObject(config->dbh, p1PendingExp); 111 111 psFree(p1PendingExp); 112 112 } … … 118 118 newFrame->exposure 119 119 ); 120 p2PendingExpInsertObject(config->d atabase, p2PendingExp);120 p2PendingExpInsertObject(config->dbh, p2PendingExp); 121 121 psFree(p2PendingExp); 122 122 } -
trunk/ippTools/src/regtoolConfig.c
r6340 r6341 136 136 137 137 // define Database handle, if used 138 config->d atabase= pmConfigDB(config->site);138 config->dbh = pmConfigDB(config->site); 139 139 140 140 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
