Jump to content
Sign in to follow this  
Guest spnugent

Initializing XML gauge variables (HELP!)

Recommended Posts

Guest spnugent

I need some help with a new gauge I'm working on (FS2004). This problem should be trivial to solve, but it's driving me bonkers!I've photoshoped a cabin altitude/pressure differential gauge and created all the neccessary bitmaps. I've created the XML code for all the moving elements (rotating needle for pressure differential and rotating card to display cabin altitude). Everything works correctly when tested to display the pressure differential with respect to sealevel and the altitude. I'm confident that my movement logic is correct, I just need to send the proper to the rotating elements.Ideally, the cabin pressure will follow the Barometric pressure until 10K feet where it should stabilize. I plan on creating a separate panel for basic functions like cabin dump,pressurization, selecting cabin altitude...etc. All this just to have something extra to look at on the panel. But for now I just want the gauge to work with some default values.The problem that I'm having is that all the L and G variables that I create aren't being initialized. Here is my code...I guess the pertinent section is Cabin Pressure Management (not much going on yet). 0.1 (>L:Cabin over pressure,psi) 10.1 (>L:Cabin min pressure,psi) (A:Ambient pressure,psi) (>L:Cabin pressure,psi)Cabin Pressure (%((L:Cabin pressure,psi))%!1f!) 0.1 (>L:Cabin over pressure,psi)Over Pressure (%((L:Cabin over pressure,psi))%!f!)Barometric pressure (%((A:Barometer pressure,psi))%!f!)Cabin min pressure (%((L:Cabin min pressure,psi))%!f!) (A:Cabin pressure,psi) (L:Cabin pressure,psi) (A:Barometer pressure,psi) - Shouldn't (A:Ambient pressure,psi) (>L:Cabin pressure,psi) pop the barometric pressure onto the stack and then store it in L:Cabin Pressure? When I check the tooltips the value for L:Cabin Pressure is still zero!If I put 0.1 (>L:Cabin over pressure,psi) in the section, I can load the proper value by clicking in the appropriate Area on the gauge. I don't know XML well enough to know what I'm doing wrong (incorrect use of ? Putting these lines in the wrong place? Do I have to declare the variables before I use them?)I will greatly appreciate any help you can offer! Thanks in advance - Steve

Share this post


Link to post
Share on other sites

Hello Steve I think you need to reverse your mins & maxes :- Should be Should be RPN backwards and upside down forever!


Paul EGLD

Share this post


Link to post
Share on other sites

Hi,>> 0.1 (>L:Cabin over pressure,psi)> 10.1 (>L:Cabin min pressure,psi)> (A:Ambient pressure,psi) (>L:Cabin>pressure,psi)>>>Shouldn't (A:Ambient pressure,psi) (>L:Cabin>pressure,psi) pop the barometric pressure onto the>stack and then store it in L:Cabin Pressure? > must be used inside a tag, something like this:0.1 (>L:Cabin over pressure,psi)10.1 (>L:Cabin min pressure,psi)(A:Ambient pressure,psi) (>L:Cabin pressure,psi)Also there is no need to initialize L/GVars.Hope this helpsTom

Share this post


Link to post
Share on other sites
Guest spnugent

Thanks! I've changed the code: 1 (>L:Cabin over pressure,psi) 10.1 (>L:Cabin min pressure,psi) (A:Ambient pressure,psi) (>L:Cabin pressure,psi) The third value statment now works fine and cabin pressure is set equal to the ambient pressure but the first two are still zero! One step forward; a half step back. Anymore thoughts?Regards,Steve

Share this post


Link to post
Share on other sites

Hi, 1 (>L:Cabin over pressure,psi) 10.1 (>L:Cabin min pressure,psi) (A:Ambient pressure,psi) (>L:Cabin pressure,psi) is enoughJan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

As Jan's code shows, but with no explanation :) is that you can have one and only one section per section.Simply put all your assignments inbetween the single tag pair... ;)


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

>As Jan's code shows, but with no explanation :) is that you>can have one and only one section per >section.>>Simply put all your assignments inbetween the single >tag pair... ;)Yes, I showed a proper example but forgot to add that only one - the last in sequence - is recognized per any tag. It may be interesting to say, also, that for testing purposes it could be faster - at least for me it is - to have a set of scripts with different values to test, and cut and paste the one whose data is wanted each time into the last position, instead of deleting/replacing part of the current 's script.Tom

Share this post


Link to post
Share on other sites
Guest spnugent

Thanks for the help, that seems to clear up the problem. The gauge is now working properly.

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