(inSky)

 找回密码
 立即加入

QQ登录

只需一步,快速开始

查看: 5747|回复: 12

飞机面板设计教程(共十讲)

[复制链接]
发表于 2009-3-6 11:30:08 | 显示全部楼层 |阅读模式
以前在国外网站看到的贴出来大家学习,对于开发制作很有帮助。


Lesson One:  Introduction
Who's This Tutorial For?
If you've ever wanted to change or rearrange instruments on a Flight Simulator instrument panel, and the only thing stopping you from doing it is that you don't know how, then this tutorial is for you.


What Does It Do?
When learning how do do something new, many people like to have it explained to them in general terms first, along with some examples. After that some like to go through it step-by-step. And that's what this tutorial does. In each lesson you'll get a general explanation along with some examples. After you've read through the lesson you'll go to the workbook that accompanies this tutorial and do some step-by-step exercises to get some practical experience doing the work.


What Design Tools Do You Need?
Making a good instrument panel (meaning one that you like) is actually very simple. The only design tool you'll really need is a good text editor. You don't need to go out and buy one, though. Microsoft's Windows™ operating system comes with Notepad, a text editor that works just fine for doing what you'll need to do in this tutorial.


What's Included in This Tutorial's Zip File?
(1) This HTML tutorial and its support files. (2) A workbook with exercises on how to change the appearance of a Flight Simulator instrument panel.


What's in the Workbook?
Exercise 1.0  Windows Tools For Panel Design
  1.1  Using Windows Explorer
     1.1.1  Finding file folders.
     1.1.2  Creating, copying, moving, deleting folders.
     1.1.3  Searching for text in a file.
     Checkride.

  1.2  Using Windows Notepad
     1.2.1  Setting up Notepad.
     1.2.2  Editing files.
     Checkride.
Exercise 2.0  The Basics
  2.1  Cloning the Extra 300S.
     2.1.1  Cloning the Extra 300S.
     2.1.2  Configuring the clone as the Extra 300XP.
     Checkride.   2.2  Creating two virtual aircraft.
     2.2.1  Create the first virtual Extra 300XP.
     2.2.2  Create the second virtual Extra 300XP.
     2.2.3  Create panel folders for the virtual aircraft.
     Checkride. Exercise 3.0  What's in a PANEL Folder
  3.1  Reviewing the contents of your PANEL folder.
     (no checkride required). Exercise 4.0  Understanding the PANEL.CFG File
  4.1  White space and delimiters
     4.1.1  Create a file header.
     4.1.2  Add white space and comments.
     4.1.3  Make some temporary changes to your file.
     Checkride. Exercise 5.0  Understanding .GAU Gauge Files
  5.1  Reviewing the contents of your GAUGES folder.
     Checkride. Exercise 6.0 Panels and Views
  6.1  Putting gauges on a panel.
     6.1.1  Setting up your panel configuration file.
     6.1.2  Adding a set of switches to the panel.
     6.1.3  Flight testing your new gauge entry.
     Checkride.   6.2  Using an alias.
     6.2.1  Disabling your current panel configuration file.
     6.2.2  Writing a new panel configuration file.
     6.2.3  Flight testing your aliased panel.
     6.2.4  Restoring your original panel configuration file.
     Checkride. Exercise 7.0 Panels and Gauges in CFS and Add-On Aircraft
  7.1  Organizing your GAUGES folder.
     7.1.1 (Option A): Setting up a new folder in your GAUGES folder.
     7.1.1 (Option B): Setting up two new folders in your GAUGES folder.
     7.1.2  Selecting a gauge to put in your SWITCHES folder.
     7.1.3  Writing a path statement in your PANEL.CFG file.
     7.1.4  Flight test your path statement.
     Checkride. Exercise 8.0  Using Windows Paint on Bitmap Files
  8.1  Using Windows Paint on Bitmap Files.
     8.1.1  Opening Paint and support files.
     8.1.2  Setting up Paint.
     8.1.3  Positioning a guague on a panel.
     8.1.4  Adding to and painting a panel.
     Checkride. Exercise 9.0  Creating Kneeboard Files
  9.1  Flight Simulator 92      9.1.1  Create a file header.
     9.1.2  Add a new checklist.
     9.1.3   Saving and closing the file.
     Checkride.   9.2  Flight Simulator 2000, 2002
     9.2.1  Write flight plan notes.
     Checkride. Exercise 10.0  Understanding XML Gauges
  10.1  The Boeing 747-400's Gauge Cabinet File
     10.1.1  Find and open the 747's gauge cabinet file.
     10.1.2  Create some folders in GAUGES.
     10.1.3  Select and decompress (extract) the 747's standby altimeter.
     Checkride.   10.2  Creating and Using an XML Single-Gauge Cabinet File
     10.2.1nbsp; Using the DOS utility cabdir.exe..
     10.2.2nbsp; Writing and using a DOS batch file.
     10.2.3nbsp; Installing and flight testing your XML gauge.
     Checkride.   10.3  Turning the Standby Altimeter into a Radar Altimeter
     10.3.1  Editing the standby altimeter's XML document.
     10.3.2  Making a cabinet file for your radar altimeter.
     10.3.3  Installing and flight testing your new XML gauge.
     Checkride.



[ 本帖最后由 ColdFront 于 2009-3-6 12:05 编辑 ]
回复

使用道具 举报

 楼主| 发表于 2009-3-6 11:30:55 | 显示全部楼层
Lesson Two: The Basics
What\'s in Your Design Toolbox
Everything you need to modify an instrument panel is in your Microsoft Flight Simulator and Windows programs. You\'ll use Windows Explorer to select Flight Simulator folders and subfolders for the aircraft and instrument panels you want to change. You\'ll use Microsoft\'s Notepad text editor (a Windows accessory program) to change the text in your Flight Simulator configuration files. You\'ll use Microsoft\'s Paint (another Windows accessory program) to change the shape and color of instrument panels, use it to correct flaws and defects in existing panels, and use it to create new panel details. And you\'ll use your Flight Simulator program to check out the design changes you\'re making, to check for errors, omissions, and how to improve your design.

Other \'Nice to Have\' Tools
There are some very useful \'nice to have\' tools that you\'ll want to consider having at hand when you\'re moving or changing instruments on a panel, or doing some clean up work on the changes you\'ve made.  Some of these nice to have tools are:
Pencil and paperHaving something to write on and something to write with while you\'re making changes to a instrument panel can almost be \'required\' tools. Pencils, pens, lined paper will help you keep your work organized. And if you\'re really meticulous and engineering-minded you\'ll want to have a pad of quad-ruled (gridded) paper to use for sketching out a panel that you want to design or modify. Three-holed punched ruled paper for 3-ring binders is also handy for keeping notes on what instruments you\'re using, what folder or subfolder you got them from, and what they are or do. Changing the size of gauges, switches or other panel items is something that you\'re going to be doing regularly when you\'re working with instrument panels, so keeping a notepad or notebook that you can refer back to on basic gauge measurements and what size you\'ve scaled them up to (or down to) will come in handy. You\'ll find that keeping some kind of scratchpand and writing tool close by is going to be necessary to keep track of what you\'re doing in your design work.


Flexible plastic rulerA flexible, transparent combination inch/centimeter ruler helps when you want to take gauge or panel measurements directly off your display screen. If you use an inch ruler you\'ll find that a ruler with decimal inches (like a triangular drafting ruler) will be much more useful than a standard inch ruler.


DividersDrafting dividers (the kind with a point at the tip of each leg) are useful when you want to take accurate gauge or panel measurements directly off your display screen. Instead of trying to get an accurate measurement by holding a plastic ruler against your display, you can set the dividers to the width or height of the gauge you\'re measuring, then use a ruler to get the distance in decimal inches or millimeters between the divider\'s points. This will improve the precision to your measurements.


CalculatorThere can be some arithmetic involved when you\'re designing instrument panels and adding gauges. It\'s not hard stuff, though. While you can use your pencil and paper to do the arithmetic, having an inexpensive four-function (add, subtract, multiply, divide) calculator around can come in handy. If you don\'t already have a calculator like that, you don\'t need to go out and buy one. There\'s a good calculator that\'s included as an accessory with your Windows operating system.


What You Need to Know Before You Start
In addition to Flight Simulator, the two essential Microsoft Windows progams you\'ll need to know how to use (and how to use well) are Windows Explorer and Windows Notepad. If you already know how to use these two programs, that\'s fine. But if you don\'t know how to use them (or you\'re not confident when you use them), then you should get some practice using them before you start doing the workbook exercises. You\'ll also need to know how to run Flight Simulator and other programs simultaneously and switch between them. Here\'s what you\'ll need to know:


MultitaskingOne of the core features of Microsoft\'s Windows™ operating system is it\'s ability to run many programs at the same time. Called \'multi-tasking\', this feature lets you run use a program while you have other programs running in the background at the same time. There are different ways of switching back and forth the program that you\'ve got running in the foreground to one that\'s running in the background. A fast and convenient way to do this is to use the Alt, Tab key combination. When you want to switch from the program that you\'ve got running in the foreground you hold down the Alt key and press the Tab key to show the icons for all the programs you\'ve got running. You press the Tab key to cycle through the programs to the one you want to bring to the foreground. Whether you use the Alt, Tab key combination or something else, you\'ll need to be able to multitask quickly and easily.


Windows ExplorerYou\'ll need to know how to find, open, and close the foldes and subfolders in your Flight Simulator folder. You\'ll also have to know how to use the program to copy folders and files, rename them, and move or copy them to new locations.


Windows NotepadYou\'ll need to know how to open a file, move around in it, make changes to the text, save your work, close the file, and rename it if necessary. You\'ll need to know how to use your pull-down menu options, to right-click your mouse (or use keyboard or pull-down menu commands) to highlight, cut, copy, and paste text in a file.

If you\'re familiar with Windows Wordpad (or some other word processor program) don\'t use it here. When working with configuration files it\'s a lot safer to use Microsoft\'s Notepad because Notepad is strictly an ASCII text editor. It won\'t turn your configuration files into garbage, which could happen if you used a word processor instead of an ASCII text editor.

Configuration File Basics
In the workbook excercises you\'ll be editing the panel configuration file of a clone of Flight Simulator\'s Extra 300S aircraft. The data in this aircraft\'s panel configuration file (PANEL.CFG) is read and stored by Flight Simulator\'s core program (also called the \'simulator engine\') whenever you select the aircraft from Flight Simulator\'s list of available aircraft. Although configuration files are data sources, not programs, there are some programming concepts and conventions that you should know about. In the following paragraphs you\'re going to learn a wee bit about computer programming. It\'s just a wee bit, nothing to get alarmed about.


ParsingWhen Flight Simulator reads an aircraft\'s configuration files it uses an internal subroutine called a \'parser\'. Flight Simulator\'s parser does is something like what you do when you read the contents of a web page, a newspaper, or an article in a magazine. When you read you quickly put together words, phrases and sentences to understand what you\'re reading. A parser can\'t do that. Parsers have to laboriously read text character by character, just like you used to do back when you were a little kid in school just learning to read. Parsers are told to look for certain characters and character combinations. And it can\'t jump around in a file like you can. So when Flight Simulator\'s parser starts reading a configuration file it goes to the beginning of the file and starts reading the file\'s contents character by character. It continues doing this and won\'t quit until it reads a character that tells it that it\'s reached the end of the file and for it to go away and do something else.

Like you, parsers make decisions based on what they read in their files. However, the parser\'s decision-making abilities are a whole lot more limited than yours. All a configuration file parser can do is detemine when it\'s found significant data in a file, and to pass that data on to the simulator engine. It does this by looking for specific ASCII characters (called delimiters) as it reads a file. A delimiter is a signal that alerts the parser that a significant stream of data is either coming, or has stopped. For example, the two delimiters [ and ] tells the parser that the stream of characters between the two delimiters is a section name.

The parser goes to the beginning of the configuration file and continues through the file character by character, line by line, until it reaches an \'end-of-file\' (EOF) code. What the parser looks for are delimiters and the data stream between the delimiters. A section name tells the simulator engine what type of data is in the section. Section labels follow a specific order in a configuration file. If the order isn\'t correct then the file is tagged as bad or corrupt and the aircraft won\'t be displayed.

Configuration Files in General
There are four types of configuration (.CFG) files in Flight Simulator that you should know something about because you may be working with all four of them at one time or another after you complete this tutorial. The four types of configuration files are aircraft, model, panel, and sound. All flyable aircraft will have all four of these files in their aircraft\'s folders. You may also have occasion to work with the startup configuration file for your version of Flight Simulator. This file is located in Flight Simulator\'s root folder. For Flight Simulator 2004 you may have to use a Windows search feature to locate this file (search for FS9.CFG) if it\'s not in Flight Simulator\'s root folder.


Section namesA configuration file is a series of sections that have specific types of data in them. Section names identify the various sections in a configuration file. What a parser does with a configuration file is basically read the file section by section and extract the data that\'s in them.


