I have huge code and some problem. I don't know how to make example. I'm afraid I can't make good SMALL example to demonstrate you the problem. So I'll try to explain. Maybe somebody know about such problem.
I have some DynamicModule
. Large grid of plots, controls and tables of expressions some of them Dynamic
.
Dynamic[myplots=Grid[{{Plot[...], Plot[...]}}], TrackedSymbols:>{expr}]
I have some function that execute some calculations what change Dynamic
plots and Tables.
What's the problem:
expr=values;
Export["file.png", myplots];
When I'm trying to export calculated data and dynamically updating data from grid I get empty grid.
Changing expr
launch calculating Dynamic
grids. And Export
saves file until calculations complete. So I get empty file.
If I add:
expr=values;
Pause[5];
Export["file.png", myplots];
All calculations complete and I have right result in "file.png".
But I never know how much time I need. It depends on input data size. Sometimes it 1 sec, sometimes it 30sec. So always have to wait 30sec to guarantee right result it's a bad idea.
I look at some commands as WaitAll:
expr=values;
WaitAll[myplots];
WaitAsynchronousTask[myplots];
Export["file.png", myplots];
Still nothing. I just don't understand.
What did I do wrong and how can I fix it?
FinishDynamic[]
help? $\endgroup$