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

Fix MSC streaming

parent 7eb9b6ee
......@@ -360,16 +360,13 @@ class asn1Editor(QTreeView):
else:
raise TypeError('CHOICE determinant not found')
elif asnType == 'INTEGER':
print 'SET INTEGER'
ptr.Set(int(value))
elif asnType == 'REAL':
ptr.Set(float(value))
elif asnType == 'BOOLEAN':
print 'SET BOOLEAN'
boolValue = value == 'True'
ptr.Set(boolValue)
elif asnType == 'ENUMERATED':
print 'SET ENUMERATED', value
intMappings = root.child(i, 3).data(INTMAP)
for enumerant, num in intMappings.viewitems():
if enumerant == value:
......@@ -446,7 +443,6 @@ class asn1Editor(QTreeView):
break
else:
raise TypeError('CHOICE ROW not found')
print 'READING CHOICE', value, rownb
self.parseModel(root, dest=dest, choice=rownb)
intMappings = self.model.item(row, 3).data(INTMAP)
for enumerant, num in intMappings.viewitems():
......@@ -558,7 +554,6 @@ class asn1Editor(QTreeView):
else:
self.log.error("CHOICE index not found in DV.py")
self.model.item(row, 3).setText(enumerant)
print 'SETTING CHOICE = ', enumerant
# Find the row and set the value
for rownb in xrange(root.rowCount()):
if enumerant == root.child(rownb, 0).text():
......@@ -580,7 +575,6 @@ class asn1Editor(QTreeView):
for enumerant, num in intMappings.viewitems():
# XXX if value is not initialized and no enum has value 0
# an error will be raised
print type(num), num, enumerant
if num == value:
self.model.item(row, 3).setText(enumerant)
break
......@@ -605,9 +599,9 @@ class asn1Editor(QTreeView):
self.log.debug("Entering tmToEditor")
self.updateVariable()
# Send value to the MSC recorder
name = self.item['nodeTypename'] # XXX probably wrong, name should be the name of the TM
msg = name + '(' + self.asn1Instance.GSER() + ')'
self.log.debug('Emitting input to MSC')
name = self.item['id']
msg = name + '(' + vn.format_gser(self.asn1Instance.GSER()) + ')'
self.log.debug('MSC: '+ msg)
if emit_msc:
self.msc.emit('in', msg)
self.new_tm.emit()
......@@ -676,20 +670,13 @@ class asn1Editor(QTreeView):
sort: root ASN.1 typename (with dash, no underscores)
ASN1_AST: full AST generated by ASN1SCC
'''
#var = self.getVariable(root).popitem()[1]
# DEPRECATED - call getVariable directly
self.getVariable(root=root, dest=dest)
# vn.valueNotationToCTypes(gser=None,
# var=var,
# dest=dest,
# ASN1Mod=ASN1Mod,
# sort=sort,
# ASN1_AST=ASN1_AST)
def sendTC(self):
''' Encode and send the TC to the main TASTE binary using message queue or UDP '''
self.getVariable(dest=self.asn1Instance)
gser = self.asn1Instance.GSER()
gser = vn.format_gser(self.asn1Instance.GSER())
msg = "{name}({gser})".format(name=self.treeItem.text(), gser=gser)
self.log.debug('out ' + msg)
self.msc.emit('out', msg)
......
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