Re: Automatic button pressing:is there a way? [message #5141] |
Mon, 02 October 1995 00:00 |
peter
Messages: 80 Registered: February 1994
|
Member |
|
|
TOM HILLER (phtmh@siva.bris.ac.uk) wrote:
: I want to have my widget press one of its own buttons
: at regular intervals, about once a second. Is this possible
: in PV-WAVE 5.00b, on a SGI Power Challenge XL?
: The reason I want to do this; I have a complicated data set which
: can be fitted by a model. The fitting takes a good fraction
: of a second, and I want to be able to vary parameters with sliders,
: watch how the fitting looks on the screen, and get a number for the
: fit as I go along. I have set up the sliders, the data display, and
: the redrawing of the fit, but the widget is unuseable if I get it
: to re-calculate the fit on every slider event. At the moment I use
: a button to get the fit number, but this is a pain. Can I get it
: to calculate the fit once a second, i.e. press its fit button
: itself?
: Thanks for your help,
WTTIMER will generate timed events. Setting keyword drag=0 in the
WWCONTROLSBOX call that creates the sliders will cause the slider to
generate events only on button transitions.
--------------------------------
Peter Webb, HP Labs Medical Dept
E-Mail: peter_webb@hpl.hp.com
Phone: (415) 813-3756
|
|
|
Re: Automatic button pressing:is there a way? [message #5144 is a reply to message #5141] |
Mon, 02 October 1995 00:00  |
knighton
Messages: 12 Registered: June 1995
|
Junior Member |
|
|
In <DFqv4I.K60@midway.uchicago.edu> rivers@cars3.uchicago.edu (Mark Rivers) writes:
> In article <30SEP199520411554@siva.bris.ac.uk>, phtmh@siva.bris.ac.uk (TOM HILLER) writes:
>> I want to have my widget press one of its own buttons
>> at regular intervals, about once a second. Is this possible
>> in PV-WAVE 5.00b, on a SGI Power Challenge XL?
>>
snip, snip
> In IDL there are two ways you might achieve what you want to do:
> - Use widget timer events. You can get a timer event delivered to your event
> handler every 1 second. You can recalculate your fit on receipt of these
> events.
snip, snip
Some things to consider when using timer events:
1. A timer event only goes off once; therefore, the event handler must
issue another one to have a recurring timer.
2. As far as I know, there is no way to turn the timer event off once it
has been issued. Therefore, your event handler(s) must be able to deal
with an event occurring after you decide to stop the timer. This can
be done by setting up a "timer off " flag and checking it when timer
events are processed.
3. Timer events are not particularly accurate, especially in a networked
environment.
On a more general note, I have used timer events to do some cool things such as
giving a blink attribute to text and making an alarm widget that flashes on the
screen. I have been able to set numerous timers at once under HP-UX and
X-windows in a networked environment and they work great.
Ken Knighton, knighton@gav.gat.com, knighton@cts.com
Fusion Division
General Atomics
San Diego, CA
|
|
|
Re: Automatic button pressing:is there a way? [message #5145 is a reply to message #5141] |
Mon, 02 October 1995 00:00  |
zawodny
Messages: 121 Registered: August 1992
|
Senior Member |
|
|
In article <30SEP199520411554@siva.bris.ac.uk> phtmh@siva.bris.ac.uk (TOM HILLER) writes:
> I want to have my widget press one of its own buttons
> at regular intervals, about once a second. Is this possible
> in PV-WAVE 5.00b, on a SGI Power Challenge XL?
>
> The reason I want to do this; I have a complicated data set which
> can be fitted by a model. The fitting takes a good fraction
> of a second, and I want to be able to vary parameters with sliders,
> watch how the fitting looks on the screen, and get a number for the
> fit as I go along. I have set up the sliders, the data display, and
> the redrawing of the fit, but the widget is unuseable if I get it
> to re-calculate the fit on every slider event. At the moment I use
> a button to get the fit number, but this is a pain. Can I get it
> to calculate the fit once a second, i.e. press its fit button
> itself?
>
> Thanks for your help,
>
> Tom.
>
> P.S. We also have IDL 3.6.1a on a DEC Alpha, should I use this? I
> have not tried to program IDL widgets yet.
I do not know about PV-WAVE, but IDL has a .drag field in the event
structure for slider widgets. Use this to proccess only the "button
release" slider events.
You can send your own events to the Xmanager using the
WIDGET_CONTROL,SEND_EVENT=event_structure call.
Best of luck,
--
Dr. Joseph M. Zawodny KO4LW NASA Langley Research Center
E-mail: J.M.Zawodny@LaRC.NASA.gov MS-475, Hampton VA, 23681-0001
|
|
|
Re: Automatic button pressing:is there a way? [message #5146 is a reply to message #5141] |
Sun, 01 October 1995 00:00  |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
In article <30SEP199520411554@siva.bris.ac.uk>, phtmh@siva.bris.ac.uk (TOM HILLER) writes:
> I want to have my widget press one of its own buttons
> at regular intervals, about once a second. Is this possible
> in PV-WAVE 5.00b, on a SGI Power Challenge XL?
>
> The reason I want to do this; I have a complicated data set which
> can be fitted by a model. The fitting takes a good fraction
> of a second, and I want to be able to vary parameters with sliders,
> watch how the fitting looks on the screen, and get a number for the
> fit as I go along. I have set up the sliders, the data display, and
> the redrawing of the fit, but the widget is unuseable if I get it
> to re-calculate the fit on every slider event. At the moment I use
> a button to get the fit number, but this is a pain. Can I get it
> to calculate the fit once a second, i.e. press its fit button
> itself?
>
> P.S. We also have IDL 3.6.1a on a DEC Alpha, should I use this? I
> have not tried to program IDL widgets yet.
In IDL there are two ways you might achieve what you want to do:
- Use widget timer events. You can get a timer event delivered to your event
handler every 1 second. You can recalculate your fit on receipt of these
events.
- Use the cw_fslider widget, asking only for mouse release events. This way
you don't get all of the events as the user drags the slider, only when he
releases it. This cuts down the number of times the fit would be calculated.
____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
|
|
|