Need help with 2 syntax issues...
I'm doing some XML work in Microsoft Flight Simulator, and I'm having trouble with two issues. I'm not very good at XML, just hacking my way through.
 I assign the value of a standard variable (Airspeed) to a unique variable (Aspd) for display later on.
<Value>(A:Airspeed Indicated,knots) (>L:Aspd,number)
This works just fine...the value of Airspeed is forced into Aspd. BUT...let's say I want to add some chosen value to Airspeed before I stuff it into Aspd (Say 15, just for example). So...if the actual Airspeed was 200, when I display Aspd it would show 215. Can't figure out the syntax for this.
 Flight Sim has tons of output variables that show various aircraft parameters, such as: Airspeed, Altitude, Vertical Speed, Fuel Flow, Flaps Position...hundreds of them. There are instances when I need to ADD the value of one variable to another (or SUBTRACT it from another), and assign the results to a unique variable. Let's say, for example, that my target Autopilot Altitude (A:AUTOPILOT ALTITUDE LOCK VAR,feet) is 10,000 feet, and my actual Altitude (A:PLANE ALTITUDE, feet) is 8,000 feet. How would I subtract actual from target, and assign the results to a unique variable (say, L: AltDiff)?
Thanks in advance for any help you can offer.
When you say "doing some XML work", what are you using to do the modifications?
A programming language like C#? Or something that compliments XML like XSLT?
Either way some samples from your current code base would be useful...
RE: XML and Flight Simulator??
Not sure I can answer your questions correctly, since I’m not a professional programmer, but I’ll try to be more explanatory. First of all, you’re correct…everything I do with XML involves MS Flight Simulator. Yes, we do use input and output variables that are unique to Flight Sim, such as (A:Airspeed Indicated,knots) which shows the aircraft altitude, (A:Indicated Altitude,feet) shows the altitude above sea level,
<Click Event="TOGGLE_MASTER_BATTERY"/> used to toggle the master battery off.on, etc…there are hundreds of these input/output variables. Far as I’m told, the code used to display information from the Flight Sim variables (in digital form, or to rotate a needle, or some other format, etc), or to cause some action within the aircraft (turn something on or off, set a specific value, etc)…is just plain old XML. I use Windows Notepad as an XML editor (along with my own BMP images) to create or modify an XML gauge or instrument. There are probably other editors, but this is how I was taught.Shown below is an Airspeed gauge that works in Flight Sim . (My comments are in RED).
<Gauge Name="Beech-18 Airspeed Gauge" LiewAire Virtual Airlines ">
<Image Name="B18-Airspeed-Backing.bmp" ImageSizes="158,158,0,0"/>
** Here, I'm just saying to put an ima down first (B18-Airspeed-Backing) and place everthing else below on top of that image **
<!-- Display Airspeed -->
<Position X="50" Y="50"/>
<Image Name="B18-Airspeed-Needle.bmp" PointsTo="East">
<Axis X="30" Y="4"/>
</Image> ** Here I'm telling the code which image (B18-Airspeed-Needle.bmp) to use for the needle...I'm tellit precisely where to position it (X=50 and Y=50) on the primary background image, and I'm declaring the precise AXIS (center of the needle) in pixels. **
<Value Minimum="0" Maximum="300">(A:Airspeed Indicated, knots)</Value>
</Failures> ** Airspeed gauges rely on static pressure from the PITOT TUBE mounted outside the aircraft. This code says that if the Pitot Tube is plugged with ice or other debris, set the Airspeed needle to ")" and freeze it there until the Pitot Tube is functional. **
<Item Value="0" Degrees="270"/>
<Item Value="40" Degrees="286"/>
<Item Value="80" Degrees="337"/>
<Item Value="94" Degrees="0"/>
<Item Value="105" Degrees="17"/>
<Item Value="120" Degrees="41"/>
<Item Value="151" Degrees="90"/>
<Item Value="180" Degrees="138"/>
<Item Value="209" Degrees="180"/>
<Item Value="230" Degrees="199"/>
<Item Value="248" Degrees="215"/>
<Item Value="300" Degrees="250"/>
</Element> ** Here (above) I tell it to READ a variable (A:Airspeed Indicated, knots), I'm telling it that the scale I'll use is 0-300, I'm telling it to ROTATE the needle to a specific degree based on output from the variable, and I'm telling it to rotate it slowly <DELAY...>(life-like versus instantaneous) **
Why do we need to create gauges/instruments in XML? For two reasons: One, Flight Sim does provide a list of “standard gauges/instruments, which were designed with Microsoft proprietary language and create a (.GAU) extension. Absolutely untouchable, no way to open them or modify them…you can use them exactly as they are, but that's all. Two, sometimes we need a gauge or instrument that Microsoft does not offer.
I’m attaching two images of instrument panels: One shows a a Flight Sim instrument panel for the Cessna 172, using standard Flight Sim gauges & instruments…I can use these gauges on a different panel, but they will look & perform exactly as these do. The other image is a custom instrument panel that I created for the Shorts-360B, part of our fleet (the Shorts is a third-party aircraft not offered by Flight Sim). I created every gauge and instrument for this panel using XML code and my own BMP images. With this I have total control…I can make a gauge look and perform however I wish.
I hope this clears things up a bit. If you have any further questions, please feel free to ask. If you want a complete package of all gauges/instruments for one aircraft, let me know and I’ll make it available. There’s a wide variation in functionality…some gauges just read and display a variable in digital text, some gauges make a needle rotate, some gauges “DO” something to the aircraft, such as: Raise/lower the landing gear, or the Flaps, or turn a switch on/off.
Last edited by Hack; 01-12-2011 at 01:51 PM.
Reason: Added Code Tags
Sorry, but I will not be able to help...I know nothing about MS Flight Simulator or their syntax (whether its XML or otherwise). Does MS Flight Simulator not have a forum of it's own where other people who have worked with MS Flight Simulator might be able to help!?
By Freelancer.Internet.com in forum Careers
Last Post: 08-25-2009, 10:10 PM
By shers in forum Database
Last Post: 06-17-2006, 05:01 AM
By kenn_rosie in forum .NET
Last Post: 04-09-2006, 09:28 PM
By Patrick Troughton in forum .NET
Last Post: 08-13-2002, 12:18 PM
By Dan Barclay in forum .NET
Last Post: 08-12-2002, 11:06 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL