Jump to content
Sign in to follow this  
phjvh

Same gauge in the same window but independent working

Recommended Posts

>Probably the error resides there in the LeftSingle code.>G.FrancoYes, it is there. Replace "if {" with "if{" - No spaces allowed here.Tom

Share this post


Link to post
Share on other sites

Hi,I see some spaces error.(1. after if no spaces.2. between code and after { or } always a space)Try again:(M:Event) 'LeftSingle' scmp 0 ==space if{space (L:guard,bool)space if{space (L:switch,enum)space1space+space(>L:switch,enum)space (L:switch,enum)space2space>spaceif{space0space(>L:switch,enum)space}space space} space} (M:Event) 'RightSingle' scmp 0 ==spaceif{space(L:guard,bool)space!space(>L:guard,bool)space} Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

(L:switch1,enum)(L:guard1,bool)Failure switches (M:Event) 'LeftSingle' scmp 0 == if{ (L:guard1,bool) if{ (L:switch1,enum) 1 + (>L:switch1,enum) (L:switch1,enum) 2 > if{ 0 (>L:switch1,enum) } } } (M:Event) 'RightSingle' scmp 0 == if{ (L:guard1,bool) ! (>L:guard1,bool) } this is the code after the last space check but the result still the same.LeftSingle click doesn't works.Gianfranco

Share this post


Link to post
Share on other sites

Hi Gianfranco,I just paid a little more attention to your code, and actually it is probably working ok; the problem is that you will never see the switch in the up or down position because you are stamping the "guarded/not guarder" bitmap over the "switch position" bitmap.As it is coded, the only possible bitmaps to see are "Cpt1FO2guard.bmp" and "Cpt1FO2notguard.bmp"; and it seems that this last one also includes the switch in the center position.A solution fo this would be to use a command in the second element, discarding the structure, like: (L:guard1,bool)And that's it.Tom

Share this post


Link to post
Share on other sites

Hi,I tested the whole gauge except with my own bitmaps and everthing is working perfect.So there must be something wrong with your bitmaps, transparancy, #000000 ??I use for the guard open and close the same size bitmaps, but when the guard is open you only see the flipped open part, the rest is transparant, so you will see the switch below.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

hi,thanks for your help.Now the bitmaps are visible but to switch up or down you have to pass always for "Cpt1FO2guard.bmp". This is my code now:(L:switch1,enum)(L:guard1,bool)Failure switch(M:Event) 'LeftSingle'scmp 0 == if{ (L:guard1,bool) if{ (L:switch1,enum) 1 + (>L:switch1,enum) (L:switch1,enum) 2 > if{ 0 (>L:switch1,enum) } } } (M:Event) 'RightSingle' scmp 0 == if{ (L:guard1,bool) ! (>L:guard1,bool) }

Share this post


Link to post
Share on other sites

Hi,Can you show some pictures?Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

(L:switch1,enum)(L:guard1,bool)Failure switch(M:Event) 'LeftSingle'scmp 0 == if{ (L:guard1,bool) if{ (L:switch1,enum) 1 + (>L:switch1,enum) (L:switch1,enum) 2 > if{ 0 (>L:switch1,enum) } } } (M:Event) 'RightSingle' scmp 0 == if{ (L:guard1,bool) ! (>L:guard1,bool) }now by this code the bitmaps are visible but:1)the switch starts with guard open and cannot be closed2)the LeftSingle click as usual is under service.Only by rightSingle one you can move the switch but you cannot close the guard.I still considering that an error resides in the LeftSingle click.Gianfranco

Share this post


Link to post
Share on other sites

Well,I think you have to show your bitmaps and after that we can test them and the code again, because in my panel, with a lot of guarded switches, everything is working perfect.see example: guard with pushbutton below.Jan"Beatus ille qui procul negotiis..."http://forums.avsim.net/user_files/175901.jpg

Share this post


Link to post
Share on other sites

