08-31-2020 06:55 PM
Hello Everyone,
I'll be quick with this one; I'm using a Listbox to set active plots on a graph. The flickering starts when selecting 2 or more names. I've tried placing decorations on the graph and timers to slow down the loops, no luck there... The flickering graph is always every other one. I would like to have the flickering to stop somehow.
To see a scenario, probe at "14" and select the names "Bob 2-4" ("Bob 3" flickers).
Solved! Go to Solution.
08-31-2020 11:09 PM
What happens if you don't go through the process of writing to the property nodes for visibility on every iteration even when the list doesn't change?
This should be in an event structure for the change of the list box. Or at least a case structure where you compare the old values of the list box to the new values.
The shift register on your little for loop should be blue, not orange.
And it would have been even simpler if you just took the wire from the i terminal and indexed that out. No shift register, no increment, no initialization constant!
09-01-2020 02:12 AM
Listen to RavensFan's advice. The actual flickering is caused by the fact that you are showing and then hiding plots. It becomes more obvious if you lower the loop time and if you would put a wait between the second and third for loop (the ones that write to Plot.Visible).
Learn about events, then try again.
One solution (no, try it yourself first):
09-01-2020 05:17 PM
Here is where I have it in the larger picture:
The Listbox is called in the event structure and then queues it to the state ("Listbox"), after done with ActivePlots the state goes back to "monitoring". It doesn't make sense on how it skips while auto-indexing from the "Sensor Box" local variable. (RavensFan, thanks for the help. I see your post all of the place with assisting people's troubles.)
09-01-2020 05:20 PM
Thanks Thols,
This works! I don't see how my code was skipping because if you look at my post above, you can see I incorporate a event structure. It simply sets the active plots and removes the de-active ones. Thanks again, Thols!
09-02-2020 02:02 AM
@LawnMower3000 wrote:
Thanks Thols,
This works! I don't see how my code was skipping because if you look at my post above, you can see I incorporate a event structure. It simply sets the active plots and removes the de-active ones. Thanks again, Thols!
Glad you got it working.
Nothing is being skipped, but if by skipping you mean flickering, then that is because you first activate all plots then deactivate some. Its like turning a lamp on and then off, you will see it flilckering even if the on/off is done quickly.