Aircraft Log

Started by wheelie, May 05, 2008, 01:51:18 AM

Previous topic - Next topic

wheelie

An addition for the wish list: a log of the aircraft that pilots use.

Why should I want this? Because one of the things that has always annoyed me is the way that FS9 handles the display of aircraft when you don't have the particular model that someone else is flying (ie you see a default Cessna or the same plane that you are flying). To solve this problem I created a 'multiplayer aircraft hangar' with about 450 aircraft types in it. It's available for anyone to use (http://users.skynet.be/wheelie/downloads/MAH.zip - takes a while cos it's 21MB) just unzip it into your FS9 aircraft folder.

However, identifying what planes people fly meant that I had to copy the chat text and pick up the plane names from that and then edit out all the chat to just leave the names of the planes.  But the rate at which new variants are created means it is time consuming to keep monitoring and editing the chat. If I could just have a log file that recorded the planes people use then that would speed things up for me.

Russell Gilbert

Hi,

Have you tried getting the info from the Pilot Logs?  Take a look at the Help page for more info:

http://www.chocolatesoftware.com/fshost/?help.html#pilot_logs

Russell

wheelie

Thanks Russell. Yes, I knew about the pilot logs but the name of the aircraft gets truncated to 35 characters. FS9 looks for an exact match on the aircraft name so truncated names can't be used. The chat log displays the complete aircraft name. Of the 750 aircraft names I have collected so far, 124 have names that are longer than 35 characters. The longest aircraft name I have ever seen is:
"Aeroworx Super King Air B200 MedCenter Air N210CM - 2D Analogue Cockpit & VC + Cabin V.I.P" (90 characters).

The 'top 20' list of long aircraft names is (90 characters down to 55 characters):

    Aeroworx Super King Air B200 MedCenter Air N210CM - 2D Analogue Cockpit & VC + Cabin V.I.P
    Locheed Martin Corp. F-16C Fighting Falcon Block 50 Hellenic Air Force 341st Sqdr v 2.3
    Project Opensky - Boeing Dreamliner 737-800 with Virtual Cokcpit - Blended Winglet
    Aeroworx Super King Air B200 MedCenter Air N209CM - 2D EFIS Cockpit & VC + Cabin
    [DXT3] Level D Simulations B767-300ER - United Airlines (Old Livery)
    Project Opensky - Boeing 747-312 Travel City Direct/Excel Airways
    [DXT3] Level D Simulations B767-300ER - KLM Royal Dutch Airlines
    B737-700 Southwest Airlines Classic  - Virtual Cockpit/Winglets
    Northrop/McDonnell Douglas YF-23A "Black Widow" II PAV-1 87800
    Project Opensky - Airbus A330-200 RR Emirates Airlines A6-EKW
    Project Opensky - Airbus A330-200 RR Emirates Airlines A6-EKZ
    [DXT3] Level D Simulations B767-300ER - First Choice Airways
    Super Hornet VFA-115 EAGLES Triple tank PAVEWAYx2 Sparrowx2
    Project Opensky - Airbus A340-311 Lufthansa "Oldenburg" WV
    Boeing Corporation "Dreamliner" B737-600 - Virtual Cockpit
    Super Hornet VX-9 VAMPIRES Triple tank PAVEWAYx2 Sparrowx2
    Aeroworx Super King Air B200 - 2D EFIS Cockpit, VC & Cabin
    Commerical Level Simulations - Airbus A300B4-608ST Airbus
    USAF F-16C-30 185th FW Gold Lockheed Martin F-16C Falcon
    Project Opensky - Airbus A340-313E Emirates Airlines WV
    50N Boeing 737-400 Alaska Airlines Salmon-Thirty-Salmon


Russell Gilbert

Ah, good point.

Have you tried the normal system log file?  (Server / Options / Log, enable log file and "Log aircraft changes").

Russell

wheelie

I tested 'log aircraft changes' and that looks like this:
Quote080513 06:39:51  Aircraft change for 'Wheelie': Learjet 45 Limited Edition
080513 06:43:36  Aircraft change for 'Wheelie': Boeing 737-400
080513 06:55:06  Aircraft change for 'Wheelie': Concorde Air France "Revolution"
080513 06:56:31  Aircraft change for 'Wheelie': Project Opensky - Boeing Dreamliner 737-800 with Virtual Cokcpit - Blended Winglet
080513 06:56:52  Aircraft change for 'Wheelie': Boeing 737-400
So that is recording the full aircraft name (no truncation) but it still leaves me with the problem of editing out all the irrelevant log entries to just leave the aircraft changes and to delete all the characters on the line that precede the aircraft name. That is the time consuming part I was trying to avoid by requesting an aircraft log. The only info I would want from the above example is:
QuoteLearjet 45 Limited Edition
Boeing 737-400
Concorde Air France "Revolution"
Project Opensky - Boeing Dreamliner 737-800 with Virtual Cokcpit - Blended Winglet
Boeing 737-400
This file I would then import into MS Excel where I have a macro that I use to generate the aircraft.cfg's for the multiplayer aircraft hangar (well it's a bit more complicated than that but never mind).

Russell Gilbert

#5
Yeah, you'd need a little script or something to strip out the parts you don't need.

Ok, here's what you can do...  I think this will be what you want.  :)

First, download and install these two programs:

Grep for Windows
(click "Setup" next to "Complete package, except sources")
http://gnuwin32.sourceforge.net/packages/grep.htm

Sed for Windows
(click "Setup" next to "Complete package, except sources")
http://gnuwin32.sourceforge.net/packages/sed.htm

Install both programs to their default location, which will be:

C:\Program Files\GnuWin32

Then you need to add those programs to your path, so you can use them from the command line.  Assuming you're using XP, go to Control Panel / System / Advanced, click "Environment Variables" at the bottom.  In the "System variables" section at the bottom, scroll down to the variable named "Path" and edit it.  Then at the end of the "Variable value" line, add the following, including the semicolon at the beginning:

;C:\Program Files\GnuWin32\bin

Then click OK several times to get out.

Then open a Command Prompt window (Start / Programs / Accessories / Command Prompt) and change directory to wherever your FSHost log file is.  For example:

cd C:\FSHost

Then run the following command.  It's best to copy and paste this, since every single character is extremely important:

grep "Aircraft change for" FSHost.log | sed -e "s/.*Aircraft change for '[^'][^']*': //"

In the example above, my log file is named "FSHost.log".  Change that part if your file is different.

When you run that, the output will be all of the aircraft lines, with the part before the aircraft name stripped out.  If you want to redirect it to a file called "aircraft.log" you could add "> aircraft.log" to the end of the command, such as:

grep "Aircraft change for" FSHost.log | sed -e "s/.*Aircraft change for '[^'][^']*': //" > aircraft.log

When you run that command, you won't see anything happen, but the file aircraft.log will then contain the output that you saw on the screen before.  Or use >> instead of > if you want to append to aircraft.log instead of overwrite it each time.

You could even save that whole command into a file called something like "get_aircraft.bat", and then double-click it to run it each time.

Let me know how it goes...

Russell

wheelie

Wow! Thanks Russell. All those incantations - my ignorance seems to know no bounds  ;)

A few teething problems. Some of the command lines were missing some '\' but I figured that out eventually.

Running the 'grep' from the command line didn't work for some reason. I then tried it using a 'bat' file as you suggested and that worked perfectly. So my 'wish' has come true and you don't need to worry about this one anymore.

Once again, I am indebted to you for all your help. I am still looking for a different postcard of where I live.........