mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-24 12:05:27 +00:00
ATIS v0.3.0
This commit is contained in:
@@ -68,6 +68,7 @@ __Moose.Include( 'Scripts/Moose/Functional/Fox.lua' )
|
|||||||
__Moose.Include( 'Scripts/Moose/Ops/Airboss.lua' )
|
__Moose.Include( 'Scripts/Moose/Ops/Airboss.lua' )
|
||||||
__Moose.Include( 'Scripts/Moose/Ops/RecoveryTanker.lua' )
|
__Moose.Include( 'Scripts/Moose/Ops/RecoveryTanker.lua' )
|
||||||
__Moose.Include( 'Scripts/Moose/Ops/RescueHelo.lua' )
|
__Moose.Include( 'Scripts/Moose/Ops/RescueHelo.lua' )
|
||||||
|
__Moose.Include( 'Scripts/Moose/Ops/ATIS.lua' )
|
||||||
|
|
||||||
__Moose.Include( 'Scripts/Moose/AI/AI_Balancer.lua' )
|
__Moose.Include( 'Scripts/Moose/AI/AI_Balancer.lua' )
|
||||||
__Moose.Include( 'Scripts/Moose/AI/AI_Air.lua' )
|
__Moose.Include( 'Scripts/Moose/AI/AI_Air.lua' )
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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={}
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ Functional/Fox.lua
|
|||||||
Ops/Airboss.lua
|
Ops/Airboss.lua
|
||||||
Ops/RecoveryTanker.lua
|
Ops/RecoveryTanker.lua
|
||||||
Ops/RescueHelo.lua
|
Ops/RescueHelo.lua
|
||||||
|
Ops/ATIS.lua
|
||||||
|
|
||||||
AI/AI_Balancer.lua
|
AI/AI_Balancer.lua
|
||||||
AI/AI_Air.lua
|
AI/AI_Air.lua
|
||||||
|
|||||||
Reference in New Issue
Block a user