Classic Boeings

Working on a instrument project or just finished a project? Show it to others!

Moderators: russ, Ralph

Post Reply
Message
Author
BW901
Posts: 81
Joined: Mon Apr 23, 2018 11:36 am

Re: Classic Boeings

#41 Post by BW901 »

Hi Frumpy. Thanks. That would probably work with a single screen setup running AM as you say. However I'm running multiple monitors on all my PCs.

The "cheap" way I can think of is to split the overhead into different panels which don't fully fit the screen, with the same background (or even with appropriately placed dummy click spots) and then mouse click to bring the relevant panel to the top. It's not the most elegant method but it might work. Scrolling up or down on a single panel would be the "professional" solution. I guess if the appropriate panels are set to open automatically when the 737-200 loads then as user you wouldn't notice that multiple panels were actually being used.

Cheers
Jon

BW901
Posts: 81
Joined: Mon Apr 23, 2018 11:36 am

Re: Classic Boeings

#42 Post by BW901 »

The centre MIP for the 737-200 is more fully populated now, cosmetic tweaks to do, and the rear overhead is also done. Considering adding in the additional annunciators (as "automated dummies") for gravel kit and combi/cargo so they are available as options. Text is also being converted to being drawn by AM, rather than within image files, so I can start on lighting effects.

