Commit 0d5f5c89 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix handling of internal states

parent 433da64a
......@@ -564,14 +564,12 @@ class sdlHandler(QObject):
asn1_type = self.proc.dataview[sort.ReferencedTypeName]
asn1_instance = getattr(ASN1, typename)()
# Fill up the ASN.1 instance
self.asn1_editor.to_asn1scc_ctypes(root=self.tree_items[var],
dest=asn1_instance, ASN1Mod=ASN1,
sort=sort,
ASN1_AST=self.proc.dataview)
self.asn1_editor.getVariable(root=self.tree_items[var],
dest=asn1_instance)
new_state.append(asn1_instance)
# Add the SDL state to the new global state, create a new hash, save it
sdl_state = self.asn1_editor.getVariable(self.tree_items['_states'])
new_sdl_state = sdl_state['Current SDL state']['Enum']
state_row = self.tree_items['_states'].row()
new_sdl_state = self.asn1_editor.model.item(state_row, 3).text()
new_state.append(UnicodeName(new_sdl_state))
new_hash = hash(frozenset(new_state))
self.set_of_states[new_hash] = new_state
......@@ -600,23 +598,15 @@ class sdlHandler(QObject):
value = get_value()
asn1_instance = getattr(ASN1, typename)()
asn1_instance.SetData(value)
#typeC = self.asn1_editor.item['nodeTypename'].replace('-', '_')
#asn1_instance = getattr(ASN1, typeC)()
#self.asn1_editor.asn1Instance.SetData(value)
#gser = asn1_instance.GSER()
#as_pyside = vn.fromValueNotationToPySide(var, gser)
self.asn1_editor.updateVariable(root=self.tree_items[var],
asn1Var=asn1_instance)
complete_state.append(asn1_instance)
# Add the SDL state to the new global state
complete_state.append(self.current_sdl_state)
# Update the SDL state in the global state panel
readable_state = self.current_sdl_state.replace(UNICODE_SEP, '--')
# XXX UPDATE THE STATE IN THE GUI TODO
# state_as_pyside = vn.fromValueNotationToPySide('Current SDL state',
# readable_state.lower().replace('_', '-'))
# self.asn1_editor.updateVariable(state_as_pyside,
# root=self.tree_items['_states'])
readable_state = CleanName(self.current_sdl_state)
state_row = self.tree_items['_states'].row()
self.asn1_editor.model.item(state_row, 3).setText(readable_state)
# And save this new state in the graph, if it was not there yet
new_hash = hash(frozenset(complete_state))
# Set a flag indicating a new state was added
......
Markdown is supported
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