Gianfranco,I think you need to understand what the code it trying to accomplish. In fact it is a matter of pure logic; XML in gauges is 99.99 % a logical scripting system, so if you don't get the logic the road becomes steeper. Now let's see some reasoning:"1)the switch starts with guard open and cannot be closed"It means that "Cpt1FO2notguard.bmp" is not the starting bitmap, but "Cpt1FO2guard.bmp" (was the other name?) is, so make the proper replacement in the second element. "2)the LeftSingle click as usual is under service.Only by rightSingle one you can move the switch but you cannot close the guard.I still considering that an error resides in the LeftSingle click."Now, if you analize 'LeftSingle' code, forgetting about spaces, etc, and you see it meets the logic, THEN if it is not working, you go to the first element involved, and it also seems to be right, THEN you go back to the 'LeftSingle' part and watch for errors in spaces, etc.And precisely, this part 'LeftSingle'scmp 0 == lacks of a space between 'LeftSingle' and 'scmp'. This error wasn't present in the previous example, that's the reason it may be difficult to detect.My point here is, I am not giving you a working code, but trying to show you a way to figure out the wrong parts so that you could learn to fix them by yourself. I hope you'll understand :-)Tom

Share this post


Link to post
Share on other sites

- - - (L:switch1,enum) - - - - (L:guard1,bool)- - Failure switch(M:Event) 'LeftSingle' scmp 0 == if{ (L:guard1,bool) if{ (L:switch1,enum) 1 + (>L:switch1,enum) (L:switch1,enum) 2 > if{ 0 (>L:switch1,enum) } } } (M:Event) 'RightSingle' scmp 0 == if{ (L:guard1,bool) ! (>L:guard1,bool) }attached there are the switch positions.until now works only the RightSingle click and the guard will be opened and closed.By the LeftSingle click it still impossible to move the switch UP and/or DOWN.G.Franco

Share this post


Link to post
Share on other sites

Hi,Not knowing the individual bmp's, but try:(L:switch1,enum)(L:guard1,bool)Otherwise show them with their names.Jan

Share this post


Link to post
Share on other sites

hi Jan,your last code works only for three positions:Guard;notguard UP and notguard DOWN.I studied this code without the rightSingle click:Gauge Name="Failure Switch" Version="1.0">(L:switch1,enum)(L:guard1,bool)Failure switch(M:Event) 'LeftSingle' scmp 0 == if{ (L:guard1,bool) if{ (L:switch1,enum) 1 + (>L:switch1,enum) (L:switch1,enum) 2 > if{ 0 (>L:switch1,enum) } } } (M:Event) 'LeftSingle' scmp 0 == if{ (L:guard1,bool) ! (>L:guard1,bool) }by this code the switch follows the correct sequence:1- switch in "Cpt1FO2guard" position2- switch in "Cpt1FO2notguard" position3- switch in "Cpt3FO2" position4- switch in "Cpt1FO2notguard" position5- switch in "Cpt1FO3" position6- switch in "Cpt1FO2notguard" position7- switch in "Cpt1FO2guard" position This is a great result until now but there's a problem left:the switch works following the"AND"logic:I have to follow and complete the whole sequence to rich the required position.I would like a switch following the "OR" logic:After the guard opening you can decide which is the position where direcly go and being free to close the guard at any moment, without to be constrained to follow the above sequence.I didn't see any tutorial or any post about a three positions guarded switch so I'm moving in a inexplored field(for a beginner)but it's a fascinating field.Thanks very much for your patience and for your precious help.I will continue to search the right "OR" logic code and if you have any idea it will be very appreciated.G.Franco

Share this post


Link to post
Share on other sites

If you want to move the switches not in sequence, make several clickspots like:L:switch1,enum) }rightmouse (L:guard1,bool) ! (L:guard1,bool)L:switch1,enum) }rightmouse (L:guard1,bool) ! (L:guard1,bool)L:switch1,enum) }rightmouse (L:guard1,bool) ! (L:guard1,bool)Now with the right mouse you open the guard and then you can click with the left on one of three postions yo operate the switch.Jan

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...