FGRUN - FlightGear Launch Control

external: index
internal: preamble | prerequisites | checkout | fltk | folders | building | ATI problem | functions | running | image | recording | downloads | build 2011 | end

Preamble

2011-10-16: This is not exactly an update, but I wanted to recompile a version of FGRUN that used PLIB instead of OSG to display the aircraft, so I went back to a 2008 source (in C:\FG\26), and re-built fgrun. See build 2011

2008-12-05: It had been a while, since mid-2006, fgfs-027.htm, that I last visited this source, so it was about time, about 2.5 years later, to look again!

Home Page : http://sourceforge.net/projects/fgrun
Help Pages : http://wiki.flightgear.org/index.php/FlightGear_Launch_Control

This is a great application, adding a GUI front end to running FlightGear. See this page - fgfs-047.htm - for building of FlightGear and its prerequisites, which must be done BEFORE building FGRUN ...

top


Prerequisites

As the README in the downloads states -
- FLTK-1.x.x with threads enabled - http://www.fltk.org/
- PLIB 1.8.4 or greater - http://sourceforge.net/svn/?group_id=382
- SimGear 0.3.10 - http://www.simgear.org/
- OpenGL or equivalent - say freeglut - http://sourceforge.net/cvs/?group_id=1032
- gettext (optional) - http://www.gnu.org/software/gettext/

And for Simgear -
- zlib-1.2.3 - http://www.zlib.net/
- OpenAL 1.1 SDK and ALUT - http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx
- OpenSceneGraph (includes OpenThreads) - http://www.openscenegraph.com/index.php
- libpng - http://sourceforge.net/project/showfiles.php?group_id=5624
- pthreads - http://sources.redhat.com/pthreads-win32/

These are all repeated on my - http://geoffair.net/fg/prereq.htm - page ...

Since this list is also needed for FlightGear, it makes sense to ONLY build FGRUN after you have been able to build FlightGear! And as can be seen below, I use the SAME WORK folder as my FG project.

top


The Checkout

The CHECKOUT (download) of the latest development source was easy ... It is hosted on sourceforge.net, with fredb (Frederic Bouvier), and bbright (Bernie Bright) as administrators - the SVN command is (for only the 'trunk' - development branch).

> svn co https://fgrun.svn.sourceforge.net/svnroot/fgrun/trunk fgrun

Note, without the addition of 'trunk', you will get all branches and tags, which you may need if you want to do a PLIB version - there is a branches/plib source, which would presumably also require the Simgear PRE-OSG library, rather than the latest which uses OpenSceneGraph (OSG) ...

top


Building FLTK Static Library

FLTK Home Page: http://www.fltk.org/

From the 'trunk' source of FGRUN I downloaded, it appears it used version fltk-1.1.7, but will (maybe?) function with later versions of FLTK, which at this time is at 1.3.x, but perhaps _NOT_ with fltk-2.x.x?

I decide to go with the OSG (latest 'trunk') FGRUN version, and fltk-1.3 ... and because of the OSG dependence, I add these two folder, 'fgrun' and 'fltk-1.3' to my latest FG WORK folder, D:\FG\27, see fgfs-047.htm page, since this is where I have PLIB, zlib, SimGear, etc, but more importantly _ALL_ the OSG DLLs ...

After making a new folder, D:\FG\27\fltk-1.3, I copy the updated SVN SOURCE to this WORK folder. There is a folder 'ide', with a README.IDE file, which indicates I should use vc2005 since I am building with MSVC9 (2008) Express ...

I load the ide/vc2005/fltk.sln file, and proceed with the 'conversion'. I end up with 72 projects. Since I ONLY want the static library, fltk.lib, I uncheck everything in the MSVC Configuration Manager, except fltk, which is the 'static' library, for BOTH Release and Debug ... I later ALSO found I need fltkgl.lib to be built, so I end up building 2 of the 72 projects ... I built the Release and Debug ... skipping some 70 projects, but in Debug MSVC9 insists on building about 10 others! 

This process puts the static libraries into the WORK folder fltk-1.3\lib

   12/05/2008 03:29 PM 1,420,666 fltk.lib
   12/05/2008 03:34 PM 3,976,156 fltkd.lib
   12/05/2008 04:35 PM   155,976 fltkgl.lib
   12/05/2008 04:35 PM   403,472 fltkgld.lib

