Changeset 6300 for trunk/ippTools/src/regtool.c
- Timestamp:
- Feb 1, 2006, 7:43:36 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/regtool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtool.c
r6286 r6300 6 6 static bool updateMode(pxConfig *config); 7 7 static psArray *newFrameSearchPending(pxConfig *config); 8 static p1PendingExpRow *newToP1PendingExp(newExpRow *newExp); 9 static p2PendingExpRow *newToP2PendingExp(newExpRow *newExp); 8 10 9 11 int main(int argc, char **argv) … … 55 57 56 58 psArray *new = newFrameSearchPending(config); 59 if (!new) { 60 psError(PS_ERR_UNKNOWN, false, "no newFrames found"); 61 return true; 62 } 57 63 58 64 // insert 'new' rawScience & detrendframes … … 73 79 } 74 80 } 81 82 // lookup camera name in p0CameraConfig 83 psMetadata *where = psMetadataAlloc(); 84 //bool status = false; 85 psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, NULL, 86 newFrame->exposure->camera); 87 psArray *configs = p0CameraConfigSelectRowObjects(config->database, where, MAX_ROWS); 88 psFree(where); 89 // if there is no match then we default to sending into into p2 90 if (!configs) { 91 // convert newFrame->exposure to p2PendingExp 92 p2PendingExpRow *p2PendingExp = newToP2PendingExp( 93 newFrame->exposure 94 ); 95 p2PendingExpInsertObject(config->database, p2PendingExp); 96 psFree(p2PendingExp); 97 continue; 98 } 99 100 // only use the first match 101 int pX = ((p0CameraConfigRow *)configs->data[0])->phase; 102 switch (pX) { 103 case 1: 104 // convert newFrame->exposure to p1PendingExp 105 { 106 p1PendingExpRow *p1PendingExp = newToP1PendingExp( 107 newFrame->exposure 108 ); 109 p1PendingExpInsertObject(config->database, p1PendingExp); 110 psFree(p1PendingExp); 111 } 112 break; 113 case 2: 114 // convert newFrame->exposure to p2PendingExp 115 { 116 p2PendingExpRow *p2PendingExp = newToP2PendingExp( 117 newFrame->exposure 118 ); 119 p2PendingExpInsertObject(config->database, p2PendingExp); 120 psFree(p2PendingExp); 121 } 122 break; 123 default: 124 // XXX add argv[0] to pxConfig 125 psAbort("foo", "invalid phase (this should not happen)"); 126 } 127 128 psFree(configs); 75 129 } 130 psFree(new); 76 131 } 77 132 … … 141 196 return new; 142 197 } 198 199 200 static p1PendingExpRow *newToP1PendingExp(newExpRow *newExp) 201 { 202 return p1PendingExpRowAlloc( 203 newExp->exp_id, 204 newExp->camera, 205 newExp->exp_type, 206 newExp->filter, 207 newExp->class, 208 newExp->nclass, 209 newExp->stats, 210 0 // XXX calc version number 211 ); 212 } 213 214 static p2PendingExpRow *newToP2PendingExp(newExpRow *newExp) 215 { 216 return p2PendingExpRowAlloc( 217 newExp->exp_id, 218 newExp->camera, 219 newExp->exp_type, 220 newExp->filter, 221 newExp->class, 222 newExp->nclass, 223 newExp->stats, 224 0, // XXX calc version number 225 0 // XXX calc version number 226 ); 227 }
Note:
See TracChangeset
for help on using the changeset viewer.
