mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-24 12:05:27 +00:00
Merge branch 'develop' into FF/Fox2
This commit is contained in:
@@ -113,8 +113,10 @@
|
||||
--
|
||||
-- ## 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.
|
||||
-- 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.
|
||||
-- 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.
|
||||
--
|
||||
-- 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.
|
||||
-- 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 in °C.
|
||||
-- Temperature in �C.
|
||||
local temperature=coord:GetTemperature(height)
|
||||
|
||||
local TEMPERATURE=string.format("%d", temperature)
|
||||
|
||||
@@ -331,7 +331,7 @@ AIRBASE.TerminalType = {
|
||||
--- Runway data.
|
||||
-- @type AIRBASE.Runway
|
||||
-- @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 Core.Point#COORDINATE position Position of runway start.
|
||||
-- @field Core.Point#COORDINATE endpoint End point of runway.
|
||||
@@ -1010,8 +1010,9 @@ end
|
||||
--- Get runways data. Only for airdromes!
|
||||
-- @param #AIRBASE self
|
||||
-- @param #number magvar (Optional) Magnetic variation in degrees.
|
||||
-- @param #boolean mark (Optional) Place markers with runway data on F10 map.
|
||||
-- @return #table Runway data.
|
||||
function AIRBASE:GetRunwayData(magvar)
|
||||
function AIRBASE:GetRunwayData(magvar, mark)
|
||||
|
||||
-- Runway table.
|
||||
local runways={}
|
||||
@@ -1059,7 +1060,7 @@ function AIRBASE:GetRunwayData(magvar)
|
||||
-- Heading of runway.
|
||||
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))
|
||||
|
||||
-- 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))
|
||||
|
||||
-- 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.
|
||||
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))
|
||||
|
||||
-- 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.
|
||||
table.insert(inverse, runway)
|
||||
end
|
||||
|
||||
-- Add inverse runway.
|
||||
for _,runway in pairs(inverse) do
|
||||
-- Add runway.
|
||||
table.insert(runways, runway)
|
||||
end
|
||||
|
||||
@@ -1165,7 +1170,7 @@ function AIRBASE:GetActiveRunway(magvar)
|
||||
local dot=UTILS.VecDot(Vwind, Vrunway)
|
||||
|
||||
-- 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?
|
||||
if dotmin==nil or dot<dotmin then
|
||||
@@ -1180,6 +1185,3 @@ function AIRBASE:GetActiveRunway(magvar)
|
||||
|
||||
return runways[iact]
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user