This, combined with all the FGFS stuff already there, I hope I am ready for building FGRUN ...

top


Work Folders

This increased my WORK folders to, in my case in D:\FG\27 :

image of WORK folder

Sound Library: Note the alut folder, which contains the source to build the ALUT.DLL, but as mentioned elsewhere, I now use the OpenAL 1.1 SDK, rather than compiling OpenAL32.DLL and wrap_oal.dll from source ...

top


Building FGRUN Application

The 'trunk' source also contains a MSVC6 (dsw/dsp) build files, but it seems these are quite out of date. That is the sources in the DSP file do not match the sources in the checkout, and fltk-1.1.4 is indicated! However, there is also a MSVC7.1 (sln/vcproj) build files, which seems to more closely match the source, and indicates fltk-1.1.7, and further indicates this is fgrun VERSION="1.1.0" ...

After making a new folder, D:\FG\27\fgrun, I copy the updated SVN SOURCE to this WORK folder, and remove the doubled 'fgrun' folders ...

D:\FG\27\fgrun> xcopy /S c:\FGCVS\fgrun\fgrun .

and then load, and convert msvc\7.1\fgrun.sln ...

It had 2 projects, but I remove SimGear, since this library has already been done ... Before trying a build, I check the fgrun Property Pages -> Configuration Properties -> C/C++ -> General - Additional Include Directories, and correct "..\..\..\fltk-1.1.7" to my "..\..\..\fltk-1.3", and several other path adjustments ...

But when I start the build, I get an error -

Project : error PRJ0019: A tool returned an error code 
  from "Generating portugese translation"

... where did this come from?

Hmmm, each of the Resource Files - say de.po - the de.po Property Pages, shows a 'special' build step, like ..\..\..\getetxt\bin\msgfmt -o ...etc ... BUT I do not have this tool ... so I exclude each of the *.po files from the build ... and get to my next error ...

d:\fg\27\fgrun\src\i18n.h(39) : fatal error c!083: Cannot open include
   file: 'libintl.h': No such file or directory

I can get past this by REMOVING ENABLE_NLS from the Preprocessor Definitions ... I later read the ABOUT-NLS file in the root fgrun folder, but decide to forgo multiple languages, for now, since it would add another prerequisite of 'gettext' ... note I mark this source as 'optional' above.

The next error, when compiling fgrun.rc, is that it can NOT find the file 'resource.h', so I create one, and add the one IDI_ICON1 define to it ... Then it can not find 'afxres.h', so I change this to 'windows.h' ... And it builds, but on the link, it can not find 'fltk.lib' ... so I fix the Additional Library Directories ... and note I must also add SimGear.lib, and a path to this library, "..\..\..\Simgear\Release", in my case, remove intl.lib, and add back fltkgl.lib ...

*** AND IT LINKS *** ;=)).

Of course, to run this fgrun.exe I MUST copy it to my D:\FG\27\bin folder, where all the necessary DLLs exist to run FlightGear.EXE ...

AND IT RUNS ... I connect it to my local FlightGear.exe, and my local 'data', select the c172p, and KSFO, and click [ Run ], and -

IT WORKS ;=)) FlightGear loads, and I AM FLYING ;=))

top


ATI Graphic Card Problem

But, as noted before, see image, some of the instruments do not show on the aircraft panel in this machine, so I download, and install the latest ATI drivers and Catalyst Control Center, to suit my ATI Radeon HD 2600 XT in this Vista-32 powered machine ... in my case the file was 8-11_vista32_dd_ccc_wdm_enu_70229.exe, about 42MB ...

This installation, which I directed to the folder c:\Program Files\ATI, took a long, _LONG_ time - at certain stages I thought it had 'stalled', but with lots of patience - especially when it at one stage changed the screen resolution to something like 640x480 - it completed successfully, and REBOOTED the machine ...

NOW ALL MY INSTRUMENTS, that were missing before, ARE NOW SHOWN - PHEW!!!

top


FGRUN Functions

So now I have added FGRUN to my WORK folder, and successfully compiled it, excluding the *.po file conversions ...

