Changeset 16218
- Timestamp:
- Jan 23, 2008, 3:26:20 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConcepts.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConcepts.c
r15770 r16218 739 739 } 740 740 741 // FPA.PON.TIME741 // FPA.PON.TIME 742 742 { 743 743 psMetadataItem *item = psMetadataItemAllocF32("FPA.PON.TIME", "Power On Time", NAN); … … 1035 1035 1036 1036 1037 // XXX EAM : Paul, please handle the biassec independently so the 1038 // psList is copied without a verbose warning. when this is fixed, you can 1039 // convert the trace back to a log (psMetadata.c:429) 1037 // List of concepts not to copy, for each level. 1038 // Must be NULL-terminated 1039 static const char *dontCopyConceptsFPA[] = { "FPA.NAME", 0 }; 1040 static const char *dontCopyConceptsChip[] = { "CHIP.NAME", 0 }; 1041 static const char *dontCopyConceptsCell[] = { "CELL.NAME", "CELL.TRIMSEC", "CELL.BIASSEC", 0 }; 1042 1043 // Copy concepts from a source container to a target container, avoiding certain entries 1044 static void copyConcepts(psMetadata *target, // Target metadata container 1045 psMetadata *source, // Source metadata container 1046 const char *dontCopyConcepts[] // Don't copy these concepts 1047 ) 1048 { 1049 assert(target); 1050 assert(source); 1051 assert(dontCopyConcepts); 1052 1053 psMetadataIterator *iter = psMetadataIteratorAlloc(source, PS_LIST_HEAD, NULL); 1054 psMetadataItem *item; // Item from iteration 1055 while ((item = psMetadataGetAndIncrement(iter))) { 1056 const char *name = item->name; // Name of concept 1057 bool copyOK = false; // OK to copy 1058 for (int i = 0; dontCopyConcepts[i] && copyOK; i++) { 1059 if (strcmp(name, dontCopyConcepts[i]) == 0) { 1060 copyOK = false; 1061 } 1062 } 1063 if (!copyOK) { 1064 continue; 1065 } 1066 psMetadataItem *new = psMetadataItemCopy(item); // New item, a copy of the old 1067 psMetadataAddItem(target, new, PS_LIST_TAIL, PS_META_REPLACE); 1068 psFree(new); // Drop reference 1069 } 1070 psFree(iter); 1071 1072 return; 1073 } 1074 1040 1075 1041 1076 bool pmFPACopyConcepts(pmFPA *target, const pmFPA *source) … … 1045 1080 1046 1081 // Copy FPA concepts 1047 target->concepts = psMetadataCopy(target->concepts, source->concepts);1082 copyConcepts(target->concepts, source->concepts, dontCopyConceptsFPA); 1048 1083 1049 1084 // Copy chip concepts … … 1061 1096 continue; 1062 1097 } 1063 targetChip->concepts = psMetadataCopy(targetChip->concepts, sourceChip->concepts); 1098 1099 copyConcepts(targetChip->concepts, sourceChip->concepts, dontCopyConceptsChip); 1064 1100 1065 1101 // Copy cell concepts … … 1078 1114 } 1079 1115 1080 psMetadataIterator *iter = psMetadataIteratorAlloc(sourceCell->concepts, PS_LIST_HEAD, NULL); 1081 psMetadataItem *item; // Item from iteration 1082 while ((item = psMetadataGetAndIncrement(iter))) { 1083 psMetadataItem *new; // New item, a copy of the old 1084 // Don't copy TRIMSEC or BIASSEC 1085 if (strcmp(item->name, "CELL.TRIMSEC") != 0 && strcmp(item->name, "CELL.BIASSEC")) { 1086 new = psMetadataItemCopy(item); 1087 } else { 1088 new = psMetadataItemAlloc(item->name, item->type, item->comment, NULL); 1089 } 1090 psMetadataAddItem(targetCell->concepts, new, PS_LIST_TAIL, PS_META_REPLACE); 1091 psFree(new); // Drop reference 1092 } 1093 psFree(iter); 1116 copyConcepts(targetCell->concepts, sourceCell->concepts, dontCopyConceptsCell); 1094 1117 } 1095 1118 }
Note:
See TracChangeset
for help on using the changeset viewer.
