Cristina Cocho
2011-11-07 10:20:08 UTC
Hi
We are carrying out some tests in order to check the feasibility to
develop real time applications with Guiqwt. We have already managed to
do a simple application in C++ which executes two python threads
(using Python/C API): the main thread which generates the GUI
application (in our case an ImageDialog window) and a secondary thread
that produces and gives periodically new data to the main thread (data
that should be plotted).
When measuring the overall time needed to refresh the data (the
ImagePlot widget of the ImageDialog window) we realized there is a
huge amount of time consumed when doing the conversion:
image = make.image(data)
Being data a numpy array.
We could not find another way to add images/data to the ImageDialog
window than the shown in the examples:
#create data as a numpy array:
data = np.ndarray((x,y),buffer=buf,dtype=float)
#convert our numpy based data:
image = make.image(data)
#get the ImagePlot “widget” from our ImageDialog window
plot = win.get_plot()
#where win = ImageDialog(edit=False, toolbar=True, wintitle="Cross
sections test",
#
options=dict(show_xsection=True, show_ysection=True))
#add the new image to our plot:
plot.add_item(image)
#finally show the window:
win.show()
We would like to know if there are other ways to refresh the data
(ImagePlot widget) in order to avoid having to use make.image(data).
Moreover, is it possible to manipulate and add data to ImagePlot
widget (or any Guiqwt widget) by following different steps than the
ones shown above? That is, are there other options than creating numpy
arrays, converting them into “image items” and adding the result to
the Guiqwt window?
Thank you in advance,
Cristina
We are carrying out some tests in order to check the feasibility to
develop real time applications with Guiqwt. We have already managed to
do a simple application in C++ which executes two python threads
(using Python/C API): the main thread which generates the GUI
application (in our case an ImageDialog window) and a secondary thread
that produces and gives periodically new data to the main thread (data
that should be plotted).
When measuring the overall time needed to refresh the data (the
ImagePlot widget of the ImageDialog window) we realized there is a
huge amount of time consumed when doing the conversion:
image = make.image(data)
Being data a numpy array.
We could not find another way to add images/data to the ImageDialog
window than the shown in the examples:
#create data as a numpy array:
data = np.ndarray((x,y),buffer=buf,dtype=float)
#convert our numpy based data:
image = make.image(data)
#get the ImagePlot “widget” from our ImageDialog window
plot = win.get_plot()
#where win = ImageDialog(edit=False, toolbar=True, wintitle="Cross
sections test",
#
options=dict(show_xsection=True, show_ysection=True))
#add the new image to our plot:
plot.add_item(image)
#finally show the window:
win.show()
We would like to know if there are other ways to refresh the data
(ImagePlot widget) in order to avoid having to use make.image(data).
Moreover, is it possible to manipulate and add data to ImagePlot
widget (or any Guiqwt widget) by following different steps than the
ones shown above? That is, are there other options than creating numpy
arrays, converting them into “image items” and adding the result to
the Guiqwt window?
Thank you in advance,
Cristina