October 11, 201015 yr Below is some code for the sound of aircon.The switch positions are down(off) and up(on)When I click to turn the switch on(up) there is no aircon sound. When I subsequently click the switch off(down)the aircon sound is initiated until I then click the switch on(up). Consequently the switchis operating in reverse order.Could someonw have a look at the code and suggest a correction.Many thanks.vololiberista <Gauge Name="Aircon switch" Version="1.0"> <Element> <Select> <Value>(G:Var1)</Value> <Case Value="0"> <Image Name="OH_SWITCH_2_OFF.bmp" ImageSizes="33,58"/> </Case> <Case Value="1"> <Image Name="OH_SWITCH_2_ON.bmp" ImageSizes="33,58"/> </Case> </Select> </Element> <Mouse> <Tooltip>Aircon Switch</Tooltip> <Cursor Type="Hand"/><Click>(G:Var1) 0 != if{ 0 (>G:Var1) 1 (>L:Sound_button,enum) 2 (>L:Sound_aircon,enum) } els{ 1 (>G:Var1) 1 (>L:Sound_button,enum) 0 (>L:Sound_aircon,enum) }</Click> </Mouse></Gauge> Super VC10 into LOWI with PF3 at a cinema near you https://www.youtube.com/watch?v=298UDyNmgUA
October 11, 201015 yr Hi,Not tested, try:<Click>(G:Var1) 0 == if{ 1 (>G:Var1) 2 (>L:Sound_aircon,enum) } els{ 0 (>G:Var1) 0 (>L:Sound_aircon,enum) } 1 (>L:Sound_button,enum) </Click> Jan Jan "Beatus ille qui procul negotiis..."
October 11, 201015 yr Moderator ...or, simply swap the on and off image assignments... :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
October 11, 201015 yr Hi,But then, I think, the switch will always be on at startup and the airco sound off, unless you add an init in where the sound is set to 2.Again, not tested.Jan Jan "Beatus ille qui procul negotiis..."
October 11, 201015 yr Author Many thanks phjvh your code works fine.But n4gix yours had no effect :-(thanks to both.vololiberista Super VC10 into LOWI with PF3 at a cinema near you https://www.youtube.com/watch?v=298UDyNmgUA
October 12, 201015 yr Moderator But n4gix yours had no effect :-(thanks to both.vololiberistaLike Jan, I too have a name: Bill. That's why I sign my posts... :)Funny that it didn't work: <Case Value="0"> <Image Name="OH_SWITCH_2_ON.bmp" ImageSizes="33,58"/> </Case> <Case Value="1"> <Image Name="OH_SWITCH_2_OFF.bmp" ImageSizes="33,58"/> </Case> This should have simply synchronized your switch image with the sound file... :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
October 12, 201015 yr Author Thanks to "Jan" and "Bill" :-)Just swapping the switch assignments with the code as it was didn't work. Even though one would expect it to do so!!!!The only annomaly now is that the sound momentarily stops/pauses when I select other panels from within the main panel. The dsd_xml_sound3 ini file is on the main panel window00 but the switch is located on the overhead. Whenever I select any panel such as ohd, radio, etc (whilst still having the main visible) after switching on the sound, the sound as previously stated montarily pauses. Is this an anomaly related to xml? Or can it be cured?vololiberista Super VC10 into LOWI with PF3 at a cinema near you https://www.youtube.com/watch?v=298UDyNmgUA
October 12, 201015 yr Try loading the sound gauge in a VC entry in the panel.cfg. VC entries load no matter if the VC is used, it may take care of it.Roman FS RTWR SHRS F-111 JoinFS Little Navmap
October 19, 201015 yr Another tip, although not relevant wrt. to your question:If you use variables that should retain their value overtime (like you use G:Var1 now), in general try to avoid using G:Vars but use your own defined L:Vars instead.Because under some circumstances (like reloading a panel in FS9 after editting a gauge, or changing from FullScreenMode to WindowedMode v.v.) G:Vars are reset to 0.Which usually isn't what you want/expect :( Cheers, Rob
Create an account or sign in to comment