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.
NAV types Air Manager 4.x
- Keith Baxter
- Posts: 4830
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Gauteng
Re: NAV types Air Manager 4.x
Hi,
Use static_data().
Keitg
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
Re: NAV types Air Manager 4.x
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
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
Re: NAV types Air Manager 4.x
Corjan, Keith
Thank you for your suggestions, I will give that a try.
Dave
Thank you for your suggestions, I will give that a try.
Dave
- Keith Baxter
- Posts: 4830
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Gauteng
Re: NAV types Air Manager 4.x
Hi,
What is it you are trying to do?
I may have done it already and can save you a lot of time.
Keith
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
Re: NAV types Air Manager 4.x
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
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
- Keith Baxter
- Posts: 4830
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Gauteng
Re: NAV types Air Manager 4.x
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
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
Re: NAV types Air Manager 4.x
Keith
That would be fantastic!!
Thanks
Dave
That would be fantastic!!
Thanks
Dave
Re: NAV types Air Manager 4.x
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
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