Open jbcolme opened 8 years ago
Are you sure you have an up-to-date build on the master branch? Signal-scope includes some example scripts, and a few of them use the timeWindow attribute with error, it works. For example, this example command should work:
$ signal-scope examples/example5.py
The Python api can call any Qt function which is marked as a slot. Simply edit plotwidget.h and move the methods such as setBackgroundColor() and setPointSize() to be listed under the "public slots:" tag, then recompile. Then you can call plot.setPointSize(4) from the Python console or script.
If you submit a pull request with that change I'd be happy to accept it, please also add a demonstration to one of the example py files. Thanks!
Done!
The error was on my side.
About loading the configuration from python, this is what I did. Since the curve style and point size are the same for all plots, I made a function on signalScopeSetup.py called "formatOptions". I also added the time window, so if its the same for all plots you have to write it only once. Plus, added the example about how to use it to the util_example that has three plots. I'll make the pull request so you can go through the code and let me know what you think.
From the examples, setting yLimits work but setting the timeWindow gives an error:
I'm just adding this line to the python file:
addPlot(timeWindow=20, yLimits=[-50, 50])
We would also like to be able to set the point size and line style from the python file, so that you don't have to load two files every time. Since this two things are global to all plots the idea is that the user sets them on the first plot and get done with it. If you guide me through the code a little bit I'll be more than happy to do it.