comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » SIMULTANEOUS RUN
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
SIMULTANEOUS RUN [message #2403] Wed, 06 July 1994 19:58 Go to next message
victor is currently offline  victor
Messages: 9
Registered: May 1994
Junior Member
I want to thank everyone who replied to my posting; however, unfortunately,
it was not able to run TWO events simultaneously, .
sorry for miscommunication.
Here is what I need:
I have a very long deconvolution routine < about 5-10 minutes to finish>
and during this time I want to use the xsurface routine < to rotate the image>
right now I have something like this:
a=widget_base()
b=widget_base(a)
XSURFACE is under the B base

c=widget_base(a)
DECONVOLUTION ROUTINE under c base

HOW do I call xmanager so that I get DECONVOLUTION ROUTINE_event to run
and If I choose XSURFACE button when deconvolution is running,
I would be able to use xsurface WHILE DECON is running and NOT after.
Thanks!
Re: simultaneous run [message #2410 is a reply to message #2403] Tue, 05 July 1994 09:46 Go to previous messageGo to next message
8015 is currently offline  8015
Messages: 52
Registered: November 1993
Member
In article <2vavun$3d8@news.service.uci.edu>,
Victor Shvetsky (Garden) <victor@astro2.ps.uci.edu> wrote:
> For example:
...
> a=widget_base()
> b=widget_base(a, event_pro='x')
> c=widget_base(a,event_pro='y')
>
> How can one run x and y simulataneously?
> And if iyt impossible, then what would you do in order to make 2
> programs run simulataneously with XMANAGER, because xmanager, 'x',b
> and xmanager,'y',c does not work
> Thanks!!!!!!!!!!!

I believe the answer centers around the use of the timer keyword to
Widget_Base, but I don't have enough experience with using timer (read
as "damn near none") to help beyond that. This would allow b and c run
as background tasks to the base, a.

Mike Schienle Hughes Santa Barbara Research Center
8015@sbsun0010.sbrc.hac.com 75 Coromar Drive, M/S B28/87
Voice: (805)562-7466 Fax: (805)562-7881 Goleta, CA 93117
Re: simultaneous run [message #2415 is a reply to message #2403] Tue, 05 July 1994 06:01 Go to previous messageGo to next message
tai is currently offline  tai
Messages: 14
Registered: June 1994
Junior Member
Victor Shvetsky (Garden) (victor@astro2.ps.uci.edu) wrote:
: a=widget_base()
: b=widget_base(a, event_pro='x')
: c=widget_base(a,event_pro='y')

: How can one run x and y simulataneously?

I have never needed to use the event_pro keyword. Thus, I handle all
events under the main base in one procedure with a single CASE
statement. Here is an quick example I created using wided:

PRO MAIN1_Event, Event
WIDGET_CONTROL,Event.Id,GET_UVALUE=Ev
CASE Ev OF
'Button': BEGIN
Print, 'Event for Button'
END
ENDCASE
END

PRO test, GROUP=Group
IF N_ELEMENTS(Group) EQ 0 THEN GROUP=0
junk = { CW_PDMENU_S, flags:0, name:'' }
MAIN1 = WIDGET_BASE(GROUP_LEADER=Group, ROW=1, MAP=1, UVALUE='MAIN1')
BASE2 = WIDGET_BASE(MAIN1, ROW=1, FRAME=1, MAP=1, TITLE='Base 1', $
UVALUE='BASE2')
BASE3 = WIDGET_BASE(MAIN1, ROW=1, FRAME=1, MAP=1, UVALUE='BASE3')
BUTTON4 = WIDGET_BUTTON( BASE3, UVALUE='Button', VALUE='Button')
WIDGET_CONTROL, MAIN1, /REALIZE
XMANAGER, 'MAIN1', MAIN1
END


Alan
Re: SIMULTANEOUS RUN [message #2496 is a reply to message #2403] Thu, 07 July 1994 12:30 Go to previous message
robijn is currently offline  robijn
Messages: 18
Registered: June 1994
Junior Member
In article <2vfr1h$idl@news.service.uci.edu>,
Victor Shvetsky (Garden) <victor@astro2.ps.uci.edu> wrote:
>
> Here is what I need:
> I have a very long deconvolution routine < about 5-10 minutes to finish>
> and during this time I want to use the xsurface routine < to rotate the image>
> right now I have something like this:
> a=widget_base()
> b=widget_base(a)
> XSURFACE is under the B base
>
> c=widget_base(a)
> DECONVOLUTION ROUTINE under c base
>
> HOW do I call xmanager so that I get DECONVOLUTION ROUTINE_event to run
> and If I choose XSURFACE button when deconvolution is running,
> I would be able to use xsurface WHILE DECON is running and NOT after.

You can't, at least not in plain IDL. What you need for that is to split
the IDL process in two threads - one running the DECON and the other
executing other IDL commands. This is typically handled by an operating
system. On a PC running Windows 3.1 (IDL also runs on that platform) it
is not possible to run two programs simultaniously, so IDL would have
to provide the code to handle the time sharing between the threads. That
would be quite an effort.

There is a possibility to run DECON parallel to IDL on Unix machines, but
that requires that you use CALL_EXTERNAL or SPAWN. The latter is the
easiest: adapt the deconvolution procedure so that it reads the input
data from a file and writes the results to another file. Use SPAWN to
start a second IDL session in the background. That second session only
runs DECON and exits. The first IDL process then has to check periodically
(widget_control, /timer) whether the file with results is complete
or whether the second process is still running. If it has finished, the
first IDL process reads the results and can continue.

Frank
--
_____ ____
/ / / Frank Robijn Internet: Robijn@Strw.LeidenUniv.NL
/___ /___/ Sterrewacht Leiden Bitnet: Robijn@HLERUL51
/ / \ Phone (31) 71 275841 Local: Robijn@HL628
/ / \ Fax : (31) 71 275819 Snail: P.O.Box 9513, 2300 RA Leiden,
The Netherlands
Re: SIMULTANEOUS RUN [message #2499 is a reply to message #2403] Thu, 07 July 1994 04:19 Go to previous message
stl is currently offline  stl
Messages: 70
Registered: February 1994
Member
In article <2vfr1h$idl@news.service.uci.edu> victor@astro2.ps.uci.edu (Victor Shvetsky (Garden)) writes:
>
> and during this time I want to use the xsurface routine < to rotate the image>
> right now I have something like this:
> a=widget_base()
> b=widget_base(a)
> XSURFACE is under the B base
>
> c=widget_base(a)
> DECONVOLUTION ROUTINE under c base
>
> HOW do I call xmanager so that I get DECONVOLUTION ROUTINE_event to run
> and If I choose XSURFACE button when deconvolution is running,
> I would be able to use xsurface WHILE DECON is running and NOT after.

Hi,

okay, well, if you are using xmanager (which you should be) you will set
up an event handler for your program something like the following:
xmanager,'your_program',a
then in your event handler called: your_program_event.pro you parse for
what event occured, from say your two buttons. I believe once one is
started from within the event handler, you can hit the other button, and
even though the other one is not done yet, the new event will trigger
new code to start (while the other is still running) You should not
need to use the TIMER event stuff because it doesn't sound like your
code is time specific, you just want it to run more or less in parallel.

hope this helps a little. if not, let me know and we can mail back and
forth about this.

good luck,

-stephen
--
Stephen C Strebel / SKI TO DIE
strebel@sma.ch / and
Swiss Meteorological Institute, Zuerich / LIVE TO TELL ABOUT IT
01 256 93 85 / (and pray for snow)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Can't get POSTSCRIPT output
Next Topic: SIMULTANEOUS RUN

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:42:26 PDT 2025

Total time taken to generate the page: 0.00651 seconds