Changeset 18939 for trunk/psModules/src/config/pmConfigDump.c
- Timestamp:
- Aug 5, 2008, 5:40:45 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfigDump.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfigDump.c
r18908 r18939 13 13 #include "pmFPAview.h" 14 14 #include "pmFPAfile.h" 15 #include "pmConfigCamera.h" 15 16 16 17 #include "pmConfigDump.h" … … 18 19 // Cull entries in the metadata, ignoring the ones listed. 19 20 static bool configCull(psMetadata *md, // Configuration metadata from which to cull 20 const char*list // List of items NOT to cull21 const psArray *list // List of items NOT to cull 21 22 ) 22 23 { 23 24 PS_ASSERT_METADATA_NON_NULL(md, false); 25 PS_ASSERT_ARRAY_NON_NULL(list, false); 24 26 25 if (!list || strlen(list) == 0) {26 // Save everything if nothing is listed27 return true;27 psHash *keep = psHashAlloc(list->n); // Hash with strings to keep 28 for (int i = 0; i < keep->n; i++) { 29 psHashAdd(keep, list->data[i], list->data[i]); 28 30 } 29 30 psArray *keepList = psStringSplitArray(list, " ,;", false); // List of items to keep31 psHash *keep = psHashAlloc(keepList->n); // Hash with strings to keep32 for (int i = 0; i < keep->n; i++) {33 psHashAdd(keep, keepList->data[i], keepList->data[i]);34 }35 psFree(keepList);36 31 37 32 psMetadataIterator *iter = psMetadataIteratorAlloc(md, PS_LIST_HEAD, NULL); // Iterator … … 57 52 } 58 53 59 return configCull(config->recipes, save); 54 psArray *keep = psStringSplitArray(save, " ,;", false); // List of items to keep 55 56 bool result = configCull(config->recipes, keep); // Result of culling 57 psFree(keep); 58 59 return result; 60 60 } 61 61 … … 70 70 } 71 71 72 return configCull(cameras, config->cameraName); 72 // Get names of the root camera and its derivatives 73 psArray *keep = psArrayAlloc(4); 74 keep->data[0] = pmConfigCameraRootName(config->cameraName); 75 keep->data[1] = pmConfigCameraChipName(config->cameraName); 76 keep->data[2] = pmConfigCameraFPAName(config->cameraName); 77 keep->data[3] = pmConfigCameraSkycellName(config->cameraName); 78 79 bool result = configCull(cameras, keep); // Result of culling 80 psFree(keep); 81 82 return result; 73 83 } 74 84
Note:
See TracChangeset
for help on using the changeset viewer.
