mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-17 03:11:28 +00:00
FC FG
This commit is contained in:
@@ -37,7 +37,7 @@
|
|||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
--- **Ground Control**: Airliner X, Good news, you are clear to taxi to the active.
|
--- **Ground Control**: Airliner X, Good news, you are clear to taxi to the active.
|
||||||
-- **Pilot**: Roger, What’s the bad news?
|
-- **Pilot**: Roger, What's the bad news?
|
||||||
-- **Ground Control**: No bad news at the moment, but you probably want to get gone before I find any.
|
-- **Ground Control**: No bad news at the moment, but you probably want to get gone before I find any.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
@@ -86,15 +86,9 @@ FLIGHTCONTROL = {
|
|||||||
|
|
||||||
--- Parking spot data.
|
--- Parking spot data.
|
||||||
-- @type FLIGHTCONTROL.ParkingSpot
|
-- @type FLIGHTCONTROL.ParkingSpot
|
||||||
-- @field #number index Parking index.
|
|
||||||
-- @field #number id Parking id.
|
|
||||||
-- @field Core.Point#COORDINATE position Coordinate of the spot.
|
|
||||||
-- @field #number terminal Terminal type.
|
|
||||||
-- @field #boolean free If true, spot is free.
|
|
||||||
-- @field #number drunway Distance to runway.
|
|
||||||
-- @field #boolean reserved If true, reserved.
|
-- @field #boolean reserved If true, reserved.
|
||||||
-- @field #string reserved4 Flight group the spot is reserved for. Applies only to landing.
|
|
||||||
-- @field #number markerid ID of the marker.
|
-- @field #number markerid ID of the marker.
|
||||||
|
-- @extends Wrapper.Airbase#AIRBASE.ParkingSpot
|
||||||
|
|
||||||
--- Runway data.
|
--- Runway data.
|
||||||
-- @type FLIGHTCONTROL.Runway
|
-- @type FLIGHTCONTROL.Runway
|
||||||
@@ -792,17 +786,10 @@ function FLIGHTCONTROL:_InitParkingSpots()
|
|||||||
self.parking={}
|
self.parking={}
|
||||||
|
|
||||||
for _,_spot in pairs(parkingdata) do
|
for _,_spot in pairs(parkingdata) do
|
||||||
local spot=_spot --Wrapper.Airbase#AIRBASE.ParkingData
|
local spot=_spot --Wrapper.Airbase#AIRBASE.ParkingSpot
|
||||||
|
|
||||||
local parking={} --#FLIGHTCONTROL.ParkingSpot
|
local parking=spot --#FLIGHTCONTROL.ParkingSpot
|
||||||
|
parking.reserved="none"
|
||||||
parking.position=spot.Coordinate
|
|
||||||
parking.drunway=spot.DistToRwy
|
|
||||||
parking.terminal=spot.TerminalType
|
|
||||||
parking.id=spot.TerminalID
|
|
||||||
parking.free=spot.Free
|
|
||||||
parking.reserved=spot.TOAC
|
|
||||||
parking.reserved4="none"
|
|
||||||
|
|
||||||
-- Mark position.
|
-- Mark position.
|
||||||
local text=string.format("ID=%d, Terminal=%d, Free=%s, Reserved=%s, Dist=%.1f", parking.id, parking.terminal, tostring(parking.free), tostring(parking.reserved), parking.drunway)
|
local text=string.format("ID=%d, Terminal=%d, Free=%s, Reserved=%s, Dist=%.1f", parking.id, parking.terminal, tostring(parking.free), tostring(parking.reserved), parking.drunway)
|
||||||
@@ -832,7 +819,7 @@ function FLIGHTCONTROL:_CheckParking()
|
|||||||
local spot=_spot --#FLIGHTCONTROL.ParkingSpot
|
local spot=_spot --#FLIGHTCONTROL.ParkingSpot
|
||||||
|
|
||||||
-- Assume spot is free.
|
-- Assume spot is free.
|
||||||
spot.free=true
|
spot.Free=true
|
||||||
|
|
||||||
-- Loop over all flights.
|
-- Loop over all flights.
|
||||||
for _,_flight in pairs(self.flights) do
|
for _,_flight in pairs(self.flights) do
|
||||||
@@ -850,7 +837,7 @@ function FLIGHTCONTROL:_CheckParking()
|
|||||||
-- Element is parking on this spot
|
-- Element is parking on this spot
|
||||||
if dist<5 and not element.unit:InAir() then
|
if dist<5 and not element.unit:InAir() then
|
||||||
element.parking=true
|
element.parking=true
|
||||||
spot.free=false
|
spot.Free=false
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -876,7 +863,7 @@ function FLIGHTCONTROL:_GetFreeParkingSpots(terminal)
|
|||||||
for _,_parking in pairs(self.parking) do
|
for _,_parking in pairs(self.parking) do
|
||||||
local parking=_parking --#FLIGHTCONTROL.ParkingSpot
|
local parking=_parking --#FLIGHTCONTROL.ParkingSpot
|
||||||
|
|
||||||
if parking.free and parking.reserved4=="none" then
|
if parking.Free and parking.reserved=="none" then
|
||||||
if terminal==nil or terminal==parking.terminal then
|
if terminal==nil or terminal==parking.terminal then
|
||||||
n=n+1
|
n=n+1
|
||||||
table.insert(freespots, parking)
|
table.insert(freespots, parking)
|
||||||
@@ -901,18 +888,11 @@ function FLIGHTCONTROL:_UpdateParkingSpots()
|
|||||||
for _,_spot in pairs(parkingdata) do
|
for _,_spot in pairs(parkingdata) do
|
||||||
local spot=_spot --Wrapper.Airbase#AIRBASE.ParkingSpot
|
local spot=_spot --Wrapper.Airbase#AIRBASE.ParkingSpot
|
||||||
|
|
||||||
if parking.id==spot.TerminalID then
|
if parking.TerminalID==spot.TerminalID then
|
||||||
|
|
||||||
parking.position=spot.Coordinate
|
|
||||||
parking.drunway=spot.DistToRwy
|
|
||||||
parking.terminal=spot.TerminalType
|
|
||||||
parking.id=spot.TerminalID
|
|
||||||
parking.free=spot.Free
|
|
||||||
parking.reserved=spot.TOAC
|
|
||||||
|
|
||||||
-- Mark position.
|
-- Mark position.
|
||||||
if parking.markerid then
|
if parking.markerid then
|
||||||
parking.position:RemoveMark(parking.markerid)
|
parking.Coordinate:RemoveMark(parking.markerid)
|
||||||
end
|
end
|
||||||
|
|
||||||
local text=string.format("ID=%03d, Terminal=%03d, Free=%s, Reserved=%s, reserved4=%s, Dist=%.1f", parking.id, parking.terminal, tostring(parking.free), tostring(parking.reserved), parking.reserved4, parking.drunway)
|
local text=string.format("ID=%03d, Terminal=%03d, Free=%s, Reserved=%s, reserved4=%s, Dist=%.1f", parking.id, parking.terminal, tostring(parking.free), tostring(parking.reserved), parking.reserved4, parking.drunway)
|
||||||
@@ -1161,7 +1141,7 @@ function FLIGHTCONTROL:_GetElementParkingSpot(element)
|
|||||||
local parkingspot=_parkingspot --#FLIGHTCONTROL.ParkingSpot
|
local parkingspot=_parkingspot --#FLIGHTCONTROL.ParkingSpot
|
||||||
|
|
||||||
-- Spot position.
|
-- Spot position.
|
||||||
local spos=parkingspot.position
|
local spos=parkingspot.Coordinate
|
||||||
|
|
||||||
-- 3D distance from unit to spot.
|
-- 3D distance from unit to spot.
|
||||||
local dist=spos:Get3DDistance(upos)
|
local dist=spos:Get3DDistance(upos)
|
||||||
|
|||||||
@@ -1616,9 +1616,9 @@ function FLIGHTGROUP:onafterHold(From, Event, To, airbase, SpeedTo, SpeedHold, S
|
|||||||
if n>=Ne then
|
if n>=Ne then
|
||||||
for i,unit in pairs(Template.units) do
|
for i,unit in pairs(Template.units) do
|
||||||
local spot=parking[i] --Ops.FlightControl#FLIGHTCONTROL.ParkingSpot
|
local spot=parking[i] --Ops.FlightControl#FLIGHTCONTROL.ParkingSpot
|
||||||
spot.reserved4=unit.name
|
spot.reserved=unit.name
|
||||||
unit.parking_landing=spot.id
|
unit.parking_landing=spot.TerminalID
|
||||||
local text=string.format("FF Reserving parking spot %d for unit %s", spot.id, tostring(unit.name))
|
local text=string.format("FF Reserving parking spot %d for unit %s", spot.TerminalID, tostring(unit.name))
|
||||||
env.info(text)
|
env.info(text)
|
||||||
end
|
end
|
||||||
--[[
|
--[[
|
||||||
|
|||||||
Reference in New Issue
Block a user