NAV types Air Manager 4.x

Latest Information on Sim Innovation's flagship product Air Manager

Moderators: russ, Ralph

Post Reply
Message
Author
DaveC3
Posts: 12
Joined: Mon Feb 20, 2023 3:54 pm

NAV types Air Manager 4.x

#1 Post by DaveC3 »

I have added a table to the nav_db.sqlite3 data base inside the Air Plugin folder. Is there a way to add a structure so I can access the data. Currently give me an error when I try to access the data table.

Screenshot 2024-11-11 144315.png
Screenshot 2024-11-11 144658.png
Screenshot 2024-11-11 144658.png (9.6 KiB) Viewed 4558 times

User avatar
Keith Baxter
Posts: 4830
Joined: Wed Dec 20, 2017 11:00 am
Location: Gauteng

Re: NAV types Air Manager 4.x

#2 Post by Keith Baxter »

Hi,
Use static_data().

Keitg
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 3052
Joined: Thu Nov 19, 2015 9:04 am

Re: NAV types Air Manager 4.x

#3 Post by Corjan »

Hi,


The code is not setup to generically query the database. So changing the database won't make it available within the instrument.


Like Keith said, static_data might be of help to you,

Corjan

DaveC3
Posts: 12
Joined: Mon Feb 20, 2023 3:54 pm

Re: NAV types Air Manager 4.x

#4 Post by DaveC3 »

Corjan, Keith
Thank you for your suggestions, I will give that a try.
Dave

User avatar
Keith Baxter
Posts: 4830
Joined: Wed Dec 20, 2017 11:00 am
Location: Gauteng

Re: NAV types Air Manager 4.x

#5 Post by Keith Baxter »

Hi,

What is it you are trying to do?

I may have done it already and can save you a lot of time.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

DaveC3
Posts: 12
Joined: Mon Feb 20, 2023 3:54 pm

Re: NAV types Air Manager 4.x

#6 Post by DaveC3 »

Keith
I want be able to display runways with their associated ILS names and frequencies by airport ICAO's. currently the VHF_NAVAID AIRPORT_ID field is unpopulated. I have my own localizer database with the associated airport ID that I want to use. That is why I was trying to add a table to Air Manager data. My data is currently in a CSV format. Now I am attempting to querie the data using static data as you suggested. I am not sure how to do that yet. My end result is for example I select a airport KLAX
result
freq bearing runway Type
10850 83 06L ILS-cat-I
11170 83 06R ILS-cat-I
11110 83 07L ILS-cat-I
10990 83 07R ILS-cat-I
11170 263 24L ILS-cat-I
10850 263 24R ILS-cat-III
10990 263 25L ILS-cat-III
11110 263 25R ILS-cat-I


From the WIKI example I can print the fields for the total data set but I have not figured out how to selectively get the data as above.
Any help would be greatly appreciated.
Dave

User avatar
Keith Baxter
Posts: 4830
Joined: Wed Dec 20, 2017 11:00 am
Location: Gauteng

Re: NAV types Air Manager 4.x

#7 Post by Keith Baxter »

Hi

Ok that I have some examples. But they are .json files.
My PC is not connected ATM as I painted the room today. I should have it up and running later tonight/early tomorrow.
As soon as it is up I will post some examples for you to play around with.

Once you get the gist of what is possible using static data you will want to add all sorts of data. Including flight plans😎

Keith
Last edited by Keith Baxter on Tue Nov 12, 2024 4:36 pm, edited 1 time in total.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

DaveC3
Posts: 12
Joined: Mon Feb 20, 2023 3:54 pm

Re: NAV types Air Manager 4.x

#8 Post by DaveC3 »

Keith
That would be fantastic!!
Thanks
Dave

DaveC3
Posts: 12
Joined: Mon Feb 20, 2023 3:54 pm

Re: NAV types Air Manager 4.x

#9 Post by DaveC3 »

Keith
I think I figured it out, I am sure there is a better way but this does what I need it to do.

Thanks again for your help
Dave

Code: Select all

--Prof of concept using external data using static data 

local ap_sel = "KSEA"  -- just an example

data = static_data_load("localizer.csv", "csv_header=true")  --loads the csv file into  variable data
local function data_callback(data)
        if data ~= nil then
                  for key,value in pairs(data) do
                  end
        end
end

function get_data(ap_sel) -- this does the qurie
        if data ~= nil then
                  for key,value in pairs(data) do
                          if value["apid"] == ap_sel then
                                print(value["freq"] .. "   " .. value["apid"] .. "   " .. value["locname"] .."   " ..value["rwnum"])
                          end
                  end
        end
end

function ap_set(typecmd)
        if typecmd == 'END' then
        get_data(ap_sel)
        end
end

xpl_command_subscribe("FlyWithLua/T-6A/ap_sel_DN",ap_set) -- external switch for testing



Post Reply