|
From: | Michael Goffioul |
Subject: | Re: __fltk_ginput__ to __qt_ginput__ |
Date: | Fri, 28 Mar 2014 12:38:46 -0400 |
I will gladly explain what we want.On Fri, Mar 28, 2014 at 11:51 AM, Michael Goffioul <address@hidden> wrote:
On Fri, Mar 28, 2014 at 11:46 AM, John Swensen <address@hidden> wrote:
On Fri, Mar 28, 2014 at 11:38 AM, Doug Stewart <address@hidden> wrote:
On Fri, Mar 28, 2014 at 10:51 AM, Michael Goffioul <address@hidden> wrote:
On Fri, Mar 28, 2014 at 10:30 AM, Doug Stewart <address@hidden> wrote:
But waitfor suspends octave.
On Fri, Mar 28, 2014 at 10:00 AM, Michael Goffioul <address@hidden> wrote:
On Fri, Mar 28, 2014 at 9:48 AM, Doug Stewart <address@hidden> wrote:
a file that would work with the qt back end.and would like your advice on how tho change it into
I am looking at:
function [x, y, button] = __fltk_ginput__ (f, n = -1)
I think a simple, and not toolkit specific, implementation could leverage the existence of the function waitfor. Conceptually, you can wait for a button press using something along those lines:set (gcf, 'windowbuttondownfcn', @(f) set (f, 'userdata', 1));waitfor (gcf, 'userdata');This is the core functionality. Then you need to wrap this up with:- save/restore windowbuttonfcn and userdata properties- loop to retrieve multiple mouse clicks- keep track of the pointer coordinates for each mouse click- listen for Enter key to stop the processAFAIK, "waitfor" works in both Qt and FLTK toolkits, so you'd have an implementation that works for both.Michael.What we need for sisotool is a non blocking mouse event grabber.The user , after a plot is drawn, MIGHT want to click on it or might not.I don't understand your concern. ginput also suspends octave...Michael.Is there any way to make a nonblocking mouse event function, using the uixxx type of logic?If there isn't then I don't see how we can do the sisotool using uixxx functions.
I could be made in qt c++ language but this is quit a different GSoC project.I'm assuming that many of the UI callbacks are not implemented yet?for a description of how you can register for mouse event through a callback function. This is how I normally do little GUI tools in Matlab, rather than ginput. I usually use ginput for cases where it is just a simple script with a known number of points.QtHandles already supports a bunch of callbacks. The most outstanding missing one is the "motion" callback.Michael.The sisotool is a tool that take a closed loop transfer function :[ 1x + 2 ] /[ 3x^3 + 1x^2 + 5x + 7]
and draws the rlocus plot and optionally the bode plot and step response and impulse response, each in a different panel.Then the user has the option of using the mouse to adjust the transfer function, by grabbing, with the mouse an "x" (root of the denominator polynomial), or an "o"(root of the numerator polynomial), and moving them on the plot panel. The roots my be displayed on different panels, and the user might move them in the rlocus panel or in the bode panel or the user might want to add a different panel to see a different perspective.
As the user is moving the "x" or "o" we need to dynamically update all the panels.This involves
1) getting a mouse down signal
2) getting the x,y in pixels3) converting to eng units4) finding the closest x or o5) looking for a mouse move before a mouse up
6) with a mouse move calculate new eng. units7) update the transfer function8) redraw all panelsetc.When the user is satisfied with the shape of all the plots on the different panels then the user will want to see the new numerator and denominator.
I hope this helps
[Prev in Thread] | Current Thread | [Next in Thread] |