One 'feature' that I did not like was when I selected a 'scenario', just to see what that was about, there seemed no way to later 'deselect' it ... so I created a file 'WORK/data/AI/nothing.xml', with a description 'This is a NULL scenario', and made no <entry> items ... and this seemed to be ok, as a sort of 'do nothing' selection ... maybe later I could modify the code to NOT add anything to the command line when this 'nothing' is selected, or have a special 'none' entry in the list ...

I later learned that I can delete the file fgrun.prefs that, in my case, is stored in c:\Users\Geoff\AppData\Roaming\flightgear.org, or at least remove the 'scenario-item-1:', and maybe the scenario-count:1 entries from it ...

But to have any chance of changing the code I also needed to build the Debug configuration, but to do this I had to go back and build the Debug configuration for OSG, and my full FGFS.SLN set ... and then run my UPD.BAT with a 'd' switch, in a MSVC command prompt, 'WORK> upd d', to copy _ALL_ the debug libraries to WORK\bin ...

And so that I can run it with all the DLLs, I change the fgrun Property Pages -> Configuration: Debug -> Configuration Properties -> Linker -> General -> Output File: to ..\..\..\bin\fgrund.exe, and make that folder, WORK\bin the Debugging -> Work Directory ...

That all WORKED ;=)) Now I could trace through the FGRUN code, if I wanted too ...

top


Running FGRUN

Although fgrun.exe is a CONSOLE application, it uses FLTK to generate, and run a window - that is a Graphical User Interface (GUI), where all the hundreds of FG command line parameters are represented as mouse selectable options. It is made up of  many 'pages' of options, as the following HELP documentation describes ...

It seems the MAIN (HELP) documentation for running FGRUN is on the FlightGear Wiki - http://wiki.flightgear.org/index.php/FlightGear_Launch_Control - there is a great set of screen shots, with some good explanation of most of the options ...

One of the features I like the BEST is the aircraft selection page! If, like me, you are not always familiar with an aircraft just from its name, FGRUN has a preview, like :-

Preview of the aircraft

Just by selecting its name from the long list on the left, a preview image of the aircraft is shown -  FANTASTIC STUFF ! Even an indication of its 'Status', and 'Author(s)', if available in the specific WORK/data/Aircraft/xxx/xxx-set.xml file, which (I assume) is what the left list is based on - see search_aircraft_dir() function in wizard_funcs.cxx ...

With OSG, there is an osgviewer.exe built, which will also load AC3D *.ac files, and show the models, but it is great to have an immediate 'preview' available like this ...

Of course I miss the fact that the previous PLIB version of FGRUN used to slowly rotate the model automatically, but now you can use the left click hold and mouse to rotate the model to any angle desired. You can not have everything ;=)). And it seems to include at least one 'strange' things like ATC, which does 'run' - see http://wiki.flightgear.org/index.php/ATC-aircraft, - but it is NOT an aircraft as such, and has no 'preview' model!

Take care, the FGRUN application 'hangs' if you select the 'Airbus A38-House', and aborts on the 'Fokker 50', but understand this may not be a problem with FGRUN, but the aircraft model itself - you also sometimes see 'warning' messages output to the console on loading certain 'models' ...

 But all in all, a  FANTASTIC APPLICATION  that really SIMPLIFIES the running of FlightGear, with its hundreds of command line options ;=))

top


Record of Flights

As per my June 2006 build, see fgfs-027.htm, I added back my very rough 'Flight Log' function, but this time used gmtime(), instead of simple ctime() to output the start and end times ...

It would be nice addition to FGRUN to add options, say a --logfile=<out_file>, and --cmdfile=<out_file>, to make it more flexible than outputting just the default names of tempcmds.txt and tempfgfs.log file names.

In fact the addition of --logfile=<something> could trigger the log keeping, and of course, this could/should be an 'extra' option added into the GUI selectable options, and kept in preferences ...

The additional source files, fgfslog.[cxx|h], and modified run_win32.cxx, are included in the fgrun-src-06.zip file below ...

top


Downloads

fgvc9rt06.zip - contains fgrun.exe, plus FlightGear.exe, and the many OSG DLL needed to run, plus Openal-06.zip, with OpenAL DLLs, but these should be obtained from the OpenAL SDK - see prereq.htm ...

vc9sln06.zip - contains fgrun/msvc/7.1/fgrun.sln, and fltk-1.3\ide\vc2005\fltk.sln, plus the relevant vcproj file, converted to MSVC9 (2008) ... It ALSO contains this fgrun.patch.txt file, to patch the current FGRUN SVN source to add the very rudimentary 'Flight Log' feature.

