merge the constraints and the arrival routes
This commit is contained in:
		| @@ -1,9 +1,10 @@ | |||||||
| #!/usr/bin/env python | #!/usr/bin/env python | ||||||
|  |  | ||||||
| from threading import Thread, Lock | from threading import Thread, Lock | ||||||
|  | import sys | ||||||
| import time | import time | ||||||
| from aman.com import Weather |  | ||||||
|  |  | ||||||
|  | from aman.com import Weather | ||||||
| from aman.config.Airport import Airport | from aman.config.Airport import Airport | ||||||
| from aman.sys.aco.Configuration import Configuration | from aman.sys.aco.Configuration import Configuration | ||||||
| from aman.sys.WeatherModel import WeatherModel | from aman.sys.WeatherModel import WeatherModel | ||||||
| @@ -36,6 +37,29 @@ class Worker(Thread): | |||||||
|         self.ReportQueue = {} |         self.ReportQueue = {} | ||||||
|         self.WeatherModel = WeatherModel(configuration.GaforId, weather) |         self.WeatherModel = WeatherModel(configuration.GaforId, weather) | ||||||
|         self.RecedingHorizonControl = RecedingHorizonControl(configuration.RecedingHorizonControl) |         self.RecedingHorizonControl = RecedingHorizonControl(configuration.RecedingHorizonControl) | ||||||
|  |  | ||||||
|  |         # merge the constraint information with the GNG information | ||||||
|  |         for runway in self.Configuration.GngData.ArrivalRoutes: | ||||||
|  |             for star in self.Configuration.GngData.ArrivalRoutes[runway]: | ||||||
|  |                 for name in self.Configuration.ArrivalRouteConstraints: | ||||||
|  |                     if name == star.Name: | ||||||
|  |                         for constraint in self.Configuration.ArrivalRouteConstraints[name]: | ||||||
|  |                             foundWaypoint = False | ||||||
|  |  | ||||||
|  |                             for waypoint in star.Route: | ||||||
|  |                                 if constraint.Name == waypoint.Name: | ||||||
|  |                                     waypoint.Altitude = constraint.Altitude | ||||||
|  |                                     waypoint.Speed = constraint.Speed | ||||||
|  |                                     waypoint.BaseTurn = constraint.BaseTurn | ||||||
|  |                                     waypoint.FinalTurn = constraint.FinalTurn | ||||||
|  |                                     foundWaypoint = True | ||||||
|  |                                     break | ||||||
|  |  | ||||||
|  |                             if False == foundWaypoint: | ||||||
|  |                                 sys.stderr.write('Unable to find ' + constraint.Name + ' in ' + name) | ||||||
|  |                                 sys.exit(-1) | ||||||
|  |                         break | ||||||
|  |  | ||||||
|         self.start() |         self.start() | ||||||
|  |  | ||||||
|     def acquireLock(self): |     def acquireLock(self): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user