July 25, 200718 yr 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
July 25, 200718 yr Author 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..." Jan "Beatus ille qui procul negotiis..."
July 26, 200718 yr - 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
July 26, 200718 yr Author 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..." Jan "Beatus ille qui procul negotiis..."
July 26, 200718 yr Author 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..." Jan "Beatus ille qui procul negotiis..."
July 27, 200718 yr (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
July 27, 200718 yr Author Hi,Is this the whole code of the gauge?Where are area and tooltip etc.?Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
July 27, 200718 yr - - - (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
July 27, 200718 yr Author 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..." Jan "Beatus ille qui procul negotiis..."
July 27, 200718 yr hi,the gauge still not working.I checked the code ,bmps,etc with no result.The gauge appears but not works.Gianfranco
July 27, 200718 yr Author 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..." Jan "Beatus ille qui procul negotiis..."
July 28, 200718 yr Author 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..." Jan "Beatus ille qui procul negotiis..."
July 28, 200718 yr - - - (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
July 28, 200718 yr Author 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..." Jan "Beatus ille qui procul negotiis..."
July 29, 200718 yr - - - (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
Create an account or sign in to comment