Date Zip Size MD5
2008-12-06 fgvc9rt06.zip 6,047,703 d7d051ab8a727f2feadaa5ec24b4b676
2008-12-07 vc9sln06.zip 130,450 f043bdf07311002b7eee787818855b4f

As always, take care downloading and running executables from the web! ;=((

top


Sources: <NOT RECOMMENDED>!

fgrun-src-06.zip - contains the full source of fgrun, including the modified fgrun/msvc/7.1/fgrun.sln, now converted to MSVC9, and the full fltk-1.3 source, with modified fltk-1.3/ide/vc2005/fltk.sln, now converted to MSVC9, ready for use. It also include the two new files, fgfslog.[cxx|h] adding the above flight logging to fgrun. 

File MD5 Size Date
fgrun-src-06.zip 078c7e9eb2c6c808eb088bd17316dac4 7,427,915 2008-12-06

This frozen, now stale full source is NOT RECOMMENDED. It is  BETTER  you checkout the latest SVN versions. If used, this should be unzipped, with folders, into the FG WORK folder, as mentioned above. These sources are incomplete without the full SimGear, OpenSceneGraph, etc, etc sources of full FlightGear project ...

top


Rebuild 2011

2011-10-16: This is not exactly an update, but I wanted to recompile a version of FGRUN that used PLIB instead of OSG to display the aircraft, so I went back to a 2008 source (in C:\FG\fgrun\fgrun2008\fgrunplib), using some 3rd party items form C:\FG\26, and C:\Projects, re-built fgrun. This was in XP, using MSVC8, and the MS DLL runtime (/MD and /MDd).

To make the build simple, I built each of the prerequisites, and copied their headers and libraries to a '3rdparty' folder, thus this source is sort of self contained. The folder structure, so important if you do not want to get into adjusting the MSVC8 build files, is -
<any-base>\3rdparty - This contains all the 3rd party headers in 'include', and the 3rd party libraries in 'lib'
 <any-base>\fgrunplib - The full source used in this build.

Some downloads:
fgrun-08-3rd.zip: The full content of the 3rd party folder.
fgrun-08-bin.zip: FGRUN WIN32 exe binaries.
fgrun-08-src.zip: Full FGRUN source, including the MSVC build files.

Date Link Size MD5
2011/10/16 fgrun-08-3rd.zip 17,664,904 e3a62b31993beff47d210d1ab7735898
2011/10/16 fgrun-08-bin.zip 1,258,787 386d8184ea157598ee5974bf806ce86e
2011/10/16 fgrun-08-src.zip 243,843 9fc7739bf8469082a6366cd4b28311a9

And for good measure, here are most of the 3rd party sources used -
fgrun-08-pthread.zip
- using the MSVC6 pthread_s.dsw, or MSVC8 pthread_s.sln build files, in the pthreads\static folder,
fgrun-08-PLIB.zip - using the MSVC8 plib.sln in the root,
fgrun-08-fltk-1.1.10.zip - using the MSVC8 fltk.sln in the vc2005 folder,
fgrun-08-simgear.zip - there are MSVC build files in this source, but may need adjustments,
fgrun-08-zlib-1.2.3.zip - using the MSVC8 zlib.sln build files in the 'projects\msvc8' folder.
Perhaps the ONLY missing item is OSG, but since ONLY some osg headers are needed, no OSG libraries, this has not been included.

Date Link Size MD5
2011/10/16 fgrun-08-pthread.zip 764,062 afa025c9ac699d556f518a67a198aed8
2011/10/15 fgrun-08-PLIB.zip 4,212,936 7e4c1c8d0d6af0ba2d19acaa9d9191e0
2010/05/22 fgrun-08-fltk-1.1.10.zip 3,528,854 406b252fed8a15abb4a43f0718f8710a
2008/11/18 fgrun-08-simgear.zip 964,074 30d45cd5b3bf108c5a6a2da8e667020d
2008/11/12 fgrun-08-zlib-1.2.3.zip 593,225 43d998b0668358b2a7f4ff17135b5795

Geoff.
October 16, 2011.

top


Geoff.
December 07, 2008.

EOF - fgfs-048.htm

checked by tidy  Valid HTML 4.01 Transitional