Jump to content
Sign in to follow this  
phjvh

Same gauge in the same window but independent working

Recommended Posts

hi,If four same switches are installed in the same window how it's possible to get their work independent?I renamed all in different way but the behaviour still the same. Now if I operate a switch all other together move in the same manner.Thanks G.Franco

Share this post


Link to post
Share on other sites

Hi,The LVar's must be different.So:Position 1...(L:switch 1,bool)...Position 2...(L:switch 2,bool)...etc.Area 1...(L:switch 1,bool) ! (>L:switch 1,bool)...Area 2...(L:switch 2,bool) ! (>L:switch 2,bool)...etc.If this is what you mean, i hope it helps,Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

- Size X="166" Y="45" - - (L:switch 1,bool) - - - - (L:switch 2,bool) - - - - (L:switch 3,bool) - - - - (L:switch 4,bool) - - - - - Failure switches Area left="5" Top="0" Width="5" Height="45"/> (L:switch 1,bool) ! (>L:switch 1,bool) ! (>L:switch 1,bool) ! (>L:switch 1,bool) Area left="5" Top="0" Width="5" Height="45"/> (L:switch 2,bool) ! (>L:switch 2,bool) ! (>L:switch 2,bool) ! (>L:switch 2,bool) Area left="5" Top="0" Width="5" Height="45"/> (L:switch 3,bool) ! (>L:switch 3,bool) ! (>L:switch 3,bool) ! (>L:switch 3,bool) Area left="5" Top="0" Width="5" Height="45"/> (L:switch 4,bool) ! (>L:switch 4,bool) ! (>L:switch 4,bool) ! (>L:switch 4,bool)the difference is that for all the intended switches 4.bmps are neededand at each click all those event will be carried out:1)the switch appear guarded2)the switch guard will be opened and the switch is centered3)the switch will be operated up4)the switch will be operated to center 5)the switch will be operated down6)the switch will be operated to center7)the guard will be closedI choise always gauges without any tutorial.Cheers Gianfranco

Share this post


Link to post
Share on other sites

Hi,That code will not work.Do you want to have the guarded switch in one clickspot with your sequence of events?Then try something like (first switch):(L:switch 1,enum)Failure switches(L:switch 1,enum) 1 + (>L:switch 1,enum) (L:switch 1,enum) 6 == if{ 0 (>L:switch 1,enum) } Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Btw.I do it this way:(L:switch,enum)(L:guard,bool)(M:Event) 'LeftSingle' scmp 0 == if{ (L:guard,bool) if{ (L:switch,enum) 1 + (>L:switch,enum) (L:switch,enum) 2 == if{ 0 (>L:switch,enum) } } } (M:Event) 'RightSingle' scmp 0 == if{ (L:guard,bool) ! (>L:guard,bool) } Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

(L:switch,enum)(L:guard,bool)(M:Event) 'LeftSingle'scmp 0 == if{ (L:guard,bool) if{ (L:switch,enum) 1 + (>L:switch,enum) (L:switch,enum) 2 == if{ 0 (>L:switch,enum)}}} (M:Event) 'RightSingle' scmp 0 == if{ (L:guard,bool) ! (>L:guard,bool)}the switch appears but doesn't move.I think because in your examplethe same .bmp has been called by two different names:first time :switch center.bmpsecond time:guard open.bmpanyway I called it by same name but the switch cannot be moved and the Click Hand doesn't even appear.Check the code I'm using please and if you find same error it will be very appreciated all your suggestions.cheers Gianfranco

Share this post


Link to post
Share on other sites

Hi,Is this the whole code of the gauge?Where are area and tooltip etc.?Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

