objdictgen/nodemanager.py
changeset 30 a5dd050b28cb
parent 0 4472ee7c6c3e
child 39 3e94ee906bc6
equal deleted inserted replaced
29:6d35e9caedd4 30:a5dd050b28cb
   176             for subIndex, values in enumerate(mappingdictionary[index]["values"]):
   176             for subIndex, values in enumerate(mappingdictionary[index]["values"]):
   177                 if mappingdictionary[index]["values"][subIndex]["pdo"]:
   177                 if mappingdictionary[index]["values"][subIndex]["pdo"]:
   178                     infos = Manager.GetEntryInfos(mappingdictionary[index]["values"][subIndex]["type"])
   178                     infos = Manager.GetEntryInfos(mappingdictionary[index]["values"][subIndex]["type"])
   179                     if mappingdictionary[index]["struct"] & OD_IdenticalSubindexes:
   179                     if mappingdictionary[index]["struct"] & OD_IdenticalSubindexes:
   180                         values = Manager.GetCurrentEntry(index)
   180                         values = Manager.GetCurrentEntry(index)
   181                         for i in xrange(len(values)):
   181                         for i in xrange(len(values) - 1):
   182                             list.append((index, i + 1, infos["size"], StringFormat(mappingdictionary[index]["values"][subIndex]["name"],1,i)))
   182                             list.append((index, i + 1, infos["size"], StringFormat(mappingdictionary[index]["values"][subIndex]["name"],1,i+1)))
   183                     else:
   183                     else:
   184                         list.append((index, subIndex, infos["size"], mappingdictionary[index]["values"][subIndex]["name"]))
   184                         list.append((index, subIndex, infos["size"], mappingdictionary[index]["values"][subIndex]["name"]))
   185     return list
   185     return list
   186 
   186 
   187 """
   187 """
   778                 elif editor == "bool":
   778                 elif editor == "bool":
   779                     value = value == "True"
   779                     value = value == "True"
   780                     self.CurrentNode.SetEntry(index, subIndex, value)
   780                     self.CurrentNode.SetEntry(index, subIndex, value)
   781                 else:
   781                 else:
   782                     subentry_infos = self.GetSubentryInfos(index, subIndex)
   782                     subentry_infos = self.GetSubentryInfos(index, subIndex)
       
   783                     type = subentry_infos["type"]
   783                     dic = {}
   784                     dic = {}
   784                     for typeindex, typevalue in CustomisableTypes:
   785                     for typeindex, typevalue in CustomisableTypes:
   785                         dic[typeindex] = typevalue
   786                         dic[typeindex] = typevalue
   786                     if dic[subentry_infos["type"]] == 0:
   787                     if type not in dic:
       
   788                         type = self.CurrentNode.GetEntry(type)[1]
       
   789                     if dic[type] == 0:
   787                         try:
   790                         try:
   788                             value = eval(value, {})
   791                             value = eval(value, {})
   789                             self.CurrentNode.SetEntry(index, subIndex, value)
   792                             self.CurrentNode.SetEntry(index, subIndex, value)
   790                         except:
   793                         except:
   791                             pass
   794                             pass