Title: Re: [opendx-general] Need a dx box that acts as an "if
I just sent something to the list, but I just thought, do you mean use three Switches?

Fred
At 03:31 PM 7/23/01 -0400, you wrote:

Looks like Greg embellished my answer with the necessary Compute(a+1) that I forgot. I believe it's the case that when you data-drive Selector, the auto-generated list starts at 0 so the Compute bumps everything up one to make Switch happy. Otherwise, his answer should serve. That is, he and I think alike that the only place you really need the Switch is just before the output regardless of how much viz stuff happens between Select and Image.

You might be thinking you'd save processing time if you didn't execute unneeded branches at all. This is where Route (several) would help possibly, but not Switch. If I remember correctly, Switch branches all evaluate always. Route(0) branches do not execute. However, this does not always compute, i.e., there are some modules downstream of a terminated Route that will bitch and whine (or essentially not execute at all leaving you with no image). I fear that Switch is one.

So you might rig up some Computes of the nature (a == 1 ? 1 : 0) to pass a 1 if comp1 is chosen [and you feed this Compute's a input with the output of Selector and the prior Compute(a+1)] but 0 otherwise, to Route. This would execute that subbranch below Route if comp1, otherwise not execute. Likewise a == 2 ? 1 : 0 for choice 2. Each branch needs such a Compute and its own Route with only the 0|1 value and one selected input stream and you only use the leftmost output (the "1" valued stream; 0 value makes no output stream out of that leftmost output or any other output for that matter). So now you end up with 3 Routes, 2 of which do nothing depending on Selector. Collect, Image, season to taste.

I typically install a whole raft of Selectors and Routes (usually user-driven) to turn on/off various objects in the output, so if all you do is Collect and Image these 3 streams (one valid, two null), it should work.

Chris Pelkie
Vice President/Scientific Visualization Producer
Conceptual Reality Presentations, Inc.
30 West Meadow Drive
Ithaca, NY 14850
[EMAIL PROTECTED]

Reply via email to