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

Fix plotters

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