comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: wait loop

Re: wait loop
type: item
description: Dominik Paul wrote: > > hi there, > > we would like to check a directory, if there is a file every 10 oder 20 > minutes in an IDL programm For this we would like to use a waitung funktion, > in a loop, which doesnt cost to much processor time. > > Does somebody know a waiting function for this problem, because I coulnd > find anything suitable in the IDL help files. > > Thanks > > Dom Dear Dom, are you looking for something like: FUNCTION wait_until_daytime,day_time ask_time = string2js(day_time) time_now = string2js(/now) IF ask_time lt time_now THEN return,0 WHILE time_now LT ask_time DO time_now = string2js(/now) RETURN,1 END result=wait_until_daytime('2001-09-20 13:35:00 000') http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/string2js.tar.gz regards Reimar -- Reimar Bauer Institut fuer Stratosphaerische Chemie (ICG-1) Forschungszentrum Juelich email: R.Bauer@fz-juelich.de http://www.fz-juelich.de/icg/icg1/ ============================================================ ====== a IDL library at ForschungsZentrum Juelich http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml http://www.fz-juelich.de/zb/text/publikation/juel3786.html ============================================================ ====== read something about linux / windows http://www.suse.de/de/news/hotnews/MS.html
creator: R.Bauer
date: 2001-09-20T11:41:32-00:00

Re: wait loop
type: item
description: I think, this kind of loop needs to much processor power. We would like to have somethink you nearly dont notice, that there is a IDL task running in the back. Dom "Reimar Bauer" <r.bauer@fz-juelich.de> schrieb im Newsbeitrag news:3BA9D5EC.504C0EB3@fz-juelich.de... > Dominik Paul wrote: >> >> hi there, >> >> we would like to check a directory, if there is a file every 10 oder 20 >> minutes in an IDL programm For this we would like to use a waitung funktion, >> in a loop, which doesnt cost to much processor time. >> >> Does somebody know a waiting function for this problem, because I coulnd >> find anything suitable in the IDL help files. >> >> Thanks >> >> Dom > > > Dear Dom, > > are you looking for something like: > > > FUNCTION wait_until_daytime,day_time > > ask_time = string2js(day_time) > time_now = string2js(/now) > > IF ask_time lt time_now THEN return,0 > > WHILE time_now LT ask_time DO time_now = string2js(/now) > > RETURN,1 > END > > > result=wait_until_daytime('2001-09-20 13:35:00 000') > > http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/downl oad/string2js.tar.gz > > > regards > Reimar > > -- > Reimar Bauer > > Institut fuer Stratosphaerische Chemie (ICG-1) > Forschungszentrum Juelich > email: R.Bauer@fz-juelich.de > http://www.fz-juelich.de/icg/icg1/ > ============================================================ ====== > a IDL library at ForschungsZentrum Juelich > http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml > > http://www.fz-juelich.de/zb/text/publikation/juel3786.html > ============================================================ ====== > > read something about linux / windows > http://www.suse.de/de/news/hotnews/MS.html
creator: Dominik[1]
date: 2001-09-20T11:41:44-00:00

Re: wait loop
type: item
description: Reimar Bauer <r.bauer@fz-juelich.de> writes: > Dominik Paul wrote: >> we would like to check a directory, if there is a file every 10 >> oder 20 minutes in an IDL programm For this we would like to use a >> waitung funktion, in a loop, which doesnt cost to much processor >> time. > WHILE time_now LT ask_time DO time_now = string2js(/now) Hmm, I think he was looking for something that doesn't consume too much processor time.... What's about a simple wait, seconds Pit -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ Dr. Peter "Pit" Suetterlin http://www.astro.uu.nl/~suetter Sterrenkundig Instituut Utrecht Tel.: +31 (0)30 253 5225 P.Suetterlin@astro.uu.nl ____________________________________________________________ ______________
creator: pit
date: 2001-09-20T12:20:15-00:00

Re: wait loop
type: item
description: Dominik Paul wrote: > hi there, > > we would like to check a directory, if there is a file every 10 oder 20 > minutes in an IDL programm For this we would like to use a waitung funktion, > in a loop, which doesnt cost to much processor time. > > Does somebody know a waiting function for this problem, because I coulnd > find anything suitable in the IDL help files. > > Thanks > > Dom > > > Well, there's a WAIT procedure. Won't that do? Does it have to be a function? ;-) -- ----------------------------------------------------------- Nigel Wade, System Administrator, Space Plasma Physics Group, University of Leicester, Leicester, LE1 7RH, UK E-mail : nmw@ion.le.ac.uk Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
creator: Nigel Wade
date: 2001-09-20T12:25:25-00:00

