681 value = "0" + value |
681 value = "0" + value |
682 value = value.decode('hex_codec') |
682 value = value.decode('hex_codec') |
683 node.SetEntry(index, subIndex, value) |
683 node.SetEntry(index, subIndex, value) |
684 except: |
684 except: |
685 pass |
685 pass |
|
686 elif editor == "dcf": |
|
687 node.SetEntry(index, subIndex, value) |
686 else: |
688 else: |
687 subentry_infos = self.GetSubentryInfos(index, subIndex) |
689 subentry_infos = self.GetSubentryInfos(index, subIndex) |
688 type = subentry_infos["type"] |
690 type = subentry_infos["type"] |
689 dic = {} |
691 dic = {} |
690 for typeindex, typevalue in CustomisableTypes: |
692 for typeindex, typevalue in CustomisableTypes: |
1046 if dic["type"].startswith("VISIBLE_STRING"): |
1048 if dic["type"].startswith("VISIBLE_STRING"): |
1047 editor["value"] = "string" |
1049 editor["value"] = "string" |
1048 elif dic["type"] in ["TIME_OF_DAY","TIME_DIFFERENCE"]: |
1050 elif dic["type"] in ["TIME_OF_DAY","TIME_DIFFERENCE"]: |
1049 editor["value"] = "time" |
1051 editor["value"] = "time" |
1050 elif dic["type"] == "DOMAIN": |
1052 elif dic["type"] == "DOMAIN": |
1051 editor["value"] = "domain" |
1053 if index == 0x1F22: |
|
1054 editor["value"] = "dcf" |
|
1055 else: |
|
1056 editor["value"] = "domain" |
1052 dic["value"] = dic["value"].encode('hex_codec') |
1057 dic["value"] = dic["value"].encode('hex_codec') |
1053 elif dic["type"] == "BOOLEAN": |
1058 elif dic["type"] == "BOOLEAN": |
1054 editor["value"] = "bool" |
1059 editor["value"] = "bool" |
1055 dic["value"] = BoolType[dic["value"]] |
1060 dic["value"] = BoolType[dic["value"]] |
1056 result = type_model.match(dic["type"]) |
1061 result = type_model.match(dic["type"]) |
1078 editors.append(editor) |
1083 editors.append(editor) |
1079 return data, editors |
1084 return data, editors |
1080 else: |
1085 else: |
1081 return None |
1086 return None |
1082 |
1087 |
|
1088 def AddToDCF(self, node_id, index, subindex, size, value): |
|
1089 if self.CurrentNode.IsEntry(0x1F22, node_id): |
|
1090 dcf_value = self.CurrentNode.GetEntry(0x1F22, node_id) |
|
1091 nbparams = BE_to_LE(dcf_value[:4]) |
|
1092 new_value = LE_to_BE(nbparams + 1, 4) + dcf_value[4:] |
|
1093 new_value += LE_to_BE(index, 2) + LE_to_BE(subindex, 1) + LE_to_BE(size, 4) + LE_to_BE(value, size) |
|
1094 self.CurrentNode.SetEntry(0x1F22, node_id, new_value) |
|
1095 |
1083 #------------------------------------------------------------------------------- |
1096 #------------------------------------------------------------------------------- |
1084 # Node Informations Functions |
1097 # Node Informations Functions |
1085 #------------------------------------------------------------------------------- |
1098 #------------------------------------------------------------------------------- |
1086 |
1099 |
1087 def GetCustomisedTypeValues(self, index): |
1100 def GetCustomisedTypeValues(self, index): |