Changeset 6670 for trunk/ippTools/src/pztoolConfig.c
- Timestamp:
- Mar 21, 2006, 5:17:21 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pztoolConfig.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pztoolConfig.c
r6659 r6670 45 45 "indicate that an image file has been downloaded", ""); 46 46 47 // -pending search 48 /* 49 psMetadata *pendingArgs = psMetadataAlloc(); 50 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_id", 0, 47 // -copydone search 48 psMetadata *copydoneArgs = psMetadataAlloc(); 49 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-exp_id", 0, 51 50 "define exposure ID", ""); 52 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-inst", 0, 53 "define camera of interest", ""); 54 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-telescope", 0, 55 "define camera of interest", ""); 56 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_type", 0, 51 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-class", 0, 57 52 "define class", ""); 58 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-class", 0, 59 "define class", ""); 60 */ 53 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-class_id", 0, 54 "define class_id", ""); 55 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-suri", 0, 56 "define storage uri", ""); 61 57 62 58 bool argErr = false; … … 73 69 printf("Usage: %s <mode> [<options>]\n\n", argv[0]); 74 70 printf(" <mode> : -seen | -pending | -copydone\n\n"); 75 /* 76 fprintf (stdout, "-pending "); 77 psArgumentHelp(pendingArgs); 78 fprintf (stdout, "-update "); 79 psArgumentHelp(updateArgs); 80 */ 71 fprintf (stdout, "-copydone "); 72 psArgumentHelp(copydoneArgs); 81 73 psFree(args); 82 /* 83 psFree(pendingArgs); 84 psFree(updateArgs); 85 */ 74 psFree(copydoneArgs); 86 75 exit(EXIT_FAILURE); 87 76 } 77 78 psFree(copydoneArgs); 88 79 89 80 // XXX why is "" being returned when -[foo] isn't specified? … … 93 84 } 94 85 95 /* 96 switch (config->mode) { 97 bool status; 98 case PX_MODE_PENDING: 99 // -exp_id 100 config->exp_id = psMetadataLookupStr(&status, args, "-exp_id"); 101 psMemIncrRefCounter(config->exp_id); 102 EMPTY_TO_NULL_STRING(config->exp_id); 103 // -inst 104 config->camera_name = psMetadataLookupStr(&status, args, "-inst"); 105 psMemIncrRefCounter(config->camera_name); 106 EMPTY_TO_NULL_STRING(config->camera_name); 107 // -telescope 108 config->camera_name = psMetadataLookupStr(&status, args, 109 "-telescope"); 110 psMemIncrRefCounter(config->telescope); 111 EMPTY_TO_NULL_STRING(config->telescope); 112 // -exp_type 113 config->class = psMetadataLookupStr(&status, args, "-exp_type"); 114 psMemIncrRefCounter(config->exp_type); 115 EMPTY_TO_NULL_STRING(config->exp_type); 116 // -class 117 config->class = psMetadataLookupStr(&status, args, "-class"); 118 psMemIncrRefCounter(config->class); 119 EMPTY_TO_NULL_STRING(config->class); 120 break; 121 case PX_MODE_UPDATE: 122 // -exp_id 123 config->exp_id = psMetadataLookupStr(&status, args, "-exp_id"); 124 psMemIncrRefCounter(config->exp_id); 125 EMPTY_TO_NULL_STRING(config->exp_id); 126 // -filter 127 config->filter = psMetadataLookupStr(&status, args, "-filter"); 128 psMemIncrRefCounter(config->filter); 129 EMPTY_TO_NULL_STRING(config->filter); 86 config->args = args; 130 87 131 break; 132 default: 133 psAbort(argv[0], "invalid option (this should not happen)"); 134 } 135 */ 136 137 psFree(args); 138 /* 139 psFree(pendingArgs); 140 psFree(updateArgs); 141 */ 142 143 88 if (config->mode == PX_MODE_COPYDONE) { 144 89 psMetadata *where = psMetadataAlloc(); 145 90 146 /*147 if (config->camera_name != NULL) {148 if (!psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==",149 config->camera_name)) {150 psError(PS_ERR_UNKNOWN, false, "failed to add item camera");91 bool status; 92 psString str; 93 if ((str = psMetadataLookupStr(&status, args, "-exp_id"))) { 94 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", str)) { 95 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 151 96 psFree(where); 152 97 return NULL; 153 98 } 154 99 } 155 if (config->filter != NULL) { 156 psMetadataAddStr(where, PS_LIST_TAIL, "filter", 0, "==", 157 config->filter); 100 if ((str = psMetadataLookupStr(&status, args, "-class"))) { 101 if (!psMetadataAddStr(where, PS_LIST_TAIL, "class", 0, "==", str)) { 102 psError(PS_ERR_UNKNOWN, false, "failed to add item class"); 103 psFree(where); 104 return NULL; 105 } 158 106 } 159 if (config->exp_id != NULL) { 160 psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", 161 config->exp_id); 107 if ((str = psMetadataLookupStr(&status, args, "-class_id"))) { 108 if (!psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==", str)) { 109 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); 110 psFree(where); 111 return NULL; 112 } 162 113 } 163 if (config->class != NULL) {164 psMetadataAddStr(where, PS_LIST_TAIL, "class", 0, "==",165 config->class);166 }167 if (config->class_id != NULL) {168 psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==",169 config->class_id);170 }171 */172 173 /*174 // psMetadataConfig does not support times yet175 if (!psTimeIsZero(config->start) && !psTimeIsZero(config->stop)) {176 psMetadataAddTime (where, PS_LIST_TAIL, "TIME_START", 0, "<", config->stop);177 psMetadataAddTime (where, PS_LIST_TAIL, "TIME_STOP", 0, ">", config->start);178 }179 */180 114 181 115 if (where->list->n < 1) { … … 183 117 where = NULL; 184 118 } 185 186 119 config->where = where; 187 188 189 // add the input and output images to the args list 190 //psMetadataAddStr (args, PS_LIST_TAIL, "-output", 0, "Name of the output image", argv[1]); 120 } 191 121 192 122 // define Database handle, if used
Note:
See TracChangeset
for help on using the changeset viewer.
