06-23-2016 02:45 PM
I'm trying to move two sliders at the same time under a given conditions. I have my program set up as followed:
When 1st switch is set to "Continous", all values output 4.
When 1st switch is set to "Pulse", values output based on '"Send Signal" button press based on the following conditions below:
1. Slider 1 outputs the value of slider 1 and slider 2 when the switch is set to "Simultaneous".
2. Slider 1 and slider 2 output the value of slider 1 and slider 2 when set to "Independent".
My question is based on 1 above. I basically am having a hard time trying to figure out when the condition is set to "Simultaneous" be able see slider 2 move.
Can someone help? Much would be appreciated.
NOTE: The output is correct how I want it. I just want the slider 2 to move when slider 1 moves under a certain condition.
Solved! Go to Solution.
06-23-2016 02:50 PM - edited 06-23-2016 02:53 PM
if you just want to match values, then set the value of Slider 2 using a local variable.
See below, where I also simplified your code quite a bit. You boolean input to the selector will always be True in that case, so just wire the True case. Also, why do you multiply by zero all over the place?
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-23-2016 02:59 PM
Thanks for the reply James.Morris!
The only problem with it was it looked like the value that slider was giving me the output value on the slider. I would like the slider 2 to match slider 1 in that particular case.
I also may need to adjust my code to see if that does fix it. It was just from the first look it did not work. I had originally tried a property node, but the output was showing on the slider, rather than the input. Maybe I need to make slider 2 and output in that case.
06-23-2016 03:00 PM
I also multiplied by zero all over the place to make the value only show when the button was pressed.
06-23-2016 03:17 PM
All I needed was to move the Slider 2 property node to before the the multiplcation piece.
Thanks again James.Morris for your help!!
06-23-2016 03:31 PM
Ah yes, you can't write a value to a control to match after you've altered the original value. Duh, I should have caught that.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-23-2016 03:40 PM
Yeah, All I needed to do was to move the multiplication to after the slider2 property node, and that fixed the issue. I just had to add to the multiplication piece to the false case as well.
I have attached the edit to the post if you wanted to see.
06-23-2016 03:53 PM
Be careful with code duplication. If you are always going to multiply no matter the case, put the multiplication outside of the case structure. If you are going to have a Wait for the whole loop, put the Wait function outside of all the case structures (this is the correct way to do loop timing).
These are just general pointers so you don't run in to trouble down the line. Sounds like your application works as you expect, so have fun!
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'