The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> XML Programming
|
Microsoft Flight Simulator XLM question
Discuss Microsoft Flight Simulator XLM question in the XML Programming forum on Dev Shed. Microsoft Flight Simulator XLM question XML Programming forum discussing XML and related technologies, including XUL and XSL. XML is a self-describing file format, designed for maximum compatibility between applications.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

August 1st, 2011, 08:39 AM
|
|
Registered User
|
|
Join Date: Aug 2011
Posts: 2
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>
|

August 1st, 2011, 11:29 AM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
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.
|

August 2nd, 2011, 01:34 AM
|
|
Registered User
|
|
Join Date: Aug 2011
Posts: 2
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>
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|