Re: wait loop
type: item
description: Reimar Bauer wrote: > Dominik Paul wrote: > >> hi there, >> >> we would like to check a directory, if there is a file every 10 oder 20 >> minutes in an IDL programm For this we would like to use a waitung funktion, >> in a loop, which doesnt cost to much processor time. >> >> Does somebody know a waiting function for this problem, because I coulnd >> find anything suitable in the IDL help files. >> >> Thanks >> >> Dom >> > > > Dear Dom, > > are you looking for something like: > > > FUNCTION wait_until_daytime,day_time > > ask_time = string2js(day_time) > time_now = string2js(/now) > > IF ask_time lt time_now THEN return,0 > > WHILE time_now LT ask_time DO time_now = string2js(/now) > > RETURN,1 > END > > > result=wait_until_daytime('2001-09-20 13:35:00 000') > > http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/string2js.tar.gz > > > regards > Reimar > > I can't actually test this procedure as I don't have string2js, but it looks to me as though it would use around 100% of the CPU while it's waiting. That's not very friendly if it's a multiuser system. -- ----------------------------------------------------------- Nigel Wade, System Administrator, Space Plasma Physics Group, University of Leicester, Leicester, LE1 7RH, UK E-mail : nmw@ion.le.ac.uk Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
creator: Nigel Wade
date: 2001-09-20T12:28:56-00:00

Re: wait loop
type: item
description: in article 9ocd41$mis$1@n.ruf.uni-freiburg.de, Dominik Paul at dpaul@ukl.uni-freiburg.de wrote on 9/20/01 5:28 AM: > we would like to check a directory, if there is a file every 10 oder 20 > minutes in an IDL programm For this we would like to use a waitung funktion, > in a loop, which doesnt cost to much processor time. > Dom, What you want to use is a timer event for widgets. This doesn't use any cpu time until the event fires off. If you don't have any widgets as part of your program you can still create a simple base and keep map=0 so that it never becomes visible. -Ronn -- Ronn Kling KRS, inc. email: ronn@rlkling.com "Application Development with IDL"ï¿½ programming book updated for IDL5.4! "Calling C from IDL, Using DLM's to extend your IDL code" NEW BOOK! http://www.rlkling.com/
creator: ronn
date: 2001-09-20T12:52:40-00:00

Re: wait loop
type: item
description: Hi, thanks, that was what I was looking for, perhaps I didnt express my self very good. "ronn kling" <ronn@rlkling.com> schrieb im Newsbeitrag news:B7CF5DD5.330B%ronn@rlkling.com... > in article 9ocd41$mis$1@n.ruf.uni-freiburg.de, Dominik Paul at > dpaul@ukl.uni-freiburg.de wrote on 9/20/01 5:28 AM: > >> we would like to check a directory, if there is a file every 10 oder 20 >> minutes in an IDL programm For this we would like to use a waitung funktion, >> in a loop, which doesnt cost to much processor time. >> > Dom, > > What you want to use is a timer event for widgets. This doesn't use any cpu > time until the event fires off. If you don't have any widgets as part of > your program you can still create a simple base and keep map=0 so that it > never becomes visible. > > -Ronn > > > -- > Ronn Kling > KRS, inc. > email: ronn@rlkling.com > "Application Development with IDL" programming book updated for IDL5.4! > "Calling C from IDL, Using DLM's to extend your IDL code" NEW BOOK! > http://www.rlkling.com/ > >
creator: Dominik[1]
date: 2001-09-20T13:03:37-00:00

