Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a73fc855 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[gui-lib] Fix bug during the deletion of a transition

parent 40e42366
No related branches found
No related tags found
No related merge requests found
......@@ -1920,12 +1920,20 @@ class CTransition(object):
"""
remove the transition from its macro node
"""
lgtr = self.macro_node.transitions
for gtr in self.macro_node.transitions:
if self in gtr:
gtr.remove(self)
if len(gtr) == 0:
lgtr.remove(gtr)
# list<list<CTransitions>> Sublists: transitions with common extremities
# defaultdict(<type 'list'>, {frozenset(['A', 'D']): [D -> A, C:, E:],
temp_transitions = self.macro_node.new_transitions
for nodes, transitions in self.macro_node.new_transitions.items():
if self in transitions:
if len(transitions) == 1:
temp_transitions.pop(nodes)
continue
# Multiple transitions: remove only the current one
# Is it really happen?
print("Remove only the current transition")
transitions.remove(self)
self.macro_node.new_transitions = temp_transitions
self.ori.outgoing_trans.remove(self)
self.ext.incoming_trans.remove(self)
self.ori.model.transition_list.remove(self)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment