I have a stream of data coming in through a gate. For each gate output, I want to be able to set the value to zero when there is no data at the gate. I think a metronome will be required to periodically 'check' if there is data coming, and if there isnt set it to zero.
This 'zero' would then control a spigot to control data flow from another source.
I have tried a combination of spigots, gates, logical tests, bangs and metronomes, and I just cant get it to work.
Pseudo code:
var control (user can control)
var dataStream1 (constant data streams on all accounts)
var dataStream2 "
var dataStream3 "
var dataStream4 "
var collector (i want the data streams to end up here)
if 1 >= control <= 4 then
send dataStreamcontrol to collector
endif
I can get as far as a gate and the controler, however, since all data streams are dumping data, even if the date is switched to say, 2, the collector gets filled simultaneously with all the data streams.
Here is an analogy which can also describe what I want incase its unclear:
Where [gate] might be compared to filling for example four buckets full of water from a hosepipe - that is one data stream and several collectors. In this scenario, if you switch from filling bucket 1 to bucket 2, there will still be some water in bucket 1 from where you filled it earlier. Here I might have 4 buckets on the floor and I move the hosepipe.
I have four hosepipes, each with different coloured water. By selecting 1, 2, 3 or 4, I want to fill ONE bucket with that coloured water, but if I change to a different hosepipe, I want to empty the bucket first, then start filling it with the new coloured water. Here I might have 4 hosepipes suspended and I'm moving the bucket underneath them (tipping out unwanted water).
Meh!