Jump to content
Sign in to follow this  
n4gix

Window 'on' at startup

Recommended Posts

Hello again Folks.I am getting the hang of my basic XML so far but I am confused as to why this is happening.At first startup and a/c selection in FS my Fuel Display popup window is showing in my MFD screen. At present I have not used an electrics 'on' function for simplicity and the toggle switch is in the 'off' position. It should only popup when I press the toggle switch for that window. There is also a Radar popup which works fine. I have checked to make that 'Visible at startup' in Panel Studio is unticked.When I select another a/c and then reselect 'my' a/c the display is blank and the window toggles on and off no problem after that.I am confused why it always shows on startup. Here's my code if someone wouldn't mind taking a look to check if I have something in the wrong sequence. (L:Fuel,bool)Fuel Stats(L:Fuel,bool) ! (>L:Fuel,bool) 90 (>K:PANEL_ID_TOGGLE)Regards...Kenny

Share this post


Link to post
Share on other sites

Hi,Try something like:(L:Startup,enum) 0 == if{ 0 (>L:Fuel,bool) 90 (>K:PANEL_ID_CLOSE) 1 (>L:Startup,enum) } (L:Fuel,bool) You can also use, to make things more clear:(L:Fuel,bool) ! if{ { 1 (>L:Fuel,bool) 90 (>K:PANEL_ID_OPEN) } els{ { 0 (>L:Fuel,bool) 90 (>K:PANEL_ID_CLOSE) } Jan

Share this post


Link to post
Share on other sites

Jan, thanks for the code.I will read up to see what the '{' brackets do. Also, if you don't mind, where do I place your new code in relation to my switch on/off bmp code ie my lines. I am assuming that the part will be a replacement section. I will try it out for myself as well because that is a good way to learn.I hope that I am making sense to you. As you know I am just beginning with XML and am still unsure of the structure.Cheers...Kenny

Share this post


Link to post
Share on other sites

Hi,Try:(L:Startup,enum) 0 == if{ 0 (>L:Fuel,bool) 90 (>K:PANEL_ID_CLOSE) 1 (>L:Startup,enum) } (L:Fuel,bool) Fuel Stats(L:Fuel,bool) ! if{ 1 (>L:Fuel,bool) 90 (>K:PANEL_ID_OPEN) } els{ 0 (>L:Fuel,bool) 90 (>K:PANEL_ID_CLOSE) } You can take anything for "Startup"; You must not have this variable elsewhere in your gauges!Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Jan, thanks for taking the time to show me this. I appreciate it.It's a bit late at night now here so I will try this tomorrow. I am finding out from you chaps that there are a lot more options for XML than what the Tutorials are showing me.I have managed to make COM and NAV radios work using mouse selection points on a knob. So I am progressing Thanks again...Kenny

Share this post


Link to post
Share on other sites

I must confess I find this puzzling, because all L:vars initialize to zero at first load.Since nothing in your original script would force the L:var to an "on" state, the popup window should NOT open.All Jan's routine is doing is forcing the L:var to be "off" as well as forcing the popup panel to be closed......but this should not be necessary... *:-*


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Bill, Jan's code looks good... The first part of the tag is the .ini of the gauge :(L:Startup,enum) 0 == if{ 0 (>L:Fuel,bool) 90 (>K:PANEL_ID_CLOSE) 1 (>L:Startup,enum) } It will set the switch to off and make sure the window is closed -- ONLY at first window load so.. The window MUST be set in the panel.cfg to Visible=1, otherwise if the window is closed at aircraft load the 1st time the switch is clicked it will show for a second then closes again, requiring 2 clicks to make work.The second part of the tag is the value for switch positions. (L:Fuel,bool) You are correct in that all vars are at zero at start, but, if the plane is loaded from a saved flight the window "could" be open and the switch is off-- out of synch.Roman


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites

>You are correct in that all vars are at zero at start, but, if>the plane is loaded from a saved flight the window "could" be>open and the switch is off-- out of synch.The OP stated with certainty that the panel.cfg switch was configured correctly. The only rational explanation is your suggestion that the a/c is being loaded from a saved flight in which that window was saved in the open condition... ;)I even agree that it is actually a good idea to have an initialization routine to force synchronization of sim vars and any user defined vars... ;)I however would make such a routine obvious by placing it in an section rather than within an section...

   					(L:B787 PFD Init,bool) 0 == if{			6 (>L:B787_PFD Scale,enum)			1 (>L:B787 GPS Map,bool)			1 (>L:B787 GPS FPL,bool)			1 (>L:B787 GPS VOR, boolean)			0 (>L:B787_Timer7,enum)			1 (>L:B787 PFD Init,bool) }		

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Hello Bill,As you know my knowledge of XML and more importantly, it's operating sequences are limited. I have made a popup window with Eric's a/c radar gauge on it. This also displays on the MFD screen via a toggle. Is it possible that the code for this toggle being in an 'off' state is prompting the L variable for the Fuel window toggle to go to an 'on' state? What I mean is, will FS recognise the L var. in different toggle switches at the same time? If one switch is toggled off will it prompt the L var. in another switch to toggle on?Here's my code for the radar window :-(L:Radar,bool)Aircraft radar(L:Radar,bool) ! (>L:Radar,bool) 80 (>K:PANEL_ID_TOGGLE)Regards...Kenny

Share this post


Link to post
Share on other sites

Hello again Folks,Yes, I am using a saved flight of my a/c parked on a ramp. I am using it all the time when I test my work. Right,I have just had a thought!! I have now reloaded my a/c which makes the MFD blank like I said earlier, then saved it. Restarted FS and the a/c loaded with a blank display.I apologise for any head scratching I have inadvertently caused. It never twigged with me regarding the effect of a saved flight. Although I see it now. OOPS.Thanks all for your efforts on my behalf. I can hear all your groans from here.Regards from a suitably self chastised Kenny.

Share this post


Link to post
Share on other sites

>What I mean is, will FS recognise the L var. in different>toggle switches at the same time? If one switch is toggled off>will it prompt the L var. in another switch to toggle on?Only if they have the same name, Kenny. All (L:var,units) will be shared across all gauges.No problem wrt to the head scratching. I've been caught with knickers around me ankles too! :)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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