Changeset 9572 for trunk/psModules/src/concepts/pmConceptsPhotcode.c
- Timestamp:
- Oct 13, 2006, 4:35:39 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConceptsPhotcode.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsPhotcode.c
r8815 r9572 4 4 5 5 #include <stdio.h> 6 #include <string.h> 6 7 #include <pslib.h> 7 8 8 9 #include "pmConceptsPhotcode.h" 9 10 10 char *pmConceptsPhotcodeForView(pmConfig *config, pmFPAfile *file, pmFPAview *view)11 psString pmConceptsPhotcodeForView(pmConfig *config, pmFPAfile *file, pmFPAview *view) 11 12 { 13 PS_ASSERT_PTR_NON_NULL(config, NULL); 14 PS_ASSERT_PTR_NON_NULL(file, NULL); 15 PS_ASSERT_PTR_NON_NULL(view, NULL); 12 16 13 17 if (view->chip < -1) { 14 psError(PS_ERR_IO, true, " photcodes undefined for FPA: defined by chip\n");18 psError(PS_ERR_IO, true, "Photcodes undefined for FPA: defined by chip\n"); 15 19 return NULL; 16 20 } 17 21 18 22 // select recipe options supplied on command line 19 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, "PHASE2"); 20 if (recipe == NULL) { 21 psError(PS_ERR_IO, true, "recipe PHASE2 not found\n"); 23 bool mdok; // Status of MD lookup 24 psMetadata *recipe = psMetadataLookupPtr(&mdok, config->recipes, "PHASE2"); 25 if (!mdok || !recipe) { 26 psError(PS_ERR_IO, true, "Recipe PHASE2 not found\n"); 22 27 return NULL; 23 28 } 24 29 25 30 // select photcode rule from recipe 26 char *rule = psMetadataLookupStr (NULL, recipe, "PHOTCODE.RULE");27 if ( rule == NULL) {31 char *rule = psMetadataLookupStr(&mdok, recipe, "PHOTCODE.RULE"); 32 if (!mdok || !rule || strlen(rule) == 0) { 28 33 psError(PS_ERR_IO, true, "PHOTCODE.RULE not found in PHASE2 recipe\n"); 29 34 return NULL; … … 31 36 32 37 // convert rule to real photcode 33 char *photcode = pmFPAfileNameFromRule(rule, file, view);38 psString photcode = pmFPAfileNameFromRule(rule, file, view); 34 39 35 40 return photcode;
Note:
See TracChangeset
for help on using the changeset viewer.
