Merge pull request #1210 from FlightControl-Master/FF/Develop

ATIS v0.4.0
This commit is contained in:
Frank 2019-10-10 19:33:48 -04:00 committed by GitHub
commit 3e9f54aaa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 754 additions and 107 deletions

View File

@ -321,6 +321,8 @@ function RADIOQUEUE:Broadcast(transmission)
-- Set command for radio transmission. -- Set command for radio transmission.
sender:SetCommand(commandTransmit) sender:SetCommand(commandTransmit)
--MESSAGE:New(string.format("transmissing file %s duration=%.2f sec, subtitle=%s", filename, transmission.duration, transmission.subtitle or ""), 5, "RADIOQUEUE"):ToAll()
else else
@ -347,6 +349,7 @@ function RADIOQUEUE:Broadcast(transmission)
if vec3 then if vec3 then
self:T("Sending") self:T("Sending")
self:T( { filename = filename, vec3 = vec3, modulation = self.modulation, frequency = self.frequency, power = self.power } ) self:T( { filename = filename, vec3 = vec3, modulation = self.modulation, frequency = self.frequency, power = self.power } )
--MESSAGE:New(string.format("transmissing file %s duration=%.2f sec, subtitle=%s", filename, transmission.duration, transmission.subtitle or ""), 5, "RADIOQUEUE (trigger)"):ToAll()
trigger.action.radioTransmission(filename, vec3, self.modulation, false, self.frequency, self.power) trigger.action.radioTransmission(filename, vec3, self.modulation, false, self.frequency, self.power)
end end

File diff suppressed because it is too large Load Diff

View File

@ -872,6 +872,23 @@ function UTILS.VecHdg(a)
return h return h
end end
--- Calculate the difference between two "heading", i.e. angles in [0,360) deg.
-- @param #number h1 Heading one.
-- @param #number h2 Heading two.
-- @return #number Heading difference in degrees.
function UTILS.HdgDiff(h1, h2)
-- Angle in rad.
local alpha=math.rad(h1)
local beta=math.rad(h2)
-- Runway vector.
local v1={x=math.cos(alpha), y=0, z=math.sin(alpha)}
local v2={x=math.cos(beta), y=0, z=math.sin(beta)}
return math.abs(UTILS.VecAngle(v1, v2))
end
--- Rotate 3D vector in the 2D (x,z) plane. y-component (usually altitude) unchanged. --- Rotate 3D vector in the 2D (x,z) plane. y-component (usually altitude) unchanged.
-- @param DCS#Vec3 a Vector in 3D with x, y, z components. -- @param DCS#Vec3 a Vector in 3D with x, y, z components.

View File

@ -1076,7 +1076,7 @@ function AIRBASE:GetRunwayData(magvar, mark)
-- Debug mark -- Debug mark
if mark then if mark then
runway.position:MarkToAll(string.format("Runway %s: true heading=%03d, length=%d m", runway.idx, runway.heading, runway.length)) runway.position:MarkToAll(string.format("Runway %s: true heading=%03d (magvar=%d), length=%d m", runway.idx, runway.heading, magvar, runway.length))
end end
-- Add runway. -- Add runway.
@ -1104,7 +1104,7 @@ function AIRBASE:GetRunwayData(magvar, mark)
-- Debug mark -- Debug mark
if mark then if mark then
runway.position:MarkToAll(string.format("Runway %s: true heading=%03d, length=%d m", runway.idx, runway.heading, runway.length)) runway.position:MarkToAll(string.format("Runway %s: true heading=%03d (magvar=%d), length=%d m", runway.idx, runway.heading, magvar, runway.length))
end end
-- Add runway. -- Add runway.