From f975fa8eaee7bd33351b46d6c6661872102ef8f2 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 18 Nov 2019 22:48:24 +0100 Subject: [PATCH] Update FlightControl.lua --- Moose Development/Moose/Ops/FlightControl.lua | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Moose Development/Moose/Ops/FlightControl.lua b/Moose Development/Moose/Ops/FlightControl.lua index aa0b8127d..a13c53a98 100644 --- a/Moose Development/Moose/Ops/FlightControl.lua +++ b/Moose Development/Moose/Ops/FlightControl.lua @@ -261,6 +261,7 @@ function FLIGHTCONTROL:onafterStatus() -- Check parking spots. --self:_CheckParking() + -- Update parking spots. self:_UpdateParkingSpots() @@ -396,11 +397,14 @@ end function FLIGHTCONTROL:_CheckQueues() -- Print queues - self:_PrintQueue(self.flights, "All flights") - self:_PrintQueue(self.Qparking, "Parking") - self:_PrintQueue(self.Qtakeoff, "Takeoff") - self:_PrintQueue(self.Qwaiting, "Holding") - self:_PrintQueue(self.Qlanding, "Landing") + if false then + self:_PrintQueue(self.flights, "All flights") + self:_PrintQueue(self.Qparking, "Parking") + self:_PrintQueue(self.Qtakeoff, "Takeoff") + self:_PrintQueue(self.Qwaiting, "Holding") + self:_PrintQueue(self.Qlanding, "Landing") + end + -- Number of groups landing. local nlanding=#self.Qlanding @@ -429,8 +433,7 @@ function FLIGHTCONTROL:_CheckQueues() -- Get free parking spots. local n,parking=self:_GetFreeParkingSpots() - - + -- Get number of alive elements. local Ne=flight:GetNelements() @@ -495,11 +498,11 @@ function FLIGHTCONTROL:_GetNextFlight() if flightholding then nH=flightholding:GetNelements() end - - env.info("FF") - self:I({nextholding=flightholding}) - self:I({nextparking=flightparking}) - self:I(string.format("GetNext: holding=%d - parking=%d", nH, nP)) + + --env.info("FF") + --self:I({nextholding=flightholding}) + --self:I({nextparking=flightparking}) + --self:I(string.format("GetNext: holding=%d - parking=%d", nH, nP)) -- If no flight is waiting for takeoff return the holding flight or nil. if not flightparking then @@ -906,7 +909,7 @@ function FLIGHTCONTROL:_GetFreeParkingSpots(terminal) for _,_parking in pairs(self.parking) do local parking=_parking --#FLIGHTCONTROL.ParkingSpot - if parking.Free and parking.reserved=="none" then + if parking.Free and parking.TOAC==false and parking.reserved=="none" then if terminal==nil or terminal==parking.terminal then n=n+1 table.insert(freespots, parking)