Skip to content

Commit

Permalink
corrections to ATC closest point
Browse files Browse the repository at this point in the history
also, added all airbases to ATC data and sorted the named points list
  • Loading branch information
davidp57 committed Oct 19, 2019
1 parent 5daced1 commit 1451973
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 8 deletions.
46 changes: 42 additions & 4 deletions src/scripts/mission-specific/caucasus/veafNamedPointsConfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,48 @@
-------------------------------------------------------------------------------------------------------------------------------------------------------------

veafNamedPoints.Points = {
-- airbases
{name="AIRBASE Tbilisi",point={x=-315414,y=480,z=897262, atc=true, tower="138.00", runways={{name="12R", hdg=121, ils="110.30"},{name="30L", hdg=301, ils="108.90"}}}},
{name="AIRBASE Sukhumi",point={x=-219998,y=0,z=563926, atc=true, tower="129.00", runways={{hdg=110},{hdg=290}}}},
{name="AIRBASE Batumi",point={x=-355808,y=0,z=617385, atc=true, tower="131.00", runways={{hdg=119, ils="110.30"},{hdg=299}}, tacan="16X BTM"}},
-- airbases in Georgia
{name="AIRBASE Kobuleti",point={x=-318000,y=0,z=636620, atc=true, tower="133.00", tacan="67X KBL"
, runways={ {name="07", hdg=69, ils="111.50"}}}},
{name="AIRBASE Gudauta", point={x=-196850,y=0,z=516496, atc=true, tower="130.00"
, runways={ {name="15", hdg=150}, {name="33", hdg=330}}}},
{name="AIRBASE Vaziani", point={x=-319000,y=0,z=903271, atc=true, tower="140.00", tacan="22X VAS"
, runways={ {name="13", hdg=135, ils="108.75"}, {name="31", hdg=315, ils="108.75"}}}},
{name="AIRBASE Kutaisi", point={x=-284860,y=0,z=683839, atc=true, tower="134.00", tacan="44X KTS"
, runways={ {name="08", hdg=74, ils="109.75"}, {name="26", hdg=254}}}},
{name="AIRBASE Senaki", point={x=-281903,y=0,z=648379, atc=true, tower="132.00", tacan="31X TSK"
, runways={ {name="09", hdg=94, ils="108.90"}, {name="27", hdg=274}}}},
{name="AIRBASE Batumi", point={x=-356437,y=0,z=618211, atc=true, tower="131.00", tacan="16X BTM"
, runways={{name="13", hdg=125, ils="110.30"}, {name="31", hdg=305}}}},
{name="AIRBASE Sukhumi", point={x=-221382,y=0,z=565909, atc=true, tower="129.00"
, runways={{name="12", hdg=116}, {name="30", hdg=296}}}},
{name="AIRBASE Tbilisi", point={x=-314926,y=480,z=895724, atc=true, tower="138.00", tacan="25X GTB"
, runways={{name="13", hdg=127, ils="110.30"},{name="31", hdg=307, ils="108.90"}}}},
-- airbases in Russia
{name="AIRBASE Anapa - Vityazevo", point={x=-4448,y=0,z=244022, atc=true, tower="121.00"
, runways={ {name="22", hdg=220}, {name="04", hdg=40}}}},
{name="AIRBASE Gelendzhik", point={x=-50996,y=0,z=297849, atc=true, tower="126.00"
, runways={ {hdg=40}, {hdg=220}}}},
{name="AIRBASE Maykop - Khanskaya", point={x=-27626,y=0,z=457048, atc=true, tower="125.00"
, runways={ {name="04", hdg=40}, {name="22", hdg=220}}}},
{name="AIRBASE Krasnodar - Pashkovsky", point={x=-8707,y=0,z=388986, atc=true, tower="128.00"
, runways={ {name="23", hdg=227}, {name="05", hdg=47}}}},
{name="AIRBASE Krasnodar - Center", point={x=-11653,y=0,z=366766, atc=true, tower="122.00"
, runways={ {name="09", hdg=86}, {name="27", hdg=266}}}},
{name="AIRBASE Novorossiysk", point={x=-40299,y=0,z=279854, atc=true, tower="123.00"
, runways={ {name="04", hdg=40}, {name="22", hdg=220}}}},
{name="AIRBASE Krymsk", point={x=-7349,y=0,z=293712, atc=true, tower="124.00"
, runways={ {name="04", hdg=39}, {name="22", hdg=219}}}},
{name="AIRBASE Mineralnye Vody", point={x=-52090,y=0,z=707418, atc=true, tower="135.00"
, runways={ {name="12", hdg=115, ils="111.70"}, {name="30", hdg=295, ils="109.30"}}}},
{name="AIRBASE Nalchik", point={x=-125500,y=0,z=759543, atc=true, tower="136.00"
, runways={ {name="06", hdg=55}, {name="24", hdg=235, ils="110.50"}}}},
{name="AIRBASE Beslan", point={x=-148472,y=0,z=842252, atc=true, tower="141.00"
, runways={ {name="10", hdg=93, ils="110.50"}, {name="28", hdg=273}}}},
{name="AIRBASE Sochi - Adler", point={x=-165163,y=0,z=460902, atc=true, tower="127.00"
, runways={ {name="06", hdg=62, ils="111.10"}, {name="24", hdg=242}}}},
{name="AIRBASE Mozdok", point={x=-83330,y=0,z=835635, atc=true, tower="137.00"
, runways={ {name="08", hdg=82}, {name="26", hdg=262}}}},
-- farps
{name="FARP Java",point={x=-247450,y=0,z=799583}},
{name="FARP Lentehi",point={x=-214442,y=0,z=695610}},
Expand Down
21 changes: 17 additions & 4 deletions src/scripts/veafNamedPoints.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ veafNamedPoints.namedPoints = {}
veafNamedPoints.rootPath = nil
veafNamedPoints.weatherPath = nil
veafNamedPoints.atcPath = nil
veafNamedPoints.atcClosestPath = nil

--- Initial Marker id.
veafNamedPoints.markid=1270000
Expand Down Expand Up @@ -268,7 +269,13 @@ end
function veafNamedPoints.listAllPoints(unitName)
veafNamedPoints.logDebug(string.format("listAllPoints(unitName = %s)",unitName))
local message = ""
names = {}
for name, point in pairs(veafNamedPoints.namedPoints) do
table.insert(names, name)
end
table.sort(names)
for _, name in pairs(names) do
local point = veafNamedPoints.namedPoints[name]
local lat, lon = coord.LOtoLL(point)
message = message .. name .. " => " .. mist.tostringLL(lat, lon, 2) .. "\n"
end
Expand Down Expand Up @@ -367,29 +374,35 @@ function veafNamedPoints._buildAtcRadioMenuPage(menu, names, pageSize, startInde
if endIndex < namesCount then
veafNamedPoints.logDebug("adding next page menu")
local nextPageMenu = veafRadio.addSubMenu("Next page", menu)
veafNamedPoints._buildAtcReportsRadioMenuPage(nextPageMenu, names, 10, endIndex+1)
veafNamedPoints._buildAtcRadioMenuPage(nextPageMenu, names, 10, endIndex+1)
end
end

--- refresh the ATC radio menu
function veafNamedPoints._refreshAtcRadioMenu()
veafNamedPoints.logTrace("adding ATC On Closest Point submenu")
if veafNamedPoints.atcClosestPath then
veafNamedPoints.logTrace("deleting ATC On Closest Point submenu")
veafRadio.delSubmenu(veafNamedPoints.atcClosestPath, veafNamedPoints.rootPath)
end
veafNamedPoints.atcClosestPath = veafRadio.addSubMenu("ATC on closest point", veafNamedPoints.rootPath)
veafRadio.addCommandToSubmenu("ATC on closest point" , veafNamedPoints.atcClosestPath, veafNamedPoints.getAtcAtClosestPoint, nil, veafRadio.USAGE_ForUnit)

if veafNamedPoints.atcPath then
veafNamedPoints.logTrace("deleting ATC submenu")
veafRadio.delSubmenu(veafNamedPoints.atcPath, veafNamedPoints.rootPath)
end
veafNamedPoints.logTrace("adding ATC submenu")
veafNamedPoints.atcPath = veafRadio.addSubMenu("ATC", veafNamedPoints.rootPath)
veafRadio.addCommandToSubmenu("Closest point" , veafNamedPoints.atcPath, veafNamedPoints.getAtcAtClosestPoint, nil, veafRadio.USAGE_ForUnit)
names = {}
for name, point in pairs(veafNamedPoints.namedPoints) do
veafNamedPoints.logTrace("processing point name="..name)
if point.atc then
veafNamedPoints.logTrace("ATC is set on point name="..name)
table.insert(names, name)
end
end
table.sort(names)
veafNamedPoints._buildAtcRadioMenuPage(veafNamedPoints.atcPath, names, 10, 1)

veafRadio.refreshRadioMenu()
end

Expand Down

0 comments on commit 1451973

Please sign in to comment.