12-05-2011 08:58 PM
I would like to animate an algorithm on a VI's front panel. The algorithm is this: Imagine a juke-box-like device, with a linear magazine of, say, discs. There is a fixed-position target for insertion. The idea is this: to insert disc 3, I'd like the magazine to move (up or down) until disc 3 is adjacent to the insertion point, then see it slide horizontally out of the magazine into the insertion point.
I tried a cluster of string indicators, and slid the cluster up or down using a property node on its position, but sliding the indicator "out" of its cluster just made it disappear. I guess it's only visible when within the boundaries of its parent.
I fiddled with decorations a bit, without success. Any suggestions? Sorry if this question is vaguely worded.
-Jeff
12-05-2011 10:35 PM
12-06-2011 01:54 AM
Without looking at the actual code, here are some options:
12-06-2011 12:09 PM
Good advice. I've attached a VI to illustrate. The block diagram is empty, I'm using the front panel to better illustrate my question.
What I am envisioning is that the magazine would move up and down, aligning one of the strings with the slot. Then the selected string would move to the right, "into" the slot, looking like an insertion into the slot. I would want to depict an empty space in the magazine.
Then, move the slotted string back into the magazine, move the magazine to select another string, and so on.
The magazine only goes up and down, and the selected string right and left.
In my example, I don't claim that clusters or strings are required or are the right way to go; I'm still casting around for the right approach.
Thanks for any advice you can give.
12-07-2011 01:48 AM
Well, all the methods suggested in my previous reply are doable and using the cluster of strings is certainly valid. I think the first is easiest in terms of the amount of the code required. As you already saw, you can use the position property to control the location, so you can simply move the magazine cluster up or down until the specific control you want reaches the same line as the slot, then move the string sideways. You could probably implement it as a fairly simple state machine.
12-08-2011 03:29 PM
Hello, JWP!
Were you able to implement JWP's suggestions?
Please let us know if you have further questions.
-Will
12-08-2011 03:46 PM
Thanks for the replies. I'm still exploring the various techniques (I like #2 above), but I'm on my way now. Thanks again for the replies!
12-09-2011 11:10 AM
*tst's suggestions - my mistake!
01-07-2012 06:00 PM
I took tst's advice, and built a state machine just as he suggested. It came out pretty well. When you run my shuffle vi, click to select a filter, then fetch to load it into the slot, stow to bring it back out.
It's a little elaborate, but I wanted to practice building an event-driven queued state machine. If you click on a bunch of filter-selects quickly, you can see the event loop loading things into the queue, and the "stop" button clears out the queue. It's sort of a test-bed for my project goals.
Thanks very much for the advice! And, of course, comments are always welcome.
-Jeff