Changeset 18561 for trunk/ippTools/src/regtoolConfig.c
- Timestamp:
- Jul 15, 2008, 10:30:59 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/regtoolConfig.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtoolConfig.c
r18336 r18561 50 50 // -pendingimfile 51 51 psMetadata *pendingimfileArgs = psMetadataAlloc(); 52 // support for this options is unimplemented53 #if 054 ADD_OPT(Str, pendingimfileArgs, "-exp_id", "search by exposure ID", NULL);55 ADD_OPT(Str, pendingimfileArgs, "-class", "search by class", NULL);56 ADD_OPT(Str, pendingimfileArgs, "-class_id", "search by class ID", NULL);57 #endif58 52 ADD_OPT(U64, pendingimfileArgs, "-limit", "limit result set to N items", 0); 59 53 ADD_OPT(Bool, pendingimfileArgs, "-simple", "use the simple output format", false); … … 68 62 ADD_OPT(Str, addprocessedimfileArgs, "-class_id", "define class ID (required)", NULL); 69 63 ADD_OPT(Str, addprocessedimfileArgs, "-uri", "define URI (required)", NULL); 64 70 65 ADD_OPT(Str, addprocessedimfileArgs, "-exp_type", "define exposure type", NULL); 71 66 ADD_OPT(Str, addprocessedimfileArgs, "-filelevel", "define filelevel", NULL); 72 67 ADD_OPT(Str, addprocessedimfileArgs, "-filter", "define filter ", NULL); 73 68 ADD_OPT(Str, addprocessedimfileArgs, "-comment", "define comment ", NULL); 69 74 70 ADD_OPT(F32, addprocessedimfileArgs, "-airmass", "define airmass", NAN); 75 71 ADD_OPT(F64, addprocessedimfileArgs, "-ra", "define RA", NAN); … … 94 90 ADD_OPT(F32, addprocessedimfileArgs, "-m2_tip", "define M2 TIP position", NAN); 95 91 ADD_OPT(F32, addprocessedimfileArgs, "-m2_tilt", "define M2 TILT position", NAN); 92 96 93 ADD_OPT(F32, addprocessedimfileArgs, "-env_temperature","define Environmental Temperature", NAN); 97 94 ADD_OPT(F32, addprocessedimfileArgs, "-env_humidity", "define Environmental Humidity", NAN); … … 139 136 // -pendingexp 140 137 psMetadata *pendingexpArgs = psMetadataAlloc(); 141 // support for these options in unimplemented142 #if 0143 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exposure ID", NULL);144 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-inst", 0, "search by camera", NULL);145 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-telescope",0, "search by telescope", NULL);146 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_type", 0, "search by exposure type", NULL);147 #endif148 138 psMetadataAddU64(pendingexpArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 149 139 psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); … … 156 146 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-telescope", 0, "define the telescope name (required)", NULL); 157 147 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_tag", 0, "define the external exposure tag name (required)", NULL); 148 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-filelevel", 0, "define the data partitioning level of this file (required)", NULL); 149 158 150 psMetadataAddTime(addprocessedexpArgs, PS_LIST_TAIL, "-dateobs", 0, "define observation time", NULL); 159 151 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_type", 0, "define exposure type", NULL); 160 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-filelevel", 0, "define the data partitioning level of this file", NULL);161 152 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-workdir", 0, "define the \"default\" workdir for this exposure", NULL); 162 153 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-dvodb", 0, "define the dvodb for the next processing step", NULL); … … 208 199 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-hostname", 0, "define host name", NULL); 209 200 psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-code", 0, "set fault code", 0); 210 /*211 psMetadataAddStr(updateArgs, PS_LIST_TAIL, "-recip", 0, "define URL", NULL);212 psMetadataAddStr(updateArgs, PS_LIST_TAIL, "-mosiac", 0, "define URL", NULL);213 */214 201 215 202 // -processedexp … … 297 284 psFree(modes); 298 285 299 // setup search criterion300 #define addWhereStr(name) \301 { \302 psString str = NULL; \303 bool status = false; \304 if ((str = psMetadataLookupStr(&status, config->args, "-" #name))) { \305 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\306 psError(PXTOOLS_ERR_PROG, false, "failed to add item " #name); \307 psFree(config); \308 return NULL; \309 } \310 } \311 }312 313 // generate SQL where clause314 config->where = psMetadataAlloc();315 316 addWhereStr(exp_id);317 addWhereStr(exp_name);318 // convert '-inst' to 'camera'319 {320 psString str = NULL;321 bool status = false;322 if ((str = psMetadataLookupStr(&status, config->args, "-inst"))) {323 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) {324 psError(PXTOOLS_ERR_PROG, false, "failed to add item camera");325 psFree(config);326 return NULL;327 }328 }329 }330 331 addWhereStr(telescope);332 addWhereStr(exp_type);333 addWhereStr(class);334 addWhereStr(class_id);335 addWhereStr(tmp_class_id);336 addWhereStr(filter);337 338 // convert '-code' to 'fault'339 {340 psS16 fault = 0;341 bool status = false;342 if ((fault = psMetadataLookupS16(&status, config->args, "-code"))) {343 if (!psMetadataAddS16(config->where, PS_LIST_TAIL, "fault", 0, "==", fault)) {344 psError(PS_ERR_UNKNOWN, false, "failed to add item fault");345 psFree(config);346 return NULL;347 }348 }349 }350 351 if (config->where->list->n < 1) {352 psFree(config->where);353 config->where = NULL;354 }355 356 357 286 // define Database handle, if used 358 287 config->dbh = psMemIncrRefCounter(pmConfigDB(config->modules));
Note:
See TracChangeset
for help on using the changeset viewer.
