Commit e9d3a6e0 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Update state function

parent 359f1ad8
......@@ -251,6 +251,8 @@ class sdlHandler(QObject):
state (variables of the SDL model): Create an undo action that
applies the change.
'''
# Create a new global state
new_state = []
# Get the variables values from the asn1_value_editor window
for var, (sort, _) in self.proc.variables.viewitems():
#as_pyside = self.asn1_editor.getVariable(root=self.tree_items[var])
......@@ -262,6 +264,16 @@ class sdlHandler(QObject):
dest=asn1_instance, ASN1Swig=ASN1,
sort=sort,
ASN1_AST=self.proc.dataview)
new_state.append(asn1_instance)
# Add the SDL state to the new global state, create a new hash, save it
new_state.append(self.current_sdl_state)
new_hash = hash(frozenset(new_state))
self.set_of_states[new_hash] = new_state
# Apply the change and create Undo command to restore previous state
old_state = self.current_hash
self.restore_global_state(new_hash)
undo_cmd = SendTC(self, old_state)
self.undo_stack.push(undo_cmd)
def on_event(self, tc_name=None, param=None):
''' Update the list of global states and GUI after a TC has been sent
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment