Page 1 of 1
Posted: 18 Mar 2009, 06:59
by woodslanding
I have a nice setup going where a switch makes a panel visible, and then the close button on the panel turns the switch off. Great!
But if I hit the switch while it's already on, it turns off. I don't want to be able to close the panel from the switch, and I don't want the switch position to get out of sync with the panel.
How can I keep the switch from turning itself off, and still allow it to turn itself on? And still allow the close button to turn it off??
It's making my head hurt.....
Thanks!
-eric
Posted: 18 Mar 2009, 07:16
by nay-seven
can you upload a little example or screenshot of the way you've pach this..?
could be more easy to help...

Posted: 18 Mar 2009, 09:30
by pansoul
To make what you ask for, i would use a script because i did not find a simple way to do that but i am really interested in find it.
Perhaps , rather than use a switch , it would be better to use a separator and panel module which produce always the same output ( button behaviour) and allow you to change his color separatly (the color would represent the state visible or not).
i think to something like that :
the problem is to always get a 1 after clicking on the sep and panel. i thought that the 0 to 1 module do that but it's not (??).
so what module produce a 1 each time it receives a button output ?
and after that, the button on your panel has to take the hand over all this loop to produce a 0 at the visible output.
Posted: 18 Mar 2009, 10:33
by 23fx23
I would deal with color to update the state of the panel as pansoul says and maybe use a "pass only if positive" (A>b then then A pass) so that it will only produce 1 when positiv...
Posted: 18 Mar 2009, 13:16
by pansoul
are you refering to the math - logical - A>B module ? if yes , the problem is that if A is not sup to B , it produces a 0, it means as soon as you release the sep-panel.
Posted: 18 Mar 2009, 18:38
by 23fx23
yup but if after that you put a "pass" module, the value 1 only will pass, not 0.
either pannel mouse dwn - from 0 to 1 - pass event flow. (the input "in"of pass is either mouse dwn or constant 1 value, the "pass"input is "from 0 to 1")
or pannel mouse dwn - A>B - pass event flow.
so if you put a fader/sw after that, it will only be updated when the pannel is "enabled", the 0 value of mouse dwn will be ignored.
....so if the first switch "visible or not" is folowed by a "passonly if chg" event it should control the visibility,
and if the second switch/panel change, it will update only to go from 0 to 1, if 1 and go to zero the value won't pass... so it won't self disapear if im not wrong.
hope it's clear , or ill try to post a pic.
Posted: 18 Mar 2009, 21:52
by bsork
I knew it wouldn't take a lot of modules:
..but that don't mean that it was easy to find this way of doing it!
Posted: 18 Mar 2009, 21:55
by 23fx23
he very nice bsork even simpler, I really need to loose my bad habits and not forget the multivar!
Posted: 18 Mar 2009, 23:42
by nay-seven
great ! maybe a good candidate for the wiki / how to...?
Posted: 19 Mar 2009, 00:21
by bsork
I see if I can put something in the Wiki within a week or so (unless someone chimes in). I have a bit of bad conscience for not adding anything to it yet - about time I did I guess... Maybe the Tips'n'Tricks for scripts that I have had in the back of my head for ages (long before the Wiki appeared on the site) too.
@23fx23: I agree about the multivar module. I can't remember right now what it was, but that very same module also did the trick a while ago with a similar problem. This time I too tried different ways of using Pass/Stop/Not/Xor and whatnot without success before I found the solution.
Posted: 20 Mar 2009, 10:53
by senso
+1 for the wiki!
Posted: 20 Mar 2009, 17:58
by woodslanding
thanks bsork!!
and thanks to all for contributing to the discussion!
-e
Posted: 20 Mar 2009, 18:18
by woodslanding
okay, this is almost perfect. But, I want the switch to still have an effect when it's on--just not the effect of turning itself off!! or to be more precise:
I'd like it to turn off and then be turned back on again.
I'll see if I can get there from here.....
Posted: 21 Mar 2009, 09:02
by bsork
If you want it be turned off for a split second sending 0 followed by a 1 almost like a button in reverse, what about inserting a WaitOne somewhere?
Posted: 24 Mar 2009, 14:17
by woodslanding
I've been trying that.... but event driven programming drives me batty!
Actually, maybe I'll try scripting something....
Posted: 27 Mar 2009, 06:54
by woodslanding
Hey, I got it working. Maybe not the minimum number of modules, but it does work.
If someone can explain how to upload it, I'll put up a screenshot. Or maybe I can figure out how to put it in the library.....
thanks!
-e