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

Fix plotters

parent ac79c3b2
...@@ -463,14 +463,6 @@ class asn1Editor(QTreeView): ...@@ -463,14 +463,6 @@ class asn1Editor(QTreeView):
ptr = getattr(dest, name) if not seqOf else dest ptr = getattr(dest, name) if not seqOf else dest
if seqOf: if seqOf:
ptr = ptr[i] ptr = ptr[i]
if asnType in ('INTEGER', 'REAL', 'SEQOF'):
# XXX plotter: TODO
plotters = child.data(PLOTTERS)
if plotters is not None:
self.log.debug("updateModel - updatePlot call")
for plotter in plotters:
self.plotterBackend.updatePlot(plotter, value)
self.log.debug("updateModel - updatePlot end")
if asnType in ('INTEGER', 'REAL'): if asnType in ('INTEGER', 'REAL'):
child.setText(str(ptr.Get())) child.setText(str(ptr.Get()))
elif asnType == 'BOOLEAN': elif asnType == 'BOOLEAN':
...@@ -514,6 +506,14 @@ class asn1Editor(QTreeView): ...@@ -514,6 +506,14 @@ class asn1Editor(QTreeView):
ptr.Reset(state) ptr.Reset(state)
child.setText(str(size)) child.setText(str(size))
self.updateModel(root.child(i), ptr, nbRows=size) self.updateModel(root.child(i), ptr, nbRows=size)
if asnType in ('INTEGER', 'REAL', 'SEQOF'):
plotters = child.data(PLOTTERS)
if plotters is not None:
self.log.debug("updateModel - updatePlot call")
value = float(child.text())
for plotter in plotters:
self.plotterBackend.updatePlot(plotter, value)
self.log.debug("updateModel - updatePlot end")
if choice != -1: if choice != -1:
stateBefore = ptr.GetState() stateBefore = ptr.GetState()
...@@ -583,11 +583,10 @@ class asn1Editor(QTreeView): ...@@ -583,11 +583,10 @@ class asn1Editor(QTreeView):
else: # SEQUENCE or SET else: # SEQUENCE or SET
self.updateModel(root, asn1Instance) self.updateModel(root, asn1Instance)
if asnType in ('INTEGER', 'REAL', 'SEQOF'): if asnType in ('INTEGER', 'REAL', 'SEQOF'):
plotters = self.model.item(row, 3).data(PLOTTERS) plotters = self.model.item(row, 3).data(PLOTTERS) or []
if plotters != None: value = self.model.item(row, 3).text()
for plotter in plotters: for plotter in plotters:
# XXX this won't work, value is not in the right format self.plotterBackend.updatePlot(plotter, float(value))
self.plotterBackend.updatePlot(plotter, value)
self.hideUnusedFields(root, True, row=row) self.hideUnusedFields(root, True, row=row)
if self.plotterBackend is not None: if self.plotterBackend is not None:
self.plotterBackend.refresh() self.plotterBackend.refresh()
......
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