3-way switch without Knobster

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

Message
Author
User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: 3-way switch without Knobster

#11 Post by Sling »

You should listen and read carefully what I wrote. If you had it would be working by now. I had it working in under 2 minutes.

Let me address your last post.
doog wrote: Sat Sep 04, 2021 9:15 pm The console error is just a missing sound file, cause i threwit together quick but it's not relevant to the discussion. Same issue without that line.
100% the reason it’s not working is the error. And yes I know the sound line also gives an error but another error is still there after the sound line is taken out. Please don’t dismiss what I say without first checking. It seems you don’t understand how to use a switch correctly. I suggest you check the wiki examples or the switch tutorials.
doog wrote: Sat Sep 04, 2021 9:15 pm The subscribe is needed to put the switch in the correct position if it’s moved in the sim and not the panel.
You think I don’t know that? I didn’t say a subscribe was not needed just not in the switch_add(). Read what I posted carefully.
doog wrote: Sat Sep 04, 2021 9:15 pm The sequence order doesn't matter.
You are correct. I did say it may because I wasn’t sure but I’ve since checked it.
doog wrote: Sat Sep 04, 2021 9:15 pm I also think in general it’s weird to force knobster focus on a switch… it’s not how switches should move in my opinion.
Well this and Keith’s point are an interesting discussion. The reason the knobster highlights a switch like this is it is 3 ways. It will highlight by default all switches of 3 ways or more because without knobster switches of 3 ways or more are treated as rotary. If it were not like this you would have to do the touch rotary finger movement to alter these switches. The solution if you don’t want it like this is to use buttons to control the switch rather than a switch_add(). It’s more code to do it like this but I guess a personal choice. For what it’s worth I do it this way because I also don’t want knobster controlling switches. If you think there is a better solution please let us know.

doog
Posts: 38
Joined: Wed Sep 18, 2019 2:52 am

Re: 3-way switch without Knobster

#12 Post by doog »

Easy tiger. I’m not seeing any other error, so not sure what you’re on about. Anyways I fixed it by using two two way switches and toggling ones visibility on and off. Just seems hacky. If you have a better way perhaps you could explain clearly or post an example.

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: 3-way switch without Knobster

#13 Post by Sling »

Apologies but support is a 2 way thing and you came across as dismissive of the suggestions. Particularly because i know what you were trying to do was incorrect. I should walk away but i will give the benefit of the doubt and try one last time.

Rather than do this which as i said before is incorrect.

Code: Select all

switch_inverter = switch_add("silver_switch_off.png", "silver_up2.png", "silver_down2.png", 40,35,25,65,inverter_callback,callback_switch_inverter)
Do this and it all works. A very easy fix just like i tried to convey.

Code: Select all

switch_inverter = switch_add("silver_switch_off.png", "silver_up2.png", "silver_down2.png", 40,35,25,65,callback_switch_inverter)

User avatar
Ralph
Posts: 7867
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: 3-way switch without Knobster

#14 Post by Ralph »

Not receiving errors doesn't necessarily mean that there are no errors. I can understand why Tony got a bit upset, because you entirely ignored suggestions.

Post Reply