- - - (L:switch,enum) - - - - - (L:guard,bool) - - - Failure switches(M:Event) 'LeftSingle'scmp 0 == if{ (L:guard,bool) if{ (L:switch,enum) 1 + (>L:switch,enum) (L:switch,enum) 2 == if{ 0 (>L:switch,enum)}}} (M:Event) 'RightSingle' scmp 0 == if{ (L:guard,bool) ! (>L:guard,bool)}(M:Event) 'LeftSingle'scmp 0 == if{ (L:guard,bool) if{ (L:switch,enum) 1 + (>L:switch,enum) (L:switch,enum) 2 == if{ 0 (>L:switch,enum)}}} (M:Event) 'RightSingle' scmp 0 == if{ (L:guard,bool) ! (>L:guard,bool)}here the complete code but still not working.I think I made a little confusion with "LeftSingle + RightSingle"Cheers Gianfranco

Share this post


Link to post
Share on other sites

Hi,Try:(L:switch,enum)(L:guard,bool)Failure switches(M:Event) 'LeftSingle' scmp 0 == if{ (L:guard,bool) if{ (L:switch,enum) 1 + (>L:switch,enum) (L:switch,enum) 2 == if{ 0 (>L:switch,enum) } } } (M:Event) 'RightSingle' scmp 0 == if{ (L:guard,bool) ! (>L:guard,bool) } Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Well,That is strange, because it is working without any problems in my panel.Give the whole code again.NB. watch the spaces!Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Btw,Stupid question, do you use the right mouse button too?Open the guard with the right mouse-button and operate the switch with the left-mouse button.As another example here the code of one of my other switches:....(L:altn gear,bool) (L:capt instr bus AC volts,number) 100 > if{ (L:panellights, bool) } 2 * +(L:altn gear guard,bool) (L:capt instr bus AC volts,number) 100 > if{ (L:panellights, bool) } 2 * +....AltnGear(M:Event) 'LeftSingle' scmp 0 == if{ (L:altn gear guard,bool) if{ (L:altn gear,bool) ! (>L:altn gear,bool) (>K:GEAR_PUMP) 1 (>L:switch,number) } } (M:Event) 'RightSingle' scmp 0 == if{ (L:altn gear guard,bool) ! (>L:altn gear guard,bool) 1 (>L:guard,number) } Study and replace with your bmp's and L:Var'sHope it helps,Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

- - - (L:switch,enum) - - - - - (L:guard,bool) - - - - Failure switches(M:Event) 'LeftSingle' scmp 0 == if{(L:guard,bool) if{ (L:switch,enum) 1 + (>L:switch,enum) (L:switch,enum) 2 == if{ 0 (>L:switch,enum) } } } (M:Event) 'RightSingle' scmp 0 == if{ (L:guard,bool) ! (>L:guard,bool) }Now adjusting some spaces the rightSingle click is working and the guard opens and closes.The leftSingle click doesn't produce any event and the switch remains centered.Gianfranco

Share this post


Link to post
Share on other sites

Hi,I think this is the solution, I use L:init, which automatically sets the switch to 0 at startup of the sim.So try to use:Failure switches(M:Event) 'LeftSingle' scmp 0 == if{ (L:guard,bool) if{ (L:switch,enum) 1 + (>L:switch,enum) (L:switch,enum) 2 > if{ 0 (>L:switch,enum) } } } (M:Event) 'RightSingle' scmp 0 == if{ (L:guard,bool) ! (>L:guard,bool) } or make an init, like:(L:init,enum) 0 ==if{ 0 (>L:switch,enum) 1 (>L:init,enum) } Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

- - - (L:switch,enum) - - - - - (L:guard,bool) - - - - Failure switches(M:Event) 'LeftSingle' scmp 0 == if {(L:guard,bool) if {(L:switch,enum) 1 + (>L:switch,enum) (L:switch,enum) 2 > if { 0 (>L:switch,enum) }}} (M:Event) 'RightSingle' scmp 0 == if{ (L:guard,bool) ! (>L:guard,bool) }Tryied also with Init value but the LeftSingle click doesn't work.In the LeftSingle code you changed:(L:switch,enum) 2 ==to (L:switch,enum) 2 >but anyway it still not working in both cases.Probably the error resides there in the LeftSingle code.G.Franco

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...