Changeset 6214
- Timestamp:
- Jan 26, 2006, 1:48:43 PM (20 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 5 edited
-
chiptoolConfig.c (modified) (1 diff)
-
p2searchDoneFrames.c (modified) (3 diffs)
-
p2searchPendingFrames.c (modified) (4 diffs)
-
p2searchRawFrames.c (modified) (2 diffs)
-
pxtools.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptoolConfig.c
r6210 r6214 116 116 EMPTY_TO_NULL_STRING(config->url); 117 117 118 psMetadata *where = psMetadataAlloc(); 119 120 if (config->camera_name != NULL) { 121 if (!psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==", 122 config->camera_name)) { 123 psError(PS_ERR_UNKNOWN, false, "failed to add item camera"); 124 psFree(where); 125 return NULL; 126 } 127 } 128 if (config->filter != NULL) { 129 psMetadataAddStr(where, PS_LIST_TAIL, "filter", 0, "==", 130 config->filter); 131 } 132 if (config->exp_id != NULL) { 133 psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", 134 config->exp_id); 135 } 136 if (config->class != NULL) { 137 psMetadataAddStr(where, PS_LIST_TAIL, "class", 0, "==", 138 config->class); 139 } 140 if (config->class_id != NULL) { 141 psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==", 142 config->class_id); 143 } 144 145 /* 146 // psMetadataConfig does not support times yet 147 if (!psTimeIsZero(config->start) && !psTimeIsZero(config->stop)) { 148 psMetadataAddTime (where, PS_LIST_TAIL, "TIME_START", 0, "<", config->stop); 149 psMetadataAddTime (where, PS_LIST_TAIL, "TIME_STOP", 0, ">", config->start); 150 } 151 */ 152 153 if (where->list->n < 1) { 154 psFree(where); 155 where = NULL; 156 } 157 158 config->where = where; 159 160 118 161 // add the input and output images to the arguments list 119 162 //psMetadataAddStr (config->arguments, PS_LIST_TAIL, "-output", 0, "Name of the output image", argv[1]); -
trunk/ippTools/src/p2searchDoneFrames.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 (where->list->n < 1) { 19 psFree(where); 20 where = NULL; 21 } 22 23 psArray *exposures = p2DoneExpSelectRowObjects(config->database, where, 24 MAX_ROWS); 25 psFree (where); 7 psArray *exposures = p2DoneExpSelectRowObjects(config->database, 8 config->where, MAX_ROWS); 26 9 if (!exposures) { 27 10 psError(PS_ERR_UNKNOWN, false, "no p2DoneExp rows found"); … … 34 17 frames->n = 0; 35 18 36 // 'where' to select each exposure37 where = psMetadataAlloc ();38 19 for (int i = 0; i < exposures->n; i++) { 39 20 p2DoneExpRow *exposure = exposures->data[i]; 40 21 22 // 'where' to select each exposure 23 psMetadata *where = psMetadataAlloc (); 41 24 psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", PS_META_REPLACE, "==", 42 25 exposure->exp_id); … … 44 27 psArray *images = p2DoneImfileSelectRowObjects(config->database, where, 45 28 MAX_ROWS); 29 psFree(where); 46 30 if (!images) { 47 31 psError(PS_ERR_UNKNOWN, false, "database access failed"); -
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"); -
trunk/ippTools/src/p2searchRawFrames.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 // psMetadataConfig does not support times yet 18 /* 19 if (!psTimeIsZero(config->start) && !psTimeIsZero(config->stop)) { 20 psMetadataAddTime (where, PS_LIST_TAIL, "TIME_START", 0, "<", config->stop); 21 psMetadataAddTime (where, PS_LIST_TAIL, "TIME_STOP", 0, ">", config->start); 22 } 23 */ 24 25 // if no search criteria were added then set where to NULL to search for 26 // everything 27 // XXX fix handling of where 28 if (where->list->n < 1) { 29 psFree(where); 30 where = NULL; 31 } 32 33 psArray *exposures = rawScienceExpSelectRowObjects(config->database, where, 34 MAX_ROWS); 35 psFree(where); 7 psArray *exposures = rawScienceExpSelectRowObjects(config->database, 8 config->where, MAX_ROWS); 36 9 if (!exposures) { 37 10 psError(PS_ERR_UNKNOWN, false, "no rawScienceExp rows found"); … … 45 18 46 19 // 'where' to select each exposure 47 where = psMetadataAlloc ();20 psMetadata *where = psMetadataAlloc (); 48 21 for (int i = 0; i < exposures->n; i++) { 49 22 rawScienceExpRow *exposure = exposures->data[i]; -
trunk/ippTools/src/pxtools.h
r6210 r6214 44 44 char *class_id; 45 45 char *url; 46 psMetadata *where; 46 47 } pxConfig; 47 48
Note:
See TracChangeset
for help on using the changeset viewer.
