Sign in to follow this  
phjvh

xml question

Recommended Posts

I have made an overlay window panel which (if activated) blackens (=overlays with a black rectangle) the gauges I want to have Off when the master battery switch is Off.And I need that because appearantly these gauges to not react to the master battery switch position properly.I would like to make a XML gauge that automatically opens/closes that new window based on the position of the master battery switch. So no manual switch, just an invisible gauge. Can somebody tell me how to make it? help is much appreciated.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,Not tested, but you could try:(A:GENERAL_PANEL_CIRCUIT_ON,bool) ! if{ X (>K:Panel_id_Open) } els{ X (>K:Panel_id_Close) }Or(A:MASTER_BATTERY,bool) ! if{ X (>K:Panel_id_Open) } els{ X (>K:Panel_id_Close) }X=your panel idHope it helps,Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Hi Jan,Bad advice ...LOLThis introduces that bl**dy "continuous event" problem.This is better ... (A:ELECTRICAL MASTER BATTERY,bool) (G:Var2) == ! (G:Var1) 10 < || if{ (G:Var1) ++ (>G:Var1) (A:ELECTRICAL MASTER BATTERY,bool) if{ "x" (>K:PANEL_ID_CLOSE) } els{ "x" (>K:PANEL_ID_OPEN) } } (A:ELECTRICAL MASTER BATTERY,bool) (>G:Var2) (During the first 10 schedules it forces the window to the correct position, to override the window status definition in the .flt file; after that only when the MasterBattery changes)Cheers, Rob

Share this post


Link to post
Share on other sites

Hi Rob,I just can't get it to work. I made everything you said I write the panel ident number in the gauge same as in the panel.cfg also in the panel.cfg it looks like this:[Window09]file=dark.bmp file_1024=dark.bmp size_mm=1280,960window_size_ratio=1.000 position=0visible=1ident=10005window_size= 1.000, 1.000window_pos= 0.000, 0.070gauge00=herbie!Battery, 0,0Now when I toggle the battery switch the main panel is closed but window09 is still open! and the main panel is:[Window00]file=B747dlx5.bmp size_mm=1280window_size_ratio=1.000 position=0visible=1ident=MAIN_PANELwindow_size= 1.000, 1.000window_pos= 0.000, 0.070 so I don't know what is wrong

Share this post


Link to post
Share on other sites

Hi,Just tested the code and it works ok for me.Maybe try another ident nr.I used 38. (A:ELECTRICAL MASTER BATTERY,bool) (G:Var2) == ! (G:Var1) 10 < || if{ (G:Var1) ++ (>G:Var1) (A:ELECTRICAL MASTER BATTERY,bool) if{ 38 (>K:PANEL_ID_CLOSE) } els{ 38 (>K:PANEL_ID_OPEN) } } (A:ELECTRICAL MASTER BATTERY,bool) (>G:Var2) Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Hi Jan,I'm stupid because I put the ident number in the xml file like this if{ "10005" (... ) and not if{ 10005 (... ). I know I have done something wrong but didn't know what.Now it is working I'm very happyThanks for the help to you all.

Share this post


Link to post
Share on other sites

Glad it works now, so the work wasn't for nothing :-)And Jan, I hope you knew about this "continuous event" problem, and what it causes ??Cheers, Rob

Share this post


Link to post
Share on other sites

Still busy cleaning up things with Doug's gauge!Jan"Beatus Ille Procul Negotiis"

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