11-02-2020 03:42 AM
Hi,
I'm having trouble exporting an image from a chart. It works but sometimes it doesn't and I don't know why. I guess it has something to do with the graphic system doing stuff in the background and when the plot is actually updated and when the image is exported/created.
What am I trying to do :
- Say you have trend chart of 5000 samples
- I want the full trend divided in plots of 1000 samples.
- So I change the X-scale programmatically accordingly in a loop
- After changing the x-scale I trigger the invoke node 'Export Image' for each plot
The results are unpredictable. Sometimes the X-scale are correct, on other times they are just off.
I tried inserting waits after changing the scale and triggering the 'Export Image'. Also tried the 'Force Redraw' invoke node.
To be fair, this belongs in a larger project with different loops running at the same time.
In the isolated example below I was not able to reproduce the problem. But I attached it anyway to give you an idea on how the plots are exported.
Attached the isolated code.
I guess what I need to know is, how can I be sure that the plot is redrawn with the new scales and ready to be exported.
Thanks for any tips/tricks
11-02-2020 08:18 AM
If the system can be busy with other processes, try adding a check that the scale has the desired limits:
11-03-2020 07:59 AM
A simple answer to my complex problem that might actually work 🙂
I'll try this out as soon as I get the chance