Commit 8c9fbdd3 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add state to the observable parameters (incomplete)

parent d47f9cdd
......@@ -2,8 +2,8 @@
# Resource object code
#
# Created: Wed Feb 18 20:57:05 2015
# by: The Resource Compiler for PySide (Qt v4.8.6)
# Created: Wed Feb 25 12:44:26 2015
# by: The Resource Compiler for PySide (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
......
......@@ -40,6 +40,9 @@ except ImportError:
print 'No Python A mapper generated dataview, SDL handler cannot be used'
ASN1 = None
# Unicode separator used by Opengeode in the Ada backend
# to build unambiguous names, in particular when using nested states
UNICODE_SEP = u'\u00dc'
class SendTC(QUndoCommand):
''' Undo command to send a message to the running system '''
......@@ -166,10 +169,16 @@ class sdlHandler(QObject):
# Add the SDL variables to the ASN.1 editor
row = 0
for var, (sort, _) in self.proc.variables.viewitems():
dataview = self.proc.dataview
item = asn1sccToasn1ValueEditorTypes(dataview, var, sort)
item = asn1sccToasn1ValueEditorTypes(self.proc.dataview, var, sort)
self.tree_items[var] = self.asn1_editor.setAsn1Model(item, row)
row += 1
# Add the state list to the ASN.1 Editor
statenames = [s.replace(UNICODE_SEP, '->')
for s in self.proc.mapping.viewkeys()
if 'START' not in s]
states = {'id': 'Current SDL state', 'type': 'ENUMERATED',
'values': statenames}
self.tree_items['States'] = self.asn1_editor.setAsn1Model(states, row)
# In the simulation panel, set the buttons to send paramless TC/timers
self.set_paramless_tc()
self.set_paramless_tm()
......@@ -255,7 +264,6 @@ class sdlHandler(QObject):
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])
typename = sort.ReferencedTypeName.replace('-', '_')
asn1_type = self.proc.dataview[sort.ReferencedTypeName]
asn1_instance = getattr(ASN1, typename)()
......
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