mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-19 13:46:08 +00:00
Merge remote-tracking branch 'origin/master' into branch
This commit is contained in:
@@ -105,7 +105,7 @@ jobs:
|
|||||||
if: ${{ vars.SKIP_LUACHECK != true }}
|
if: ${{ vars.SKIP_LUACHECK != true }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
luacheck --std=lua51c --config=.luacheckrc -gurasqq "Moose Development/Moose"
|
luacheck --std=lua51c --config=.luacheckrc -guras "Moose Development/Moose"
|
||||||
|
|
||||||
- name: Run LuaSrcDiet
|
- name: Run LuaSrcDiet
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -5584,7 +5584,7 @@ end
|
|||||||
-- @param #string dest Name of the destination airport.
|
-- @param #string dest Name of the destination airport.
|
||||||
function RAT:_ATCAddFlight(name, dest)
|
function RAT:_ATCAddFlight(name, dest)
|
||||||
-- Debug info
|
-- Debug info
|
||||||
BASE:I(RAT.id..string.format("ATC %s: Adding flight %s with destination %s.", dest, name, dest))
|
BASE:T(RAT.id..string.format("ATC %s: Adding flight %s with destination %s.", dest, name, dest))
|
||||||
|
|
||||||
-- Create new flight
|
-- Create new flight
|
||||||
local flight={} --#RAT.AtcFlight
|
local flight={} --#RAT.AtcFlight
|
||||||
@@ -5603,7 +5603,7 @@ end
|
|||||||
function RAT._ATCDelFlight(t,entry)
|
function RAT._ATCDelFlight(t,entry)
|
||||||
for k,_ in pairs(t) do
|
for k,_ in pairs(t) do
|
||||||
if k==entry then
|
if k==entry then
|
||||||
BASE:I(RAT.id..string.format("Removing flight %s from queue", entry))
|
BASE:T(RAT.id..string.format("Removing flight %s from queue", entry))
|
||||||
t[entry]=nil
|
t[entry]=nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -5614,7 +5614,7 @@ end
|
|||||||
-- @param #string name Group name of the flight.
|
-- @param #string name Group name of the flight.
|
||||||
-- @param #number time Time the fight first registered.
|
-- @param #number time Time the fight first registered.
|
||||||
function RAT._ATCRegisterFlight(name, time)
|
function RAT._ATCRegisterFlight(name, time)
|
||||||
BASE:I(RAT.id..string.format("Flight %s registered at ATC for landing clearance.", name))
|
BASE:T(RAT.id..string.format("Flight %s registered at ATC for landing clearance.", name))
|
||||||
RAT.ATC.flight[name].Tarrive=time
|
RAT.ATC.flight[name].Tarrive=time
|
||||||
RAT.ATC.flight[name].holding=0
|
RAT.ATC.flight[name].holding=0
|
||||||
end
|
end
|
||||||
@@ -5649,15 +5649,16 @@ function RAT._ATCStatus()
|
|||||||
|
|
||||||
-- Aircraft is holding.
|
-- Aircraft is holding.
|
||||||
local text=string.format("ATC %s: Flight %s is holding for %i:%02d. %s.", dest, name, hold/60, hold%60, busy)
|
local text=string.format("ATC %s: Flight %s is holding for %i:%02d. %s.", dest, name, hold/60, hold%60, busy)
|
||||||
BASE:I(RAT.id..text)
|
BASE:T(RAT.id..text)
|
||||||
|
|
||||||
elseif hold==RAT.ATC.onfinal then
|
elseif hold==RAT.ATC.onfinal then
|
||||||
|
|
||||||
-- Aircarft is on final approach for landing.
|
-- Aircarft is on final approach for landing.
|
||||||
local Tfinal=Tnow-flight.Tonfinal
|
local Tonfinal = flight.Tonfinal or timer.getTime()-1
|
||||||
|
local Tfinal=Tnow-Tonfinal
|
||||||
|
|
||||||
local text=string.format("ATC %s: Flight %s is on final. Waiting %i:%02d for landing event.", dest, name, Tfinal/60, Tfinal%60)
|
local text=string.format("ATC %s: Flight %s is on final. Waiting %i:%02d for landing event.", dest, name, Tfinal/60, Tfinal%60)
|
||||||
BASE:I(RAT.id..text)
|
BASE:T(RAT.id..text)
|
||||||
|
|
||||||
elseif hold==RAT.ATC.unregistered then
|
elseif hold==RAT.ATC.unregistered then
|
||||||
|
|
||||||
@@ -5711,13 +5712,13 @@ function RAT._ATCCheck()
|
|||||||
-- Debug message.
|
-- Debug message.
|
||||||
local text=string.format("ATC %s: Flight %s runway is busy. You are #%d of %d in landing queue. Your holding time is %i:%02d.",
|
local text=string.format("ATC %s: Flight %s runway is busy. You are #%d of %d in landing queue. Your holding time is %i:%02d.",
|
||||||
airportname, flightname, qID, nqueue, flight.holding/60, flight.holding%60)
|
airportname, flightname, qID, nqueue, flight.holding/60, flight.holding%60)
|
||||||
BASE:I(RAT.id..text)
|
BASE:T(RAT.id..text)
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
local text=string.format("ATC %s: Flight %s was cleared for landing. Your holding time was %i:%02d.",
|
local text=string.format("ATC %s: Flight %s was cleared for landing. Your holding time was %i:%02d.",
|
||||||
airportname, flightname, flight.holding/60, flight.holding%60)
|
airportname, flightname, flight.holding/60, flight.holding%60)
|
||||||
BASE:I(RAT.id..text)
|
BASE:T(RAT.id..text)
|
||||||
|
|
||||||
-- Clear flight for landing.
|
-- Clear flight for landing.
|
||||||
RAT._ATCClearForLanding(airportname, flightname)
|
RAT._ATCClearForLanding(airportname, flightname)
|
||||||
@@ -5772,7 +5773,7 @@ function RAT._ATCClearForLanding(airportname, flightname)
|
|||||||
|
|
||||||
|
|
||||||
-- Debug message.
|
-- Debug message.
|
||||||
BASE:I(RAT.id..string.format("ATC %s: Flight %s cleared for landing", airportname, flightname))
|
BASE:T(RAT.id..string.format("ATC %s: Flight %s cleared for landing", airportname, flightname))
|
||||||
|
|
||||||
if string.find(flightname,"#") then
|
if string.find(flightname,"#") then
|
||||||
flightname = string.match(flightname,"^(.+)#")
|
flightname = string.match(flightname,"^(.+)#")
|
||||||
@@ -5799,8 +5800,9 @@ function RAT._ATCFlightLanded(name)
|
|||||||
|
|
||||||
-- Times for holding and final approach.
|
-- Times for holding and final approach.
|
||||||
local Tnow=timer.getTime()
|
local Tnow=timer.getTime()
|
||||||
local Tfinal=Tnow-flight.Tonfinal
|
local Tonfinal = flight.Tonfinal or timer.getTime()-1
|
||||||
local Thold=flight.Tonfinal-flight.Tarrive
|
local Tfinal=Tnow-Tonfinal
|
||||||
|
local Thold=Tonfinal-flight.Tarrive
|
||||||
|
|
||||||
local airport=RAT.ATC.airport[dest] --#RAT.AtcAirport
|
local airport=RAT.ATC.airport[dest] --#RAT.AtcAirport
|
||||||
|
|
||||||
@@ -5823,9 +5825,9 @@ function RAT._ATCFlightLanded(name)
|
|||||||
local TrafficPerHour=airport.traffic/(timer.getTime()-RAT.ATC.T0)*3600
|
local TrafficPerHour=airport.traffic/(timer.getTime()-RAT.ATC.T0)*3600
|
||||||
|
|
||||||
-- Debug info
|
-- Debug info
|
||||||
BASE:I(RAT.id..string.format("ATC %s: Flight %s landed. Tholding = %i:%02d, Tfinal = %i:%02d.", dest, name, Thold/60, Thold%60, Tfinal/60, Tfinal%60))
|
BASE:T(RAT.id..string.format("ATC %s: Flight %s landed. Tholding = %i:%02d, Tfinal = %i:%02d.", dest, name, Thold/60, Thold%60, Tfinal/60, Tfinal%60))
|
||||||
BASE:I(RAT.id..string.format("ATC %s: Number of flights still on final %d.", dest, airport.Nonfinal))
|
BASE:T(RAT.id..string.format("ATC %s: Number of flights still on final %d.", dest, airport.Nonfinal))
|
||||||
BASE:I(RAT.id..string.format("ATC %s: Traffic report: Number of planes landed in total %d. Flights/hour = %3.2f.", dest, airport.traffic, TrafficPerHour))
|
BASE:T(RAT.id..string.format("ATC %s: Traffic report: Number of planes landed in total %d. Flights/hour = %3.2f.", dest, airport.traffic, TrafficPerHour))
|
||||||
|
|
||||||
if string.find(name,"#") then
|
if string.find(name,"#") then
|
||||||
name = string.match(name,"^(.+)#")
|
name = string.match(name,"^(.+)#")
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2467,7 +2467,7 @@ function GROUP:CopyRoute( Begin, End, Randomize, Radius )
|
|||||||
|
|
||||||
--self:T3( { GroupName } )
|
--self:T3( { GroupName } )
|
||||||
|
|
||||||
local Template = _DATABASE.Templates.Groups[GroupName].Template
|
local Template = _DATABASE.Templates.Groups[GroupName] and _DATABASE.Templates.Groups[GroupName].Template or nil
|
||||||
|
|
||||||
if Template then
|
if Template then
|
||||||
if not Begin then
|
if not Begin then
|
||||||
@@ -2491,7 +2491,7 @@ function GROUP:CopyRoute( Begin, End, Randomize, Radius )
|
|||||||
end
|
end
|
||||||
return Points
|
return Points
|
||||||
else
|
else
|
||||||
error( "Template not found for Group : " .. GroupName )
|
BASE:E( "Template not found for Group : " .. GroupName )
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user