where/how to add trigger blocker here

For general discussion related FlowStone
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

where/how to add trigger blocker here

Post by tester »

Question. Where/how in such thing add trigger blocking, so that the random generator does not produces output when input (values) is changed? And I don't mean clickable S&H on all inputs or on output; the question is - how to block generating itself, so that randomizer produces results only on request.
Attachments
blocker.fsm
(656 Bytes) Downloaded 1057 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: where/how to add trigger blocker here

Post by billv »

blocker_fix.fsm
(684 Bytes) Downloaded 1049 times
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: where/how to add trigger blocker here

Post by tester »

We misunderstood. The problem is, that whatever change on whatever value-based input (first 3 inputs) - produces trigger that generates output. I'd like to avoid that. But also I'd like to avoid multiple generations (if S&H is connected to each individual input - that sort of things will happen). So - individual silent changes on all 3 inputs, and trigger only on demand.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: where/how to add trigger blocker here

Post by trogluddite »

You need to do this inside the Ruby itself...
blocker V2.fsm
(703 Bytes) Downloaded 1118 times

The 'i' variable is the index of the input that has just caused an 'event'. Triggers on other inputs will still update the values of their variables, but by 'filtering' the 'i' value, won't cause any of the array output code to run.
You can't really do the same using 'external' trigger blockers, because the triggers are necessary in order for Ruby to know when to update the '@' variable values (there are no "backwards" triggers from Ruby prim's to request the current values).

You could also give the trigger input a name, and use its name for the 'i' comparison...
if i == "trigger_input" ...etc...
...this is safer, because the name won't change if you add/delete/re-order the inputs, whereas the numeric index might change if you decide to update the module. The 'i' parameter has a special data type that is both number and string, so you can mix numeric indexes and names any way you like.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: where/how to add trigger blocker here

Post by tester »

Okay, thanks. I suspected that it must be something within ruby code.

I need to gather my thoughts...
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: where/how to add trigger blocker here

Post by trogluddite »

Yeah, the "no backwards trigger" thing is unlike almost all the other prim's. It's caught me out quite a few times!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: where/how to add trigger blocker here

Post by tester »

Generally the whole "ruby thing" is a headache maker for me. I'm so used to simple visual modularity, that when I watch at ruby and it's syntax, I simply feel dumb... I don't know if I'm able to cross that borderline.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: where/how to add trigger blocker here

Post by Nubeat7 »

tester wrote:Generally the whole "ruby thing" is a headache maker for me. I'm so used to simple visual modularity, that when I watch at ruby and it's syntax, I simply feel dumb... I don't know if I'm able to cross that borderline.

come on, its you TESTER, you will! just open your mind for it :) the good thing is, after you got some basics it really makes fun exploring it, and its an endless world to test out, and you will see that things become more and more easy with it also more easy than making it the "graphical" way, and after some time you want to program everything in ruby, and i`m still at the beginning, just writing my first own methods.. just give yourself a little time and do small and easy code, it starts to grow by itself then ;)
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: where/how to add trigger blocker here

Post by billv »

mis-understood

Sorry tester...didnt read question properly.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: where/how to add trigger blocker here

Post by tester »

Nubeat7 wrote:come on, its you TESTER, you will! just open your mind for it :) the good thing is, after you got some basics it really makes fun exploring it, and its an endless world to test out, and you will see that things become more and more easy with it also more easy than making it the "graphical" way, and after some time you want to program everything in ruby, and i`m still at the beginning, just writing my first own methods.. just give yourself a little time and do small and easy code, it starts to grow by itself then ;)


It's just too much for me. Open mind is not a trash. :lol: I repeat over and over - I do these little things in order to use created stuff. My fun is there. Having yet another syntax to deal with - I'm overloaded. If you remember the story/paradox of Pinocchio I posted recently, then you know what kind of computations are on my everyday basis... It's just difficult to flip back to things like... ruby :mrgreen:

BTW - are in nature "divisions by zero" (in terms of programming solutions) present? ;-)
Attachments
divisions-by-zero.fsm
(543 Bytes) Downloaded 1027 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Post Reply