Changeset 16101
- Timestamp:
- Jan 16, 2008, 3:53:10 PM (18 years ago)
- Location:
- branches/end_stage/ippTools/src
- Files:
-
- 3 edited
-
pzgetexp.c (modified) (3 diffs)
-
pzgetimfiles.c (modified) (3 diffs)
-
pztool.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/end_stage/ippTools/src/pzgetexp.c
r15091 r16101 69 69 PS_ASSERT_PTR_NON_NULL(config, NULL); 70 70 71 bool status = false; 72 psString camera = psMetadataLookupStr(&status, config->args, "-inst"); 73 if (!status) { 74 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst"); 75 return false; 76 } 77 if (!camera) { 78 psError(PS_ERR_UNKNOWN, true, "-inst is required"); 79 return false; 80 } 81 82 psString telescope = psMetadataLookupStr(&status, config->args, "-telescope"); 83 if (!status) { 84 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope"); 85 return false; 86 } 87 if (!telescope) { 88 psError(PS_ERR_UNKNOWN, true, "-telescope is required"); 89 return false; 90 } 71 // required 72 PXOPT_LOOKUP_STR(camera, config->args, "-inst", true, false); 73 PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", true, false); 74 PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false); 91 75 92 76 // find last fileset/exp_name (if we have one) … … 119 103 // invoke dsproductls 120 104 // dsproductls --uri <> --last_fileset <> 121 psString uri = psMetadataLookupStr(&status, config->args, "-uri");122 105 psString cmd = NULL; 123 106 if (haveLastFileSet) { … … 275 258 // these are constants for all records parsed -- look them up before we do 276 259 // any work 277 bool status = false; 278 char *camera = psMetadataLookupStr(&status, config->args, "-inst"); 279 if (!status) { 280 psError(PS_ERR_UNKNOWN, false, "failed to lookup item '-inst'"); 281 return NULL; 282 } 283 char *telescope = psMetadataLookupStr(&status, config->args, "-telescope"); 284 if (!status) { 285 psError(PS_ERR_UNKNOWN, false, "failed to lookup item '-telescope'"); 286 return NULL; 287 } 260 // required 261 PXOPT_LOOKUP_STR(camera, config->args, "-inst", true, false); 262 PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", true, false); 288 263 289 264 // split the string into lines -
branches/end_stage/ippTools/src/pzgetimfiles.c
r15287 r16101 2 2 * pzgetimfiles.c 3 3 * 4 * Copyright (C) 2006 Joshua Hoblitt4 * Copyright (C) 2006-2008 Joshua Hoblitt 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify it … … 70 70 PS_ASSERT_PTR_NON_NULL(config, NULL); 71 71 72 bool status = false; 73 psString uri = psMetadataLookupStr(&status, config->args, "-uri"); 74 if (!status) { 75 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri"); 76 return false; 77 } 78 if (!uri) { 79 psError(PS_ERR_UNKNOWN, true, "-uri is required"); 80 return false; 81 } 82 83 psString filesetid = psMetadataLookupStr(&status, config->args, "-filesetid"); 84 if (!status) { 85 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -filesetid"); 86 return false; 87 } 88 if (!filesetid) { 89 psError(PS_ERR_UNKNOWN, true, "-filesetid is required"); 90 return false; 91 } 92 93 psString camera = psMetadataLookupStr(&status, config->args, "-inst"); 94 if (!status) { 95 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst"); 96 return NULL; 97 } 98 if (!camera) { 99 psError(PS_ERR_UNKNOWN, true, "-inst is required"); 100 return NULL; 101 } 102 103 psString telescope = psMetadataLookupStr(&status, config->args, "-telescope"); 104 if (!status) { 105 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope"); 106 return NULL; 107 } 108 if (!telescope) { 109 psError(PS_ERR_UNKNOWN, true, "-telescope is required"); 110 return NULL; 111 } 72 // required 73 PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false); 74 PXOPT_LOOKUP_STR(filesetid, config->args, "-filesetid", true, false); 75 PXOPT_LOOKUP_STR(camera, config->args, "-inst", true, false); 76 PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", true, false); 112 77 113 78 // invoke dsfilesetls … … 429 394 // these are constants for all records parsed -- look them up before we do 430 395 // any work 431 bool status = false; 432 psString exp_name = psMetadataLookupStr(&status, config->args, "-filesetid"); 433 if (!status) { 434 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for '-filesetid'"); 435 return NULL; 436 } 437 if (!exp_name) { 438 psError(PS_ERR_UNKNOWN, true, "-filesetid is required"); 439 return NULL; 440 } 441 442 psString camera = psMetadataLookupStr(&status, config->args, "-inst"); 443 if (!status) { 444 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst"); 445 return NULL; 446 } 447 if (!camera) { 448 psError(PS_ERR_UNKNOWN, true, "-inst is required"); 449 return NULL; 450 } 451 452 psString telescope = psMetadataLookupStr(&status, config->args, "-telescope"); 453 if (!status) { 454 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope"); 455 return NULL; 456 } 457 if (!telescope) { 458 psError(PS_ERR_UNKNOWN, true, "-telescope is required"); 459 return NULL; 460 } 396 PXOPT_LOOKUP_STR(exp_name, config->args, "-filesetid", true, false); 397 PXOPT_LOOKUP_STR(camera, config->args, "-inst", true, false); 398 PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", true, false); 461 399 462 400 // split the string into lines -
branches/end_stage/ippTools/src/pztool.c
r16083 r16101 92 92 PS_ASSERT_PTR_NON_NULL(config, false); 93 93 94 bool status = false; 95 psString camera = psMetadataLookupStr(&status, config->args, "-inst"); 96 if (!status) { 97 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst"); 98 return false; 99 } 100 if (!camera) { 101 psError(PS_ERR_UNKNOWN, true, "-inst is required"); 102 return false; 103 } 104 105 psString telescope = psMetadataLookupStr(&status, config->args, "-telescope"); 106 if (!status) { 107 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope"); 108 return false; 109 } 110 if (!telescope) { 111 psError(PS_ERR_UNKNOWN, true, "-telescope is required"); 112 return false; 113 } 114 115 psString uri = psMetadataLookupStr(&status, config->args, "-uri"); 116 if (!status) { 117 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri"); 118 return false; 119 } 120 if (!uri) { 121 psError(PS_ERR_UNKNOWN, true, "-uri is required"); 122 return false; 123 } 94 // required 95 PXOPT_LOOKUP_STR(camera, config->args, "-inst", true, false); 96 PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", true, false); 97 PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false); 124 98 125 99 if (!pzDataStoreInsert(config->dbh, … … 139 113 PS_ASSERT_PTR_NON_NULL(config, false); 140 114 115 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 116 141 117 if (!p_psDBRunQuery(config->dbh, "SELECT * FROM pzDataStore")) { 142 118 psError(PS_ERR_UNKNOWN, false, "database error"); … … 153 129 psFree(output); 154 130 return true; 155 }156 157 bool simple = false;158 {159 bool status = false;160 simple = psMetadataLookupBool(&status, config->args, "-simple");161 if (!status) {162 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");163 return false;164 }165 131 } 166 132 … … 180 146 { 181 147 PS_ASSERT_PTR_NON_NULL(config, false); 148 149 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 182 150 183 151 psString query = psStringCopy("SELECT * FROM summitExp"); … … 207 175 } 208 176 209 bool simple = false;210 {211 bool status = false;212 simple = psMetadataLookupBool(&status, config->args, "-simple");213 if (!status) {214 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");215 return false;216 }217 }218 219 177 // negative simple so the default is true 220 178 if (!ippdbPrintMetadatas(stdout, output, "summitExp", !simple)) { … … 233 191 PS_ASSERT_PTR_NON_NULL(config, false); 234 192 235 bool status = false; 236 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 237 if (!status) { 238 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -limit"); 239 return false; 240 } 193 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 194 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 241 195 242 196 psString query = psStringCopy( … … 279 233 } 280 234 281 bool simple = false;282 {283 bool status = false;284 simple = psMetadataLookupBool(&status, config->args, "-simple");285 if (!status) {286 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");287 psFree(output);288 return false;289 }290 }291 292 235 // negative simple so the default is true 293 236 if (!ippdbPrintMetadatas(stdout, output, "pzPendingExp", !simple)) { … … 306 249 PS_ASSERT_PTR_NON_NULL(config, false); 307 250 308 bool status = false; 309 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 310 if (!status) { 311 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -limit"); 312 return false; 313 } 251 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 252 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 314 253 315 254 psArray *cameras = pzGetPendingCameras(config); … … 330 269 } 331 270 271 bool status; 332 272 psString camera = psMetadataLookupStr(&status, cameras->data[i], "camera"); 333 273 psStringAppend(&query, " WHERE camera = \"%s\"", camera); … … 380 320 psFree(cameraImfiles); 381 321 382 bool simple = false;383 {384 bool status = false;385 simple = psMetadataLookupBool(&status, config->args, "-simple");386 if (!status) {387 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");388 psFree(output);389 return false;390 }391 }392 393 322 // negative simple so the default is true 394 323 if (!ippdbPrintMetadatas(stdout, output, "pzPendingImfile", !simple)) { … … 407 336 PS_ASSERT_PTR_NON_NULL(config, false); 408 337 409 bool status = false; 410 psString exp_name = psMetadataLookupStr(&status, config->args, "-exp_name"); 411 if (!status) { 412 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_name"); 413 return false; 414 } 415 if (!exp_name) { 416 psError(PS_ERR_UNKNOWN, true, "-exp_name is required"); 417 return false; 418 } 419 420 psString camera = psMetadataLookupStr(&status, config->args, "-inst"); 421 if (!status) { 422 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst"); 423 return NULL; 424 } 425 if (!camera) { 426 psError(PS_ERR_UNKNOWN, true, "-inst is required"); 427 return NULL; 428 } 429 430 psString telescope = psMetadataLookupStr(&status, config->args, "-telescope"); 431 if (!status) { 432 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope"); 433 return NULL; 434 } 435 if (!telescope) { 436 psError(PS_ERR_UNKNOWN, true, "-telescope is required"); 437 return NULL; 438 } 439 440 psString class = psMetadataLookupStr(&status, config->args, "-class"); 441 if (!status) { 442 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class"); 443 return NULL; 444 } 445 if (!class) { 446 psError(PS_ERR_UNKNOWN, true, "-class is required"); 447 return NULL; 448 } 449 450 psString class_id = psMetadataLookupStr(&status, config->args, "-class_id"); 451 if (!status) { 452 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class_id"); 453 return NULL; 454 } 455 if (!class_id) { 456 psError(PS_ERR_UNKNOWN, true, "-class_id is required"); 457 return NULL; 458 } 459 460 psString uri = psMetadataLookupStr(&status, config->args, "-uri"); 461 if (!status) { 462 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri"); 463 return false; 464 } 465 if (!uri) { 466 psError(PS_ERR_UNKNOWN, true, "-uri is required"); 467 return false; 468 } 338 // required 339 PXOPT_LOOKUP_STR(exp_name, config->args, "-exp_name", true, false); 340 PXOPT_LOOKUP_STR(camera, config->args, "-inst", true, false); 341 PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", true, false); 342 PXOPT_LOOKUP_STR(class, config->args, "-class", true, false); 343 PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false); 344 PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false); 469 345 470 346 // need to know exp_name, camera, telescope, class, class_id (to find the … … 476 352 return false; 477 353 } 478 479 354 480 355 // cp the imfile into pzDoneImfile
Note:
See TracChangeset
for help on using the changeset viewer.
