Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic resizing function #22

Open
mfocchi opened this issue Feb 24, 2016 · 7 comments
Open

automatic resizing function #22

mfocchi opened this issue Feb 24, 2016 · 7 comments

Comments

@mfocchi
Copy link

mfocchi commented Feb 24, 2016

Dear Pat

we are starting to use the signal_scope as the default debugging tool in our lab at IIT.
A nice functionality we had in our previous simulation software oscilloscope (we used SL http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.142.4178&rep=rep1&type=pdf)
was to be able to 1) resize the Yaxis limits around the variable value (basically the plot was magnified around the variable value at the instant we typed a certain refresh command). Then, if the variable was changing, 2) the Yaxis limit were moving too (e.g. if we have an increasing amplitude sine the Yaxis limits were "moving" at each cycle as the amplitude was increasing). This was applicable to all the plots.
It would be very useful to trigger the reset (1) functionality with a button and the (2) functionality with a toggle switch button. Let me know if something is not clear and if this is feasible.

cheers
Michele

@patmarion
Copy link
Member

Did you try right-clicking on the plot window and choose "Reset Y Axis Scale". Does that do the functionality you describe in 1? A toggle switch for "auto rescale" would be nice indeed, I imagine that would be straight forward to implement.

@mfocchi
Copy link
Author

mfocchi commented Feb 24, 2016

all right, "Reset Y Axis Scale" does the 1) thanks! but it would be nice to do for all the plots together (since we have a lot of dofs, we have e.g. 18 plots on average, and we need to rescale 1 by 1 that way)

@patmarion
Copy link
Member

Here's a quick workaround:

  • update master branch

  • open python console (F8) and enter this command:

    map(lambda x: x.onResetYAxisScale(), _mainWindow.getPlots())

This command will work in your current version of signal-scope but it might segfault because of a python threading issue that I just fixed.

If you want, you could attempt to add a button to the toolbar or an action with a keyboard shortcut to the Edit menu that does the same thing. Just have a look at mainwindow.cpp and find MainWindow::clearHistory(). That function is a good example of looping over each plot. All you have to do is loop over each plot and call onResetYAxisScale. To auto rescale, you could call that function from the draw loop, see the very end of MainWindow::onRedrawPlots() where it loops over each plot.

@mfocchi
Copy link
Author

mfocchi commented Feb 24, 2016

ok thanks! I will have a look

@jbcolme
Copy link

jbcolme commented Mar 8, 2016

Hi Pat,

I work with Michele. The button has been added. Do you think this could be usefull to others? I can make a pull request if you want to take a look.

Cheers.

@patmarion
Copy link
Member

Yes, please open a pull request, that would be great.

@patmarion
Copy link
Member

I'll leave this issue open to track the remaining feature request, a toggle button to turn on automatic resizing of the plots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants