Changeset 8015 for trunk/ippTools/src/regtool.c
- Timestamp:
- Jul 31, 2006, 2:18:49 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/regtool.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtool.c
r8013 r8015 73 73 PS_ASSERT_PTR_NON_NULL(config, false); 74 74 75 bool status = false; 76 bool detrend = psMetadataLookupBool(&status, config->args, "-detrend"); 77 if (!status) { 78 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -detrend"); 79 return false; 80 } 81 75 82 psArray *new = newFrameSearchPending(config); 76 83 if (!new) { … … 80 87 81 88 // insert 'new' rawScience & detrendframes 82 if ( new->n> 0) {89 if (psArrayLength(new) > 0) { 83 90 for (long i = 0; i < new->n; i++) { 84 91 newFrame *newFrame = new->data[i]; 85 if (strcmp(newFrame->exposure->exp_type, "object") == 0) { 92 if (detrend) { 93 // it's a detrend frame 94 rawDetrendFrame *frame = newToRawDetrendFrame(newFrame); 95 if (!frame) { 96 } 97 if (!rawDetrendFrameInsert(config, frame)) { 98 // error 99 } 100 } else { 86 101 // it's a science frame 87 rawScienceFrame *rawScienceFrame = newToRawScienceFrame(newFrame); 88 if (!rawScienceFrameInsert(config, rawScienceFrame)) { 102 rawScienceFrame *frame = newToRawDetrendFrame(newFrame); 103 if (!frame) { 104 } 105 if (!rawScienceFrameInsert(config, frame)) { 89 106 // error 90 107 } 91 } else {92 // it's a detrend frame93 rawDetrendFrame *rawDetrendFrame = newToRawDetrendFrame(newFrame);94 if (!rawDetrendFrameInsert(config, rawDetrendFrame)) {95 // error96 }97 108 } 98 99 /*100 // lookup camera name in p0CameraConfig101 psMetadata *where = psMetadataAlloc();102 //bool status = false;103 psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, NULL,104 newFrame->exposure->camera);105 psArray *configs = p0CameraConfigSelectRowObjects(config->dbh, where, MAX_ROWS);106 psFree(where);107 // if there is no match then we default to sending into into p2108 if (!configs) {109 // convert newFrame->exposure to p2PendingExp110 p2PendingExpRow *p2PendingExp = newToP2PendingExp(111 newFrame->exposure112 );113 p2PendingExpInsertObject(config->dbh, p2PendingExp);114 psFree(p2PendingExp);115 continue;116 }117 118 // only use the first match119 int pX = ((p0CameraConfigRow *)configs->data[0])->phase;120 switch (pX) {121 case 1:122 // convert newFrame->exposure to p1PendingExp123 {124 p1PendingExpRow *p1PendingExp = newToP1PendingExp(125 newFrame->exposure126 );127 p1PendingExpInsertObject(config->dbh, p1PendingExp);128 psFree(p1PendingExp);129 }130 break;131 case 2:132 // convert newFrame->exposure to p2PendingExp133 {134 p2PendingExpRow *p2PendingExp = newToP2PendingExp(135 newFrame->exposure136 );137 p2PendingExpInsertObject(config->dbh, p2PendingExp);138 psFree(p2PendingExp);139 }140 break;141 default:142 // XXX add argv[0] to pxConfig143 psAbort("foo", "invalid phase (this should not happen)");144 }145 146 psFree(configs);147 */148 109 } 149 psFree(new);150 }110 } 111 psFree(new); 151 112 152 113 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
