Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Initializing XML gauge variables (HELP!)

Featured Replies

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

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

Paul EGLD

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

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

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

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Moderator

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

>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

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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.