Merge branch 'develop' into FF/Fox2

This commit is contained in:
Frank
2019-10-02 23:41:34 +02:00
2 changed files with 347 additions and 343 deletions
+5 -3
View File
@@ -113,8 +113,10 @@
-- --
-- ## Active Runway -- ## Active Runway
-- --
-- By default, the currently active runway is determined automatically by analysing the wind direction. However, there are special cases, where this does not yield the correct result. -- By default, the currently active runway is determined automatically by analysing the wind direction. Therefore, you should obviously set the wind speed to be greater zero in your mission.
-- Also, there are airports with more than one runway facing in the same direction (usually denoted left and right). In this case, there is obviously no *unique* result depending on the wind vector. --
-- Note however, there are a few special cases, where automatic detection does not yield the correct or desired result.
-- For example, there are airports with more than one runway facing in the same direction (usually denoted left and right). In this case, there is obviously no *unique* result depending on the wind vector.
-- --
-- If the automatic runway detection fails, the active runway can be specified manually in the script via the @{#ATIS.SetActiveRunway}(*runway*) function. -- If the automatic runway detection fails, the active runway can be specified manually in the script via the @{#ATIS.SetActiveRunway}(*runway*) function.
-- The parameter *runway* is a string which can be used to specify the runway heading and, if applicable, whether the left or right runway is in use. -- The parameter *runway* is a string which can be used to specify the runway heading and, if applicable, whether the left or right runway is in use.
@@ -646,7 +648,7 @@ function ATIS:onafterBroadcast(From, Event, To)
--- Temperature --- --- Temperature ---
------------------- -------------------
-- Temperature in °C. -- Temperature in C.
local temperature=coord:GetTemperature(height) local temperature=coord:GetTemperature(height)
local TEMPERATURE=string.format("%d", temperature) local TEMPERATURE=string.format("%d", temperature)
+12 -10
View File
@@ -331,7 +331,7 @@ AIRBASE.TerminalType = {
--- Runway data. --- Runway data.
-- @type AIRBASE.Runway -- @type AIRBASE.Runway
-- @field #number heading Heading of the runway in degrees. -- @field #number heading Heading of the runway in degrees.
-- @field #string idx Runway ID: heading 070° ==> idx="07". -- @field #string idx Runway ID: heading 070 ==> idx="07".
-- @field #number length Length of runway in meters. -- @field #number length Length of runway in meters.
-- @field Core.Point#COORDINATE position Position of runway start. -- @field Core.Point#COORDINATE position Position of runway start.
-- @field Core.Point#COORDINATE endpoint End point of runway. -- @field Core.Point#COORDINATE endpoint End point of runway.
@@ -1010,8 +1010,9 @@ end
--- Get runways data. Only for airdromes! --- Get runways data. Only for airdromes!
-- @param #AIRBASE self -- @param #AIRBASE self
-- @param #number magvar (Optional) Magnetic variation in degrees. -- @param #number magvar (Optional) Magnetic variation in degrees.
-- @param #boolean mark (Optional) Place markers with runway data on F10 map.
-- @return #table Runway data. -- @return #table Runway data.
function AIRBASE:GetRunwayData(magvar) function AIRBASE:GetRunwayData(magvar, mark)
-- Runway table. -- Runway table.
local runways={} local runways={}
@@ -1059,7 +1060,7 @@ function AIRBASE:GetRunwayData(magvar)
-- Heading of runway. -- Heading of runway.
local hdg=c1:HeadingTo(c2) local hdg=c1:HeadingTo(c2)
-- Runway ID: heading=070° ==> idx="07" -- Runway ID: heading=070 ==> idx="07"
local idx=string.format("%02d", UTILS.Round((hdg-magvar)/10, 0)) local idx=string.format("%02d", UTILS.Round((hdg-magvar)/10, 0))
-- Runway table. -- Runway table.
@@ -1074,7 +1075,9 @@ function AIRBASE:GetRunwayData(magvar)
self:T(string.format("Airbase %s: Adding runway id=%s, heading=%03d, length=%d m", self:GetName(), runway.idx, runway.heading, runway.length)) self:T(string.format("Airbase %s: Adding runway id=%s, heading=%03d, length=%d m", self:GetName(), runway.idx, runway.heading, runway.length))
-- Debug mark -- Debug mark
runway.position:MarkToAll(string.format("Runway %s Heading=%03d", runway.idx, runway.heading)) if mark then
runway.position:MarkToAll(string.format("Runway %s: true heading=%03d, length=%d m", runway.idx, runway.heading, runway.length))
end
-- Add runway. -- Add runway.
table.insert(runways, runway) table.insert(runways, runway)
@@ -1100,14 +1103,16 @@ function AIRBASE:GetRunwayData(magvar)
self:T(string.format("Airbase %s: Adding runway id=%s, heading=%03d, length=%d m", self:GetName(), runway.idx, runway.heading, runway.length)) self:T(string.format("Airbase %s: Adding runway id=%s, heading=%03d, length=%d m", self:GetName(), runway.idx, runway.heading, runway.length))
-- Debug mark -- Debug mark
runway.position:MarkToAll(string.format("Runway %s Heading=%03d", runway.idx, runway.heading)) if mark then
runway.position:MarkToAll(string.format("Runway %s: true heading=%03d, length=%d m", runway.idx, runway.heading, runway.length))
end
-- Add runway. -- Add runway.
table.insert(inverse, runway) table.insert(inverse, runway)
end end
-- Add inverse runway.
for _,runway in pairs(inverse) do for _,runway in pairs(inverse) do
-- Add runway.
table.insert(runways, runway) table.insert(runways, runway)
end end
@@ -1165,7 +1170,7 @@ function AIRBASE:GetActiveRunway(magvar)
local dot=UTILS.VecDot(Vwind, Vrunway) local dot=UTILS.VecDot(Vwind, Vrunway)
-- Debug. -- Debug.
env.info(string.format("runway=%03d° dot=%.3f", runway.heading, dot)) --env.info(string.format("runway=%03d dot=%.3f", runway.heading, dot))
-- New min? -- New min?
if dotmin==nil or dot<dotmin then if dotmin==nil or dot<dotmin then
@@ -1180,6 +1185,3 @@ function AIRBASE:GetActiveRunway(magvar)
return runways[iact] return runways[iact]
end end