Static TXT and Variables data fields

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Static TXT and Variables data fields

#11 Post by Keith Baxter »

Hi,

This is another structure. It is important to decide what your structure is.

Note this structure uses tables within tables. I cannot share the whole table as the data is not open source. But these two airports give an idea.

Code: Select all

{
	"FAAB":
	{
		"AIRPORT":		
		{
			"MEDIUM ID":"1015",
			"LARGE ID":"",
			"NAME":"ALEXANDER BAY",
			"AREA":"ALEXANDER BAY, South African Rep",
			"INDENT":"FAAB",
			"POSITION": "28°34'24\" S 16°32'04\" E",
			"ELIVATION":"30 m MSL",				
			"MAGVAR": " -19°",
			"IFR": "YES",
			"ARP TYPE": "Civil",
			"LONG RWY": "1848m",
			"FUEL": "n/a",
			"LAT": -28.575001,
			"LON": 16.533300			
		},		
		"COM":
		{
			"COM1":["information","AFIS","118.700","ALEXANDER BAY Radio AFIS"],
			"COM2":["","","",""],
			"COM3":["","","",""],
			"COM4":["","","",""],
			"COM5":["","","",""],
			"COM6":["","","",""],			
			"COM7":["","","",""],
			"COM8":["","","",""],			
			"COM9":["","","",""],
			"COM10":["","","",""],
			"COM11":["","","",""],			
			"COM12":["","","",""],
			"COM13":["","","",""],
			"COM14":["","","",""],
			"COM15":["","","",""],
			"COM16":["","","",""],
			"COM17":["","","",""]			
		},
		"NAV":
		{			
			"RWY1":["RW19","163","n/a","n/a"],
			"RWY2":["RW01","343","n/a","n/a"],
			"RWY3":["RW25","44","n/a","n/a"],
			"RWY4":["RW07","224","n/a","n/a"],
			"RWY5":["RW29","88","n/a","n/a"],
			"RWY6":["RW11","268","n/a","n/a"]			
			
		},
		"RWY":
		{			
			"RWY1": ["RW19","163","30m MSL","1848 X 46 m", "Asphalt (ASPH)"],
			"RWY2": ["RW01","343","30m MSL","1848 X 46 m", "Asphalt (ASPH)"],
			"RWY3": ["RW25","44","30m MSL", "1676 x 36 m", "Gravel (GRVL)"],
			"RWY4": ["RW07","224","30m MSL", "1676 X 36 m", "Gravel (GRVL)"],
			"RWY5": ["RW29","88","30m MSL", "1470 x 35 m", "Gravel (GRVL)"],
			"RWY6": ["RW11","224","30m MSL", "1470 x 35 m", "Gravel (GRVL)"]
			
		},
		"NEAR AIRP":
		{
			"ICAO1":["ORANJEMUND","FYOG","","8.71 km"],
			"ICAO2":["SANDDRIFT","","","30.16 km"],
			"ICAO3":["ROSH PINAH AIRPORT","FYRP","","70.85 km"],
			"ICAO4":["SKORPION MINE AIRPORT","FYSA","","78.03 km"],
			"ICAO5":["KLEINSEE","FAKZ","","134.52 km"]
		},
		"NEAR NAV":
		{
			"ID1":["ALEXANDER BAY","JSV","112.100 CH58X","-19.09°","","0.31 km"],
			"ID2":[""],
			"ID3":[""],
			"ID4":[""],
			"ID5":[""]
		}				
	},
	"FABL":
	{
		"AIRPORT":		
		{
			"MEDIUM ID":"1019",
			"LARGE ID":"",
			"NAME":"BRAAM FISHER",
			"AREA":"BLOEMFONTEIN, South African Rep",
			"INDENT":"FABL",
			"POSITION": "29°05'38\" S 26°18'14\" E",
			"ELIVATION":"1359 m MSL",				
			"MAGVAR": " -22°",
			"IFR": "YES",
			"ARP TYPE": "Public",
			"LONG RWY": "2563m",
			"FUEL": "n/a",
			"LAT": -29.092699,
			"LON": 26.302401			
		},		
		"COM":
		{
			"COM1":["Information","ATIS","126.450","COM4"],
			"COM2":["Communication","TOWER","120.800","TWR"],			
			"COM3":["Communication","APPROACH","124.300","COM4"],
			"COM4":["Communication","GROUND","122.650","GND"],		
			"COM5":["","","",""],
			"COM6":["","","",""],			
			"COM7":["","","",""],
			"COM8":["","","",""],
			"COM9":["","","",""],
			"COM10":["","","",""],			
			"COM11":["","","",""],
			"COM12":["","","",""],
			"COM13":["","","",""],
			"COM14":["","","",""],
			"COM15":["","","",""],
			"COM16":["","","",""],		
			"COM17":["","","",""]			
		},
		"NAV":
		{			
			"RWY1":["RW30","101","n/a","yes"],
			"RWY2":["RW12","128","n/a","yes"],
			"RWY3":["RW20","180","n/a","yes"],
			"RWY4":["RW02","360","n/a","yes"],
			"RWY5":["RW29","88","n/a","n/a"],
			"RWY6":["RW11","268","n/a","n/a"]			
			
		},
		"RWY":
		{			
			"RWY1": ["RW30","101","1359 m MSL","2194 x 46 m", "Asphalt (ASPH)"],
			"RWY2": ["RW12","343","1359 m MSL","2194 x 46 m", "Asphalt (ASPH)"],
			"RWY3": ["RW20","180","1359 m MSL", "2563 x 46 m", "Asphalt (ASPH)"],
			"RWY4": ["RW07","224","1359 m MSL", "2563 x 46 m m", "Asphalt (ASPH)"],
			"RWY5": ["","","", "",""],
			"RWY6": ["","","", "",""]
			
		},
		"NEAR AIRP":
		{
			"ICAO1":["NEW TEMPE","FATP","","15.75 km"],
			"ICAO2":["BRANDFORT","","46.21 km"],
			"ICAO3":["FATN","","THABA N CHU","","56.25 km"],
			"ICAO4":["EDENBURG","","","81.66 km"],
			"ICAO5":["BULTFONTAIN","FABU","","92.23 km"]
		},
		"NEAR NAV":
		{
			"ID1":["BLOEMFONTEIN","BLV","114.100 CH88X","-22.37°","","0.8 km"],
			"ID2":["MASERU","MU","317.000","-23.26°","","119.12 km"],
			"ID3":["WELKOM","WMV","116.400","-21.01°","","126 km"],
			"ID4":["KIMBERLEY","KYV","113.200 CH79X","","","153.98 km"],
			"ID5":["FICKSBURG","FB","390.000","-22.72°","","158.59 km"]
		}				
	},

To validate your .json file and make sure it is a .json file'

https://jsonlint.com/

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 

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

Re: Static TXT and Variables data fields

#12 Post by Keith Baxter »

WOW I am rambling on.

You could also do this.

Code: Select all

local fp_id = "FAOR-FACT"

local flight_plan = persist_add(fp_id,{"FAOR","GAV","EKBEX","APDUR","KYV","EGRUP","VWV","SLV","CSV","CTV","FACT"})

  fp_data = persist_get(flight_plan)
 print(fp_data)
If you look in your persistence folder, which is found here
ice_screenshot_20211219-010445.png
ice_screenshot_20211219-010445.png (9.75 KiB) Viewed 642 times
It would have produced this.
ice_screenshot_20211219-010236.png
This data could be entered via a AM keyboard. and will be stored in the persistence file :mrgreen:

I think I have probably overloaded you with ideas. Choose what works best for you and what you understand.

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 

User avatar
Marcnamara2021
Posts: 83
Joined: Wed Dec 01, 2021 6:00 am
Location: Sao Jose dos Campos, SP

Re: Static TXT and Variables data fields

#13 Post by Marcnamara2021 »

This is very didatic. I will try. Please tell me if I can do this>

Hello Keith, good morning,

I had already managed to load them as cars.txt entries, but that's not exactly what I asked. Let me explain it better.
This Sample FitPlan screen has static text, was written in a text editor and loaded onto the instrument screen. The edited text can have different Flight Plan entries, just to remind the pilot. I'll see if I can be clearer.

I'm going to edit ten Flight Plan entries in txt. Is there any way in Air Manager to load a list of edited flaight plans in TXT and show them on screen, being possible to scroll down with the encoder knob, like I did in the list of menu entries? In my logical thinking I would edit these texts on the PC and insert it into an fpln.lua in the LIB folder.


Thanks

Post Reply