DelimitersDelimiters are special characters that separate the data items in a line of data in a section. The delimiter that separates data elements in a line of data is a comma. Delimiters for the file componesnts of a data element are either the forward or backward slash mark to delimit a folder or subdirectory, the exclamation point to declare the filename of a compiled multiple gauge file. The period is used in single gauge files as a file naming convention to associate the gauge with a particular type of aircraft.


White SpaceWhite space is the empty space around characters usually created with the tab key and space bar.

CommentsA comment is a line of text in the file that the parser can ignore and isn\'t supposed to act upon.


File path notationWhen parsing a line of data that points to a file location (e.g., a gauge file), the parser recognizes both the forward and backward slash as a directory/folder separator in a file path statement.

回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-6 11:31:33 | 显示全部楼层
Lesson Three:  What\'s in the PANEL FolderWhat\'s in the Panel Folder?
The files in an aircraft\'s PANEL folder are the ones that are used to create your views of the aircraft\'s instrument panels and subpanels. The folder also has files for the other views that you see from the cockpit, like views in and around the interior of your aircraft.

In the PANEL folder you have the aircraft\'s panel configuration file. This is the file that you\'ll work with when you want to add, replace, or otherwise change the flight instruments, gauges, switches and other instrument panel elements in your aircraft. It\'s also the file you\'ll work with if you want to add additional views, or change existing ones.

The PANEL folder also has all the bitmap graphics files that make up the cockpit and instrument panel views that you see when you fly and aircraft.
The Panel Configuration File
The instrument panel configuration file, PANEL.CFG, is the file that creates Flight Simulator\'s cockpit view windows. These views are the main instrument panel, subpanels, and views of the aircraft\'s interior. All of these views are windows that are superimposed on the default (exterior) view. In Flight Simulator 2002 and subsequent releases the file is also used to create instrument panel views used in the virtual cockpit view mode.

Panel configuration files are unformatted ASCII (American Standard Code for Information Interchange) text files. What this means is that (a) the file is a document, (b) it\'s a document that only uses the ASCII character set, and (c) the document doesn\'t have bold, italic, or underlined characters.

As a panel designer, this is your file. You can change what\'s in it, add more stuff to it, do what you like with it to create or customize your cockpit views.
Bitmap Files
The bitmap (.BMP) graphics files you see in the PANEL folder are what determine what you\'ll see superimposed on the outside (default) view as you look around your aircraft\'s cockpit.

You\'ll always have at least one bitmap file, the bitmap graphic for your forward view. That bitmap will be your aircraft\'s instrument panel and windshield graphic. It\'s a blank panel, in the sense that there are no gauges or other operating elements on it. It\'s a file you\'ll learn how to modify (if you\'ve a mind to) or can replace with a panel bitmap from another aircraft.

You might find some other bitmaps in your aircraft\'s PANEL folder besides your main instrument panel bitmap. Some common bitmaps are subpanels used for radio stacks and GPS displays. You might find other bitmaps for control yokes and other flight controls, and bitmap graphics of interior structures like seats, windshield frames, bulkheads, and passenger compartments.

In Lesson Eight of this tutorial you see how you can use the Windows accessory program Paint to change the look of your instrument panel. Once you learn how to use Paint you\'ll be surprised how easy it is to make changes to an instrument panel, or even make a customized instrument panel for an aircraft.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-6 11:32:59 | 显示全部楼层
Lesson Four: Understanding the PANEL.CFG File
Background
Flight Simulator\'s PANEL.CFG file is a special purpose document called a configuration file.  Configuration files are used everwhere in computer games, programs, and other home and businesss software products.  They store information used to set up programs to some predetermined state or condition.   When a program ends, changes made to the program\'s configuration while the program was running are often written into the program\'s startup configuration file.

For example, when you select an aircraft to fly in Flight Simulator, the program uses information in your selected aircraft\'s PANEL.CFG file to set up the instrument panel and views from inside the aircraft.  If you happen to change the default airport while you were running the program, that change will be written into your Flight Simulator version\'s startup configuration file (e.g. FLTSIM98.CFG, FS9.CFG, etc.)
File Format
Panel configuration files are documents. A panel configuration file is a page of instructions in a document that your Flight Simulator program reads to set up the instrument panels of aircraft you want to fly.

Like other documents, configuration files have paragraphs, paragraph headings, and sentences. Like legal papers and other types of specialized documents, configuration files have their own special format and grammar rules. Paragraph headings are called section names, paragraphs are called sections, and sentences in the paragraphs are called entries.

From a programmer\'s point of view, configuration files are text files that use only ASCII (American Standard Code for Information Interchange) characters. ASCII characters are all the printable characters you see on your computer keyboard, plus the space and tab keys.  The text in a configuration file is arranged in a series of orderly rows of ASCII characters called strings. The end of every string is marked by an end-of-line(EOL) code generated when the Enter key is pressed. A string can have one or more ASCII characters, or none at all (called a null string).  Every time you select a new aircraft to fly, Flight Simulator uses functions in your Windows operating system to read the strings in that aircraft\'s panel configuration file.
Grammar Rules for Section Names and Entries
The grammar rules for section names and entries is called a protocol or syntax. The syntax for section names is that they must (a) always be enclosed in square brackets, and (b) be valid names recognized by Flight Simulator. Other syntax rules for section names is that spaces are ignored, and any text following the right bracket of a section name is treated as a comment. The following are the valid section names for Flight Simulator 98 and Flight Simulator 2000 ):

[Window Titles]  [Window]   [Fixed Window]   [Views]    [8 Bit Colors]   [Default View][size=+0]
Three new section names were added to the list of valid section names with the release of Flight Simulator 2002 and subsequent versions. The additional sections names are:

[[VCockpit]]  [Color]   [Strings]
An entry has two parts, a key name and a key value.  A key name is sometimes called a keyword or variable.  If a key value has only one value, the value is often called a parameter.  If a key value has more than one value (as it often does), the values are usually called a parameter list.

The syntax for an entry is determined by the entry\'s key name.  A key name identifies some Flight Simulator item or function, like a gauge or the position of a view window. The syntax for key names is that they must (a) be names recognized by Flight Simulator, and (b) have an equal (=) sign as the last character. Some examples of valid entries are: [Window01](first row)gauge12= IMPORT/CFS1/Bf109E!Airspeed,190,429,75gauge13= Bell_206B.Clock,228,370,54gauge14= IMPORT/ARMY/SuperKingAir_Airspeed,270,377,87(second row)gauge21= Cessna!Tachometer, 273,475,75gauge22= Cessna_182.Directional_gyro,355,469,90[window06]file= NAS Pensacola runways.bmpwindowsize_ratio= 1.10ident= NAS Pensacola[window07]file= Doreen pix.bmpwindowsize_ratio= 0.100position= 8 (lower right)ident= my sweetheart[Fixed window11]file= Startup checklist.bmpvisible= 0  (overlayed on default view when selected)/visible= 1  /nomenu= 1nomenu= 0  (will be on the instrument panel list)render_3d_window= 1window_pos= 0.25, 0.25window_size= 0.50, 0.50ident= 11You can only use a key name once in a section, but you can use the same key name again in other sections of the file.   For example, you can use the key name gauge00= in several different sections, and can use the same or different key values if you\'d like.

An entry\'s key name determines the syntax for its key value.  Key values can have one or more parameters, or none at all (called a null value). When key values have more than one parameter the parameters must be listed in the order specified by the key value\'s syntax, and they must be separated by commas. The parameters for key values must be data types (integers, decimal values, characters, etc.) related to the key value\'s function.

A key value might have a mix of required and optional parameters.  You have to give values to required parameters, but not to optional parameters. If you don\'t give a value to an optional parameter then the parameter\'s default value will automatically be used.  If you want to list all of the parameters of a key value that has default parameters you can use a blank (called a null) or a space to indicate where a default parameter is being used.
File Order of Sections and Entries
Section names don\'t have to be listed in any particular order.  The only exception is that the [Window Titles] section has to be the first section in the file. If any other section name comes before this one a file error will be flagged when the aircraft is selected.  The [Default View] section and at least one [Window] section also always have to be included in the file.  All the remaining section names are optional; only the sections that are actually being used need to be listed.

Although section names don\'t have to be listed in any particular order, it\'s a good practice to do so. If you get into modifying a lot of configuration files it\'ll be a lot easier for you to find the section name you\'re looking for if you follow a consistent system to list the sections in your files.
What\'s in Each of These Sections
Each of the sections in a panel configuration file have a specific function or purpose.


[Window Titles]You use this section to (1) specify the window that you want to be visible when you select and aircraft, and (2) give identifying titles to your [Window] and [Fixed Window]. These are the titles listed when you click on the Views → Instrument Panel main menu option.  Flight Simulator automatically makes the first window in the list visible when you select an aircraft.

