objdictgen/nodemanager.py
changeset 584 e23359f62023
parent 582 e297491483ea
child 762 4b60a0d313b0
equal deleted inserted replaced
583:a2c74eca6bf2 584:e23359f62023
   742                     for abbrev,access in AccessType.iteritems():
   742                     for abbrev,access in AccessType.iteritems():
   743                         dic[access] = abbrev
   743                         dic[access] = abbrev
   744                     value = dic[value]
   744                     value = dic[value]
   745                     if editor == "raccess" and not node.IsMappingEntry(index):
   745                     if editor == "raccess" and not node.IsMappingEntry(index):
   746                         entry_infos = self.GetEntryInfos(index)
   746                         entry_infos = self.GetEntryInfos(index)
       
   747                         subIndex0_infos = self.GetSubentryInfos(index, 0, False).copy()
       
   748                         subIndex1_infos = self.GetSubentryInfos(index, 1, False).copy()
   747                         node.AddMappingEntry(index, name = entry_infos["name"], struct = 7)
   749                         node.AddMappingEntry(index, name = entry_infos["name"], struct = 7)
   748                         node.AddMappingEntry(index, 0, values = self.GetSubentryInfos(index, 0, False).copy())
   750                         node.AddMappingEntry(index, 0, values = subIndex0_infos)
   749                         node.AddMappingEntry(index, 1, values = self.GetSubentryInfos(index, 1, False).copy())
   751                         node.AddMappingEntry(index, 1, values = subIndex1_infos)
   750                 node.SetMappingEntry(index, subIndex, values = {name : value})
   752                 node.SetMappingEntry(index, subIndex, values = {name : value})
   751             if not disable_buffer:
   753             if not disable_buffer:
   752                 self.BufferCurrentNode()
   754                 self.BufferCurrentNode()
   753             return None
   755             return None
   754 
   756 
  1129             customisabletypes = self.GetCustomisableTypes()
  1131             customisabletypes = self.GetCustomisableTypes()
  1130             return values, customisabletypes[values[1]][1]
  1132             return values, customisabletypes[values[1]][1]
  1131         else:
  1133         else:
  1132             return None, None
  1134             return None, None
  1133 
  1135 
  1134     def GetEntryName(self, index):
  1136     def GetEntryName(self, index, compute=True):
  1135         if self.CurrentNode:
  1137         if self.CurrentNode:
  1136             return self.CurrentNode.GetEntryName(index)
  1138             return self.CurrentNode.GetEntryName(index, compute)
  1137         else:
  1139         else:
  1138             return FindEntryName(index, MappingDictionary)
  1140             return FindEntryName(index, MappingDictionary, compute)
  1139     
  1141     
  1140     def GetEntryInfos(self, index):
  1142     def GetEntryInfos(self, index, compute=True):
  1141         if self.CurrentNode:
  1143         if self.CurrentNode:
  1142             return self.CurrentNode.GetEntryInfos(index)
  1144             return self.CurrentNode.GetEntryInfos(index, compute)
  1143         else:
  1145         else:
  1144             return FindEntryInfos(index, MappingDictionary)
  1146             return FindEntryInfos(index, MappingDictionary, compute)
  1145     
  1147     
  1146     def GetSubentryInfos(self, index, subindex):
  1148     def GetSubentryInfos(self, index, subindex, compute=True):
  1147         if self.CurrentNode:
  1149         if self.CurrentNode:
  1148             return self.CurrentNode.GetSubentryInfos(index, subindex)
  1150             return self.CurrentNode.GetSubentryInfos(index, subindex, compute)
  1149         else:
  1151         else:
  1150             result = FindSubentryInfos(index, subindex, MappingDictionary)
  1152             result = FindSubentryInfos(index, subindex, MappingDictionary, compute)
  1151             if result:
  1153             if result:
  1152                 result["user_defined"] = False
  1154                 result["user_defined"] = False
  1153             return result
  1155             return result
  1154     
  1156     
  1155     def GetTypeIndex(self, typename):
  1157     def GetTypeIndex(self, typename):
  1168         if self.CurrentNode:
  1170         if self.CurrentNode:
  1169             return self.CurrentNode.GetTypeDefaultValue(typeindex)
  1171             return self.CurrentNode.GetTypeDefaultValue(typeindex)
  1170         else:
  1172         else:
  1171             return FindTypeDefaultValue(typeindex, MappingDictionary)
  1173             return FindTypeDefaultValue(typeindex, MappingDictionary)
  1172     
  1174     
  1173     def GetMapVariableList(self):
  1175     def GetMapVariableList(self, compute=True):
  1174         if self.CurrentNode:
  1176         if self.CurrentNode:
  1175             return self.CurrentNode.GetMapVariableList()
  1177             return self.CurrentNode.GetMapVariableList(compute)
  1176         else:
  1178         else:
  1177             return []
  1179             return []
  1178 
  1180 
  1179     def GetMandatoryIndexes(self):
  1181     def GetMandatoryIndexes(self):
  1180         if self.CurrentNode:
  1182         if self.CurrentNode: