Login  Register

Re: Is it normal to use a wait() instruction after a command

Posted by John Hayes on Feb 10, 2015; 8:54pm
URL: http://imagej.273.s1.nabble.com/Is-it-normal-to-use-a-wait-instruction-after-a-command-tp5011551p5011552.html

Hi Eric,

Can you illustrate the macro code that you are using where you are observing the problem?

In the meantime, it sounds like the plugin calls you are making from the macro are not blocking -- by that, I mean the execution of the macro continues after a given plugin is started. I _think_ this is because calls to "run" create a new instance of PlugIns/PlugInFilters and spawns a separate for each thread by default. I'm not sure what the most elegant solution for avoiding this currently is from macros, but this would explain why you would have to put a wait function after each call and the length of time varies from computer to computer.

You may want to also check out the "runMacro" function, which could potentially replace calls to "run" and I think it blocks.

HTH,

John

Le 10 févr. 2015 à 15:09, Eric Denarier a écrit :

> Hi All,
> As I had no answer to my former question , I try to rephrase it.
> Can I be explained why the instruction of a macro are not executed one after the others ?
> My problem being that sometimes I have to add a wait(1000 or more) after an instructionso that the result is obtained before the next instruction is executed. If I do not add the wait() then the last instrcution is executed before obtaining the result of the former.
> How can I know the time needed in the wait(time) instruction ?
>
> Can anyone clarified this point  ??? Thank you
>
>
>
> --
>
> Eric Denarier
> Grenoble Institut des Neurosciences
> Inserm U836
> Chemin Fortuné Ferrini
> 38700 La Tronche
> France
>
>
> Tél :33 (0)4 56 52 05 38
> Fax :33 (0)4 56 52 06 57
>
> http://neurosciences.ujf-grenoble.fr/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html