XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 1st, 2011, 08:39 AM
CoolGunS CoolGunS is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 2 CoolGunS User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 36 sec
Reputation Power: 0
Microsoft Flight Simulator XLM question

Hi folks,

Below is a bit of code from an XML file that defines some of the functions of a MFD (Multifunction Display) in the cockpit of a small business jet I purchased.

The section labelled "RANGE NM" is the bit that is wrong, it returns a result on the display in the cockput that is about 50% low.

The actual range remaining in nautical miles should be calculated based on the total remaining fuel in pounds, divided by the fuel flow in pounds per hour, and then multiplied by the ground speed in knots.

However I think the dude that wrote this got it wrong. The problem is I have no idea how to code in XML so I would appreciate someone point out his mistake and correct it. I can then recompile the MFD and have it display the correct value when I am flying the aircraft.

I have included another section called ENDUR, which returns a correct result.



<!-- ******* ENDUR ................... -->

<Element>
<Position X="68" Y="207"/>
<FormattedText X="56" Y="20" Font="Arial Bold" Adjust="Left" Color="Green" FontSize="18" Bright="Yes" >
<String>%((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pound per hour) / s0 flr s1 )%!02d!:%(l0 l1 - 60 *)%!02d! </String>
</FormattedText>
</Element>

<!-- ******* RANGE NM ..................... -->

<Element>
<Position X="70" Y="229"/>
<FormattedText X="36" Y="20" Font="Arial Bold" FontSize="18" Adjust="Right" Color="Green" Bright="Yes">
<String>%((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pounds per hour) (A:ENG1 FUEL FLOW PPH, pounds per hour) + / (A:GROUND VELOCITY,knots) *)%!d!</String>
</FormattedText>
</Element>

Reply With Quote
  #2  
Old August 1st, 2011, 11:29 AM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,718 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 7 h 33 m 49 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Code:
<Element>
<Position X="70" Y="229"/>
<FormattedText X="36" Y="20" Font="Arial Bold" FontSize="18" Adjust="Right" Color="Green" Bright="Yes">
<String>%((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pounds per hour) (A:ENG1 FUEL FLOW PPH, pounds per hour) + / (A:GROUND VELOCITY,knots) *)%!d!</String>
</FormattedText>
</Element>

The stuff in blue is XML. The stuff in black is not.
Code:
%((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pounds per hour) (A:ENG1 FUEL FLOW PPH, pounds per hour) + / (A:GROUND VELOCITY,knots) *)%!d!

That is what you need to edit. So long as you don't need <s, >s, or &s then you can put whatever you want in there.

As for how to edit it, it looks like a formula in RPN (X Y +). If you can give me the formula in normal infix notation (X+Y), using the right symbols and syntax, then I can rearrange it into RPN for you.


[edit] Half the value it should be? I think the second ENG1 FUEL FLOW PPH doesn't belong.
Code:
%((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pounds per hour) / (A:GROUND VELOCITY,knots) *)%!d!

Last edited by requinix : August 1st, 2011 at 11:33 AM.

Reply With Quote
  #3  
Old August 2nd, 2011, 01:34 AM
CoolGunS CoolGunS is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 2 CoolGunS User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 36 sec
Reputation Power: 0
Thankyou for your assistance. The correct code turned out to be

<String>%((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pounds per hour) / (A:GROUND VELOCITY,knots) *)%!d!</String>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Microsoft Flight Simulator XLM question

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap