* Fix for airbases which have no runways, e.g. Naqoura Syria
This commit is contained in:
Applevangelist 2023-06-24 14:03:43 +02:00
parent d937ab2679
commit f59326bf10

View File

@ -1,3 +1,4 @@
---@diagnostic disable: cast-local-type
--- **Ops** - Automatic Terminal Information Service (ATIS). --- **Ops** - Automatic Terminal Information Service (ATIS).
-- --
-- === -- ===
@ -608,15 +609,16 @@ _ATIS = {}
--- ATIS class version. --- ATIS class version.
-- @field #string version -- @field #string version
ATIS.version = "0.9.14" ATIS.version = "0.9.15"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list -- TODO list
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO: Add new Normandy airfields.
-- TODO: Zulu time --> Zulu in output.
-- TODO: Correct fog for elevation. -- TODO: Correct fog for elevation.
-- DONE: Zulu time --> Zulu in output.
-- DONE: Fix for AB not having a runway - Helopost like Naqoura
-- DONE: Add new Normandy airfields.
-- DONE: Use new AIRBASE system to set start/landing runway -- DONE: Use new AIRBASE system to set start/landing runway
-- DONE: SetILS doesn't work -- DONE: SetILS doesn't work
-- DONE: Visibility reported twice over SRS -- DONE: Visibility reported twice over SRS
@ -2140,15 +2142,19 @@ function ATIS:onafterBroadcast( From, Event, To )
end end
alltext = alltext .. ";\n" .. subtitle alltext = alltext .. ";\n" .. subtitle
local _RUNACT
if not self.ATISforFARPs then if not self.ATISforFARPs then
-- Active runway. -- Active runway.
if runwayLanding then
local subtitle=string.format("Active runway %s", runwayLanding) local subtitle=string.format("Active runway %s", runwayLanding)
if rwyLandingLeft==true then if rwyLandingLeft==true then
subtitle=subtitle.." Left" subtitle=subtitle.." Left"
elseif rwyLandingLeft==false then elseif rwyLandingLeft==false then
subtitle=subtitle.." Right" subtitle=subtitle.." Right"
end end
local _RUNACT = subtitle end
_RUNACT = subtitle
if not self.useSRS then if not self.useSRS then
self:Transmission(ATIS.Sound.ActiveRunway, 1.0, subtitle) self:Transmission(ATIS.Sound.ActiveRunway, 1.0, subtitle)
self.radioqueue:Number2Transmission(runwayLanding) self.radioqueue:Number2Transmission(runwayLanding)
@ -2509,8 +2515,11 @@ function ATIS:GetActiveRunway(Takeoff)
else else
runway=self.airbase:GetActiveRunwayLanding() runway=self.airbase:GetActiveRunwayLanding()
end end
if runway then -- some ABs have NO runways, e.g. Syria Naqoura
return runway.name, runway.isLeft return runway.name, runway.isLeft
else
return nil, nil
end
end end
--- Get runway from user supplied magnetic heading. --- Get runway from user supplied magnetic heading.