The key values in this section are literal strings, that is, all characters in the string (including tabs and spaces) are included in the key value and will be listed.  Here\'s an example of some valid entries for this section:
[Window Titles]Window01= front seat (IFR panel)Window02= FS95 Chicago sectional eastWindow03= FS2K Chicago sectional eastWindow04= Maryland airmap Dover AFB sectionWindow05= US/DOT Airport-Facilities Directory, Pensacola dataWindow06= NAS Pensacola (from Pensacola street map)Window07= my sweetheartFixed Window11= Start checklist(Click here to see how this looks in Flight Simulator)
Reference:  ([url=file:///D:/模拟飞行插件/FS2004/设计应用工具/面板设计/Simple%20Panel%20Design(PDToot)/Tutorial/Lessons/Lesson%2004/[Window%20Titles]%20variables%20table.html]Table 4.1.  Window Titles Keywords and Key Values[/url])


[Window00] … [Window63]The most common use of this type of section is to show an aircraft\'s main instrument panel, and also for showing subpanels that hold instruments, switches, or flight controls that are only needed temporarily.  These sections will be listed in the Views → Instrument Panel main menu option only if you\'ve listed them in the [Window Titles] section.

These windows can be used for more than just flight instruments and controls.  You can use any bitmap graphics file (any file having a .BMP file extension) that you think would be great to be able to see while you\'re flying your aircraft.  You can, for example, use Paint to write post-takeoff and pre-landing check lists, lists of runway numbers (headings) for your most often used destination fields or airports, or write frequency lists for your com/nav radios, and use those files in these windows.

If you have a scanner (even a small one) you can scan and make bitmap files of airport approach diagrams and other useful information in FAA or other flight publications, scan flight maps (even gas station or auto club road maps) and use those files in these window sections so they can be toggled on and viewed whenever you need them.

You can use any two-digit number in the range 00 through 63 to number these windows.  The numbers you use don\'t have to be consecutive or in any particular numeric order.  However, authors typically use [Window00] to display an aircraft\'s main instrument panel, if for no other reason than Flight Simulator automatically makes that window visible when you select an aircraft.

You don\'t have to start off with [Window00] if you don\'t want to.  You can just as easily use use [Window01] or any other window number you like.  But if you do that, there are a couple of things you need to be aware of.  First of all, Flight Simulator will automatically display [Window00] on startup no matter where you put it physically in your configuration file.  Second, when you select an aircraft Flight Simulator will also automatically display the first [Window] section it comes to, no matter what number you\'ve given it.  So if you\'re not careful, it\'s possible that you could have two [Window] sections showing at the same time after you\'ve started Flight Simulator or when you\'ve selected an aircraft to fly.

Flight Simulator assigns the first nine sections of this type in your configuration file (in ascending order as they appear in the file) to the keyboard number key combinations SHIFT+1 through SHIFT+9.  These keys are toggles that reverse the visible= keyword\'s value to either make the window visible or to hide it.  Higher numbered key combinations always take priority over lower ones.  For example, a window that Flight Simulator assigned to SHIFT+6 will overlay any of the windows that were assigned to key combinations SHIFT+1 through SHIFT+5.  But that window will itself be overlaid by any of the windows assigned to the key combinations SHIFT+7 through SHIFT+9.  You have to keep this fact in mind when you\'re designing subpanels.

If there are more than nine sections of this type in the file you have to select the rest of the windows from the Views → Instrument Panel option on the main menu.  The priority rule for the windows in that list is that windows lower down in the list will overlay the windows higher up in the list.

Here\'s an example of a valid [Window] section with three sample gauge entries:
[Window01]file=t28coin.bmpsize_mm=800windowsize_ratio=1position=7visible=1/ident=0ident=VFR panel(first row)gauge12=IMPORT/CFS1/Bf109E!Airspeed,190,429,75(second row)gauge21=Cessna!Tachometer, 273,475,75(third row)gauge31=IMPORT/CFS1/P47D!Thrust_Controls,96,512,68(see a PANEL.CFG text example)
Reference:  ([url=file:///D:/模拟飞行插件/FS2004/设计应用工具/面板设计/Simple%20Panel%20Design(PDToot)/Tutorial/Lessons/Lesson%2004/[WindowXX]%20Variables%20table.html]Table 4.2.  [Window] Keywords and Key Values[/url])


[Fixed Window00] … [Fixed Window63]These sections are almost always used to superimpose some kind of interior view over one of Flight Simulator\'s eleven exterior views from inside an aircraft.  They are always linked to one of the exterior views available in the [Views] section.  If you don\'t link a [Fixed Window] section to one of those views then your window won\'t be displayed.

Gauge entries aren\'t valid in [Fixed Window] sections. If you do try to put gauges in one of these sections your entries will be ignored.

You can define up to sixty-four [Fixed Window] sections.  You can use any number in the range 00 through 63 for your window numbers.  The numbers you use don\'t have to be sequential or in any particular numeric order.  You\'ll find that in most files the authors usually start with [Fixed Window00].  But if you want to you can just as easily used [Fixed Window01] (or any other number in the range) for your first [Fixed Window] section.  It makes no difference to Flight Simulator.

Microsoft\'s Flight Simulator developers always use the numbers 30 through 37 for their [Fixed Window] sections because it\'s a Microsoft convention.  They always link these [Fixed Window] numbers to specific predefined view entries in the [Views] section.  But you\'re free to use whatever numbers you like; you don\'t have to use those numbers if you don\'t want to.

[Fixed Window] sections are usually selected using the keypad numbers keys with Num Lock turned on.  A [Fixed Window] section is only displayed while it\'s associated keypad key is being held down.  Each keypad number key is linked to one of Flight Simulator\'s eleven predefined views from the cockpit.  The linked views start with key 8 (forward view) and go clockwise around the number keys to key 7 (forward left view).  Number pad key 5 in the center of the keypad keys can be linked to either of two views, up or down.  [Fixed Window] sections can also be set up so they can be selected from the Views → Instrument Panel main menu option if you\'d like.

Like your [Window] sections, your [Fixed Window] sections can be used for other things besides superimposing an interior view bitmap on an exterior view. Any bitmapped graphics file that you\'d like to see in one of the predefined exterior views can be shown with a [Fixed Window] section.

Here\'s an example of a valid [Fixed Window] section which will display the FORWARD_RIGHT.bmp file when the NUM LOCK + keypad key 9 is pressed.  To make this section work you have to link the section\'s ident= value to the forward right view in the [Views] section, like this:    VIEW_FORWARD_RIGHT_WINDOWS= 1001.
[Fixed Window09]file=FORWARD_RIGHT.bmpvisible=0nomenu=1render_3d_window=1position=window_pos=0.0,0.0window_size=1.00, 1.00ident=1001
Reference:  ([url=file:///D:/模拟飞行插件/FS2004/设计应用工具/面板设计/Simple%20Panel%20Design(PDToot)/Tutorial/Lessons/Lesson%2004/[Fixed%20WindowXX]%20variables%20table.html]Table 4.3.  [Fixed Window] Keywords and Key Values[/url])


[VCockpit00] … [VCockpit63]This is one of the new sections added in Flight Simulator 2002. Virtual cockpits have been a part of Flight Simulator since Flight Simulator 95. Up until the release of Flight Simulator 2002 the cockpit graphics displayed in the virtual cockpit view mode were a series of bitmapped graphics contained in the aircraft model (.MDL) file. The gauges on the panels in the virtual cockpits were painted replicas of gauge faces. They were designed to make the virtual cockpit views appear more realistic. The virtual cockpit graphics in these files were not accessible to users in the earlier versions.

Although you can move, replace, or delete instrument panel gauges, switches and other panel elements in the [Window] and [Fixed Window] sections in any version of Flight Simulator, it wasn\'t until the release of Flight Simulator 2002 that you could do the same thing with the instruments in the virtual cockpit view mode.

In Flight Simulator 2002 a major change was made to the virtual cockpit graphics system in the aircraft model file. In that version the virtual cockpit graphics were taken out of the aircraft model file and put in texture files. The virtual cockpit texture files are kept in the aircraft\'s TEXTURE folder along with the rest of the aircraft\'s texture files.  It\'s beyond the scope of this tutorial to go into the details of how the aircraft model file supplies the graphics required in the virtual cockpt view mode, or how to create virtual cockpit texture files.

But the bottom line is that now you can do a lot more with the virtual cockpit views than you could before.  In Flight Simulator 2002 the developers changed the .MDL file so that the instruments seen in the virtual cockpit views are functional, working instruments. No more painted replicas. The gauges you see in the virtual cockpit mode are the same gauges that you see on your main instrument panel.  So if you change a gauge on the main panel for instance, you should also make that same change in the corresponding virtual cockpit view.

Other than changing and/or repositioning gauges in the virtual cockpit views, there\'s not much else that you can do with the [VCockpit] sections.  Or very little point in doing so, really.  

Reference:   ([url=file:///D:/模拟飞行插件/FS2004/设计应用工具/面板设计/Simple%20Panel%20Design(PDToot)/Tutorial/Lessons/Lesson%2004/[VCockpitXX]%20variables%20table.html]Table 4.4.  [VCockpit] Keywords and Key Values[/url])


[Views]The [Views] section is where you can assign one of Flight Simulator\'s exterior views around the aircraft to a window that you\'ve defined in one of your [Window] and/or [Fixed Window] sections.

Reference:   ([url=file:///D:/模拟飞行插件/FS2004/设计应用工具/面板设计/Simple%20Panel%20Design(PDToot)/Tutorial/Lessons/Lesson%2004/[Views]%20variables%20table.html]Table 4.5.  Views Keywords and Key Values[/url])
                   ([url=file:///D:/模拟飞行插件/FS2004/设计应用工具/面板设计/Simple%20Panel%20Design(PDToot)/Tutorial/Lessons/Lesson%2004/[Views]%20variables%20table.html]Table 4.5.1  Views Keyword Modifiers[/url])


[8 Bit Colors]The entries in this section were used by the aircraft model file in Flight Simulator versions 95 and 98.  The section was made obsolete by changes made to the aircraft model file for Flight Simulator 2000 and later versions.

In the earlier versions the entries in this section assigned RGB color value triplets to colorXX= keywords. You\'ll only find this section in panel configuration files for aircraft designed for Flight Simulator 95 or Flight Simulator 98. This section isn\'t used if you\'re flying FS95/FS98 aircraft in FS2000 and later versions, so you can delete this section from your panel configuration file if you want to.


[Color]This is one of the new sections added in the FS2002 release. The section has three keywords: day=, night=, and luminous=.  The key values for these entries are RGB color triplets.  Typical values used with these entries are:
(for Cessna 208):day= 255, 255, 255  (white)night= 223, 72, 100luminous= 228, 64, 64

[Strings]This is another one of the sections addd in Flight Simulator 2002. This section is used for defining short aliases for any long key value strings that are used a lot in the file. Defining a short alias here avoids having to type out a long key value string over and over again if, for example, you use the same gauge in several different [Window] and VCockpit sections. An alias will also help avoid making mistakes when you type out the entry over and over again.

So, how do you use this section?  Suppose you\'ve made up a lot of subfolders in you GAUGES folder to keep your gauges better organized. Now suppose that you want to replace the existing Cessna altimeter in an aircraft with one of the metric altimeters you have in one of your GAUGES subfolders. And let\'s also suppose that the Cessna altimeter is used in several of the [Window] and [VCockpit] sections in your file. Here\'s how you could use the [Strings] section to mimimize the keystrokes you\'d have to use to get your replacement gauge installed:
[Strings]\"altimeter\"=IMPORT/CFS1/Metric gauges/German/BF109E!altimeter[Window00]/gauge11=Cessna!Altimeter, 100,100,100,,,,gauge11=%altimeter%,100,200,75[Window03]/gauge01=Cessna!altimeter,100,100,100gauge01=%altimeter%, 100, 200, 75[VCockpit01]/gauge02=Cessna!altimeter, 100, 100, 100gauge02=%altimeter%,10, 50,35[VCockpit02]/gauge21=Cessna!altimeter, 100, 100, 100gauge21=%altimeter%,10,50,35
As you can see, the alias can simplify your gauge entries. You\'d still have to type in your gauge\'s panel position and size parameters in the different windows, of course. But a lot of typing can be avoided by using an alias.

Using an alias for a string that\'s only repeated a couple of times in your file might not be worth the effort, since you have to type the complete alias string into the [Strings] section anyway.

You can\'t use an alias for keywords. This is because the percent symbol used to delimit the alias when you use it will turn the keyword into a comment. You can only use an alias as a substitute for a key value string.


[Default View]This section is used to define the width, height, and position of the default view (the forward view you see from your aircraft). the default view\'s width and height are stated in design units, with the upper left corner of the default window being the point of origin. The default view\'s position parameters locate the view\'s upper left corner, stated as a decimal percent along the view\'s x-axis and y-axis from the window\'s point of origin.

In the earlier versions of Flight Simulator which ran on slower computers the default view\'s height was often brought down just to the point where the main insturment panel started covering over the default view. Doing this helped reduce setup time, since the area covered over by an aircraft\'s main instrument panel didn\'t have to be painted and refreshed all the time. This is why you\'ll find many different values for the size= keyword\'s parameter. If you\'re using a reasonably fast computer with a reasonable amount of random access memory (RAM), you can set the size_x and size_y parameters to their maximum values, 8191 and 6144.

Notes and Comments in Your Configuration Files
Notes and comments are strings that you add to a configuration file to pass information on to a reader, or to make the file more organized and readable (sometimes called \'pretty printing\').  Since Flight Simulator ignores everything in a panel configuration file that isn\'t a valid section name or entry, you can add notes, comments, spaces, null strings, or dashed lines anywhere in the file where you think it will be helpful.

For example, you can write a paragraph (called a header) at the start of your file where you give anyone who reads the file some information about the file.  You can set off your header with single- or double-dashed lines at the top and bottom. Between these two lines you can write a paragraph about which aircraft the file belongs to, when it was originally written and/or modified, who wrote it, and anything else you want the reader to know.  There are lots of different formats used for file headers, but basically you can write a file header any way you like.  After all, it\'s your file, isn\'t it?

(Click here to see a \"before\" and \"after\" example)

No special characters are necessary to tell Flight Simulator that the strings your are writing are comments.  However, some authors with programming experience often use a single or double slash mark at the start of their comment strings.  While it\'s not necessary to mark your comments this way, using some kind of easily recognizable symbol can often help to make your comments stand out.

Programmers often use comment symbols a lot when testing or debugging programs.  A common use of comment symbols is to \"comment out\" sections of code that you want the program to ignore.  Instead of deleting or overwriting sections and entries that you\'re changing, using comment symbols to comment out the original lines is a good way to save them in case you ever decide that you need to put them back again.  You can restore original lines just by removing their comment symbols. You can then add comment symbols to comment out the changes you\'ve made.  Commenting out instead of deleting or overwriting entries is a good way to keep a visual record of your work, especially when you\'re doing trial and error testing.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-6 11:34:18 | 显示全部楼层
Lesson Five:  Understanding .GAU Gauge Files
What are Gauges?
The term \"gauges\" in Flight Simulator basically means anything that you can put on an aircraft\'s instrument panel. A gauge can be an altimeter, turn and bank indicator, throttle quadrant, communications or navigation radio, toggle switch, gear lever. You name it. If it goes on an instrument panel or view bitmap, then it\'s a gauge! And if it\'s a gauge, then it\'ll be in either of two places: (1) in your Flight Simulator GAUGES folder, or (2) in your aircraft\'s PANEL folder.

What\'s in Your GAUGE Folder
Most of your gauges are located in your Flight Simulator GAUGES folder. It\'s the recognized repository for your gauge inventory. If you use Windows Explorer and look in that folder you\'ll see a long list of .GAU files arranged alphabetically. If you download add-on aircraft from online sources like Simviation.com, then you\'ll occasionally find authors who have put gauges in your downlaoded aircraft\'s PANEL folder, too.


Single-Gauge FilesMost of the gauge files in Flight Simulator are single-gauge files, meaning that the .GAU file is for only one gauge. In almost all cases the filename for a gauge file starts with an aircraft name followed by a period and the name of the gauge. Here\'s a sampling of valid single-gauge filenames:
Bell_206B.oil.gauBendix_King.ADF.Model_B.gauExtra-300.ignition.gauExtra-300.tachometer.gauExtra-300.switches.gauLear_45.thrust_levers.2.gau

Multiple-Gauge FilesMost of the .GAU files that you have in your GAUGES folder are for just one gauge. But there are some gauge files that have more than on gauge in them. Multiple-gauge files were first used in Flight Simulator 2000.

The only way you can tell the difference between single-gauge and multiple-gauge files is by their filenames. Generally speaking, a single-gauge .GAU file will almost always have the gauge\'s type or name in the .GAU file\'s filename. A multiple-gauge file, on the other hand, will almost never have a specific gauge name in its filename.

Multiple-gauge filenames most often are associated with a specific type of aircraft, the one in which the gauges are used. But they can also be associated with a particular aircraft or gauge manufacturer. Here\'s a sampling of valid multiple-gauge filenames:
aircraft type: Concorde.gauBell_206B.gauSpitfire_MK1.gauP47D.gauLear_45.gauExtra-300.gau777-400.gaumanufacturer: Bendix_King_Radio.gauCessna.gau

Cabinet FilesA cabinet (.CAB) file is Microsoft\'s compressed file type.  While cabinet files have been used in many Microsoft applications since 1995, they first began to be used in Flight Simulator with Flight Simulator 2002 and subsequent releases.

You\'ll find cabinet files in Flight Simulator\'s GAUGES folder. Cabinet files in Flight Simulator contain compressed instrument bitmaps and the XML-coded text files that display and operate the instruments. In Flight Simulator you use cabinet files the same way that you use multiple-gauge files.

You\'ll find a more detailed description of cabinet files and how to extract gauges from them in Lessons Six and Seven of this tutorial. For now, here\'s a sampling of valid cabinet file filenames:
Beech_Baron.cabBoeing747-400.cabminipanel.cabfs9_clock.cab

What\'s in Your Gauge Files
All gauge files in Flight Simulator have a .GAU file extension. Although they have a .GAU file extension, gauge files are what are more commonly known as \'dynamic link libraries\', or .DLL files. When you select an aircraft from you aircraft list, Flight Simulator parses your aircraft\'s panel configuration file to get the gauge entries in the [Window], [Fixed Window], and [VCockpit] sections of the file. For each gauge listed, Flight Simulator gets the corresponding .GAU files from either the path statement you\'ve written (or if there\'s no path statement, then from the root of the GAUGES folder) and links your gauges into the program.

Designing a gauge is well beyond the scope of this tutorial. It\'s no simple task. There\'s much more to it than simply knowing how to write and compile gauge DLL\'s. However, if you\'re really curious about how to design your own gauges you can start by downloading one of Microsoft\'s software development kits (SDK\'s) for your version of Flight Simulator. Microsoft SDK\'s will give you detailed information on how to create gauge files.

Single-gauge .GAU files are computer program modules known as DLLs. They contain the information that Flight Simulator and Windows need to display and operate one particular instrument, switch, indicator or some other aircraft element broadly classified as being a \'gauge\'. When you specify a gauge to be used in an aircraft, that gauge\'s .GAU file is \'linked\' (made a part of) your Flight Simulator program when you select that aircraft to fly. When you see that gauge operating as you fly your aircraft, what you\'re seeing is a continuous data exchange between the simulator engine and your gauge DLL. The computer programmer or gauge designer-developer did all the grunt work for you to design the gauge and make it work. What you get is the fun part!

Multiple-gauge .GAU files are significantly different than single-gauge files. First of all, a multiple-gauge files aren\'t DLLs. They\'re a type of compressed file that holds several .GAU files. When you want to use a gauge that\'s in a multiple-gauge file you have to tell Flight Simulator that the gauge you want to use is in a multiple-gauge .GAU file, what that file\'s name is, and the name of the gauge in it that you want Flight Simulator to use. From there on what happens is the same as if the gauge was in a single-gauge file instead of a multiple-gauge file.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-6 11:35:08 | 显示全部楼层
Lesson Six:  Panels and Views
Panels and Views
Your Microsoft Flight Simulator would quickly be back in its box on some dusty shelf in a closet somewhere a long time ago if all you ever saw as you flew around the pea patch was an instrument panel covered with rows of flickering gauges, flippity switches, and blinking indicators.

The basic appeal of Flight Simulator has always been that it simulates what you would actually see in front of you and all around you when you go flying.  You sit in your aircraft cockpit, start your engine(s), taxi to the active runway, get clearance from the tower, take, fly around the patch for a while, then land at your favorite airport for a spot of tea or a cuppa coffee.  It\'s the program\'s sense of reality that grabs you, keeps you in your seat, and keeps you flying.

Try flying around for a while with your default view and instrument panel toggled off (use Shift+1).  While you\'re at it, turn off your simulated engine sounds, too.  For a while it\'s cool just flying.  Being suspended in mid-air.  You can turn, bank, swoop, and climb like a bird.  But then you\'ve got to admit that it gets old pretty quick, doesn\'t it? Nice scenery and all that, but no sense that you\'re really flying.  Flying, as in tooling around in a Cessna 172 practicing spins and stalls, doing lazy eight\'s in an F4U-4 Corsair, or acting as First Officer in the left seat of a Boeing 737 heavy on final to San Francisco International.

Following Bruce Artwick\'s pioneering work with Flight Simulator, over the years a long parade of in-house and third-party developers have done monumental work to put increasingly greater realism into the aircraft you fly; the ground terrain, airports, lakes, rivers and streams that you see; the engine sounds, radio chatter, stall warning horn, and other sounds your hear; and even the feel of your stick or control yoke sensations.  But when you come right down to it, it\'s your panels and cockpit views that really give you that all-important sense of reality when you\'re using Flight Simulator.

Using an Alias
You can write a panel configuration file where the only content is a pointer to a panel configuration file located somewhere else in Flight Simulator. The PANEL.CFG file that you point to is a substitute (called an alias) for the PANEL.CFG file you\'re using.

When you put this file in an aircraft\'s PANEL folder Flight Simulator will use the alias in the file as the aircraft\'s PANEL.CFG file.  This procedure is called aliasing an instrument panel.  Here\'s an example of a PANEL.CFG file that aliases the instrument panel of a Cessna 172S (the header and EOF comment are optional, of course):

{{ File:      PANEL.CFG{ Date:      May 2004{ Purpose:   Aliases the Cessna 172S instrument panel.{[fltsim]alias=Cessna 172S/panel{{end of file}
If this panel.cfg file is put in the PANEL folder of an aircraft, when you select that aircraft you\'ll be using the instrument panel of the Cessna 172S.

Both the [fltsim] section name and the keyword alias= are the only two required lines when aliasing a panel.  Note that the value for the keyword alias= is just a path statement that points to the alias panel.cfg file.  You don\'t include the panel configuration file\'s filename and extension to the path statement.

If you create different types of instrument panels, and you want to be able to test these panels in different aircraft, you can create a folder in AIRCRAFT directory to hold your instrument panels.  An example of this is the FSFSCONV directory.  It has a subdirectory for different configurations of jet and reciprocating engined aircraft.  In each subdirectory is a specific panel configuration file.  You can create a similar folder (one named MyPanels, for example) to hold the panels you create.  Suppose you\'ve created an IFR panel that can generally be used in most single place aircraft.  If you\'re testing this panel to use in your Extra 300XP clone you could set up a subdirectory in your AIRCRAFT folder that looks something like this:

/AIRCRAFT      /MyPanels          /T-28C          /Extra 300XP              /IFR                  PANEL.CFG

If you write a PANEL.CFG file for an aircraft that aliases your single place IFR panel, then that panel configuration file would look something like this:

{{ File:      PANEL.CFG{ Date:      May 2004{ Purpose:   Aliases the Cessna 172S instrument panel.{[fltsim]alias=MyPanels/Extra 300XP/IFR/panel{{end of file}
Keeping your test and development instrument panels in a central location in your AIRCRAFT folder is a good way to keep your work organized, easier to work with, and easier to find.

Bitmap Files
The panel bitmaps are what adds realism to your cockpit views.  There are two types of bitmap files (views) that you see when you\'re flying an aircraft: static and dynamic.

Static ViewsStatic instrument panel and other views are bitmaps called in the [Window] and [Fixed Window] sections in your panel configuration file.  Your [Window00] section is normally used as your primary view, which is normally the view of your instrument panel. Your instrument panel bitmap is what you see overlaid on your default (forward) view from your aircraft.  In almost all cases your instrument panel view also includes the windshield and canopy frames when you\'re flying single place aircraft.  Other aircraft structures, like wings, wires, and fuselage parts might be shown in the primary view if you\'re flying a vintage biplane.

Dynamic ViewsDynamic views are (a) what you see outside your aircraft, and (b) what you see inside your aircraft when you turn your head and look around.  The dynamic view that you see outside your aircraft is always the view as you would see it if you were sitting in the aircraft.  Look forward and you see what\'s in front of you.  Turn your head to the left and look down and you see what\'s in that direction.

Like the static views, internal aircraft objects and structures that you would normally see in a real aircraft are often included in dynamic views.  The bitmaps used in dynamic views are complex bitmaps that are incorporated into the aircraft\'s model file.  You can\'t change them.
The 640 and 1024 Panels
By the late 1990\'s, the screen resolution of display monitors and video cards had increased to dramatically higher resolutions than were available in the mid-1990\'s when the Windows version of Flight Simulator was first released.  As a result, the program\'s developers started using separate high resolution and low resolution panel bitmaps with the release of Flight Simulator 2000.

Flight Simulator 2000 and subsequent versions detects the user\'s screen resolution to determine whether a high resolution or a low resolution is to be presented to the user.  The dividing line between using a high resolution or a low resolution bitmap has been fixed at 800 x 600 pixels.  High resolution bitmaps are used when the user\'s screen resolution is set at 800 x 600 pixels or higher; low resolution bitmaps are used when the screen resolution is lower than that.

An optional new keyword (file_1024=)was added to the [Window] section of the panel configuration file so that a bitmap file to be used in the high resolution mode can be specified.  Flight Simulator\'s developers add _1024 to a high resolution bitmap\'s filename (e.g., \"Extra 300S_1024.bmp\") and _640 to a low resolution bitmap\'s filename (e.g., \"panel_background_640\"). This is a Flight Simulator\'s developer convention; the bitmap filename for the keyword file_1024= doesn\'t require that the file be identified as to whether it\'s a high resolution or low resolution bitmap.

You can use the keyword file= in your [Window] sections if your screen resolution is always set to 800 x 600 pixels or higher.  Flight Simulator uses that keyword\'s value for all screen resolutions if the file_1024= keyword isn\'t used.  Both keywords are separate entries, so they can both be used together in a [Window] section.   When both 1024 and 640 bitmaps are included in a window, their size ratios are always the same.

High resolution (1024) panelsThe 1024 panel bitmaps have a nominal width of 1024 pixels.  The height of the panel will vary depending on what the panel design includes.  For example, a panel bitmap that includes a windshield frame will have a larger y-axis value than a panel bitmap that doesn\'t include a windshield frame.

Low resolution (640) panelsThe 640 panel bitmaps have a nominal width of 640 pixels.  Like the 1024 panel bitmaps, the y-axis value will be a function of what\'s included in the bitmap.

(Click here to see the difference between the 640 and 1240 bitmaps.)

Putting Gauges on a Panel
You add, replace, or remove gauges from a panel by editing the gauge entries in the [Window] and [VCockpit] sections of your panel configuration file.  You can remove (delete) a gauge from a panel simply by commenting out the gauge entry.  You can replace a gauge by commenting out the existing gauge\'s entry and adding an entry for the replacement gauge.  And you can add a gauge to an instrument panel simply by adding a gauge entry for your new gauge in the appropriate [Window or [VCockpit] section of your panel configuration file.

When editing a configuration file it\'s not a very good idea to remove a gauge by simply deleting the gauge\'s entry in the panel configuration file.  It\'s a much better idea to comment out the gauge if you want to remove it from your panel.  And it\'s not a very good idea either to simply overwrite a gauge entry when you\'re changing the gauge\'s parameters.  Again, the better way is to copy the old gauge entry to a new line right below the old gauge\'s entry, comment out the old gauge entry, then change the old gauge parameters in the new gauge entry.  While it may sound complicated and a bit time consuming at first, what you\'ll be doing is creating a change history, a record of your work that you\'ll often find to be invaluable later on.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-6 11:35:57 | 显示全部楼层
Lesson Seven:  Panels and Gauges in CFS and Add-On Aircraft
In General
In general, you can interchange gauges used in any standalone flight simulator program or in add-on aircraft that are intended to be used with some version of Flight Simulator.  The files and file structure of theCombat Flight Simulator series closely resemble the files and file structure of Flight Simulator.  Panels and gauges in CFS1 and 2 are fully compatible with their counterparts in all versions of Flight Simulator.

Those same elements in add-on aircraft on the other hand are usually (but not necessarily) fully compatible with Flight Simulator.  Commercial add-ons from well-known vendors like Abacus and Just Flight can be relied upon to be fully compatible in all respects with Flight Simulator.  Although the aircraft designs downloaded from flight sim websites might not be as good as you\'d like, their panel bitmaps are usually very useable.  The gauge designs are also quite useable as well.  Aircraft and their components are more than likely to be completely compatible when installed in Flight Simulator versions specified by their authors.

CFS 1, 2 and 3
Aircraft, panels, and gauges in Microsoft\'s Combat Flight Simulator 1and 2 game programs can be used in all versions of Flight Simulator.  You can use any of the flyable aircraft in CFS1 (or their panels and gauges) in Flight Simulator 98 and 2000.  Similarly, you can use any of the flyable aircraft in CFS2 in Flight Simulator 2002 and 2004.

If you compare a panel configuration file in Combat Flight Simulator 1 or 2 with a panel configuration file in any version of Flight Simulator, the only really noticeable difference you\'ll see is that Microsoft puts a copyright notice in the Flight Simulator files, but not in the Combat Flight Simulator files.

All of the panels and gauges for aircraft in Flight Simulator and the first two Combat Flight Simulator series are interchangeable.  For example, you can install a metric airspeed gauge from a CFS1 WWII-era Luftwaffe aircraft in your Extra 300XP clone if you\'d like to have an airspeed gauge that reads out in kilometers per hour.

Combat Flight Simulator 3 is a Microsoft flight simulation game program that\'s incompatible with Flight Simulator or any of the two previous versions of Combat Flight Simulator.  The file formats in CFS3 are similar to the file formats of other war game programs in the land, sea, and air battlefield gaming market.  Consequently, there\'s nothing in CFS3 that can be used with any version of Flight Simulator or Combat Flight Simulator.

Add-On Aircraft
Panel and gauge files in any program designed to be used with your version of Flight Simulator will by definition have pretty much the same file format as your version\'s panel and gauge files.  There may occasionally find some noticeable (but quite harmless) differences.  For example, the aircraft configuration files in Abacus\'s Flight Deck for Flight Simulator 98 and 2000 include a set of nine unused [fltsim] sections.  This type of anomaly frequently happens when third-party design software uses templates to simplify the design process.  All nine of the sections could be deleted without affecting the configuration of the aircraft in any way.

Quite often you\'ll find the designer of an add-on aircraft will alias the aircraft\'s instrument panel to the panel of another aircraft.  The alias will be either the panel of an aircraft included with Flight Simulator, or one of the generic panels included in the FSFSCONV folder.

Similarly, the gauges used in the panel configuration file of many add-on aircraft are gauges from Flight Simulator\'s GAUGES folder.  And then some add-on aircraft have their own set of gauges that have to be installed in the GAUGES folder before the aircraft can be used.

If you download a lot of aircraft or install commercial add-on aircraft you\'ll end up with a very large inventory of miscellaneous gauges.  Keeping track of all these gauges can become a major problem.  However, since you\'re the only one using the aircraft in your program you can create a gauge classification and filing system within your GAUGES folder that will keep your gauge inventory all neat and tidy.

Setting up a system where different gauges of the same type, gauge manufacturer, or aircraft model are kept in separate folders can help make gauge-swapping and panel configuration file editing a little simpler and easier.  Sort of like having a parts cage where your gauges are in boxes neatly arranged on shelves.  If you have a gauge classification system that you can use that you know and understand, you can pick a gauge \"off the shelf\" so to speak when you look for a gauge to put in your panel configuration file.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-6 11:37:01 | 显示全部楼层
Lesson Eight:  Using Windows Paint on Bitmap Files
The Windows Paint Workspace
When you start working with your panel bitmap files you\'re necessarily getting into graphics design work.  If you\'ve never worked with a graphics programa before, Windows Paint is really a good place to start.  Nothing to be afraid of, and nothing you can\'t handle.  But before you can start working on your panel bitmaps you need to get familiar with what Paint is, and what it can do for you.

First of all, as graphics programs go Windows Paint is a modest, limited, but still very useful graphics design tool.  When you learn to use Paint, and use it well, you\'ll be able to make an easy transition to higher-end consumer graphics programs like Jasc Software\'s Paint Shop Pro or Adobe\'s Photoshop.

You\'ll be working exclusively with the Microsoft / IBM formatted bitmap (.BMP) files when you work with your Flight Simulator panels.  But Paint can also be used with JPEG, GIF, and TIFF images, three other widely used graphics file formats.  Besides using Paint to touch up an instrument panel, it\'s also a very useful tool if you need to do a little red-eye reduction on some of your digital camera photos of friends and relatives.

When you open Windows Paint you open a window into your Paint workspace.  It\'s a place, a workshop, where you can create, redesign, paint, and repaint panel bitmaps.  In front of you there\'s a blank canvas on which you can do your work.  Off to the left of your canvas are your graphics tools.  To the left below your canvas is your color palette.  Up at the top of your workspace is a Windows menu bar, and down at the bottom of your workspace is a Windows status bar. Here\'s some further explanation of what you see in your Paint workspace:

Your canvasThe primary object in your workspace is the blank canvas that fills the center of your workspace.  Your canvas measurements are in pixels.  There\'s an X,Y position readout on the status bar at the bottom right corner of your workspace.  The readout gives you the X,Y position coordinates whenever you move one of your graphics tools over your canvas.

You can create instrument panels from scratch with the graphics tools at your disposal.  You\'ll be surprised at how easy it is to modify panels with Paint, to create your own panels, and to correct faults that you might come across in existing panels.

The tool iconsYou hae a toolbox full of Paint tools on the left side of your canvas.  The tools you have in Paint are the kind of standard graphics tools that you\'ll find in every good quality graphics program.

When you work with instrument and other panels in Flight Simulator you can use these tools to paint or repaint sections of an instrument panel, match colors, draw lines and shapes, cut out sections or add new ones, and write text on your panels.  You can use these tools to correct design flaws in existing panels, or change the text or correct spelling errors on panel decal bitmaps.

With Paint you can go beyond working with just instrument panels.  You can use Paint to create cockpit structures that you can use in the [Window] and [Fixed Window] sections of your panel configuration file.  You don\'t necessarily need good drawing and graphics skills to create cockpit structures; you can use Paint to copy structures in the panel bitmaps of other aircraft and paste then into your own panel designs.  Just remember, however, that if you copy something that someone else has created you can\'t distribute anything you create that uses that copy without getting the original designer\'s permission to do so first.

Color bars and boxesWindows Paint gives you a big selection of colors that you can use for painting your panels and aircraft structures.  Your basic color palette is down near the lower left corner of your workspace.  You can easily change the colors in the color boxes of you color palette by clickng on the Colors → Edit Colors ... main menu command option and selecting one of the 48 basic colors that are displayed there.  Or you can create custom colors by entering RGB color codes or by picking out a color on the rainbow-hued color swatch.

Foreground, background color boxesMost of the time when you\'re using Paint you\'ll be working with two colors.  One color, called your foreground color, will be the color you\'re using to draw lines, curves, or paint panel sections.  It\'s the color you\'ll use most often, so it\'s associated with your left mouse button.  The other color is called your background color.  Your background color is the color that your foreground color draws on, or colors on.  You\'ll use that color a lot, but less frequently than your foreground color, so it\'s associated with your right mouse button.

There\'s a separate section in your color boxes (the two overlapping squares) where you can set your foreground and background colors.  You can set these two colors with one of the painting tools by positioning the tool over a color box (or the color swatch) and left-clicking your mouse.  Similarly, you set your background color by positioning the tool over the background color you want and then right-clicking your mouse.  If you\'re trying to match colors on an instrument panel you\'re working with, you take your \"eyedropper\" tool and position it over the panel color you\'re trying to match.  Then you either left-click or right-click your mouse to set the color as either your foreground or background color.

The Main Menu Bar
The workspace canvas, tools, and color bars and boxes are what you use directly when you\'re working with panel bitmap files.  Paint\'s main menu bar takes care of the indirect functions you need, like file and printing options; cutting, pasting, and other editing functions; workspace appearance options; and image manipulation functions.  Here\'s a summary of each of the main menu commands and command options:

FileYou have an interesting addition to the common file, print, and email options you know from using the File command in other Windows main menu bars.  With Paint, if you really like an image (say your favorite aircraft, for example) you can set that image as the background image on your display monitor.  To set the image as your monitor\'s background you use the File → Set As Background menu option.  You can set the background as either a centered or tiled image with this option.

Other graphics programs will let you open more than one image in your workspace, but with Paint you can only work with one graphics file at a time.  If you fhave a panel file open and then you decide that you want to work with a different file, you\'ll have to save the work you\'ve done before you open another file.

EditThe edit command has the most common graphics commands that you\'ll need, such as undoing something you\'ve done, or repeating a step, or clearing a selection you\'ve made.  The undo command only goes back three levels, but it\'s better than not being able to go back at all.

ViewThe options under the View command are limited.  The are used for changing the workspace appearance.  The View Bitmap option (or its keyboard shortcut CTRL+F) is an option that you might find yourself using quite a bit.  This option lets you view your panels and other work centered on a neutral background outside of the Paint workspace.  It\'s a good way to view your work in progress to get an idea of how it might look when it\'s being used in Flight Simulator.  The option isn\'t limited to bitmap files, however.  You can use this option to view photos and any other graphic work that you have on your canvas.

ImageA useful option under this menu command in panel design is the Image → Attributes option.  You can\'t change the X, Y readout\'s parameter with this command (the readout is always given in pixels), but the option will give you the width and height values of whatever is on your canvas.  You can select inches, centimeters, or pixels as the measurement with this option

ColorsThis command brings up the color selection window.  You use this command to change or add to your color palette.  When you click on the Define Custom Colors bar you\'ll bring up the color swatch and RGB color values window.  You can use this window either to drag and select a color range, or specify fan exact color by entering the color\'s RGB values.

HelpThis command is always very useful, especially if you\'re a beginner or intermediate user who hasn\'t had much experience using graphics programs.  The help screens give you basic information and step-by-step instructions on using Paint\'s functions.

Using Paint Tools
There are sixteen tools in your Paint toolbox that you can use.  The tools include two types of cut and move selection tools, six coloring tools, a text writing tool, a tool for enlarging the image on your canvas, two tools for drawing lines, and four tools for drawing shapes.  Each tool is an icon, and has a shape that gives you a visual idea of what the tool is used for.  Here\'s a brief summary of what each of the tools does, and how it\'s used:

PencilThe pencil tool is the fourth icon in the first column of the toolbox.  This might turn out to be the one tool in your toolbox that you use most often.  The tip of the pencil is very sharp; it\'s only one pixel wide!  When you hold your mouse left button down and move the pencil tip you\'ll draw a one pixel-wide line with your foreground color.  Hold the right button down and move your pencil tip you\'ll draw a one pixel-wide line with your background color.

EraserThe eraser tool is the second icon in the first column of the toolbox.  When you select the eraser and hold down the left mouse button you\'ll cover over whatever is under your eraser with your background color.  Holding down the right mouse button doesn\'t do anything.  When you select the eraser tool from your toolbox you get a choice of four graduated tip sizes to use.  Paint remembers what tip size you picked, and unless you change it, will use that same tip size the next time you use your eraser.

Eye dropperThe eyedropper tool (also called the color picker) is the third icon in the first column of the toolbox.  The color picker is one of the tools that you\'ll use quite often.  It\'s an auxilliary tool that you use to change your foreground or background color.  You commonly use the color picker when you\'re using the drawing or painting tools.  What you use the color picker for is to match your foreground or background color with a specific color on your panel or graphic image.  The tip of the color picker (like the pencil tip) is just one pixel wide.  So you could also call your eyedropper tool a pixel picker if you wanted to.

Instrument panels that seem to be only one color when viewed at 100% (like the Extra 300\'s light grey panel) are often actually shaded with many slightly different colored pixels.  Because the color picker\'s tip is only one pixel wide, it\'s sometimes necessary to get down to the pixel level by magnifying (zooming in on) the panel or image you\'re working with to 600% or 800% so you can see and pick out a pixel that\'s close to the color you want to match.

PaintbrushThe paintbrush tool is the fourth icon in the second column of the toolbox.  The paintbrush works something like the eraser.  You select the paintbrush tool, select a brush pattern (you\'ve got twelve patterns to choose from), then hold the left or right mouse button down while you move your mouse across your work.  The left mouse button paints with your foreground color and the right mouse button paints with your background color.  You can use your color palette or the color picker tool to select your foreground and background colors.

Spray canThe spray can is the fifth icon in the first column of the toolbox.  Microsoft calls the spray can an airbrush.  But it looks more like a spray can.  And it has three spray patterns that look more like what you\'d get out of a spray can than an airbrush.  And anyway, most of us are a lot more familiar with using spray cans than we are with airbrushes.

When you select the spray can you can choose one of three dispersal patterns; tight, medium, and broad.  The dispersal patterns are randomly spaced pixels.  The tight pattern is about 9 pixels wide, the medium is about 17 pixels wide, and the broad pattern is about 24 pixels wide.  The dispersal pattern will fill in to form a circular dot if you hold you mouse steady and centered on a single pixel.

Paint canThe paint can is the second icon in the second column.  The icon shows the paint can being tipped.  If you think about what tipping a can of paint will do, then you\'ve got a good idea of what the paint can tool will do to the panel or image you\'re working on.  Instead of using the pencil or paint brush to paint a large (or relatively large) part of your panel or graphics image, you can use the paint can to quickly spill (or pour) foreground or background color instead.  The paint can\'s tip is exactly one pixel wide, so for the greatest control and accuracy in picking the spot to spill your paint you need to get down to the pixel level (800% magnification) and use the View → Zoom → Show Grid main menu command option.

It isn\'t exactly like spilling paint from a paint can, though.  It\'s a fill-in, a controlled spill.  When you spill paint onto an area, the paint will change the color of the pixel you\'ve put the paint can\'s tip on.  It will also flow into every pixel that\'s exactly the same color as that pixel, but only into those pixels that are all touching each other and your target pixel.  A pixel that touches one of those pixels but isn\'t exactly the same color won\'t get paint spilled on it.

The letter \"A\"The capital letter \"A\" is the fifth icon in the second column of the toolbox.  The \"A\" icon is your text writing tool.  Unlike your other toolbox tools, you can only use your text tool with normal (100%) magnification.  When you select this tool, two colored panels pop up at the bottom of your tool box.  If you select the top panel (opaque mode) you\'ll be writing on your background color.  If you select the bottom panel (transparent mode) you\'ll be writing directly on your panel.

There are several steps you have to go through before you start writing  First you have to know where you want to write your text.  Then after you\'ve selected your writing mode you move your mouse to where you want to write your text.  Your cursor will change to a crosshair, because your text is going to be written inside a box you\'re going to create next.  You position your crosshair on the panel where you want the upper left corner of your writing box to start.  This starting point is relatively important, but you\'ll be able to change it once you\'ve drawn your box.  Next, hold the left mouse button down and move the crosshair down to size your box.  Release your mouse button when you think you\'ve got it right.  You can lengthen or shorten the sides of your box (resize it), make it as big or small as you want.  You can\'t move your box dragging it to where you want it, but you can move it by continually resizing it to \'walk\' it over to a different location on your panel.  You won\'t be able to move your text box after you start writing in it.

The next thing you do after you\'ve got your text box positioned and ready to accept your text is to go up to the main menu and click on the View → Text Toolbar command option.  This will expose the text toolbar (the only time you can expose the text toolbar is after you\'ve created a text box).  Use the text toolbar to select a type face and size, and any emphasis you want to use.  The third window in the toolbar is filled in automatically when you select your typefont; you don\'t need to do anything with that window.

After you\'ve made your selections you can go ahead and type your text.  You may have to do some trial and error work to get the text and writing box sizes right.  Remember, the text box can be resized (even moved), and your typefont and face can be changed at any time while you\'re writing text.  Use the main menu command option Edit → Undo if you need to back up a step (maximum of three undo\'s) or to start over again.

The text tool can be useful if you\'re doing panels for foreign aircraft.  There are several foreign language typefaces that you can select from.  For example, if you\'re doing a panel for a Russian aircraft (and you know a bit of Russian) you can write Cyrillic characters on gauge, switch, and control identification panels (and also on gauge faces) using the Cyrillic A or B typefaces that are available in the list of available fonts in the text toolbar.

Magnifying glassThe magnifying glass is the third icon in the second column of the toolbox.  The magnifying glass is your zoom tool, and is a very valuable tool for helping you do fine, precision work on your panels.  When you\'re drawing lines, curves, painting, repainting, erasing, or correcting flaws on a panel it\'s always best to work at the highest magnification possible.  You\'ll find that the wiggly straight line you draw at 100% (normal) magnification can be turned into an absolutely perfect straight line if you redraw it at 800% magnification.  At 800% magnification you\'re working down at the pixel level.  It\'s slower that way, but if you want crisp, good looking panels without overspray, color glitches, or wiggly lines it\'s the only way to go.

A very important aid to precision control at the pixel level is the View → Zoom → Show Grid main menu command option.  The option becomes available when you zoom in from the normal view at zoom level.  The grid square size is exactly one pixel.  At 800% magnification , if you have a reasonably steady hand and have the pixel grid turned on, you can do very high precision work on your panels.

The resizeable thumbnail window that you can bring up using the View → Zoom → Show Thumbnail main menu command option that, like the pixel grid, becomes available when you zoom in from the 100% (normal) view puts you in a \"picture in picture\" mode.  When you\'re working with your panel the thumbnail view lets you see what the changes you\'re making look like when you see the panel in its normal size.  The view in the thumbnail window also moves right along with you as you scroll up and down in your working window.  At very high magnification this feature helps you keep track of where you are on the panel.

The magnification (zoom) levels you can choose when you select the magnifying glass are fixed at 100% (normal view), 200%, 400%, and 800%.  You can also get 600% by using the View → Zoom → Custom main menu command option, and somewhere around 700% by using the View → Zoom → Large Size → main menu command option.

Cut and move a rectangular sectionThis tool is the first icon in the second column in your toolbox.  With this tool you can cut out a square or rectangular section of your panel or graphic and move it to some other location on your canvas.  The hole that\'s left behind is filled in with your background color.  If you use your color picker to match the color of the section you\'re going to cut out, you can usually move a cut section and leave a clean area behind.

Cut and move an irregular sectionThis tool is the first icon in the first column in your toolbox.  The only difference between this tool and the rectangular section tool is that you can cut out and move a freehand section rather than a square orrectangular section.  Otherwise the two tools work the same way.

Draw linesThere are two tools for drawing tools in your toolbox, located just beneath the spray can and text tools.  The straight line tool is used for drawing a straight line between two points.  The curved line tool draws a curving line between two points.
(1)  Straight linesWhen you select either line drawing tool you can choose one of five line thicknesses.  Your cursor changes to a crosshair when you move your cursor onto your work surface.  To use the tool you move your mouse to where you want your line to start, then hold your left (foreground color) or right (background color) mouse button down while you move your mouse to where you want your line to end.  To draw your line you release your mouse button.
(2)  Curved lines (Bezier curves)The curved line drawing tool is a bit more complicated to use than the straight line tool.  Might need to get out a calculator or slide rule and do some trigonometry if you want to create precision curves.  The curved line tool lets you draw Bezier curves that have up to two control points.  For a relatively simple curve, after you draw your line you create a control point by clicking and holding on a point on the side of the line in the direction you want your curve to go and then, still holding your mouse button down, you drag your mouse into the curved shape you want, then release your mouse button.  Sort of like pulling on a rubber band stretched between two points.  You can create a more complex curve by creating two control points instead of one.  After you\'ve created and set your first curve you move your mouse to some other point on either side of the line, where you create a second control point and pull out another curved section (which will also impact on the shape of your other curve).  Keep in mind that when you create the second control point you\'re creating a curve that\'s defined by the mathematical relationship between the anchor points of the line and its two control points.

For more information on Bezier curves do an Internet search on the subject, or find a good graphics design text book.

Draw shapesThe four tools for drawing shapes are located just below the line drawing tools in your toolbox.  The four shapes that you can draw with these tools are a rectangle, an ellipse, a rectangle with rounded corners, and a multi-sided polygon.
(1)  RectanglesYou draw both rectangles the same way.  You decide where you want to put a corner of your rectangle, click and hold either the left or right button of your mouse and drag your mouse diagonally to where you want the opposite corner to be, then release you mouse button to set the rectangle.
(2)  EllipsesFor an ellipse you decide where you want to start and end the ellipse, and where you want one side to be.  You start your ellipse by clicking on a line of where you want the end and one of the sides of your ellipse to be, then dragging your mouse up or down over to where you want your ellipse to end.
(3)  PolygonsWith the polygon tool you can draw any combination of intersecting and non-intersecting lines to create any kind of a shape that you want.  You have to draw the first line of your shape by clicking and holding one of the mouse buttons at the start of the line, dragging your mouse to the end point of that first line, then releasing the mouse button to set that point.  From there on you can simply move your mouse to the next point in the line, click your mouse button to extend your line to that point, then do the same thing for all the points in your polygon.  You can also release your mouse button when you reach your first endpoint, click and hold your mouse button while you drag your mouse (and your line) to the next endpoint, and repeat until you reach your last endpoint.  You\'ll continue to draw lines (wanted or unwanted) until you select a different tool from your toolbox.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-6 11:37:52 | 显示全部楼层
Lesson Nine:  Creating Kneeboard Files
What Are Kneeboard Files?
Kneeboard files are checklists, notes, references, and other reminders that you can call up quickly whenever you need them while you\'re flying.  They\'re called kneeboard files because pilots used to use (and sometimes still do) a wood or metal clipboard strapped to their leg just above their knee.  The clipboards were essential if you need to keep checklists and references close by in the cramped cockpits an limited space of pre-modern civilian and military aircraft.

Click here to see one example of a kneeboard, along with a typewritten checklist and aircraft owner\'s manual that can be clipped to the clipboard where they can be ready for reference.

In Flight Simulator 98 there aren\'t any kneeboard files like the ones in the later versions of Flight Simulator.  In this version you can select one of several checklists when you click on the Aircraft → Checklists main menu command option.  In this version when you select a checklist it shows up written nicely on a little spiral notepad.

In Flight Simulator 2000 through Flight Simulator 2004 there are four types of kneeboard files that you can call up and view; keyboard commands, checklists, references, and notes.  These files can be selected by using the keyboard key command F10, or from the Aircraft → Kneeboard main menu command option.

Other Types of Kneeboard Files
Although Flight Simulator\'s kneeboard files are specific text files (one each for checklists, notes, references, and key commands), you can create other equivalent or alternate files that you can call up and use in the same way that you would call up and use Flight Simulator\'s kneeboard files.

The alternate kneeboard files must be bitmap graphics files, however.  A [Window] or [Fixed Window] section in a panel configuration file will accept and display any bitmap file that you use as a value for the file= keyword, but they won\'t display text files.

Although more work is involved, using bitmap files in one or more [Window] or [Fixed Window] sections of your panel configuration file will give you a much wider range of reference material to use as alternate (.BMP) kneeboard files.

If you have a scanner available you can easily create bitmap files of reference materials.  One source, for example, are the Department of Transportation\'s Airport / Facility directories.  You can scan pages in the pubs that you\'d like to have as reference while flying.  You can also scan approach and runway charts, flight plans, ATC routing, weather briefings and reports, regional and sectional charts, or any other reference material (even oil company road maps) that you think you\'d like to be able to call up while you\'re flying.

Not having a scanner doesn\'t mean that you won\'t be able to create bitmaps for alternate kneeboard files.  You can use any other bitmap files that you might have on hand or can get from other sources.  For example, anything you see on your monitor can be captured using the Windows Print Screen keyboard key function (or alternatively, with one of the key combinations Shift, Ctrl, or Alt+Print Screen) that\'s included in all versions of Windows.  The Print Screen function will clip your screen capture to the Clipboard as a bitmapped image.  You can then easily paste that image into a Windows Paint file with Paint\'s Edit → Paste main menu command option.  You can save the Paint file as is, or use Paint\'s graphics tools to make whatever changes you\'d like before you save the file.

Writing and Editing Kneeboard Files
Since Flight Simulator\'s kneeboard files are ASCII text files, you can use Notepad to write new kneeboard files or edit existing ones.  The editing rules for kneeboard text files are the same as the editing rules for configuration files.

Kneeboard files are located in each aircraft\'s root directory.  The kneeboard file for keyboard key commands is common to all the aircraft in any given version of Flight Simulator. Because it\'s a \"one size fits all\" kind of file, it\'s located in Flight Simulator\'s AIRCRAFT directory instead of being repeated in every aircraft\'s root directory. The key commands text filename is kneeboard_keys.txt (kneeboard_keys.htm in Flight Simulator 2004).

Flight Simulator 98The checklists are one or more numbered sections in a configuration file in the aircraft\'s root directory.  You can edit this file just as you would edit any other configuration file.  The format for these files is simple, and easily understood.  You can easily add new sections or revise the ones that are already there in the file.  Note: If for any reason you decide to change the configuration file\'s filename (it\'s not magic, it can be changed), then you\'ll also have to change the checklist filename in the aircraft\'s AIRCRAFT.CFG file in the related [fltsim] section.

Click here to see an example.

If you open one of Flight Simulator 98\'s checklist configuration files you can see that the data section of the file (below the header, if one exists or you write one) begins with a [lists] section, followed by one or more numbered sections, e.g. [0], [1], [2], etc.  All of the keywords are digits followed by an equal sign.  All of the key values in the [lists] section have two values.  A comma separates the two values.  The first value is the title that will appear in the Aircraft → Checklist listings.  That parameter always starts with an ampersand (&) character, followed by the title of the list.  The second parameter is the title that appears at the top of the spiral notepad when the checklist is called up.  The keywords in the numbered sections are integers followed by an equal sign, e.g., 0=, 1=, 2=, etc.  The key values for these keywords are the text strings for the checklist procedures.

Click here to see an example (scroll down past the first example).


Flight Simulator 2000 and 2002The kneeboard files in these two versions of Flight Simulator can be written or edited when you call them up using the Aircraft → Kneeboard main menu command option. The files are ASCII text files, and can also be written and edited using Notepad.  The checklists, notes, and references are kept in separate files for each aircraft.  The kneeboard files are specified in each aircraft\'s AIRCRAFT.CFG configuration file in the file\'s [fltsim] section.

Click here to see an example.


Flight Simulator 2004Kneeboard text files were eliminated in this version of Flight Simulator.  Checklist and reference kneeboard files are still used in the program, but they are HTML-coded documents, not ASCII text files. You can edit and modify those files by using versions of Corel WordPerfect or Microsoft Word that can save a document as an HTML-coded file, or with web page processors.  If you know HTML you can edit those files with Notepad.  Notes kneeboard files are no longer used in this version.

Using Bitmaps with Alternate Kneeboard Files
Alternate kneeboard files are called up using the keyboard number and/or numberpad keys.  These are the keys associated with the [Window] and [Fixed Window] sections in a panel configuration file.  You can list your alternate bitmaps in Flight Simulator\'s views → Instrument Panel main menu command option if you want to by setting the section\'s nomenu= keyword value to 0 (false).  You can resize or position your bitmap with the parameters you state for the size_mm=, window_size_ratio=, and position= keywords in the sections you\'re using for your alternate kneeboard displays.  

Click here to see a [Fixed Window] section example.

Alternate kneeboard files that are used in [Fixed Windows] sections that aren\'t linked to the number keys on the number keypad can be selected with the Views → Instrument Panel main menu command option.

Displaying Kneeboard Files
Flight Simulator\'s kneeboard files are called up and displayed using either the F10 key or by clicking on the Aircraft → Kneeboard main menu command option.

Alternate kneeboard files are called up and displayed using either the Shift+(number key) linked with a [Window] section in the panel configuration file.  If you\'ve put an alternate kneeboard file in a [Fixed Window] section, it can be called up with the number pad key linked to the [Fixed Window] in the [Views] section, or by clicking on the View → Instrument Panel main menu command option if the nomenu= keyword value has been set to 0 (false).
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-6 11:39:34 | 显示全部楼层
Lesson Ten:  Understanding XML Gauges
Some Background
There are three major milestones in the history of the development of Flight Simulator:

  Bruce Artwick creating his brainchild, Flight Simulator.   his porting Flight Simulator from DOS to Microsoft\'s Windows operating system.   Microsoft using XML in Flight Simulator 2002.

In 1975, when Bruce Artwick (then an Electrical Engineering graduate student at the University of Illinois, Champaign-Urbana) wrote his epoch-making flight simulation demo for the Motorola 6800 microprocessor to support his Master\'s thesis (\"A Versatile Computer-Generated Dynamic Flight Display\"), he breathed life into a brainchild that would gradually become known throughout the personal computer world as Flight Simulator.

Over the next two decades Artwick went on to develop his brainchild from a thesis demo into a husky, full-blown, user-interactive, flight simulation program, one able to be run with both Motorola and Intel microprocessors and several different operating systems.

Artwick ushered in a whole new era for Flight Simulator when he ported the program to Microsoft\'s Windows operating system in 1995.  Then in 2002 Microsoft\'s Flight Simulator\'s developers included an XML parser and XML data sources in Flight Simulator, ushering in another important new era for Flight Simulator.

What is XML?
XML is frequently called a language, as in computer programming language.  And justifiably so.  Programming languages, from Dartmouth BASIC (Microsoft\'s progenitor) and the Motorola 6800 microprocessor\'s opcodes (operation codes used by Bruce Artwick when he created Flight Simulator) to contemporary programming languages like UNIX, C/C++ , and Java, all have – as do virtually all spoken and written languages – a defined, formal, standardized syntax.

XML is a document formatting language just like the document formatting languages used in Corel WordPerfect and Microsoft Word word processing programs.  Anyone who has written a web page (like the one you\'re reading now) has used HTML, a document formatting language very closely related to XML.

XML is a language used in text documents to control the application and transfer of information.  The method has been standardized by the World Wide Web Consortium (\"W3C\"), the international body that sets standards for the world wide web (Internet).

When you use XML you create a series of document markup commands (called tags) that you use to manage data that your document either needs to get from external data sources, or that your document needs to make available to data receivers like Flight Simulator.

In Flight Simulator, XML gauge documents are a series of instructions about how to create, display, and operate flight instruments.  An XML gauge document tells Flight Simulator what bitmap graphics files to use, when and where to use them, and what data sources within Flight Simulator the gauge is going to use.  The XML gauge document can also tell Flight Simulator what to do when a mouse is used with the gauge, either to operate some feature of the gauge, or to display information about the gauge.

XML data receivers like Flight Simulator have to have an XML parser (msxml.dll) to read the XML tags and information in an XML document.  Flight Simulator 2002 and subsequent versions link Microsoft\'s XML parser into their program. Flight Simulator 2000 and earlier versions don\'t, and that\'s the reason why XML gauges can\'t be used with the earlier versions.

Since XML tags are user-defined, Flight Simulator also has to have something that tells its XML parser what the tags mean.  In XML-enabled Flight Simulator versions there\'s a text document called the gauge schema (see GAUGE.XDR) which defines all the tags that can be used in gauge XML documents.  Using it\'s XML parser, the gauge schema, an XML-coded gauge document, and XML gauge data sources in the Flight Simulator program, Flight Simulator is able to create, display, and operate the gauge defined in the gauge\'s XML document.

A more detailed discussion of XML is beyond the scope of this tutorial. But if you\'re interested in knowing more about XML and its uses, there\'s any number of websites and text books that you can refer to.

What\'s the Difference Between GAU and XML Gauges?
There are a lot of differences between GAU and XML gauges.  The biggest difference between them is that a GAU gauge is created and operated in a computer program module attached to Flight Simulator, while an XML gauge is created and operated by Flight Simulator from instructions it reads in an external XML text document file.

Another significant difference between GAU and XML gauges is that while everything about a GAU gauge is contained within in a single program module attached to Flight Simulator, everything about an XML gauge comes from sources outside the Flight Simulator program.

GAU GaugesFlight Simulator\'s GAU files are dynamic link library (DLL) files.  They are binary files located in Flight Simulator\'s GAUGES folder.  The files are computer program modules that are linked into the main Flight Simulator program when Flight Simulator\'s configuration file parser encounters them while reading an aircraft\'s panel configuration file.  Every gauge is either a separate DLL (i.e., single-gauge .GAU files), or included with other gauges in a single DLL (i.e., multiple-gauge .GAU files).  The gauge DLL includes the gauge\'s graphics, and the computer programming necessary to make the gauge operate.  Gauge DLLs can exchange operational data with Flight Simulator because they are an integral part of the program. The gauge DLL gets data from Flight Simulator\'s data sources to make the gauge \'work\'.

XML GaugesFirst of all, an XML gauge isn\'t a DLL.  It\'s a combination of a a text document that\'s a set of instructions to Flight Simulator, and bitmap graphics files that show what the gauge looks like.  A Microsoft Windows XML parser (a DLL) linked to Flight Simulator reads the XML-formatted text in the gauge\'s document file and passes to Flight Simulator information about the gauge and its operation, and how the gauge\'s bitmap graphics are selected and used.  Flight Simulator then uses this information to display the gauge and make it \'work\'.

XML Gauge File Basics
An XML gauge gets its name from the fact that an XML-formatted ASCII text document defines the gauge and its operating parameters.  Like a panel configuration text file, the ASCII text in the gauge\'s XML document follows a predefined format.

An XML gauge text file is a series of nested XML tags.  These nested tages are defined in two related but mutually exclusive Windows system documents, GAUGES.DTD and GAUGES.XDR.  Both documents define (in two different ways) the tags that can be used in an XML gauge\'s document file.

GAUGES.DTDThis file is a W3C document type definition (DTD) that defines a tag, along with all the additional tags and values (attributes) than can be used with the tag.  The format used in a DTD for tag definitions is specialized, resembling formats used in defining computer programming languages.  To be able to understand and write DTDs you have to know W3C\'s DTD statement conventions and protocols.  GAUGES.DTD is located in the Windows system directory.  Click here to look at an extract from GAUGES.DTD.

GAUGES.XDRDTDs are difficult to read and write because they use format conventions that are different than XML. Because of this, Microsoft came up with the idea of using schemas, and an XDR (XML Data Reduced) schema definition document as a more user-friendly alternative to DTDs.  Schema definition documents use an XML style format to define the tags used in a schema.

GAUGES.XDR is the schema definition document that defines the XML schema <gauges>.  The XDR defines the schema\'s namespaces and elements, and the attributes of each of the elements.  All Flight Simulator XML gauge files use the tags defined in GAUGES.XDR.  GAUGES.XDR is located in the Windows system directory.  Click here to look at an extract from GAUGES.XDR.

Cabinet FilesThe files used to create XML gauges are contained in Microsoft cabinet (.CAB) files.  One or more XML gauges can be included in a cabinet file.  A utility to make cabinet files (cabdir.exe) is included with Flight Simulator 2002 and subsequent versions.  CABDIR.EXE is a file compression utility that compresses the files in a source folder.

When using the utility you specify the source folder where the files you want to put into a cabinet file are located, and the filepath, filename, and filename extension (.cab) of the destination cabinet file.  Extracting a gauge from a cabinet file is done in much the same way as when you extract a gauge from a multi-gauge .GAU file; you specify the gauge\'s cabinet filename followed by an exclamation point ( ! ) and the gauge\'s XML filename (without the .XML file extension).

Click here for an example of a single-gauge cabinet file.  If you look all the way to the right of the display in the PATH column you\'ll see that the 640 pixel and 1024 pixel bitmaps are kept in subdirectories within the cabinet file folder.

In this example the files for the 747-400\'s standby (analog) altimeter have been extracted from the cabinet file holding the 747-400\'s gauges and put in a separate single-gauge cabinet file (747SbyAlt.cab).  You can see an example of how this single-gauge file can be used in the Extra 300S panel configuration file by clicking here and scrolling down to the gauge09= entry in the [Window00] section.

In the example you\'ll see that the original entry for gauge09= has been commented out (to preserve the original entry), then followed by a new entry for the gauge.  Notice also that the XML gauge uses the same X,Y position values as the original .GAU gauge.

Gauge XML DocumentsA standard XML gauge document has an .XML file extension which identifies it as an XML file.  Since XML files are ASCII text files, Microsoft\'s Notepad and Wordpad, or any other text editor or word processor progam can be used to read and edit the files.  XML files can also be read (but not edited) with Internet Explorer, Netscape, or any other web browser able to display an XML document\'s structure.

If you click here you\'ll see an example of what the text of an XML gauge file looks like when you open the file with a text editor.

If you click here you\'ll see an example of what the text of an XML gauge file looks like when you open the file in a web browser. The advantage of looking at an XML document with an XML-enabled web browser is that you can expand and collapse the tags in the document to get a better idea of how the gauge is designed.

If you click here you\'ll see the basic structure of a gauge file.  This view gives you a quick view of the number of elements used in a gauge\'s design.

If you click here you\'ll see the basic structure of the file with one element expanded.  This view lets you look at just a single element without being distracted by the text of adjacent or other elements.

And if you click here you\'ll see that the <Mouse> element takes care of mouse clicks and mouseover movements.

Gauge Bitmap FilesBitmap graphics files show the physical shape and appearance of a gauge and its component parts.  Every XML gauge has to include at least one bitmap graphic file.  Click here to see some examples of XML gauge bitmaps.


XML Gauge Bitmaps
The gauge graphics used with the XML gauges are standard Microsoft/OS2 bitmap (.BMP) files. They are not the \'mipmaps\' or other Microsoft variants that also use the .BMP file extension.  This means that you can use Windows Paint or your favorite graphics program to embellish, enhance, or otherwise improve or change the appearance of your aircraft\'s XML gauges.

There are two sets of bitmap graphics in a set of XML gauge files. One set is used when your display resolution is set lower than 800 x 600 pixels, the other set is used when your display resolution is set to 800 x 600 pixels or higher. Both sets of bitmaps have identical filenames.  They are kept separately in their own subdirectories within the gauge\'s cabinet file.  Microsoft\'s standard for the folder names when you have the two sets of bitmaps is that the bitmap files used with low resolution displays are kept in the 640 subdirectory and the high resolution files are kept in the 1024 subdirectory.

You can eliminate the two subdirectories and lump the gauge\'s bitmap files and the gauge\'s XML document all together in one directory if you are using just one set of bitmaps for all display resolutions.

Click here to see the 1024 scale bitmaps for the Boeing 747-700\'s standby altimeter and the Beech Baron 58\'s Kollsman altimeter. The 747\'s standby altimeter can be found in Flight Simulator 2002 and later versions; the Baron\'s altimeter can be found in Flight Simulator 2004.


The 747-400 XML Standby Altimeter
The best way to understand XML gauges is to take one apart.  The Boeing 747-400 in Flight Simulator 2002 and subsequent versions uses XML gauges exclusively in its instrument panel gauge displays.  So if you want to see how an XML gauge is put together, the 747\'s standby altimeter is a good one to start with.

There are seven component parts to the 747\'s standby altimeter: six bitmaps and an XML document.  You\'ve already seen what the gauge\'s bitmaps look like.  Those bitmaps and the altimeter\'s XML gauge file are what Flight Simulator uses to construct the altimeter and make it work.

You\'ve already seen that the altimeter\'s XML gauge file uses the GAUGES.XDR schema tag <gauge>.  That tag encloses a simple <Image> tag and thirteen complex <Element> tags (click here to look at it again).  Tags which don\'t enclose other tags are called \'simple\' tags.  Tags which enclose one or more additional tags are called \'complex\' tags.

XML requires that tags have an opening tag and closing tag.  Notice that everything in the file is enclosed between these opening and closing tags: <Gauge> and </Gauge>

There are fourteen elements in the 747\'s standby altimeter: one <Image> element, twelve <Element> elements, and a <Mouse> element.  We\'ll go through the gauge\'s XML document element by element to analyze it.



Root / document element
The <Gauge> element is always the first element. The first element in an XML document is called the root element when you\'re talking about the tree structure of an XML document and its nodes, or the document element while you\'re writing XML documents.  All Flight Simulator XML gauge documents use <Gauge> as the document element.  All the other elements that are in an XML gauge file are nested inside the document element.  The document element requires an opening and a closing tag, as shown here.


<Gauge>

(document element\'s contents)

</Gauge>




Altimeter image
The <Images> element specifies the base bitmap image of the gauge.  This is the image on which the altimeter needle and the digital readouts are displayed.


<Image   Name=   ImageSizes=   />



Pressure altitude digital readout
The first three <Element> types are used for the pressure altitude digital readout.  The first of the three elements defines the position of the ten thousand feet/meters digital readout.  The second of the three elements defines the position of the thousands fee/meters digital readout.  The third of the three elements defines the position of the hundreds feet/meters digital readout.  All three elements use the same template, but each has its own set of attribute values.  Attribute values noted as being (unknown) are value types and ranges that are either not documented or not clearly documented by Microsoft in their panel SDK (or other sources).

<Element>
      <Position   X=   Y=   /> X= , Y= the X and Y value of the starting point for overlaying this element\'s mask and image over the altimeter background.
      <MaskImage   Name=   ImageSizes=   >
           <Axis   X=   Y=   >
      </MaskImage>
Name=   filename and extension of the mask bitmap.  For this group of elements the mask bitmap is the upper mask.

ImageSizes= the X,Y size values, first pair for the /1024 dpi bitmaps, next pair for the 640 dpi bitmaps.

X=  , Y=    (unknown)
      <Image   Name=   ImageSizes=   >
           <Nonlinearity>
                <Item    Value=   X=   Y=   />
                <Item    Value=   X=   Y=   />
           </Nonlinearity>
      </Image>
Name=   filename and extension of the image file.

ImageSizes=   the X,Y size values, first pair for the /1024 dpi bitmaps, next pair for the 640 dpi bitmaps.

Value=   (not known)

X= , Y=   (not known)
      <Shift>
           <Value>
           </Value>
           <Failures>
                <SYSTEM_PITOT_STATIC   Action=   />
                <GAUGE_ALTIMETER  Action=   />
           </Failures>
      </Shift>
<Value> attribute parameters   the math and logic statements that drive the ten thousands, thousands, and hundreds digital readout segments defined by this group of elements.

Action=   (the possible failure responses are not known)
</Element>




The two barometric pressure digital readouts
The next eight <:Element> types are used for the barometric pressure digital readout.  The bitmap for these three elements is the baro_card bitmap.  The first four elements are used for the millibar digital readout.  The second four elements are for the inches of mercury (inHg) digital readout.  All eight elements use the same template, but each has its own set of attribute values.

<Element>
      <Position   X=   Y=   />

      <MaskImage   Name=   ImageSizes=   >
           <Axis   X=   Y=   />
      </MaskImage>

      <Image   Name=   ImageSizes   >
           <Nonlinearity>
                <Item   Value=   X=   Y=   />
                <Item   Value=   X=   Y=   />
           </Nonlinearity>
      </Image>

      <Shift>
           <Value>
           </Value>
      </Shift>
The template for the four elements in this group is almost identical with the template for the altitude digital readout group of elements.

One difference in this group is that the mask bitmap for this group of elements is the lower mask is used instead of the upper mask.

The second difference in this group is that it doesn\'t include a failure mode in the <Shift> element because the barometric pressure digital readout parameter value is set by the user.
<Element>




Analog altimeter needle
The last <Element> type is used for the standby altimeter\'s analog needle.  The template for this element is similar to the preceeding eleven elements in many respects.  The big difference in this element is that it uses the <Rotate> sub-element to drive the needle\'s 360-degree rotation.

<Element>
      <Position   X=   Y=   /> (same as in pressure altitude digital readout table)
      <Image   Name=   PointsTo=   ImageSizes=   >
           <Axis   X=   Y=   />
      </Image>
Name=   (same as in pressure altitude readout table)

PointsTo=   (unknown). Value can be East, South, West, or North.

ImageSizes=   (same as in pressure altitude readout table)

<Axis>   X=  Y=  (unknown)
      <Rotate>
           <Value>
           </Value>

           <Failures>
                <SYSTEM_PITOT_STATIC   Action=   />
                <GAUGE_ALTIMETER   Action=   />
           </Failures>

           <Nonlinearity>
                <Item   Value=   X=   Y=   />
                <Item   Value=   X=   Y=   />
           </Nonlinearity>

           <Delay   DegreesPerSecond=   />
      </Rotate>
<Rotate>   Element that rotates needle around center point of gauge.

<Value>    Sets needle position to read either meters or feet.

<Failures>   (same as in pressure altitude readout table).

<Nonlinearity>   (same as in pressure altitude readout table).

<Delay>   (unknown)

</Element>




Mouse movement and click events
The <Mouse element specifies the text that\'s displayed on mouseover or mouse click events.

<Mouse>
      <Help   ID=   MetricID=   />


      <Tooltip   ID=   MetricID=   />

      <Area   Left=   Right=   Top=   Bottom=   >
           <Help   ID=   />
           <Tooltip   ID=   MetricID=   />

           <Area   Right=   >
                <Cursor  Type=   />
                <Click   Event=   Repeat=   />
           </Area>

      </Area>

ID=   Attribute value points to Help or Tooltip text to be used.

MetricID=   (Unknown.  Attribute is misspelled by Microsoft in this element).

<Area  Left=   Right=   Top=   Bottom=     (unknown).

<Cursor   Type=         Values are none, normal, hand, crosshair, and four directional arrows.

<Click   Event=     Type of mouse event, e.g. mouseover.

<Click   Repeat=     Values are either Yes or No.

</Mouse>


Modifying an Existing XML Gauge
One of the advantages of using XML gauges is that you don\'t have to be a computer programmer to work with XML gauge files. Taking an existing XML gauge and modifying it to create a new type of gauge can be surprisingly easy.

For example, you can create a quick and dirty digital/analog radio altimeter simply by changing the \"A:Indicated Altitude\" parameter the Boeing 747-400\'s standby altimeter XML gauge file to read \"A:Radio Height\" instead.  The same thing can be done with Flight Simulator 2004\'s Beech Baron 58\'s XML Kollsman altimeter to create a radio altimeter that more closely resembles a military-style gauge.  Click here to see an example of one of the elements where this change was made in the 747\'s STANDBY ALTIMETER.XML document.

Obviously, when you modify an existing gauge like this you save the file with a different filename, e.g. RADAR ALTIMETER.XML can be used as a filename in this case.  To create a radio altimeter like this the only thing you have to do is change some text in the gauge\'s XML document; you don\'t have to make any changes to the gauge\'s bitmap files.

Modifying parameters in a gauge\'s XML document to create a different type of gauge will be very difficult if you don\'t have a list of parameters that are used in your version of Flight Simulator.  Fortunately, all of the information you need about Flight Simulator\'s gauge parameters is provided by Microsoft in their Flight Simulator 2002 and 2004 software development kits (SDKs).

For panel and XML gauge development you\'ll need to download (a) the panel and gauge SDK, and (b) the cabinet file SDK.  Both SDKs include the kind of documentation and reference material that you need to have if you\'re going to modify or create XML gauges.

Some of Flight Simulator 2004 SDK\'ss are updated versions of the ones in the Flight Simulator 2002 SDK.  If you\'re using Flight Simulator 2002 you can download and use the Flight Simulator 2004 panel and gauges SDK, and the Flight Simulator 2004 cabinet file SDK, without a problem.  To download these two SDKs go to the Microsoft website at:

www.microsoft.com/games/flightsimulator/fs2004_downloads_sdk.asp

Exercise Ten in the companion workbook to this tutorial has exercises to help you go step by step to edit the XML documents for both gauges. Exercise Ten also includes an exercise on using the cabinet file utility that\'s included with Flight Simulator 2002 and subsequent versions to make cabinet files for your modified gauges.

XML Gauge MathThe four-function math (add, subtract, multiply, divide) used in Flight Simulator\'s XML gauges is quite unlike the four-function math that you\'re familiar with.  The math we\'re used to is called infix notation.  The math used in Flight Simulator\'s XML gauges is called postfix notation.

Postfix notation (also known as reverse Polish notation, or RPN) is more compatible with computer architecture than infix notation.  There\'s no special difference at all between the two types of notation until you get to where you\'ve got three or more operands that have to be grouped before their math functions can be performed on them.  With infix notation your math parser has to be able to identify grouping signs (e.g., parentheses), then separate and group operands according to the grouping signs, then determine the order of computation, and then carry out the computations before it can give you a final result.

RPN doesn\'t do that.  RPN just has operands on one hand and functions on the other.  Operands that come in are stacked up like plates on a table, and so are the functions that have to be performed on those operands.  All an RPN parser has to do is to pop the first two operands off the top of its stack of operands, pop a function off the top of its stack of functions, do the function to get a result (which becomes the next operand), pop another operand off the operand stack, pop a function off the function stack, do the function on both the operand and the last result which then gives the parser a new result.  The parser keeps on doing this yada yada yada until there\'s nothing left on the table but two empty stacks and the final result.

XML gauge computations could be done using infix notation.  But by using RPN, gauge computations can be done faster because, as you can see, RPN computations are less complicated to execute than infix computations.

Using an altitude computation to illustrate the difference between infix and postfix notation, the equation for altitude (in thousands of feet) in infix notation would be written as:

Altitude (in thousands of feet) = [Indicated Altitude]&#8195; [divide by]&#8195; [1000]

The same equation in postfix notation in an XML gauge file would be written as:

Altitude (in thousands of feet) = [Indicated Altitude]&#8195; [1000]&#8195; [divide by]

You\'ll note that with infix notation the indicator that the operand [Indicated Altitude] is to be divided by the operand [1000] is put in between the two operands.  But with postfix notation the indicator that the operand [Indicated Altitude] is to be divided by the operand [1000] follows after the two operands.

Without going further into postfix notation, just be aware that when you write a math equation in an XML gauge file, you have to use postfix notation.  With RPN the first operand is the one the second operand works on, and that the symbol of the function to be performed is put after the two operands.

The one problem with using RPN in an XML file that you should be aware of is that the division symbol ( / ) can be confused with the symbol used in an XML closing tag ( /> ).

It\'s beyond the scope of this tutorial to go any further into reverse Polish notation than what\'s been covered here to help you understand Flight Simulator\'s XML gauges.  For further information on RPN you can visit this website:

www.sciencedaily.com/encyclopedia/reverse_polish_notation

Using XML Gauges in Other Aircraft
Flight Simulator 2000 and earlier versions don\'t link Microsoft\'s XML parser (msxml.dll) into the program or have the other necessary XML support, so you\'re not able to use any XML gauges in those versions.

Flight Simulator 2002 links Microsoft\'s XML parser and has the other necessary XML support, but the Boeing 747-400 is the only aircraft in that version that uses XML gauges.  Flight Simulator 2004 also links Microsoft\'s XML parser and has XML support, but the Boeing 747-400 and the Beech Baron 58 are the only two aircraft in that version that use XML gauges.

You can use the 747\'s and Baron 58\'s XML gauges in any aircraft that can be flown in Flight Simulator 2002 and subsequent versions.  You can use the gauge cabinet files for either the 747 or the Baron 58 and extract gauges the same way that you\'d extract and use a gauge in a multi-gauge .GAU file.  It\'s actually easier, in fact.  Unlike a multi-gauge GAU file you can open an XML gauge cabinet file and immediately see what gauges are there.  And just like when you use any gauge from a multi-gauge .GAU file, you might have to change the gauge\'s size parameter values to adjust the gauge to fit your panel.  But the important thing is that the XML gauges will work in aircraft that were not originally designed with XML gauges in their instrument panels..

With Flight Simulator 2002 and subsequent versions you can create cabinet files for subsets of Flight Simulator\'s XML gauges, or to hold add-on XML gauges that you might design yourself or download from websites.  Creating gauge cabinet files isn\'t at all difficult to do, and the \"cabinet maker\" tool to do it is included with Flight Simulator 2002 and subsequent versions.  The only caveat is that the cabinet maker tool (cabdir.exe) is a DOS program that requires parameters to be passed to it, so you use the DOS command prompt window to run the program.

You should expect to see a steadily growing number of XML gauges, XML gauge documents, and XMLgauge bitmaps showing up for downloading on Flight Simulator-related websites as an understanding of XML and how XML gauges work spreads through the Flight Simulator community

In Exercise Ten in the workbook accompanying this tutorial there\'s an exercise that takes you through the steps of extracting a gauge\'s files from one of Flight Simulator\'s XML gauge cabinet files and creating a separate cabinet file using the DOS cabdir.exe cabinet maker utility.

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

本版积分规则

小黑屋|手机版|Archiver|(inSky)

GMT+8, 2025-4-29 17:46 , Processed in 0.052430 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表