July 29, 200718 yr >Probably the error resides there in the LeftSingle code.>G.FrancoYes, it is there. Replace "if {" with "if{" - No spaces allowed here.Tom
July 29, 200718 yr Author 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..." Jan "Beatus ille qui procul negotiis..."
July 29, 200718 yr (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
July 29, 200718 yr 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
July 29, 200718 yr Author 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..." Jan "Beatus ille qui procul negotiis..."
July 29, 200718 yr 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) }
July 29, 200718 yr Author Hi,Can you show some pictures?Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
July 29, 200718 yr (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
July 29, 200718 yr Author 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 Jan "Beatus ille qui procul negotiis..."
July 30, 200718 yr 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
July 30, 200718 yr - - - (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
July 30, 200718 yr Author Hi,Not knowing the individual bmp's, but try:(L:switch1,enum)(L:guard1,bool)Otherwise show them with their names.Jan Jan "Beatus ille qui procul negotiis..."
July 30, 200718 yr 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
July 30, 200718 yr Author 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 Jan "Beatus ille qui procul negotiis..."
Create an account or sign in to comment