equal
deleted
inserted
replaced
1087 self.Flush() |
1087 self.Flush() |
1088 self.ResetView() |
1088 self.ResetView() |
1089 self.ResetBuffer() |
1089 self.ResetBuffer() |
1090 instance = {} |
1090 instance = {} |
1091 # List of ids of already loaded blocks |
1091 # List of ids of already loaded blocks |
1092 ids = [] |
1092 ids = self.Controler.GetEditedElementInstancesIds(self.TagName, debug = self.Debug) |
1093 # Load Blocks until they are all loaded |
1093 # Load Blocks until they are all loaded |
1094 while instance is not None: |
1094 while len(ids) > 0: |
1095 instance = self.Controler.GetEditedElementInstanceInfos(self.TagName, exclude = ids, debug = self.Debug) |
1095 instance = self.Controler.GetEditedElementInstanceInfos( |
|
1096 self.TagName, ids.popitem(0)[0], debug = self.Debug) |
1096 if instance is not None: |
1097 if instance is not None: |
1097 self.loadInstance(instance, ids, selection) |
1098 self.loadInstance(instance, ids, selection) |
1098 |
1099 |
1099 if (selection is not None and |
1100 if (selection is not None and |
1100 isinstance(self.SelectedElement, Graphic_Group)): |
1101 isinstance(self.SelectedElement, Graphic_Group)): |
1219 group.AddElement(element) |
1220 group.AddElement(element) |
1220 self.SelectedElement = group |
1221 self.SelectedElement = group |
1221 |
1222 |
1222 # Load instance from given informations |
1223 # Load instance from given informations |
1223 def loadInstance(self, instance, ids, selection): |
1224 def loadInstance(self, instance, ids, selection): |
1224 ids.append(instance["id"]) |
|
1225 self.current_id = max(self.current_id, instance["id"]) |
1225 self.current_id = max(self.current_id, instance["id"]) |
1226 creation_function = ElementCreationFunctions.get(instance["type"], None) |
1226 creation_function = ElementCreationFunctions.get(instance["type"], None) |
1227 connectors = {"inputs" : [], "outputs" : []} |
1227 connectors = {"inputs" : [], "outputs" : []} |
1228 specific_values = instance["specific_values"] |
1228 specific_values = instance["specific_values"] |
1229 if creation_function is not None: |
1229 if creation_function is not None: |
1317 refLocalId = link["refLocalId"] |
1317 refLocalId = link["refLocalId"] |
1318 if refLocalId is None: |
1318 if refLocalId is None: |
1319 links_connected = False |
1319 links_connected = False |
1320 continue |
1320 continue |
1321 |
1321 |
1322 if refLocalId not in ids: |
1322 if ids.pop(refLocalId, False): |
1323 new_instance = self.Controler.GetEditedElementInstanceInfos(self.TagName, refLocalId, debug = self.Debug) |
1323 new_instance = self.Controler.GetEditedElementInstanceInfos(self.TagName, refLocalId, debug = self.Debug) |
1324 if new_instance is not None: |
1324 if new_instance is not None: |
1325 self.loadInstance(new_instance, ids, selection) |
1325 self.loadInstance(new_instance, ids, selection) |
1326 |
1326 |
1327 connected = self.FindElementById(refLocalId) |
1327 connected = self.FindElementById(refLocalId) |