I have not worked on the centre pedestal yet (except that the audio selector panels are all programmed and working. I guess if I was to look to release a suite of panels for the 737-200 navcom would need to be included? I have CPFlight hardware so I don't need them in AM myself, hence ignoring them. I think first I'm at the stage where I have to get a set of 27-inch monitors so I can fully test the whole cockpit working at once.

Image

On a separate note I'm trying to find any help or pointers with reading text files for data. At the moment I have data tables (eg historic magvar, or max EPR) included within an instrument's logic.lua file, but it would be much more flexible and cleaner to read the data from another text file - located within the same folder I guess. Nothing I've found online works with Air Manager though; has anyone got file access to work in AM - or is this even possible?

A V-bar flight director is working as option for the crosshairs, but I can't find any decent clear close-up shots on the internet, it would be nice to make things as accurate as possible.

Image

I've been watching the development progress on x-plane.org by Felis of his 747-200 which is looking sweet - would love to put that cockpit into AM, but you'd need to be a complete masochist :lol:


Cheers
Jon

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: Classic Boeings

#43 Post by JackZ »

Very nice work and graphics!

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Classic Boeings

#44 Post by Sling »

Have you seen this?

https://siminnovations.com/wiki/index.p ... _data_load

If you have any specific questions related to implementing this i’d be happy to help.

BW901
Posts: 81
Joined: Mon Apr 23, 2018 11:36 am

Re: Classic Boeings

#45 Post by BW901 »

Thanks for the pointer Tony,

So at least I know that the data files need to be in the Resources folder!

Maybe please let me explain what I'm trying to do, 'cos right now I'm stumped - see the attached Example.lua file in conjunction with the below. I fly the 737-200 in historic scenery with original Jepps, so the old aircraft can be flown the way they used to be, often into much shorter runways and with minimal navaids as compared to today. To do that right I need to take account of historically correct magnetic variation, which can quickly and easily be generated online from the NOAA website. Air Manager allows me to apply the corrections so the instruments and charts line up, which they won't do if the integral X-Plane magvar is used.

The file includes a table - MagVarJan1980 - which line by line provides a Magnetic Variation value for lat/lon points on a 1 x 1 grid. Only a few lines are included for illustration, in the full file this is of course a MUCH longer table, covering the globe - the full logic.lua file size is about 1mB.
Based on the actual aircraft position in X-Plane four points are produced (LATLON1 thru LATLON4) which define a grid box around the aircraft and from the MagVarJan1980 table the magnetic variation at each of those 4 points is extracted. By linear interpolation the magnetic variation for the aircraft position is calculated.For test purposes that value is displayed as a readout to 3 decimal places, and written to an Air Manager variable, so that the HSI, RMI, etc can read it, this being a continuous process as X-Plane and AM are running giving a constantly updated magvar calculation.

This works great and would be fine but it only allows one set of magnetic variation data to be accessed. To fly in 1970 I need to effectively load a different instrument, with a different logic.lua file containing a MagVarJan1970 table. [The tables are large enough that putting several of then into one logic.lua file doesn't work. In my first versions I only calculated MagVar based on the Southeast corner of each 1x1 degree block, so it changed in steps only as the aircraft moved into a different box. AM will actually handle a 10mB file with that more simple calculation and selecting the year on a dropdown menu in property at start-up works nicely. ]

What I'd like to do is move the MagVarJan1980 data into a text file named "MagVarJan1980.txt and have multiple text files for say 1970, 1980 and 1990.
The year/file to be used would be a Property defined by the user.
When AM starts it would read the appropriate data file and do the magnetic variation calculations as above, whether by reading continuously from that external file, or doing a one-off import to build a temporary data table used for that run.

I hope that makes sense! As always it sounds simple.I could just write a script to rename different .lua files to logic.lua before a start AM, but that just seems a clunky way of doing things.

Any help would be much appreciated. I find most online examples bear no resemblance to any practical use, but even a pointer towards what functions might do what I'm looking for would be great so I can at least dig in the right place.

Cheers
Jon



Example.lua
(2.25 KiB) Downloaded 197 times

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: Classic Boeings

#46 Post by JackZ »

I guess that if you access the proper file “on the fly” by using a file name created by concatenation of the month and year appended to the file name, that could solve your problem?

You would create a file for each month named such as: “Mag Var July 70.csv” and store them in the resource folder.
I would advise you to create your files as a comma separated values file (hence the .csv suffix), as you can format and access your data easily that way.
The structure of each csv file should be as follow:

Code: Select all

Lat,Lon,MagVar
N89,W180,134.8
N89,W179,135.8
Etc....
If needed a conversion from text to a properly formatted csv file can be made using Excel.

And in your code the file name could be built like this:

Code: Select all

Month="July"
Year="70"
file_name="Mag Var "..Month.." "..Year..".csv"
— load a csv file with header and create an array of mag Var indexed by lat and Lon

CurrentMagVar= {}
—Load the proper data file as a csv file with a header
data = static_data_load(file_name,true)
-- Print all data synchronously
for key,value in ipairs(data) do
  print(key.."- "..value["Lat"] .. "/" .. value["Lon"] .. ": " .. value["Magvar"])
  CurrentMagVar[value["Lat"]]={}
  CurrentMagVar[value["Lat"]][value["Lon"]]=value["Magvar"]
end

With as an end result, a complete array of MagVar values indexed by Lat/Lon. Here the whole array is built and filled synchronously at launch, but you could also do it asynchronously if ever needed.

Obviously your calculation routine code should be slightly modified to access this data but I’m sure you got the point.
This part of your code:

Code: Select all

 LATLON1 = LAT1..LON2
LATLON2 = LAT1..LON1
LATLON3 = LAT2..LON1
LATLON4 = LAT2..LON2

MagVar1 = (MagVarJan1980[LATLON1])

MagVar2 = (MagVarJan1980[LATLON2])

MagVar3 = (MagVarJan1980[LATLON3])

MagVar4 = (MagVarJan1980[LATLON4])
Should become

Code: Select all

 MagVar1 = CurrentMagVar[LAT1][LON2]

MagVar2 = CurrentMagVar[LAT1][LON1]

MagVar3 = CurrentMagVar[LAT2][LON1]

MagVar4 = CurrentMagVar[LAT2][LON2]
This code should be working, but I must say that I did not test it, as my computer is down at the moment (blo...y W10 updates!)

And if you add the Month and Year you want to fly as user properties in your instrument’s (or even better panel’s) code, that would be perfect.

Clever idea this “return to the past” trick by the way!

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

BW901
Posts: 81
Joined: Mon Apr 23, 2018 11:36 am

Re: Classic Boeings

#47 Post by BW901 »

Jacques,
Thank you for your detailed reply and work on the text, I really appreciate you taking the time. Apologies for my late reply, had a late notice change in plan and I have not been at home this week. Hopefully will get a chance to take a look at things this weekend.

The historic scenery started as a simple concept, but it's evolved massively and I've had to becoming adept at using WED to build airports. I'm steadily working a plan now where I build the airport as it was in 1970, then update to 1980 then to 1992, then 2003..... (the years I have Jepps manuals for). When you look at passenger traffic data for 1980 and see European capitals with 10% of today's pax numbers, let alone cities which had little or no scheduled services and are now busy it's frightening how things have gone in a relatively short space of time.
Jon

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: Classic Boeings

#48 Post by JackZ »

Turns out that my previous code wouldn’t work, as there is a mistake in the static_data_load()
So the code should be:

Code: Select all

—Load the proper data file as a csv file with a header
data = static_data_load(file_name ,"csv_header=true")
Instead.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

BW901
Posts: 81
Joined: Mon Apr 23, 2018 11:36 am

Re: Classic Boeings

#49 Post by BW901 »

Jacques,
Thanks again for your suggestions on the code. I've got AM to read the external files and the data table is being built, but AM locks up part way through the process. I wonder whether I'm trying to get AM to do too much!
For now I've taken an easier path which is to have multiple gauges, each with an internal magvar table for a particular year, which simply calculates and distributes magvar across the network. I run that gauge in the background, the year's shown hidden as part of a serial number on the panel, so it's easy to check what's loaded and if I need to change year I just run the appropriate file. Not ideal if I'm looking to distribute this as a user friendly solution, but hey it works.
Thanks again or your efforts, will pick this up again when I'm a little more settled and have more time to access my flightsim PCs.
Cheers
Jon

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: Classic Boeings

#50 Post by JackZ »

Hmmm...
If AM locks somewhere in the process that could be because your CSV file has a typo on it.
A small typo, a missing comma, an extra space or an extra tab (avoid tabulations at all costs) could lock the process. Could you try with a subset of your data file, by dividing it in small files and test these until you find the culprit?
If the LAT/LON is not available you can also stop the execution since it will return NIL
Pretty sure that’s the cause of the problem.
As said earlier, creating those data files in Excel, then exporting this data as a CSV file is probably the best way to do it.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

Post Reply