Changeset 6214 for trunk/ippTools/src/p2searchPendingFrames.c
- Timestamp:
- Jan 26, 2006, 1:48:43 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/p2searchPendingFrames.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/p2searchPendingFrames.c
r6210 r6214 5 5 PS_ASSERT_PTR_NON_NULL(config, NULL); 6 6 7 psMetadata *where = psMetadataAlloc(); 8 9 if (config->camera_name != NULL) { 10 psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==", 11 config->camera_name); 12 } 13 if (config->filter != NULL) { 14 psMetadataAddStr(where, PS_LIST_TAIL, "filter", 0, "==", 15 config->filter); 16 } 17 /* 18 if (config->exp_id != NULL) { 19 psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", 20 config->exp_id); 21 } 22 if (config->class != NULL) { 23 psMetadataAddStr(where, PS_LIST_TAIL, "class", 0, "==", 24 config->class); 25 } 26 if (config->class_id != NULL) { 27 psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==", 28 config->class_id); 29 } 30 */ 31 /* 32 if (!psTimeIsZero(config->start) && !psTimeIsZero(config->stop)) { 33 psMetadataAddTime(where, PS_LIST_TAIL, "TIME_START", 0, "<", config->stop); 34 psMetadataAddTime(where, PS_LIST_TAIL, "TIME_STOP", 0, ">", config->start); 35 } 36 */ 37 38 // if no search criteria were added then set where to NULL to search for 39 // everything 40 // XXX fix handling of where 41 if (where->list->n < 1) { 42 psFree(where); 43 where = NULL; 44 } 45 46 psArray *exposures = p2PendingExpSelectRowObjects(config->database, where, MAX_ROWS); 47 psFree(where); 7 psArray *exposures = p2PendingExpSelectRowObjects(config->database, 8 config->where, MAX_ROWS); 48 9 if (!exposures) { 49 10 psError(PS_ERR_UNKNOWN, false, "no p2PendingExp rows found"); … … 57 18 58 19 // 'where' to select each exposure 59 where = psMetadataAlloc();20 psMetadata *where = psMetadataAlloc(); 60 21 for (int i = 0; i < exposures->n; i++) { 61 22 p2PendingExpRow *exposure = exposures->data[i]; … … 82 43 PS_ASSERT_PTR_NON_NULL(config, NULL); 83 44 84 psMetadata *where = psMetadataAlloc(); 85 if (config->camera_name != NULL) { 86 if (!psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==", 87 config->camera_name)) { 88 psError(PS_ERR_UNKNOWN, false, "failed to add item camera"); 89 psFree(where); 90 return NULL; 91 } 92 } 93 if (config->filter != NULL) { 94 psMetadataAddStr(where, PS_LIST_TAIL, "filter", 0, "==", 95 config->filter); 96 } 97 if (config->exp_id != NULL) { 98 psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", 99 config->exp_id); 100 } 101 if (config->class != NULL) { 102 psMetadataAddStr(where, PS_LIST_TAIL, "class", 0, "==", 103 config->class); 104 } 105 if (config->class_id != NULL) { 106 psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==", 107 config->class_id); 108 } 109 110 if (where->list->n < 1) { 111 psFree(where); 112 where = NULL; 113 } 114 115 psArray *imfiles = p2PendingImfileSelectRowObjects(config->database, where, 116 MAX_ROWS); 117 psFree(where); 45 psArray *imfiles = p2PendingImfileSelectRowObjects(config->database, 46 config->where, MAX_ROWS); 118 47 if (!imfiles) { 119 48 psError(PS_ERR_UNKNOWN, false, "no rawScienceExp rows found"); … … 129 58 PS_ASSERT_PTR_NON_NULL(config, NULL); 130 59 131 psMetadata *where = psMetadataAlloc(); 132 if (config->camera_name != NULL) { 133 if (!psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==", 134 config->camera_name)) { 135 psError(PS_ERR_UNKNOWN, false, "failed to add item camera"); 136 psFree(where); 137 return NULL; 138 } 139 } 140 if (config->filter != NULL) { 141 psMetadataAddStr(where, PS_LIST_TAIL, "filter", 0, "==", 142 config->filter); 143 } 144 if (config->exp_id != NULL) { 145 psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", 146 config->exp_id); 147 } 148 if (config->class != NULL) { 149 psMetadataAddStr(where, PS_LIST_TAIL, "class", 0, "==", 150 config->class); 151 } 152 if (config->class_id != NULL) { 153 psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==", 154 config->class_id); 155 } 156 157 if (where->list->n < 1) { 158 psFree(where); 159 where = NULL; 160 } 161 162 psArray *exps = p2PendingExpSelectRowObjects(config->database, where, 60 psArray *exps = p2PendingExpSelectRowObjects(config->database, 61 config->where, 163 62 MAX_ROWS); 164 psFree(where);165 63 if (!exps) { 166 64 psError(PS_ERR_UNKNOWN, false, "no p2PendingExp rows found");
Note:
See TracChangeset
for help on using the changeset viewer.