Re: wait loop
type: item
description: Dominik Paul wrote: > > I think, this kind of loop needs to much processor power. We would like to > have somethink you nearly dont notice, that there is a IDL task running in > the back. Yes, I know, I missed the wait command. WHILE time_now LT ask_time DO begin time_now = string2js(/now) wait,0.5 ; saves CPU time endwhile Ronn's answer is the best solution if you like doing this by idl. Reimar > > Dom > "Reimar Bauer" <r.bauer@fz-juelich.de> schrieb im Newsbeitrag > news:3BA9D5EC.504C0EB3@fz-juelich.de... >> Dominik Paul wrote: >>> >>> hi there, >>> >>> we would like to check a directory, if there is a file every 10 oder 20 >>> minutes in an IDL programm For this we would like to use a waitung > funktion, >>> in a loop, which doesnt cost to much processor time. >>> >>> Does somebody know a waiting function for this problem, because I coulnd >>> find anything suitable in the IDL help files. >>> >>> Thanks >>> >>> Dom >> >> >> Dear Dom, >> >> are you looking for something like: >> >> >> FUNCTION wait_until_daytime,day_time >> >> ask_time = string2js(day_time) >> time_now = string2js(/now) >> >> IF ask_time lt time_now THEN return,0 >> >> WHILE time_now LT ask_time DO time_now = string2js(/now) >> >> RETURN,1 >> END >> >> >> result=wait_until_daytime('2001-09-20 13:35:00 000') >> >> > http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/downl > oad/string2js.tar.gz >> >> >> regards >> Reimar >> >> -- >> Reimar Bauer >> >> Institut fuer Stratosphaerische Chemie (ICG-1) >> Forschungszentrum Juelich >> email: R.Bauer@fz-juelich.de >> http://www.fz-juelich.de/icg/icg1/ >> ============================================================ ====== >> a IDL library at ForschungsZentrum Juelich >> http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml >> >> http://www.fz-juelich.de/zb/text/publikation/juel3786.html >> ============================================================ ====== >> >> read something about linux / windows >> http://www.suse.de/de/n…
creator: R.Bauer
date: 2001-09-20T13:17:50-00:00

Re: wait loop
type: item
description: Ronn Kling (ronn@rlkling.com) writes: > What you want to use is a timer event for widgets. This doesn't use any cpu > time until the event fires off. If you don't have any widgets as part of > your program you can still create a simple base and keep map=0 so that it > never becomes visible. Because I wasn't sure if an unmapped widget could actually receive a timer event, I just coded a file- seeking program up. Here it is. Note no error checking! ************************************************ PRO TestForFile_Event, event Widget_Control, event.top, Get_UValue=filename dummy = Findfile(filename, Count=count) IF count EQ 0 THEN BEGIN Widget_Control, event.top, Timer=5 Print, 'Still looking... ENDIF ELSE Print, 'Found File: ', filename END PRO TestForFile, filename tlb = Widget_Base(Map=0) Widget_Control, tlb, /Realize, Set_UValue=filename Widget_Control, tlb, Timer=5 XManager, 'testforfile', tlb, /No_Block END ************************************************** I ran it like this: IDL> TestForFile, 'butter.pro' Here is my output. Note, I had to save a file named "butter.pro" to get the think stopped. :-) Still looking... Still looking... Still looking... Still looking... Found File: butter.pro Cheers, David -- David W. Fanning, Ph.D. Fanning Software Consulting Phone: 970-221-0438, E-mail: david@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com/ Toll-Free IDL Book Orders: 1-888-461-0155
creator: David Fanning
date: 2001-09-20T13:51:07-00:00

Re: wait loop
type: item
description: David Fanning (david@dfanning.com) writes: > Here it is. Note no error > checking! Uh, well, or any cleanup. Here is a slightly better version. Next time, I'm going to wait a year until I post. :-( Cheers, David ****************************************** PRO TestForFile_Event, event Widget_Control, event.top, Get_UValue=filename dummy = Findfile(filename, Count=count) IF count EQ 0 THEN BEGIN Widget_Control, event.top, Timer=5 Print, 'Still looking... ENDIF ELSE BEGIN Widget_Control, event.top, /Destroy Print, 'Found File: ', filename ENDELSE END PRO TestForFile, filename tlb = Widget_Base(Map=0) Widget_Control, tlb, /Realize, Set_UValue=filename Widget_Control, tlb, Timer=5 XManager, 'testforfile', tlb, /No_Block END ****************************************** -- David W. Fanning, Ph.D. Fanning Software Consulting Phone: 970-221-0438, E-mail: david@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com/ Toll-Free IDL Book Orders: 1-888-461-0155
creator: David Fanning
date: 2001-09-20T13:53:34-00:00